- Learn
- Computer Science & IT
- Information Technology
- Cloud Architecture and Administration
- Designing Secure Cloud Architectures
Designing Secure Cloud Architectures
IntermediateLesson 6 of 8 in Cloud Architecture and Administration Course
What you will learn
- Decide which security controls a workload needs while it is still being designed, using layered defenses, data classification and threat modeling.
- Apply security design principles and defense in depthExplain how layered controls, a small blast radius, automation and traceability shape a secure design from the first diagram.
- Classify data and turn threats into control requirementsClassify the data a workload holds, find threats with STRIDE and translate requirements into specific cloud controls.
- Apply security design principles and defense in depth
- Encrypt data at rest and in transit, and manage the keys, their permissions, rotation and lifecycle with cloud key management services.
- Encrypt data at rest with envelope encryptionExplain what encryption at rest protects, how envelope encryption works, and how to choose between server-side and client-side encryption.
- Manage keys with cloud key management servicesChoose a key ownership model, write key policies that separate duties, and handle rotation, deletion, HSM requirements and cross-Region use.
- Encrypt data in transit and manage certificatesProtect traffic with TLS, choose where to terminate it, enforce encrypted connections and automate certificate renewal.
- Encrypt data at rest with envelope encryption
- Keep passwords, API keys and tokens out of code, rotate the secrets that remain, and replace stored credentials with workload identities wherever possible.
- Store and retrieve secrets safelyStore secrets in a managed secrets service with narrow access, versioning and audit, and retrieve them safely at run time.
- Rotate secrets and replace them with workload identitiesAutomate rotation without downtime and remove long-lived credentials with roles, managed identities and workload identity federation.
- Store and retrieve secrets safely
- Filter traffic between tiers, keep services and administration private, and protect public endpoints with web application firewalls and DDoS protection.
- Filter traffic with security groups, NSGs and network ACLsDesign stateful and stateless traffic filters for each tier and predict exactly which traffic a set of rules allows.
- Keep services private and control administrative accessReach cloud services through private endpoints, remove public exposure, control outbound traffic and give administrators access without open ports.
- Filter web requests with a web application firewallProtect HTTP applications from common web attacks with managed and custom WAF rules, rate limits and a safe rollout.
- Design for DDoS resilienceCombine provider DDoS protection, edge services and scalable design so a workload survives network and application-layer floods.
- Filter traffic with security groups, NSGs and network ACLs
- Collect the right security logs across accounts and Regions, and keep them central, complete and tamper-resistant for investigations and audits.
- Choose which security logs to collectIdentify control-plane, data-plane, network and edge logs, know their defaults and retention, and match each question to the log that answers it.
- Centralize and protect audit trailsBuild a central log archive with restricted access, integrity validation, write-once retention, encryption and lifecycle rules.
- Choose which security logs to collect
- Find and fix misconfigurations continuously, enforce requirements as code with automatic evidence, and review complete designs against security requirements.
- Measure and improve security postureUse posture management services to find misconfigurations against benchmarks, prioritize them by risk and track improvement.
- Automate compliance with policy as codeMap compliance requirements to preventive, detective, corrective and proactive controls, enforce them as code and collect audit evidence automatically.
- Review a workload design end to endCombine all the controls into one secure reference design, and review a design for gaps, trade-offs and provider equivalents.
- Measure and improve security posture
Designing Secure Cloud Architectures study guide
1Plan security into a cloud architecture
Good security choices begin with the workload’s data and paths. A design can look private yet still trust a stolen credential, an overly broad internal route or an administrator who can erase evidence. Plan independent layers, keep failures small and turn threats into specific controls. Classification and a data-flow diagram give those choices a purpose; explicit tests show whether the deployed design actually meets the requirement.
1.1 Build protection into the design
A secure design gives each component a clear job and limits what happens when it fails. Choose controls while drawing the workload, when changing a storage service, identity or network path is still straightforward.
Put independent controls on each path
Defense in depth combines controls that deal with different failures. A web workload can use DDoS protection and a WAF at the edge, security groups between tiers, a narrow application role, hardened compute images, input validation, encrypted storage, and protected audit logs. A WAF can block a suspicious request; the database's permissions still limit what the application can read if a request gets through.
Do not treat the inside of a network as trusted. A stolen workload identity may already be inside it. Zero trust means checking identity and authorization for requests and protecting sensitive internal traffic too. A private database still needs authenticated connections and TLS.
Keep one failure small
The blast radius is the damage a compromised component or credential can cause. Separate production and test into different accounts or subscriptions. Give each workload only the network paths, secrets and keys it needs. Separate keys for independent data sets make their access policies independent too.
For example, a test service and a production service share a database key and broad permissions. A stolen test credential may reach production documents. Move production into a separate account, give its application a dedicated role and key, and remove the cross-environment permissions. The test leak then has fewer places to go; a new account alone would not help if its policies still trusted the compromised role broadly.
Plan changes and ownership
Managed services reduce some maintenance work, but network exposure, data access, keys and backups remain design choices. With virtual machines, you patch the operating system. A managed database transfers engine-patching work to the provider; you still choose who can connect and how.
Late encryption changes can require a replacement resource. An unencrypted Amazon RDS instance needs a snapshot, an encrypted snapshot copy and a restored instance, followed by application cutover. Selecting encryption at creation avoids that migration.
Define repeatable settings in infrastructure as code. A storage template can enable public access blocking and default encryption with the approved customer managed key. Review the template before deployment, then compare deployed resources with that desired state. Console edits appear in audit logs, but they still need approval and reconciliation with the template to avoid drift.
Match effort to risk
The AWS Well-Architected security principles connect identity, traceability, layered protection, automation, protection in transit and at rest, reduced human access to data, and preparation for security events. Azure and Google Cloud frameworks apply comparable ideas.
Controls also have operating costs. Interface endpoints charge by Availability Zone and time; customer managed keys bring policy, lifecycle and request costs. Match these choices to the threat and data sensitivity. Record an accepted risk with its owner, so a later reviewer can distinguish a deliberate decision from a missed control.
Key Takeaways
- Use independent controls at the edge, network, identity, application and data layers.
- Limit the reach of a compromised workload with separate environments and narrow permissions.
- Choose encryption early; adding it later can require replacement and cutover.
- Review security settings as code and check deployed resources for drift.
- Match control cost and complexity to the data and threats.
1.2 Turn data and threats into requirements
Start with what the workload holds and what harm its loss or misuse would cause. That gives a reason for each security control and a way to check whether the design meets its brief.
Classify complete data sets
Data classification assigns labels such as public, internal, confidential and restricted. Public product images need integrity and availability, even when their contents need no secrecy. Identity documents may need customer managed keys, private access and a record of every read.
Classify exports, caches and backups as well as the main database. Combining purchase histories with a large email list can create a more sensitive data set than either input alone. Discovery tools help locate sensitive content: Amazon Macie scans S3, Microsoft Purview classifies data across stores, and Google Sensitive Data Protection scans for sensitive information.
Legal and contractual requirements can add controls. Payment card data brings PCI DSS requirements; personal and health data can bring privacy duties. A data residency requirement limits permitted storage and processing Regions. Carry that requirement into backups, replicas and exports, where an otherwise careful design can send data elsewhere.
Draw the data flows
Threat modeling makes the question "What can go wrong?" concrete:
- Draw the components, stores and flows.
- Mark trust boundaries, where data enters a zone with different trust, such as the internet-to-load-balancer boundary.
- List threats at each boundary and choose mitigations.
- Test that the mitigations are present and work.
STRIDE provides six prompts. Spoofing calls for authentication, MFA or mutual TLS. Tampering calls for integrity protection such as TLS, signatures or write-once storage. Repudiation, denying an action, calls for reliable audit trails. Information disclosure calls for encryption and limited access. Denial of service calls for edge protection, rate limits and capacity planning. Elevation of privilege calls for narrow permissions, patching and input validation.
Convert a requirement into a test
An invoice-upload application has several distinct risks. Injection through a form needs managed WAF rules and parameterized queries. A stolen database password needs a secret store and rotation. An accidentally public bucket needs public access blocking and a configuration check. Deletable logs need a separate write-once archive. A request flood needs edge absorption and rate limits.
Write each requirement with observable evidence. "Database credentials rotate automatically" can be tested by completing a rotation and opening a fresh connection. "Keep logs unchanged for seven years" needs write-once retention, not just encryption. "Storage traffic must stay off the internet" needs an endpoint path and a test of that path. "Audit use of this key" points to a customer managed key with controlled use and key-use logs.
When the application adds a nightly transfer to an analytics partner, update the diagram. That transfer creates a new trust boundary, credential, destination and log requirement. Reuse the classification of the exported data, then check TLS, destination access and audit coverage for the new flow.
Key Takeaways
- Classify combined data, exports and backups by their actual sensitivity.
- Use data flows, trust boundaries and STRIDE to identify threats and select mitigations.
- Test each control and revisit the threat model when the design changes.
2Protect data with encryption and key management
Encryption decisions include more than an algorithm. Choose where plaintext exists, which identities can use a key and what happens to backups when that key rotates or is deleted. Data at rest and data in motion need different controls. Follow a file through envelope encryption, compare key ownership and hardware choices, then trace each TLS connection so the design protects the complete path and remains recoverable.
2.1 Encrypt stored data and wrap its keys
Encryption at rest protects stored objects, disks, databases, snapshots and backups. It helps when someone reaches the storage media or ciphertext without the permissions needed to decrypt it. An authorized service read still returns plaintext, so encryption must work with access control.
Use a data key for bulk encryption
Symmetric encryption uses the same key for encryption and decryption; AES-256 is common for stored data. Asymmetric encryption uses a public/private key pair for operations such as signatures, key exchange and small messages. Bulk encryption normally uses a symmetric data key.
Envelope encryption separates the file from the key-management operation. A data key encrypts the file locally. A key encryption key, held in the key service, wraps the data key. Store the encrypted data key beside the encrypted file; discard the plaintext data key after use.
For a 2 GiB video, AWS KMS Encrypt accepts only 4,096 bytes of plaintext per request. Splitting the video into that many small pieces would require 524,288 requests. Instead:
- Call
GenerateDataKeyto receive a plaintext 256-bit data key and its encrypted copy. - Encrypt the video locally with AES-256-GCM.
- Erase the plaintext key from memory.
- Save the ciphertext and the encrypted key together.
To read the video, call KMS Decrypt on the encrypted data key, then decrypt the file locally. KMS handles a small key; the video never travels to KMS.
Choose where encryption happens
Server-side encryption lets the storage service encrypt writes and decrypt authorized reads. S3 offers SSE-S3 and SSE-KMS; Azure Storage offers Microsoft-managed and customer-managed keys; Google Cloud offers default encryption and customer-managed encryption keys (CMEK).
With client-side encryption, the application encrypts before upload. If its data key is wrapped by the same provider's KMS, that provider still controls a decryption-capable key. A requirement that the provider cannot read the data needs client-side encryption with every key required for decryption outside that provider's control.
S3 encrypts new objects with SSE-S3 by default, as it has since January 2023. Azure Storage, Azure managed disks and Google Cloud also encrypt stored data by default. EBS encryption by default is a per-Region account setting. Azure encryption at host also covers temporary disks and disk caches; Azure Disk Encryption is scheduled to retire on September 15, 2028.
Protect copies and permissions
For an unencrypted RDS database, snapshot it, copy the snapshot with encryption, restore a new encrypted instance and plan cutover. EBS uses the same snapshot-copy approach. Encrypted snapshots stay encrypted; a cross-Region copy needs a key in the destination Region. A multi-Region replica can serve there, but has its own Regional policy.
For an SSE-KMS object, a reader needs both s3:GetObject and permission to use the KMS key for decryption. A stolen application credential with both permissions can still read the object. Use the extra key permission to separate data access where needed, and keep the application's access narrow.
Key Takeaways
- Envelope encryption uses a local data key and a key-service key that wraps it.
- Server-side encryption decrypts authorized reads; permissions still matter.
- Provider-inaccessible data needs all decryption keys outside that provider.
- Existing unencrypted resources can need snapshot, copy, restore and cutover.
- A cross-Region copy needs a destination-Region key.
- SSE-KMS reads require object permission and KMS decryption permission.
2.2 Control who can use keys and keep data recoverable
A key service stores cryptographic keys, checks requests to use them and records those operations. Key ownership determines who can change those checks, rotate the material or make the data permanently unreadable.
Choose ownership and protection separately
AWS owned keys are invisible to the customer. AWS managed keys, such as aws/s3, are created for the customer and rotate yearly, but their policies cannot be edited. With customer managed keys, the customer controls policy, rotation, disabling and deletion. Choose these when the brief needs separate key-use permissions, cross-account use, custom rotation or an audit trail for a particular key.
Azure separates Microsoft-managed keys from customer-managed keys in Key Vault or Managed HSM. Google Cloud offers Cloud KMS and CMEK. Importing key material (BYOK), providing keys with individual requests (S3 SSE-C), or using an external key store gives further control and recovery responsibilities. Lost customer-controlled material can mean lost data.
Protection level is another choice. Key Vault Standard uses software-protected keys; Premium supports HSM-protected keys. AWS KMS uses HSMs validated at FIPS 140-3 Level 3. A Level 3 requirement alone therefore does not require a dedicated HSM. Sole tenancy calls for options such as AWS CloudHSM, Azure Managed HSM or Google Single-tenant Cloud HSM. External key stores keep keys outside the provider; verify the external system's hardware and tenancy separately. CloudHSM users must protect their own HSM credentials because the provider cannot recover lost keys for them.
Separate administration from use
An AWS KMS key policy controls access to its key. IAM permission grants work only when the key policy permits the account to delegate that access. Give the application Decrypt and GenerateDataKey where needed; keep policy changes and deletion in a separate administrative role. Administrators with permission to change policies remain highly trusted, even if their current role lacks decryption permission.
On Azure, Key Vault Crypto User gives an application key-use permissions. Key Vault Crypto Officer also permits cryptographic operations, so it does not meet a requirement that administrators manage keys without using them. That requires a custom role without those operations.
Cross-account AWS use needs permission in both places: the key policy in the owning account and an IAM policy in the calling account. An AWS managed key cannot support sharing an encrypted snapshot with another account; copy under a customer managed key and grant access to that key.
Rotate without losing older ciphertext
Rotation gives the same logical key new material for new encryption. Old material remains available for older ciphertext; existing files and data keys are unchanged. AWS automatic rotation for eligible customer managed symmetric keys is off by default and supports 90–2,560 days, with 365 days as the default period. On-demand rotation is also available. Asymmetric keys, HMAC keys and custom-key-store keys need a new key and an alias change for manual rotation. Azure rotation policies create new versions, picked up by services using versionless references.
Enable a 180-day period on March 15, 2026: the first rotation is September 11, 2026, and the next is March 10, 2027. April ciphertext still decrypts in October. If its plaintext data key leaked, rotating the wrapping key is insufficient: re-encrypt the affected data with a new data key.
Treat deletion as a data decision
AWS KMS deletion has a 7–30 day waiting period, 30 by default. Pending-deletion keys cannot perform cryptographic operations; actual deletion can occur up to 24 hours after the scheduled waiting period. Cancel scheduled deletion during the waiting period if the key is still needed. Disable first to test dependencies, but remember that cached plaintext data keys can keep existing services working until discarded.
Azure Key Vault soft delete retains deleted keys for 7–90 days, 90 by default. Purge protection prevents permanent deletion during that period and cannot be turned off once enabled; Azure Storage customer-managed keys require it. Keep log-archive and backup keys recoverable for as long as their data must be read.
Multi-Region KMS keys share material and key ID across related Regional keys. Each Region still has a separate key and policy, so disaster recovery needs permission checks in the recovery Region too.
Key Takeaways
- Choose key ownership for policy control and protection level for hardware or tenancy requirements.
- Separate key administration from application key use.
- Cross-account use needs the key policy and the caller account’s IAM permission.
- Rotation preserves old material and does not re-encrypt files or replace leaked data keys.
- Deletion can destroy access to backups and logs; test dependencies before proceeding.
- Multi-Region replicas share key material but retain separate Regional policies.
2.3 Protect every traffic hop with TLS
TLS protects traffic against eavesdropping and tampering, and authenticates the server through its certificate. Use TLS 1.2 or 1.3. Disable the deprecated TLS 1.0 and 1.1 versions, including on storage and database connections.
Decide where TLS ends
A connection diagram should show each TLS session separately. These designs have different consequences:
| Design | What the front end does | Path to the target |
|---|---|---|
| Termination | Decrypts and can inspect HTTP | Plain HTTP |
| Termination and re-encryption | Decrypts, inspects and opens another TLS connection | Encrypted again |
| Passthrough | Forwards encrypted traffic without HTTP inspection | Target terminates TLS |
For a document-upload service that requires encryption on every hop and WAF inspection at the front end, terminate and re-encrypt. A TCP listener on a Network Load Balancer can pass TLS through, but cannot inspect the encrypted HTTP contents. HTTPS at the public load balancer alone says nothing about the next hop.
Mutual TLS also requires the client to present a certificate. It suits partner APIs, devices and service-to-service authentication. Keep application authorization as well: a valid client certificate does not decide which records that client may read.
Use trusted certificates and automatic renewal
A certificate binds a domain name to a public key and carries a certificate authority's signature. Public services need a CA trusted by their clients. Internal services can use a private CA, with its trust anchor distributed to clients. A self-signed public website certificate causes browser warnings.
AWS Certificate Manager issues public certificates at no charge for integrated services such as load balancers, CloudFront and API Gateway. Azure provides Key Vault certificates and App Service managed certificates; Google Cloud provides Certificate Manager and Google-managed certificates. Automate renewal and alert before expiry, so a missing DNS record or failed deployment is caught before users lose access.
For publicly trusted TLS certificates, the maximum lifetime became 200 days on March 15, 2026. It falls to 100 days on March 15, 2027, and 47 days on March 15, 2029. ACM moved to 198-day public certificates in February 2026. Keep ACM's DNS-validation CNAME in place for automatic renewal.
Require encryption on every route
Offering HTTPS still permits insecure clients if HTTP remains usable. An S3 bucket policy can deny s3:* when aws:SecureTransport is false, covering both the bucket and its objects. Keep Azure Storage's secure-transfer requirement enabled. Require database TLS with settings such as RDS PostgreSQL rds.force_ssl or MySQL require_secure_transport. Redirect web HTTP to HTTPS and send HSTS so browsers use HTTPS on later visits.
Private connectivity needs encryption too. Direct Connect and ExpressRoute keep traffic off the public internet but have no default link encryption. Use application TLS, an IPsec VPN over the link, or MACsec on supported dedicated connections. A private endpoint changes the route to a service; continue to use TLS to that service.
Key Takeaways
- Mark the TLS termination point and the protection on every following hop.
- Re-encryption permits front-end inspection and encryption to the targets.
- Use trusted certificates, automatic renewal and expiry alarms.
- Enforce TLS on storage and database connections.
- Private links and endpoints still need encryption.
3Manage secrets and workload credentials
Applications need access without scattering reusable credentials through code, images and deployment settings. A managed secret store provides controlled retrieval and versioning, but rotation also depends on the target service and the application’s refresh behavior. Use short-lived workload identities wherever supported, and make any remaining password or API key narrow, auditable and replaceable without an outage.
3.1 Retrieve secrets without putting them in code
A secret is a value that grants access: a database password, API key, signing key or connection string containing a password. Treat it differently from ordinary configuration, because possession can let another person act as the application.
Put the value in a managed store
Secrets leak through source code and its history, container images, build logs, infrastructure state, environment settings and messages. Deleting a line from the latest commit leaves earlier copies in Git. Encrypting an environment variable at rest does not hide its plaintext from people or processes allowed to view the runtime value.
A managed secret store encrypts values, versions them, limits readers and records retrievals. AWS Secrets Manager supports rotation, resource policies and cross-Region replication, with a charge per secret. Parameter Store SecureString values use KMS but have no built-in rotation; standard parameters have no extra charge. Azure Key Vault stores secrets, keys and certificates. Google Secret Manager stores versioned secrets.
Choose the store for its behavior. A configuration value that changes occasionally can fit Parameter Store. A database password that must rotate automatically fits Secrets Manager. Separate applications and environments so a test workload's read permission cannot expose production values. On Azure, separate vaults per application and environment help establish that boundary.
Give the workload a narrow retrieval path
The workload uses an IAM role, managed identity or service account to fetch only its own secret. Retrieve when needed, cache briefly in memory and refresh when authentication fails. A client-side caching library reduces repeated requests without fixing one value in the process forever.
For the order service, save the payment API key as prod/orders/payment-api-key. Give orders-prod secretsmanager:GetSecretValue for that secret. For a customer managed KMS key, allow kms:Decrypt through Secrets Manager with kms:ViaService. Do not grant the developer or test roles access. CloudTrail then records each secret retrieval with the caller and time.
Platform injection is convenient, but check how the application gets updates. ECS task definitions can reference Secrets Manager, Kubernetes can mount secrets with the Secrets Store CSI driver, and App Service can use a Key Vault reference such as @Microsoft.KeyVault(SecretUri=...). A value injected into an environment at startup is not a continuously refreshed client-side cache. Its refresh or redeployment behavior must match the rotation design.
Use versions and respond to exposure
Secrets Manager marks the active version AWSCURRENT, a new rotation candidate AWSPENDING and the prior good version AWSPREVIOUS. These labels support testing and rollback. Key Vault keeps secret versions; a versionless reference retrieves the latest version.
When a secret appears in a repository, revoke or rotate it first. Remove it from history and other exposed locations, then examine audit records for use since exposure. Merely moving the same value to a vault leaves the published credential valid. Add scanning and push protection where the leak occurred so the next credential does not follow the same path.
Key Takeaways
- Store access-granting values separately from code and ordinary configuration.
- Use workload identities with permission to retrieve only needed secrets.
- Cache briefly and support refresh when authentication fails.
- Version labels separate the current, pending and previous secret values.
- Revoke or rotate an exposed value before cleaning up its copies.
3.2 Rotate credentials and remove stored passwords
Rotation succeeds only when both ends agree on the new value: the secret store and the service checking the credential. The application must also retrieve the replacement without turning a routine rotation into an outage.
Complete and test the change
AWS Secrets Manager supports managed rotation for supported cases, such as RDS-managed master passwords. A Lambda-based rotation follows four steps:
createSecretgenerates a value labeledAWSPENDING.setSecretinstalls it in the target database.testSecretauthenticates with it.finishSecretmovesAWSCURRENTto it; the old value becomesAWSPREVIOUS.
Writing a new value only to the vault does not change the database password. Test a complete rotation in staging, including new connections and clients holding cached credentials.
| Strategy | Change | Availability consideration |
|---|---|---|
| Single user | Replace one user's password | Brief failures can occur while clients refresh; use retries |
| Alternating users | Rotate the user that is not current | Previously cached credentials remain valid during the next rotation period |
Alternating users needs a separate privileged secret to create the clone. With a 30-day schedule, day 0 uses app_user, day 30 switches to app_user_clone, and day 60 changes app_user again. All clients must refresh during the overlap, before their old user's password changes. A 365-day year contains 12 scheduled 30-day rotations.
Replace credentials with identities
A workload that accesses cloud services can often avoid a stored password or access key. EC2 instance profiles, ECS task roles and Lambda execution roles supply temporary AWS credentials. Azure managed identities and attached Google service accounts provide corresponding workload identities.
An Azure system-assigned identity follows the resource's lifecycle. A user-assigned identity has its own lifecycle and can be attached to multiple resources. In both cases, access still comes from its assigned permissions; removing a secret does not justify a broad role.
For a CI/CD runner outside the target cloud, use workload identity federation. The platform issues a signed OIDC token, which is exchanged for short-lived cloud credentials. Restrict issuer, audience and subject claims to the intended workload. A subject such as repo:example-org/shop:ref:refs/heads/main restricts access to one repository's main branch. Trusting every token from the platform would also trust unrelated workloads.
Some databases accept identity-based authentication. RDS and Aurora MySQL/PostgreSQL support IAM authentication tokens valid for 15 minutes for establishing a connection. Azure SQL supports Microsoft Entra authentication with managed identities.
Handle a leaked credential
Deactivate the exposed credential, issue a replacement and update workloads, then examine its audit activity from the exposure time. For an IAM access key, its access key ID helps locate CloudTrail events. Remove the cause with secret scanning, push protection or a corrected pipeline. Frequent rotation limits exposure time, but it cannot compensate for clients that never refresh or a federation trust that accepts unintended callers.
Key Takeaways
- Install and test a replacement secret before publishing it to clients.
- Alternating users gives clients a limited refresh overlap.
- Use workload identities and restrict federation to the intended workload.
- Test client refresh and fresh connections during rotation.
4Control network access to workloads
Network protection works at several layers, from a subnet rule to HTTP inspection at a global edge. Trace the packet through each applicable filter, then check the route, DNS and public-access setting of each service. Keep administrative paths private and restrict outbound destinations. WAF rules, origin restrictions and DDoS protection then work together to protect both request handling and the finite capacity behind it.
4.1 Predict which network connections pass
Traffic filters sit at different places and evaluate rules differently. Before changing a rule, identify the filter, the direction and whether the packet belongs to a new or established connection.
Compare the rule engines
| Filter | Placement | Rule behavior | Return traffic |
|---|---|---|---|
| AWS security group | Network interface | Allow rules combined; no ordering | Stateful; permitted automatically |
| AWS network ACL | Subnet boundary | Allow/deny; lowest number first | Stateless; explicit rules needed |
| Azure NSG | Subnet, interface or both | Allow/deny; lowest priority number first | Stateful; permitted automatically |
New AWS security groups have no inbound allows and allow all outbound traffic. Default network ACLs allow all; a new custom ACL denies until rules are added. ACL rules use numbers 1–32766 with a final unmatched-traffic deny. Azure custom NSG priorities run from 100 to 4096. Google Cloud VPC firewall rules are stateful, with priorities 0–65535 and targets such as network tags or service accounts.
When both subnet and interface NSGs apply, inbound traffic passes the subnet filter then the interface filter. Outbound traffic passes them in the reverse order. Both must permit the connection.
Separate application tiers
For a three-tier AWS application, sg-alb allows TCP 443 from the internet. sg-app allows TCP 8080 only from sg-alb, and sg-db allows TCP 5432 only from sg-app. New instances gain the intended access through group membership. Neither the application nor database gets a direct internet-source allow rule.
Azure application security groups similarly group machines by role. Service tags such as Storage or Internet represent maintained address ranges; they identify a service's addresses, not an application's identity.
Trace the first match
Consider these subnet NSG rules: priority 100 allows internet HTTPS; 200 denies all internet TCP; 300 allows SSH from 203.0.113.10. An SSH attempt from that address matches 200 first and is denied. Moving its allow to 150 makes it precede the broad deny. If the interface NSG also denies SSH, the connection still fails there.
Azure's defaults follow custom rules: inbound virtual-network traffic is allowed at 65000, load-balancer traffic at 65001, and remaining inbound traffic denied at 65500. Outbound defaults allow virtual-network and internet traffic before the final deny. Add explicit internal segmentation rules; an absence of custom allows does not override the virtual-network default.
A custom ACL that allows inbound TCP 443 also needs outbound response traffic to client ephemeral ports, commonly 1024–65535. Without it, the security group's state tracking cannot rescue packets denied at the subnet boundary. To block 198.51.100.0/24, an ACL deny must precede a matching allow; a security group cannot express a deny.
Use security groups or NSGs for fine segmentation and ACLs for coarse subnet guardrails. Central services such as AWS Firewall Manager and Azure Virtual Network Manager help keep policies consistent. Do not assume rule removal ends an established session immediately: connection tracking can keep existing sessions alive.
Key Takeaways
- Security groups combine allows without ordering; ACLs and NSGs use first-match ordering.
- Stateful filters allow response traffic; stateless ACLs need explicit return rules.
- Subnet and interface NSGs must both permit a connection.
- Group references keep tier access aligned with scaling workloads.
- Azure default virtual-network rules can allow traffic between tiers.
- An established connection can outlive a rule change.
4.2 Build and test private service paths
Private access removes an internet path to a service while retaining the specific connections a workload needs. It takes a route, correct DNS, service-side restrictions and identity permissions working together.
Select the endpoint model
| Model | How it reaches the service | Important boundary |
|---|---|---|
| AWS gateway endpoint | Route-table target for S3 or DynamoDB | VPC-originated traffic; no hourly charge |
| AWS interface endpoint | Private interfaces and private DNS through PrivateLink | Many services; hourly per-zone and data charges |
| Azure private endpoint | Private address mapped to a resource instance | Configure DNS and disable its public access separately |
| Azure service endpoint | Service's public address over the Azure backbone | Subnet-based service firewall access; no on-premises access |
Gateway endpoints do not serve peered VPCs or on-premises clients. Interface endpoints can be reached over VPN or Direct Connect. An AWS endpoint policy further limits allowed principals and resources; the default is broad, so narrow it to the workload's destinations.
An Azure private endpoint targets a specific resource and subresource. A service endpoint applies to the service, and needs resource firewall rules; without destination restrictions, the subnet can still reach other accounts of that service. Google Cloud offers Private Service Connect and Private Google Access, with VPC Service Controls for data-boundary enforcement.
Work through a private-storage connection
An application must read blobs from contoso privately:
- Create a private endpoint for its blob subresource in
snet-pe. - Link
privatelink.blob.core.windows.netto the application virtual network. - Disable public network access on the storage account.
- From the workload, check
nslookup contoso.blob.core.windows.net. It should resolve to the endpoint's private address, such as10.1.2.5. - Test an authorized read privately and verify public-path access fails.
If DNS still returns the public address, private clients can fail once public access is disabled. Creating an endpoint alone leaves the public path available until separately restricted. Keep TLS and narrow identity permissions on the private route too.
Control exit and administration paths
A NAT gateway allows outbound connections and blocks unsolicited inbound ones. It does not choose safe destinations. Restrict outbound traffic with endpoint policies, instance-specific private endpoints and firewall FQDN rules. An AWS policy can restrict destinations to organizational buckets with aws:ResourceOrgID.
AWS Session Manager uses an outbound agent connection and needs no inbound management port. Configure session logging explicitly for auditable shell sessions; SSH and port-forwarding session contents are not recorded. EC2 Instance Connect Endpoint reaches SSH or RDP privately. Azure Bastion accepts users over TLS 443 in AzureBastionSubnet, sized /26 or larger; targets need no public IP but must allow 22 or 3389 from that subnet. Google IAP supports TCP forwarding. Just-in-time access opens a management port for one source for a limited period.
Keep self-managed jump hosts patched, hardened, source-restricted and protected with MFA. For hybrid access, limit advertised routes and allowed source ranges. VPN encrypts traffic; Direct Connect and ExpressRoute need TLS, IPsec or supported MACsec for encryption. A private subnet reachable through a broad peering or VPN rule can still expose a workload to compromised internal systems.
Key Takeaways
- Choose endpoints for the required service and client locations.
- Private DNS and service-side public-access restrictions complete the private path.
- Endpoint policies and egress filters limit destinations; NAT does not.
- Session Manager needs no inbound port; Bastion targets still need private management-port rules.
- Private and hybrid routes still need identity checks and encryption.
4.3 Filter HTTP attacks without blocking real users
A web application firewall inspects HTTP request details, including paths, headers, query strings, cookies and bodies. This layer-7 view lets it recognize suspicious input that an address-and-port filter cannot distinguish.
Combine request inspection with secure code
AWS WAF attaches to services including CloudFront, Application Load Balancer and API Gateway. Azure WAF runs at Application Gateway or Front Door. Google Cloud Armor protects external Application Load Balancers.
Managed rule groups cover common patterns such as SQL injection and cross-site scripting. For example, the fragment "' OR 1=1 --" may signal an attempt to alter a query. Custom rules can match an IP set, path, header, country or size. Bot controls and challenge actions add ways to slow automated abuse. AWS evaluates rules by priority and applies the web ACL's default action if no rule terminates evaluation.
A WAF helps mitigate attacks but leaves application logic and authorization to the application. Keep parameterized queries and output encoding. A normal-looking request that accesses another customer's record needs an application access check.
Choose what a rate rule counts
An AWS rate-based rule groups matching requests by an aggregation key, usually source IP. It looks backward over 60, 120, 300 or 600 seconds; the default is 300. The lowest limit is 10, and the action can be any supported rate-rule action except Allow. Enforcement is approximate, so it is unsuitable as an exact transaction quota.
For /login, use a scope-down condition, 100 requests per 300 seconds per IP and Block. At 3 requests per second, a bot attempts 900 requests over 300 seconds and crosses 100 after about 34 seconds. The trailing window is checked repeatedly; it is not a fixed five-minute block timer. Blocking continues while the estimated count remains above the threshold and ends after the count falls.
Aggregation matters. Many legitimate users behind one shared public address contribute to the same IP-based count. Review logs and traffic patterns before choosing the key and threshold.
Roll out and protect the route
Start new AWS rules in Count or Azure rules in Detection. Inspect false positives, such as legitimate HTML from a rich-text editor matching a cross-site-scripting rule. Add a narrowly scoped exclusion or condition, then enable Block or Prevention. Keep changes in code for review and rollback. WAF logs show the matched rule, action and request details; enable them before tuning.
An edge WAF is effective only on requests that traverse it. Restrict a CloudFront origin with its origin-facing prefix list and a secret custom header, or use VPC origins. A prefix list alone identifies CloudFront infrastructure, not your particular distribution. For Front Door, combine the AzureFrontDoor.Backend service tag with X-Azure-FDID, or use Private Link. Test direct access to the origin: it should fail while the intended CDN route succeeds.
Key Takeaways
- A WAF inspects HTTP content and complements secure application code.
- Rate rules count a chosen group over a trailing window and enforce approximately.
- Use Count or Detection, inspect logs, then enforce tuned rules.
- Narrow exclusions to legitimate traffic that needs them.
- Restrict the origin so requests cannot bypass the edge WAF.
4.4 Keep floods away from limited back ends
A DDoS attack uses many sources to exhaust bandwidth, connection state or application capacity. The point of exhaustion determines which layer must absorb or reject the traffic.
Match protection to the flood
Volumetric attacks fill bandwidth, often through reflected and amplified UDP traffic. Protocol attacks such as SYN floods exhaust connection resources. HTTP floods reach layer 7 and can look like normal requests. A WAF filters HTTP; the provider's edge network and DDoS service handle network-layer floods before they reach constrained back ends.
Baseline protection includes AWS Shield Standard for common layer-3/4 attacks and Azure DDoS infrastructure protection for public-address services. Google Cloud's edge infrastructure and Cloud Armor Standard protect workloads behind supported load balancers. Paid tiers add workload tuning, response support or cost safeguards.
| Tier | Useful distinction |
|---|---|
| Shield Advanced | Register protected resources; response and cost-protection features have eligibility requirements |
| Azure DDoS Network Protection | Plan covering 100 public IPs, with rapid response and cost protection |
| Azure DDoS IP Protection | Per-public-IP pricing, without rapid response or cost protection |
| Cloud Armor Enterprise | Google's paid protection tier |
As of October 2026, Shield Advanced's base subscription is USD 3,000 per month per organization's payer account with a one-year commitment, plus data-transfer fees. It protects registered supported resources. Included WAF web-ACL, rule and request fees apply up to 50 billion requests monthly per subscribed payer organization at the default 1,500-WCU limit; extra usage and features have additional charges. Shield Response Team access needs Business or Enterprise support.
Make the architecture absorb less work
Expose edge components and keep application and database tiers private. Use resilient DNS, a CDN and anycast edge capacity. Cache static responses so repeated requests avoid origin work. Put horizontal scaling behind a load balancer and apply WAF rate limits to expensive paths.
Auto scaling alone can increase the attack bill. Set maximum capacity and budget alarms, and combine scaling with request filtering and caching. The load balancer distributes accepted work; it cannot make an overloaded database unlimited.
Compare cost and prepare access
An online store loses USD 20,000 per hour of outage. A USD 3,000 monthly subscription over 12 months costs USD 36,000. Dividing 36,000 by 20,000 gives 1.8 hours of avoided outage to cover that base subscription. This is a break-even comparison, not a prediction of how many attacks the service will prevent; include transfer costs and the value of response support in the actual decision.
Prepare a runbook before an event: name contacts and escalation paths, register resources, and configure health checks and alarms. Proactive Shield engagement can notify the response team when protected resources become unhealthy during an event. Run simulations only under the provider's published testing policy, using approved partners where required. A paid subscription without the relevant enrolled resources or operational access leaves gaps at the moment it is needed.
Key Takeaways
- Use network DDoS protection for network floods and WAF rules for HTTP floods.
- Cache at the edge, keep back ends private and bound scaling cost.
- Enroll required resources and prepare response access before an event.
- Compare protection cost with outage impact and required support features.
5Record security activity in logs and audit trails
Security evidence must cover the activity you need to explain and survive the failures you are investigating. Resource changes, object reads, network connections and blocked requests appear in different logs. Choose those sources and their retention early, collect them across accounts and Regions, then move them beyond workload administrators’ control. Integrity checks, write-once retention and protected keys give the archive distinct layers of protection.
5.1 Collect the logs that answer security questions
An audit trail records the principal, action, time, source, target and result of activity. Choose the required events before deployment: logs enabled after a loss cannot reconstruct events that were never collected.
Distinguish changes from data access
Control-plane logs record resource management, such as creating a role or changing a firewall. CloudTrail Event history keeps 90 days of AWS management events per Region; use a trail for longer retention. Azure Activity Log keeps subscription operations for 90 days unless exported. Google Admin Activity audit logs are always enabled and retained for 400 days.
Data-plane logs record work inside the resource: reading an object, invoking a function or retrieving a secret. High-volume data logging often needs explicit configuration. CloudTrail data events cover selected S3, Lambda and DynamoDB activity. Azure resource logs need diagnostic settings; Google Data Access audit logs are disabled by default except for BigQuery. Identity logs, such as Entra sign-in logs, add authentication context.
CloudTrail Lake closed to new customers on May 31, 2026. New architectures can send trail events to Amazon CloudWatch for searching, while retaining a protected archive separately.
Match a question to an event
| Security question | Evidence to collect |
|---|---|
| Who deleted a security group? | CloudTrail management event DeleteSecurityGroup |
| What downloaded an export object? | S3 data events or server access logs |
| What retrieved a stored password? | CloudTrail GetSecretValue or Key Vault AuditEvent |
| Did a machine contact an address? | VPC or virtual network flow logs |
| What rule blocked a web request? | WAF logs |
Flow logs contain addresses, ports, protocol, byte counts and acceptance or rejection. They do not contain packet bodies. Use DNS query, firewall and load-balancer access logs for their corresponding questions. On Azure, choose virtual network flow logs; new NSG flow logs are unavailable and existing NSG flow logs retire on September 30, 2027.
Make coverage and retention deliberate
Collect across accounts and Regions, including unused Regions where unauthorized resources could be created. Include global-service activity such as IAM and STS. Select data events for sensitive resources, using advanced selectors to control volume and cost, rather than assuming a management trail includes object reads.
Retention follows the workload's requirements. PCI DSS requires at least 12 months of audit history, with the latest three months immediately available for analysis. Use UTC timestamps, synchronized clocks and request IDs to connect events across services. Set retention explicitly in each search and archive destination.
A credential in a log identifies the principal used, which could be an attacker using a stolen credential. Personal identities, MFA and avoidance of shared accounts improve attribution. Keep that distinction when reading "who" in an audit request: the record shows which credentials acted, and identity evidence helps connect them to a person.
Key Takeaways
- Management logs describe resource changes; data logs describe access inside resources.
- Enable required data events explicitly, before they are needed.
- Flow logs contain connection metadata, not payloads.
- Cover every account, Region and relevant global service.
- Set retention from requirements and preserve UTC time and request IDs.
5.2 Keep audit evidence separate and tamper-resistant
An audit archive should survive compromise of the workload it records. Send logs to a separate security-owned account, subscription or project, and protect both the stored records and the configuration that delivers them.
Separate collection from workload control
An AWS organization trail can deliver all organization accounts to a log-archive bucket. Control Tower creates separate Log Archive and Audit accounts. Azure Policy deployIfNotExists can deploy diagnostic settings to central destinations. Google organization-level aggregated sinks route logs centrally.
Deny workload administrators access to stop logging or delete the archive. Service control policies can restrict cloudtrail:StopLogging, DeleteTrail and UpdateTrail in member accounts. Keep tightly controlled emergency access separate from routine workload roles. An archive encrypted with a customer managed key needs its own key policy: the delivery service can encrypt, and authorized investigators can decrypt.
Detect changes and prevent deletion
CloudTrail integrity validation hashes delivered files with SHA-256. Hourly signed digest files list those hashes and link to the previous digest signature. Run aws cloudtrail validate-logs to check whether delivered files were altered or deleted. Enabling digest delivery supplies evidence for validation; it does not run the later validation for you.
Integrity validation detects changes. Write-once-read-many (WORM) retention blocks changes to protected object versions. S3 Object Lock requires versioning and has two modes:
| Mode or hold | Effect |
|---|---|
| Compliance retention | No user, including root, can delete a locked version or shorten retention before its date |
| Governance retention | A permitted caller can explicitly bypass the lock |
| Legal hold | Protects a version until an authorized person removes the hold |
Azure immutable blob storage supports locked time-based retention and legal holds; Google offers Bucket Lock. Protect the encryption key too: preserved ciphertext is useless if its key is destroyed.
Plan search, archive and deletion together
For 40 GB of logs per day retained for 365 days, keep the newest 90 days in a fast tier and the remaining 275 days in archive storage. That is 3,600 GB fast and 11,000 GB archived, about 14,600 GB total at steady state, before delivery and lifecycle timing differences.
Set Object Lock for the required retention, then use lifecycle transitions for the cheaper tier. In a versioned bucket, expiring the current object creates a delete marker; it does not remove the underlying version. Add noncurrent-version expiration after the lock permits deletion and clean up expired delete markers. Otherwise storage keeps accumulating after the planned retention.
Use a searchable store such as CloudWatch, Log Analytics or Cloud Logging for recent investigation, with explicit retention there as well. Test retention settings in governance mode before adopting a long compliance lock. Once compliance retention is set, its time and storage commitment cannot be shortened through normal object operations.
Key Takeaways
- Keep the archive outside workload administrators’ control.
- Protect log delivery settings, stored versions and the archive key.
- Signed digests detect changes; WORM retention prevents changes to locked versions.
- Governance mode permits authorized bypass; compliance mode protects through the retention date.
- Versioned-bucket cleanup needs noncurrent-version expiration as well as current expiration.
6Manage security posture and automate compliance
A secure template can drift, and a compliant-looking score can hide an exposed workload. Continuous posture checks find configuration gaps; policy and remediation make requirements repeatable. Read results in their risk context and preserve evidence of both fixes and accepted exceptions. Finish by walking the full architecture, including the identities and permissions that can change its controls, so separate good choices form a coherent design.
6.1 Use posture findings to reduce real exposure
Cloud security posture management (CSPM) compares deployed configurations with benchmarks and produces findings with severity and remediation guidance. It can identify public storage, open management ports, missing encryption or disabled logging across a large estate.
Read the finding and its context
AWS Security Hub CSPM checks standards largely through AWS Config rules. The newer AWS Security Hub correlates CSPM, GuardDuty, Inspector and Macie findings into prioritized exposures. Microsoft Defender for Cloud applies the Microsoft cloud security benchmark and can connect to AWS and Google Cloud. Its paid Defender CSPM adds attack path analysis; foundational CSPM is free. Google Cloud uses Security Command Center.
A benchmark is a set of configuration recommendations, such as CIS guidance or the provider's own best practices. A finding's mapping to a benchmark control helps organize evidence. It does not decide how much harm the affected resource could cause in your workload.
Prioritize severity together with exposure, data sensitivity and privileges. A vulnerable public machine whose role can read customer documents combines several risks into an attack path. It can deserve attention before a similarly severe finding on an isolated test system. A public website-image bucket and a public identity-document bucket need different decisions even when a tool reports the same public-access setting.
Understand what a score measures
For Defender for Cloud's classic secure score, a control contributes its maximum points multiplied by its healthy-resource fraction. A 4-point control with 15 healthy resources out of 20 contributes 3 points. Fixing the remaining five adds 1 point.
Security Hub CSPM calculates passed controls divided by enabled controls with Passed, Failed or Unknown status; controls with no data are excluded. With 180 passed out of 200 enabled, the score is 90%. Suppressing failed findings can increase the score without removing exposure. Examine the suppressions and the denominator before treating an increase as progress.
Scores summarize the checks that ran. Configuration checks do not examine every application authorization decision or identify every active attacker. Keep application testing and security monitoring alongside posture assessment.
Close findings at the source
Assign an owner and fix the infrastructure template or policy that created the setting. A console repair alone can disappear on the next deployment. Record accepted risks as suppressions or exemptions with reasons and expiry dates. Use automatic remediation for repeated, low-risk changes only after testing its effect.
Central administration avoids coverage gaps. A delegated Security Hub CSPM administrator can aggregate accounts and Regions; Defender for Cloud settings at management-group scope can include new subscriptions. Consolidate overlapping control findings so enabling more standards does not bury the same unresolved issue in duplicate records.
Key Takeaways
- Use exposure, data sensitivity and privilege alongside severity.
- Scores depend on the checks, statuses and suppressions included.
- Repair the template that creates the problem.
- Give accepted risks an owner, reason and expiry date.
- Manage coverage centrally as accounts and subscriptions are added.
6.2 Make requirements enforceable and evidence automatic
Compliance maps a requirement to controls and evidence. A provider's attestation report covers its part of the service; the workload's configuration, access processes and operating procedures still need their own evidence.
Choose when a control acts
| Control type | Timing and result | Examples |
|---|---|---|
| Proactive | Checks a template before deployment | CloudFormation Hooks, pipeline scanning |
| Preventive | Stops a prohibited change | SCPs, Azure Policy deny, organization constraints |
| Detective | Reports an existing violation | Config rule, Azure Policy audit |
| Corrective | Repairs a violation | Systems Manager Automation, Policy remediation |
AWS Config records configurations over time and evaluates managed or custom rules on changes or schedules. A conformance pack bundles rules and remediation; an aggregator combines account and Region results. An aggregator collects evidence, so confirm the rules are also deployed in each required location.
Azure regulatory compliance initiatives group policies for a framework. Assign at management-group scope for consistent subscription coverage. For create/update requests, evaluation checks disabled first, then append and modify, then deny, then audit effects. Effects such as deployIfNotExists and modify can remediate existing resources through tasks using a managed identity. Existing resources need that remediation step; merely assigning policy leaves work to do.
Work a requirement through all layers
The requirement is "All object storage uses approved customer managed keys and is not publicly accessible." On AWS:
- Set default SSE-KMS encryption with the approved key. Use a bucket policy to deny uploads selecting another key through
s3:x-amz-server-side-encryption-aws-kms-key-id. - Enable account-level Block Public Access and protect its settings with organization guardrails.
- Evaluate approved-key encryption with
s3-default-encryption-kmsand public-access settings withs3-bucket-level-public-access-prohibited. - Test remediation that restores public access blocking, and preserve compliance history.
Public access blocking prevents public grants. Authorized internet requests remain possible. If the brief also requires a private network path, add a resource policy restricting requests to approved endpoints with aws:SourceVpce. An endpoint policy limits its own path; the resource policy closes alternative paths.
On Azure, deny storage accounts with public network access enabled and audit or deny missing customer-managed encryption. Keep the key, network and access requirements separately testable.
Preserve decisions and evidence
If 184 of 200 resources comply, the rate is 92%. Fixing ten gives 194 of 200, or 97%. Assign the remaining six a fix or an explicit exemption with an owner and expiry. Keep exempt resources visible so the report does not disguise unresolved risk.
Config conformance packs and Security Hub CSPM provide technical control evidence; timestamp and protect it like audit logs. AWS Audit Manager closed to new customers on April 30, 2026. Broader policy and procedure evidence needs a compliance management tool; Microsoft Purview Compliance Manager and Google Assured Workloads support their respective cloud compliance workflows.
Scan templates with tools such as Checkov, cfn-guard, Trivy or PSRule for Azure. Keep pipeline and runtime rules aligned. Start new remediation in audit mode and test before enforcing it. Define narrow exemptions and emergency access so a broad deny does not block an essential recovery change.
Key Takeaways
- Distinguish proactive, preventive, detective and corrective controls.
- Map each requirement to a specific control and retained evidence.
- Public grants, public network paths and key choices need separate checks.
- Deploy rules as well as aggregators, and remediate existing resources deliberately.
- Keep exemptions visible, owned and time-limited.
- Align pipeline checks with runtime enforcement.
6.3 Review the whole workload and its control plane
A security review follows the request, data and administration paths. At every component, check who can reach it, who can act, how data is protected, what is logged, what finds drift and what happens under attack.
Trace a protected customer portal
At the edge, DNS and a CDN lead to a WAF with managed rules and a login rate limit, backed by DDoS protection. The public load balancer accepts only the intended CDN route. It reaches application servers in private subnets; the database allows only the application tier.
Require TLS to the application and database. Use a customer managed database key and a separate document-storage key. Block public document access and use an endpoint with a policy restricting the allowed storage destination. Give the application a role to read its rotating secret. Administrators use Session Manager.
An organization trail records management events and document-bucket data events into a separate archive with integrity validation and Object Lock. Add flow and WAF logs for their own evidence. Security Hub CSPM and Config conformance packs check the deployed design. Protect logging changes with service control policies.
Repair gaps by following the bypass
A database allowing TCP 3306 from 0.0.0.0/0 needs a private path and an application-group source restriction. A password committed to Git needs revocation or rotation, a secret store and history cleanup. A single-Region trail in the workload account needs wider coverage and a separate protected archive. A publicly readable document bucket needs public access blocked and controlled downloads. HTTP after public TLS termination needs re-encryption to targets.
A presigned URL gives temporary access to a specific object under the signer's permissions. Use a short lifetime, such as 15 minutes for a download. Temporary signing credentials can expire sooner and end access before the URL's stated time. Azure SAS provides scoped storage access; prefer a user delegation SAS signed with Entra credentials. Stored access policies support revocation of service SAS tokens, not user delegation SAS tokens.
Review administrative power and operating cost
Who can change a security group, stop a trail or schedule key deletion? Those control-plane permissions can undo data-path protection. Review them with the same care as application access, using least privilege, guardrails and sensitive-change alerts.
Estimate endpoint, key and request costs. S3 Bucket Keys can reduce SSE-KMS requests and related costs by up to 99%. For client-side envelope encryption, bounded data-key caching reduces calls; it also keeps plaintext keys in memory for the chosen interval. Monitor KMS request quotas and use retry with backoff so a busy workload does not fail when throttled.
Translate controls by function when moving providers. AWS KMS maps to Azure Key Vault/Managed HSM and Google Cloud KMS; Secrets Manager to Key Vault secrets and Secret Manager; CloudTrail to Activity/resource logs and Cloud Audit Logs. WAF/Shield, Azure WAF/DDoS Protection and Cloud Armor protect different edge surfaces. Compare the actual resource, permission and retention behavior before accepting an equivalent design.
Key Takeaways
- Review request, data and administration paths component by component.
- Test alternate public and direct-origin paths as well as the intended path.
- Short-lived download access still depends on the signer’s permissions and credential lifetime.
- Protect the permissions that can disable or weaken security controls.
- Check key-request capacity, endpoint cost and recovery dependencies.
Designing Secure Cloud Architectures examples
1Plan protection for an invoice service
10 steps
- 1IntroductionStart with the workload
An invoice service accepts PDFs from customers and keeps payment details in a database. Its design needs more than a firewall icon.
Follow the data from the upload page to storage, then decide which controls stop disclosure, unwanted changes, service loss and loss of evidence. Listing those threats is a threat model; controls that fail independently give defense in depth. The same diagram will help explain why each control belongs there.
- 2ExplanationPlace independent layers
Put WAF and DDoS protection at the edge, narrow traffic rules between tiers, and a dedicated role on the application. Protect stored data with encryption and key permissions, and send audit events to an independent archive.
These controls handle different failures. If a malicious request passes the WAF, a narrow database role still limits the records and operations it can reach.
- 3ExampleReduce the reach of a test leak
Test and production currently share an account and broad access to one encryption key. A leaked test credential can therefore affect production.
Separate the environments, assign a production-only application role and key, and remove broad cross-environment trust. The useful change is the loss of that access path. Account separation works with permissions to reduce the blast radius.
- 4ChallengeCheck the internal request
A developer proposes using plain HTTP from the load balancer to the application because both are inside the private network. What security assumption needs correction?
---reveal---
The proposal trusts the network location. Private placement does not encrypt the hop or authenticate every request. Use TLS for sensitive internal traffic and check identity and authorization even after traffic passes the perimeter.
- 5ExplanationClassify the actual stored data
Invoices, customer contact details and exports may have different sensitivity. Classify each stored combination by the harm from disclosure, alteration or loss.
An export joining purchase history to a large email list can deserve stronger controls than either table alone. Include backups and caches in the classification, because they contain usable copies of the same information.
- 6ExampleMark the trust boundaries
Draw the browser, load balancer, application, document store and database. Add arrows for uploads, reads and database calls. Mark the internet-to-edge boundary and each transition to a differently trusted service.
At the upload boundary, consider spoofed identities, altered input, sensitive content and floods. STRIDE turns those broad concerns into questions about authentication, integrity, auditability, confidentiality, availability and privilege.
- 7ExampleMake controls testable
For injection, choose managed WAF rules and parameterized database queries. For leaked passwords, use a secret store with tested rotation. For log deletion, send events to a separate archive with write-once retention.
Then specify evidence: a new connection works after rotation; the workload role cannot delete archived logs. A requirement becomes useful when the team can demonstrate it.
- 8ChallengeReview the partner export
The service adds a nightly transfer of customer invoices to an analytics partner. What must be revisited before enabling it?
---reveal---
Update the data-flow diagram and threat model for the new trust boundary. Classify the exported combination, check the destination and permitted processing Region, and define TLS, narrow credentials and transfer logging. Existing upload controls do not describe this new path.
- 9ChallengeChoose a justified control
The team proposes a paid protection tier for every test endpoint while its production archive remains deletable by application administrators. How should the design review prioritize this?
---reveal---
Address the clear evidence-loss path and assess the paid tier against actual outage impact and threats. Defense in depth needs independent, relevant controls; simply adding subscriptions does not establish that. Record any deferred risk with an owner.
- 10RecapCheck what the design can demonstrate
Use the diagram to connect data sensitivity, threats, controls and tests. Independent layers limit a breach, while separated environments limit its reach.
Before approving a new integration, check which data crosses its boundary and which new permissions it creates. Keep security settings in reviewed templates so the deployed workload can be compared with the design as it changes.
2Encrypt a document and keep it readable
15 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionFollow plaintext and key use
- 2ExplanationSeparate bulk data from the wrapping key
- 3ExampleRequest and use the data key
- 4ExampleStore the encrypted result
- 5ChallengeCheck a stolen read credential
- 6ExplanationChoose independent key permissions
- 7ExampleRotate without rewriting the archive
- 8ChallengePrepare the recovery Region
- 9TipTest dependencies before deletion
- 10ExplanationDraw both TLS connections
- 11ExampleEnforce the private hop
- 12ChallengeKeep the certificate renewable
- 13Key InsightPrivate links have a separate job
- 14ChallengeExplain unreadable but preserved logs
- 15RecapReview encryption and availability together
3Replace a deployment key and rotate a database secret
11 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionFind the credential paths
- 2ExplanationPut the secret behind a workload identity
- 3ExampleBuild the refresh path
- 4ChallengeRespond to a published password
- 5ExampleCreate and test the replacement
- 6ExplanationUse the overlap deliberately
- 7ChallengeDiagnose the rotation outage
- 8ExplanationExchange the pipeline identity
- 9ChallengeRestrict a shared build platform
- 10ChallengeKeep rotation independent of release dates
- 11RecapCheck each remaining secret separately
4Trace a request from the edge to private storage
17 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionFollow a customer request
- 2ExplanationIdentify the filter before reading rules
- 3ExampleConnect only adjacent tiers
- 4ExampleFind the shadowed exception
- 5ChallengeFind the missing response rule
- 6ExampleCreate the private storage path
- 7ExplanationClose other routes and destinations
- 8TipGive administrators a private path
- 9ChallengeDiagnose the endpoint connection
- 10ExplanationInspect the request at HTTP level
- 11ExampleTune before blocking
- 12ChallengeCheck whether the origin is bypassable
- 13ExplanationReject floods before limited resources
- 14ExamplePrepare the paid protection
- 15ChallengeSeparate two flood defenses
- 16ChallengeReview the combined path
- 17RecapTest allowed paths and refused paths
5Build an archive that survives a workload compromise
11 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionDesign evidence before the event
- 2ExplanationChoose events for the question
- 3ExampleExtend coverage beyond event history
- 4ChallengeRead the limits of a flow record
- 5ExampleMove delivery beyond the workload
- 6ExplanationAdd two different integrity controls
- 7ExampleCalculate the storage tiers
- 8ChallengeExplain storage that keeps growing
- 9TipChoose the lock commitment carefully
- 10ChallengeCheck an intact but incomplete archive
- 11RecapVerify coverage and preservation separately
6Turn a posture finding into a lasting fix
14 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionConnect a finding to the design
- 2ExplanationRead risk behind the severity
- 3ExampleUnderstand a score change
- 4ChallengeKeep the fix after deployment
- 5ExplanationChoose when to act
- 6ExampleSeparate keys, grants and paths
- 7ExampleMeasure the remaining work
- 8ChallengeRepair existing resources safely
- 9ExampleFollow the customer document
- 10ExplanationInclude the people who change controls
- 11ChallengeCheck a temporary download link
- 12ChallengeExplain a provider report’s scope
- 13TipCheck cost and key-request capacity
- 14RecapRequire evidence of the lasting result
Designing Secure Cloud Architectures practice questions
Set 1: Keep access working as controls change10 Practice Questions
Question 1 of 10
Show answerHide answer
Question 2 of 10
Show answerHide answer
Question 3 of 10
Show answerHide answer
Question 4 of 10
Show answerHide answer
Question 5 of 10
Show answerHide answer
Question 6 of 10
Show answerHide answer
Question 7 of 10
Show answerHide answer
Question 8 of 10
Show answerHide answer
Question 9 of 10
Show answerHide answer
Question 10 of 10
Show answerHide answer
Set 2: Choose controls for a new workload10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 3: Diagnose gaps in running cloud services10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 4: Review recovery, evidence and enforcement10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
AWSPENDING identify during rotation?Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 5: Resolve competing security requirements10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Stuck on your own question? Homework Help
Key Terms
A
Alternating-user rotation
Application security group
Attack path
Audit trail
B
Benchmark
Blast radius
C
Central log archive
Certificate authority
Client-side encryption
Cloud security posture management
Compliance exemption
Conformance pack
Content delivery network
Control-plane log
DeleteSecurityGroup management event identifies the request that removed a network access control.Corrective control
Credential cache
Customer managed key
D
Data classification
Data key
Data residency
Data-plane log
Defense in depth
Detective control
Digest file
Distributed denial of service
E
Economic denial of service
Egress filtering
Encryption at rest
Endpoint policy
Envelope encryption
Ephemeral port
F
False positive
Finding suppression
Flow log
G
Gateway endpoint
H
Hardware security module
I
Infrastructure as code
Integrity validation
Interface endpoint
K
Key encryption key
Key management service
Key policy
Key rotation
L
Legal hold
Log retention
M
Managed bastion
Managed identity
Managed rule group
Management plane
Multi-Region key
Mutual TLS
N
Network ACL
Network security group
Noncurrent-version expiration
O
Origin restriction
P
Policy as code
Presigned URL
Preventive control
Private endpoint
Proactive control
Protocol attack
Purge protection
R
Rate-based rule
Repudiation
Retry with backoff
S
S3 Bucket Key
Secret
Secret rotation
Secret store
Secret version
Secure score
Security by design
Security group
Separation of duties
Server-side encryption
Service endpoint
Service tag
Shared access signature
Staging label
AWSCURRENT moves to the new value after testing, while AWSPREVIOUS retains the earlier good version.STRIDE
T
Threat modeling
TLS certificate
TLS passthrough
TLS termination
Transport Layer Security
Trust boundary
V
Volumetric attack
W
Web application firewall
Workload identity
Workload identity federation
Write-once-read-many storage
Z
Zero trust
- 1Cloud Identity and Access Management
- 2Cloud Network Design
- 3Auto Scaling
- 4Cloud Storage and Database Design
- 5Designing Resilient Architectures
- 6Designing Secure Cloud Architectures
- 7Infrastructure as Code
- 8Cloud Monitoring
About this lesson
Make your own Study Materials
Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.