liveBook · Manning

Secret

As explained in Grokking Software Architecture

A secret is confidential data, such as a password or access token, that must be protected from unauthorized disclosure.

A secret is confidential data such as a password or API key. Keep it out of source code and retrieve it at runtime using a compute resource’s identity and narrowly scoped permissions. Fetching a secret at startup—or after an authorization failure—can also support rotation without an outage. section 11.5.2

Choose a protection pattern that fits how the application runs:

  • On cloud compute, give the server or container an identity authorized to read only the required secret. section 11.5.2
  • On developer-focused hosting platforms, inject secrets through encrypted environment-variable settings during deployment instead. section 11.5.2
  • For local development, remove hardcoded secrets and pass them at runtime through an environment variable; a .env file is one suggested pattern. section 11.8
Table 11.2 IAM Setup Basics Across Major Cloud Providers
Cloud Provider
Virtual Machines
Containers & Serverless
Core Terminology to Search
AWS
Attach an IAM Role via an EC2 Instance Profile.
Assign an IAM Role to the ECS Task Definition or use IRSA for EKS.
IAM Roles, Instance Profiles
Azure
Enable a System-Assigned Managed Identity on the Virtual Machine.
Assign a Managed Identity to the Azure Kubernetes Service (AKS) pod or Container App.
Managed Identities
Google Cloud
Attach a dedicated Service Account to the Compute Engine instance.
Use Workload Identity for GKE or attach a Service Account to Cloud Run.
Service Accounts, Workload Identity
Alibaba Cloud
Attach a RAM Role to the ECS instance.
Use RRSA (RAM Roles for Service Accounts) for ACK.
RAM Roles, ECS Identity
Oracle Cloud
Configure an Instance Principal for the Compute instance.
Use Workload Identity for OKE (Oracle Kubernetes Engine).
Instance Principals, Dynamic Groups

Compare the compute-identity mechanisms named for virtual machines, containers, and serverless workloads across cloud providers. section 11.5.2

How Grokking Software Architecture covers it

How deep it goes
Explains runtime retrieval, identity-based access, narrow permissions, and rotation, with provider-specific identity examples.
Examples
Uses hardcoded passwords, API keys, local environment variables, and cloud compute identities as examples.
What it assumes
Introduces compute-resource identities for readers new to cloud security.
What you can do after
Practice auditing configuration and source code, removing hardcoded secrets, and passing secrets at runtime.
How it connects
Connects secrets with identity and access management, least privilege, environment variables, and secret rotation.

Also explained in

Compare how 4 books explain secret →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Software Architecture. The section links point to the parts of the book it draws on.