AWS Core Services and Architecture Questions
Amazon Web Services' core service catalog and how the pieces compose into a working system: EC2, Lambda, S3, VPC, IAM, RDS, and the managed-service ecosystem. Covers service selection within AWS, common reference architectures, the AWS Well-Architected Framework pillars, and operational patterns specific to the platform. For provider-agnostic compute or storage trade-offs, see the cross-cloud entries.
You must guarantee end-to-end encryption for a pipeline where external clients hit API Gateway, then Lambda, then storage in DynamoDB or RDS. Design a KMS envelope-encryption approach that lets a separate analytics account decrypt the data for processing without broadly exposing the KMS key.
Sample Answer
Direct answer. Use envelope encryption: Lambda calls KMS GenerateDataKey against a customer managed KMS key (AWS Key Management Service; the key that owns the encryption policy) owned by the security or data account, encrypts the payload locally with the returned plaintext data key, discards the plaintext key immediately, and stores only the ciphertext data key next to the encrypted record in DynamoDB or RDS (Relational Database Service). The analytics account never receives a standing IAM (Identity and Access Management) permission on the KMS key itself. Instead it is issued short lived, narrowly scoped KMS grants that permit Decrypt on demand, so the trust boundary lives at the grant's lifecycle rather than at a broad key policy or cross account IAM role.
Why envelope encryption instead of calling KMS directly
KMS Encrypt/Decrypt on a symmetric key caps the plaintext at 4,096 bytes (4 KB), so calling KMS directly per record does not work once payloads exceed that size, and even for small payloads it puts a network round trip to KMS on the request's critical path for every read and write. Envelope encryption removes both problems: KMS is only called once per record to mint a data key, the actual AES-GCM encrypt/decrypt of the payload happens locally at whatever size the payload is, and only the small ciphertext data key (not the payload) ever touches KMS again on decrypt.
End to end flow
flowchart LR
Client[External client] -->|HTTPS| APIGW[API Gateway]
APIGW --> Lambda[Ingress Lambda]
Lambda -->|GenerateDataKey| KMS[(KMS key\nsecurity account)]
KMS -->|plaintext key + ciphertext key| Lambda
Lambda -->|AES-GCM encrypt payload| Store[(DynamoDB / RDS\nciphertext + ciphertext key)]
Analytics[Analytics account job] -->|assume role, use grant| KMS
KMS -->|Decrypt ciphertext key| Analytics
Analytics -->|decrypt payload locally| Store
Broker[Grant broker service] -->|CreateGrant / RetireGrant| KMS
- Ingress. API Gateway invokes the Lambda function. The Lambda calls
kms:GenerateDataKeyon the KMS key (AWS's current term for what older documentation and many engineers still call a Customer Master Key, or CMK; both names refer to the same customer managed key resource). KMS returns a plaintext data key and its ciphertext copy in one call. - Local encryption. The Lambda uses the plaintext data key to AES-GCM encrypt the record, then zeroes the plaintext key from memory. Only ciphertext payload and ciphertext data key are written to DynamoDB or RDS. No plaintext key is ever persisted or logged.
- Cross account read. When the analytics account's job starts, a grant broker (a small Lambda or Step Functions task running in the security account) calls
kms:CreateGrant, naming the analytics job's IAM role asGranteePrincipal, restrictingOperationstoDecrypt(andDescribeKeyif the client needs to introspect key metadata), and setting aRetiringPrincipalso the broker itself can retire the grant when the job ends. - Decrypt. The analytics job reads the ciphertext data key from the record, calls
kms:Decrypt(authorized purely by the grant, no key policy edit required), gets back the plaintext data key, and decrypts the payload locally. - Teardown. The broker calls
RetireGrant(orRevokeGrantfrom the security account) once the job window closes. Because a grant is a distinct, listable object (ListGrants), it can be issued and torn down per job without ever touching the KMS key's key policy or IAM policies, which is what keeps the blast radius narrow: a leaked analytics role credential is scoped to whatever grants are currently outstanding, not to the key itself.
aws kms create-grant \
--key-id arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab \
--grantee-principal arn:aws:iam::444455556666:role/AnalyticsJobRole \
--retiring-principal arn:aws:iam::111122223333:role/GrantBrokerRole \
--operations Decrypt DescribeKey \
--name analytics-job-2026-07-20
Classification, retention, and audit trail for the data itself
Envelope encryption controls who can read the data; it says nothing about how long it should exist or who touched it when, and those are the questions a reviewer for personally identifiable information (PII) will ask next:
- Classification. Tag each field or record at write time (a
classificationattribute such aspii-high,pii-low,internal) so downstream consumers, including the analytics job, can filter on sensitivity before deciding whether a grant is even appropriate for that data slice, and so the key policy or grant constraints can be scoped per classification tier rather than treating all rows uniformly. - Retention. Attach a retention rule to the classification: DynamoDB Time To Live (TTL, an attribute that expires and deletes items automatically) or an RDS scheduled purge job for the raw ciphertext, separate from any retention period required for the audit trail itself. Encryption is not a substitute for deletion; PII that no longer has a business purpose should not still be sitting around merely because it is encrypted.
- Audit trail. Every
GenerateDataKey,Decrypt,CreateGrant, andRetireGrantcall emits an AWS CloudTrail event, logged in the security account by default since KMS is the resource owner. Centralize these events (CloudTrail organization trail or a dedicated log account) and alert on anomalies: aDecryptvolume spike, aDecryptfrom a role or region that never normally calls it, or a grant that outlives its expected job window. Pair this with an application level audit table (job id, grant id, requester, record ids touched) so "who read record X and when" is answerable without reconstructing it from raw CloudTrail JSON.
Trade-offs and pitfalls
- Grants vs key policy cross account statements. A permanent key policy statement granting the analytics account
kms:Decryptis simpler to set up but is always-on: a compromised analytics credential can decrypt anything, anytime. Grants cost more operational machinery (a broker, a lifecycle to manage) but bound the exposure window to the job's actual runtime. - Data key caching. Calling
GenerateDataKeyper record at high write volume adds KMS request cost and can approach per key request quotas under bursty traffic; a data key caching library (encrypt many records under one data key, rotate the data key periodically) trades a slightly larger blast radius per data key for far fewer KMS calls. This is a real trade-off to name explicitly, not a free win. - Symmetric vs asymmetric KMS key. Symmetric is the right default here for performance and because grants and envelope encryption are built around it; asymmetric keys exist for signing or when the decrypting party must never call KMS with AWS credentials, which is not this scenario.
- Forgetting to revoke. A grant with no explicit TTL and no reliable retire step is functionally a standing permission with extra steps. The broker retiring (or revoking) the grant is not optional cleanup, it is the entire point of using a grant instead of a policy statement.
- Encryption context. Passing an
EncryptionContext(a non-secret key-value pair, for example{"table": "patient-records"}) on bothGenerateDataKeyand the laterDecryptadds authenticated context that must match exactly, which stops a ciphertext data key from one table being replayed against a different table's decrypt path.
For a regulated environment running on ECS and EKS, what security considerations differ between the two? Cover image provenance/supply-chain (scan-on-push, signed images), and task role vs IRSA for granting AWS permissions to workloads.
Sample Answer
Direct answer
The security delta between Amazon Elastic Container Service (ECS) and Amazon Elastic Kubernetes Service (EKS) in a regulated environment is mostly about where AWS-native controls plug in, not which platform is inherently more secure: ECS grants AWS permissions to workloads via a task role (one IAM role per task definition) and integrates natively with Amazon Elastic Container Registry (ECR) image scanning; EKS gives you the same image-provenance controls plus Kubernetes-native admission control, and grants AWS permissions to pods via IAM Roles for Service Accounts (IRSA) or the newer EKS Pod Identity feature, both scoped to a Kubernetes service account rather than a whole node. The bigger axis for a regulated, kernel-module-requiring workload is actually compute platform, not orchestrator: AWS Fargate and AWS Lambda run on AWS-managed microVMs with no exposed kernel to load a module into, so a workload that genuinely needs a custom kernel module has to run on self-managed Amazon EC2 (with or without ECS/EKS layered on top), never on Fargate or Lambda.
Structured elaboration
1. Image provenance / supply chain (same practice on both platforms)
- Enable ECR scan-on-push so every pushed image gets a vulnerability scan before it's eligible to run, and require image signing (for example, via Cosign) plus a generated Software Bill of Materials (SBOM) in the CI pipeline; gate deployment on both a passing scan and a valid signature, not just whatever tag exists in ECR.
- EKS adds a natural enforcement point ECS lacks: a Kubernetes admission controller (Open Policy Agent Gatekeeper or Kyverno) can reject any pod spec referencing an unsigned or unscanned image at admission time, inside the cluster. ECS has no equivalent native admission hook, so that gate has to live entirely in CI/CD, before anyone calls
RegisterTaskDefinitionorUpdateService.
2. Granting AWS permissions to workloads
- ECS task role: one IAM role per task definition; every container in that task shares the same role's permissions (task-level granularity).
- EKS IRSA: maps a Kubernetes service account to an IAM role via the cluster's OIDC identity provider; a pod using that service account gets credentials scoped to exactly that role, at pod granularity, without relying on node-level IAM permissions.
- EKS Pod Identity: AWS's newer, simpler alternative to IRSA that removes the OIDC-provider setup step, associating an IAM role with a service account directly through EKS, with credentials delivered by a Pod Identity Agent DaemonSet on each node. It grants the same pod-scoped access as IRSA; new EKS deployments should default to Pod Identity, but existing IRSA setups don't need to migrate for a security benefit, both remain supported.
- Both models beat relying on the worker node's own EC2 instance role in a regulated environment, because a node-level role is implicitly reachable by every pod scheduled on that node unless Instance Metadata Service (IMDS) access is explicitly locked down.
3. Compute-platform isolation, the axis that decides "can this even run here"
| Platform | Isolation unit | Kernel access / kernel modules | Regulated + kernel-module workload? |
|---|---|---|---|
| EC2 self-managed | Full EC2 instance | Full: you own the kernel, can load modules | Yes, the default when a kernel module is a hard requirement |
| ECS on EC2 | Container on a host kernel you manage | Full possible (privileged mode), shared by every task on that host | Yes, with a dedicated host pool to bound blast radius |
| ECS on AWS Fargate | Firecracker microVM per task | None | No |
| EKS on EC2 nodes | Pod on a host kernel you manage | Same as ECS on EC2 | Yes, plus Kubernetes-native policy enforcement |
| EKS on Fargate profiles | Firecracker microVM per pod | None | No |
| AWS Lambda | Firecracker microVM per execution environment, fully AWS-managed | None | No |
4. Runtime hardening once you're on EC2-backed compute (ECS-on-EC2 or EKS-on-EC2): seccomp profiles, dropped Linux capabilities, read-only root filesystems where the workload allows it, and behavioral runtime monitoring to catch container-escape attempts, since a shared kernel means an escape reaches every other workload on that host, not just its own task or pod.
Worked example
A regulated workload needs a custom eBPF-based network kernel module for deep packet inspection. Working through the table: Lambda and both Fargate options are eliminated immediately on the kernel-module requirement alone. That leaves EC2 self-managed, ECS-on-EC2, or EKS-on-EC2. Because the organization already runs Kubernetes-native policy tooling and wants IRSA/Pod-Identity-scoped AWS access per workload rather than one task role per definition, EKS-on-EC2 with a dedicated, tainted node group (so only this workload schedules there, bounding the shared-kernel blast radius) is the concrete choice, with ECR scan-on-push plus signature verification enforced at admission by Gatekeeper before any pod referencing that image can schedule.
Trade-offs & pitfalls
- Don't conflate "EKS supports IRSA/Pod Identity" with "EKS is more secure than ECS" - in a regulated environment, the decision that matters most is almost always the compute-platform row (Fargate/Lambda's managed isolation versus EC2's operational burden), not the orchestrator.
- A dedicated node group with a taint only limits scheduling; it doesn't stop a privileged container from reaching the underlying kernel. Combine it with seccomp/capability drops, it isn't a substitute for them.
- IRSA still works and is well understood; treat migrating existing IRSA workloads to Pod Identity as a "prefer for new work" recommendation, not an urgent deprecation.
- Enforcing image signing only in CI (ECS's situation) is bypassable by anyone with
ecs:RegisterTaskDefinitionpermission who skips the pipeline; EKS's admission-controller gate is the stronger control precisely because it's enforced at the cluster, not only at the pipeline.
Walk through AWS KMS key concepts: symmetric vs asymmetric CMKs, customer-managed vs AWS-managed keys, key policies vs IAM policies, and automatic rotation. What changes when you need cross-account access to a key, or a strict separation-of-duties requirement across a multi-account environment?
Sample Answer
Direct answer
AWS Key Management Service (KMS) is the managed service that creates, stores, and controls cryptographic keys. AWS now calls these KMS keys (you'll still hear the older term CMK, customer master key, used interchangeably). A KMS key is either symmetric (one key used for both encrypt and decrypt, the default for almost everything) or asymmetric (a public/private key pair, used for signing or for cases where encryption has to happen outside KMS). Separately, a key can be AWS managed (AWS creates and rotates it for you, you get no policy control) or customer managed (you own the key policy, rotation schedule, and lifecycle). Access to a key is governed first by its key policy, a resource policy attached directly to the key, and only within what that policy allows can AWS Identity and Access Management (IAM) policies grant identities permission to use it.
Structured elaboration
Key types
- Symmetric keys: AES-256, used for the vast majority of workloads (S3 SSE-KMS, EBS, RDS, EFS). KMS never lets the symmetric key material leave the service; you always call KMS to encrypt or decrypt.
- Asymmetric keys: RSA or elliptic-curve pairs, used for digital signatures or when a public key must be shared with a system outside AWS. Slower and not meant for bulk data.
- Neither key type rotates the same way: automatic annual rotation is available for customer managed symmetric keys as an opt-in setting; asymmetric and HMAC keys are rotated manually, by creating a new key and repointing an alias.
Key ownership tiers
| Tier | Who controls the key policy | Rotation | Typical use |
|---|---|---|---|
| AWS owned key | AWS | AWS-controlled | Backing some AWS service internals, invisible to you |
| AWS managed key | AWS | Automatic, AWS-controlled | Default encryption when you don't specify a key (e.g., default EBS or S3 encryption) |
| Customer managed key | You | Optional automatic rotation you enable | Anything needing custom access control, cross-account sharing, or a compliance-driven audit trail |
Key policies vs IAM policies: the key policy is the resource-level gate and is evaluated first; if it doesn't allow an action, no IAM policy can override that. Most customer managed keys use a key policy that delegates day-to-day permission management to IAM (a policy statement enabling the account's IAM policies), so you don't have to touch the key policy for every new role, only for cross-account or unusual grants.
Envelope encryption: services like S3, EBS, and RDS don't send your bulk data to KMS. They call GenerateDataKey to get a plaintext data key plus an encrypted copy, encrypt the data locally with the plaintext key, discard the plaintext key, and store only the encrypted data key alongside the ciphertext. This is why KMS-backed encryption scales to large objects without becoming a network bottleneck.
Grants: a lighter-weight, revocable way to hand a specific principal or service permission to use a key for defined operations, without editing the key policy. Grants are how many AWS service integrations, and cross-account or cross-service delegation, work under the hood.
A distinct, easily-confused option: SSE-C. S3 also supports server-side encryption with customer-provided keys (SSE-C), where you supply your own raw AES-256 key on every request and AWS never stores it at all. That is a different model from a customer managed KMS key: with SSE-C, if you lose the key, AWS cannot help you recover the data, and there's no KMS audit trail because KMS isn't involved.
Encryption options across storage services
| Service | Encryption options |
|---|---|
| S3 | SSE-S3 (AWS owned key), SSE-KMS (AWS managed or customer managed key), SSE-C (customer-supplied key, not stored by AWS) |
| EBS | Encryption at rest backed by a KMS key (AWS managed or customer managed); can be enabled by default per account/region |
| EFS | Encryption at rest via KMS, encryption in transit via TLS between clients and mount targets, independent of the at-rest setting |
Cross-account access: the key's owning account must add a key policy statement naming the external account or role ARN (Amazon Resource Name, AWS's unique identifier string for a resource) and the allowed actions (e.g., kms:Decrypt), and the calling account's IAM policy must separately allow that same action on the key's ARN. Both sides have to agree; missing either one fails closed.
Multi-account separation of duties: a common pattern is a dedicated security/key-management account that owns all customer managed keys. The key policy grants a narrow "key user" role to workload accounts (encrypt/decrypt only) and a separate "key administrator" role, kept out of the workload accounts entirely, for managing the key policy and lifecycle. That way no single workload-account operator can both encrypt data and change who's allowed to decrypt it, and CloudTrail in the central security account gives one place to audit every key use across the organization.
Data residency: KMS keys are regional by default, the key material never leaves the region it was created in. AWS also offers multi-Region keys, a set of replica keys sharing the same key material across regions, purely to support disaster-recovery re-encryption without touching ciphertext. If the requirement is data residency or sovereignty rather than DR, that's a reason to deliberately avoid multi-Region keys and keep a single regional key, since the whole point of a residency requirement is that the key material must not exist anywhere else.
Worked example
Account A (a workload account) needs to decrypt S3 objects encrypted with a customer managed key that lives in Account B (the security account). Both sides need an explicit statement. The key policy in Account B must include something like:
{
"Sid": "AllowWorkloadAccountDecrypt",
"Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam::111111111111:role/workload-read-role" },
"Action": ["kms:Decrypt", "kms:DescribeKey"],
"Resource": "*"
}
And the IAM policy attached to workload-read-role in Account A must independently allow:
{
"Effect": "Allow",
"Action": ["kms:Decrypt", "kms:DescribeKey"],
"Resource": "arn:aws:kms:us-east-1:222222222222:key/EXAMPLE-KEY-ID"
}
If either statement is missing, the decrypt call fails, which is exactly the separation-of-duties property the multi-account pattern is designed to give you: Account A's own admins cannot grant themselves that access unilaterally.
Trade-offs & pitfalls
The most common trap is forgetting that key policy and IAM policy are both required, an IAM policy alone is not sufficient, which shows up as confusing access-denied errors when only one side was updated. A second common decision point is one shared key versus one key per workload or data classification: a single customer managed key is simpler to audit but concentrates blast radius (a compromised principal with decrypt access can read everything protected by that key), while per-workload keys shrink blast radius at the cost of more policies to manage and, at very high request volumes, more KMS API calls that can approach service request-rate limits. Deleting a customer managed key is intentionally hard to reverse quickly, KMS enforces a waiting period before actual deletion, specifically because losing the key means losing every object it protects; that pending window is a safety net, not a formality to route around. Finally, using an asymmetric key for bulk data encryption is a real anti-pattern seen in the field, it's slower and not what asymmetric keys are designed for; reach for envelope encryption with a symmetric key instead.
You detect a suspicious IAM assume-role event, for example a role assumed from an unusual region or IP. Walk through how you'd detect this, contain it (revoke or limit the session, tighten the trust policy), and make sure the automation that does this can't itself be abused.
Sample Answer
Direct answer
Treat this as a security incident, not a policy edit: use CloudTrail-derived signals, correlated through GuardDuty and AWS Config, to detect and score the anomalous AssumeRole call, contain it by cutting off that specific session's future permissions (not by editing the role's trust policy, which only affects future AssumeRole calls), and lock the containment automation itself down so a false positive or a compromised detector can't turn into its own incident.
Structured elaboration
Detect
- CloudTrail records every
AssumeRole/AssumeRoleWithWebIdentity/AssumeRoleWithSAMLcall with source IP, region, and user agent. Route these events through an EventBridge rule into a triage Lambda or Step Functions state machine. - GuardDuty (Amazon's threat-detection service) ingests those CloudTrail management events plus its own threat intelligence and flags IAM / AWS Security Token Service (STS) anomalies: impossible-travel geography, an unfamiliar network for that principal, or an API call the principal has never made before. Treat a GuardDuty finding as one scored input, not the sole trigger.
- AWS Config runs as the compliance/drift layer in parallel: it snapshots the role's trust policy and permission boundary over time, so you can tell whether this AssumeRole succeeded because of a recent, possibly unauthorized trust-policy change, versus a genuine anomaly against a policy that hasn't moved.
Contain (the session, not the role)
- You cannot revoke an already-issued STS session token directly. AWS's actual mechanism: IAM's "Revoke active sessions" action attaches an inline policy named
AWSRevokeOlderSessionsto the role, denying all actions to any session whoseaws:TokenIssueTimepredates the revoke timestamp (with roughly 30 seconds of clock-skew tolerance), while leaving brand-new AssumeRole calls unaffected. - For a narrower blast radius than "deny the whole role," attach a Deny statement keyed on
aws:TokenIssueTimecombined withaws:PrincipalArnoraws:SourceIdentity, so only the flagged session is cut off, not every legitimate caller of that role. - Editing the trust policy is a separate control: it stops future AssumeRole calls, it does nothing to a session already issued. Don't rely on it as the primary containment step.
- Escalate on high confidence: rotate the credentials of the upstream calling principal (IAM user, federation provider, or CI system), since the assumed-role session is a symptom, not the root cause.
Keep the automation from being abused
- Run the detector/containment workflow from a dedicated account, with a role scoped to "attach exactly this deny statement to exactly the flagged role ARN" and nothing broader: no
iam:CreateRole, no wildcardiam:AttachRolePolicy, noiam:PassRole. - Session tags on the automation's own assumed role record who or what triggered each action, so every containment step is attributable in CloudTrail.
- Stage the response: a narrow, low-confidence "soft deny" (block only the riskiest actions) can auto-execute; a full
AWSRevokeOlderSessions-style lockout requires a human-approval step (a Step Functions callback, for example) unless confidence crosses a high threshold. This bounds the automation's own worst-case blast radius, a false positive can't turn into a self-inflicted denial-of-service on a production role.
Worked example
Role data-sync-role is normally assumed only from a corporate CIDR range in us-east-1. CloudTrail shows an AssumeRole call for that role from an unfamiliar region with a new user agent string. GuardDuty correlates this with its anomaly detection and raises a finding; AWS Config confirms the role's trust policy hasn't changed recently, ruling out an authorized-but-undocumented change. The EventBridge rule fires the containment Lambda, which attaches a Deny statement scoped to aws:TokenIssueTime before now and aws:SourceIdentity matching that specific session. A follow-up CloudTrail query confirms subsequent calls under that session now fail with AccessDenied, while other legitimate sessions on the same role continue working. A ticket opens for a human to decide whether the upstream credential (the CI system or federated user that called AssumeRole) also needs rotation.
Trade-offs & pitfalls
- Staged containment avoids an overly broad deny becoming a self-inflicted denial-of-service on a legitimate, high-traffic role; don't wire auto-hard-deny until the anomaly-scoring signal is tuned.
AWSRevokeOlderSessionsdenies the entire role by default, not just the flagged session, unless you narrow the condition withaws:PrincipalArn/aws:SourceIdentity: decide up front whether that blast radius is acceptable for the specific role.- The automation account's own permissions are themselves an attack surface: scope it to specific role ARNs, never a wildcard resource.
- Store every generated deny policy and its triggering event in an immutable log so a later incident review can reconstruct exactly what containment did and when.
Propose a hub-and-spoke architecture for centralized security visibility across many AWS accounts using Security Hub, GuardDuty, and CloudTrail aggregation. What three services would you enable first on a brand-new AWS account to establish a baseline security posture, and why?
Sample Answer
A hub-and-spoke security visibility architecture designates one AWS account, the hub (often called the security or log archive account), as the delegated administrator for Amazon GuardDuty and AWS Security Hub, and as the destination for every other account's (the spokes') AWS CloudTrail logs, so one team gets a unified view without operating separately in every account. On a brand-new account, before anything else, the three services to enable first are CloudTrail (so an audit trail exists from minute one), GuardDuty (so threat detection starts baselining normal behavior from minute one), and IAM Access Analyzer (so accidental external access grants are caught immediately), because everything else in a security program depends on those three signals already flowing.
Architecture
flowchart TB
subgraph Org["AWS Organizations"]
Mgmt["Management account"]
end
subgraph Spokes["Spoke / member accounts"]
SpokeA["Account A workloads"]
SpokeB["Account B workloads"]
SpokeC["Account C workloads"]
end
subgraph Hub["Hub / security account"]
GD["GuardDuty\ndelegated administrator"]
SH["Security Hub\ndelegated administrator"]
S3["Central S3 log bucket\nSSE-KMS, Object Lock"]
EB["EventBridge"]
SIEM["SIEM / ticketing"]
end
Mgmt -- designates --> GD
Mgmt -- designates --> SH
SpokeA -- CloudTrail org trail --> S3
SpokeB -- CloudTrail org trail --> S3
SpokeC -- CloudTrail org trail --> S3
SpokeA -- findings --> GD
SpokeB -- findings --> GD
SpokeC -- findings --> GD
GD -- findings --> SH
S3 -- queried by --> SH
SH -- normalized findings --> EB
EB -- routes --> SIEM
Why hub-and-spoke, mechanically
- CloudTrail: enable a single AWS Organizations trail from the management account (or a delegated administrator), which automatically applies to every current and future member account and delivers all logs to one Amazon Simple Storage Service (S3) bucket in the hub account. This removes the "did someone forget to enable logging in the new account" failure mode entirely.
- GuardDuty: the management account designates one member account as the GuardDuty delegated administrator. That account can then auto-enable GuardDuty for every existing and future member account, and every member's findings roll up into the delegated administrator's view. GuardDuty is a regional service, so the delegated administrator must be the same account in every Region you operate in, not just one.
- Security Hub: designate a delegated administrator for Security Hub too, and use its central configuration feature to push standards and controls, for example the AWS Foundational Security Best Practices standard, to every account and organizational unit from one place, instead of configuring each account separately. Security Hub also ingests and normalizes GuardDuty findings alongside its own checks, so the hub ends up with one unified findings view rather than two dashboards.
- EventBridge and downstream routing: Security Hub findings can trigger Amazon EventBridge rules in the hub account to notify a security information and event management (SIEM) tool, open a ticket, or, for well-understood finding types, run an automated remediation through AWS Systems Manager Automation.
The first three services on a brand-new account, and why that order
- CloudTrail: with no audit trail, nothing else is investigatable after the fact. This has to exist before any other service produces something worth investigating.
- GuardDuty: a passive, low-effort detector with no infrastructure to run, that starts baselining normal network and API behavior immediately. The earlier it is on, the sooner its anomaly detection becomes reliable.
- IAM Access Analyzer: catches the most common real-world incident category, a storage bucket, IAM role, or encryption key policy that unintentionally grants access to an external account or the public, through static policy analysis rather than waiting to observe an actual attack.
Worked example
A company with a management account and fifteen workload accounts under one AWS Organization stands up a dedicated security account as the hub. Step one: enable an Organizations CloudTrail trail from the management account, delivering to a central S3 bucket in the security account, with S3 Object Lock in governance mode and server-side encryption using a customer-managed AWS Key Management Service (KMS) key that only the security account administers, so even a compromised workload account cannot delete its own audit history. Step two: designate the security account as the GuardDuty delegated administrator and set auto-enable to cover all accounts, so all fifteen existing accounts and any future account get GuardDuty on day one. Step three: designate the same security account as the Security Hub delegated administrator, turn on central configuration, and push the AWS Foundational Security Best Practices standard to every account from one configuration policy. Within a day, the security account's Security Hub console shows a single, deduplicated findings list spanning all fifteen accounts instead of fifteen separate consoles nobody has time to check individually.
Trade-offs and pitfalls
- Using one account as the delegated administrator for both GuardDuty and Security Hub is the common pattern, but it concentrates real blast radius in that account. Protect it with its own strict IAM boundary and multi-factor authentication, since it can see, and for some findings act, across the entire Organization.
- GuardDuty's regional nature is easy to get wrong: designating the delegated administrator in one Region does not cover another Region automatically, and AWS requires the same account to be the delegated administrator everywhere GuardDuty is enabled.
- Security Hub's central configuration model requires choosing, per account or organizational unit, whether it is centrally managed (only the delegated administrator can change its settings) or self-managed (the account manages its own). Mixing these without a clear policy leads to accounts drifting out of the baseline.
- A single central logging bucket is simple to reason about but becomes a single point of both cost and access-control complexity at scale. Partition by account and date, and separate read access for the security team from the write access granted to the log delivery role.
- Enabling every possible security service on day one sounds appealing but produces alert fatigue before anyone has tuned suppression rules. The three named above are the minimum viable baseline, not the complete target state.
Unlock Full Question Bank
Get access to all 10 AWS Core Services and Architecture interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.