Domain 3 of 6 · Chapter 2 of 3

Compute Security

Unlock the complete study guide + 1,040 practice questions across 16 full exams.

Bundled into the existing AWS Certified Security - Specialty premium course — no separate purchase.

Included in this chapter:

  • Harden the image so every instance is born compliant
  • Authorize workloads with roles, never embedded keys
  • Find vulnerabilities continuously, patch on a baseline
  • Keyless admin access and pipeline + GenAI guardrails

Compute security controls by purpose

NeedImage BuilderInspectorPatch ManagerSession ManagerGuardDuty RuntimeBedrock Guardrails
When it actsBuild timeContinuous post-deployScheduled windowOn admin connectLive runtimePer model request
TargetsAMIs + container imagesEC2 / ECR / LambdaEC2 + on-prem managed nodesEC2 + managed nodesEC2 / ECS / EKSBedrock FM calls
Primary jobBake hardened baselineFind CVEs (SBOM-based)Apply patches to baselineLogged keyless shellDetect runtime threatsFilter unsafe input/output
Finds vs fixesPrevents driftFindsFixesAccess pathDetectsBlocks

Decision tree

What is the goal?compute-security controlBefore launch?image / identityat buildRunning workload?scan / access / GenAIafter launchEC2 Image Buildergolden AMI, CISInstance / exec roleno embedded keyshardenauthorizeAmazon Inspectorfind CVEsGuardDuty Runtimedetect threatsknown CVEbehaviorPatch Managerfix on baselineSession Managerkeyless shellBedrockGuardrails (LLM)apply fixadminGenAIAlways: least-privilege roles, IMDSv2, audited accessshift-left scans (Q Developer / CodeGuru) in the pipeline

Cheat sheet

  • Use EC2 Image Builder pipelines to ship pre-hardened golden images
  • Bake the SSM Agent and patches into the image, not on first boot
  • Give EC2 its role through an instance profile, never an embedded access key
  • Match the role attachment to the compute type: instance profile, execution role, task role
  • Require IMDSv2 to block SSRF theft of instance role credentials
  • Use IAM Roles Anywhere so on-prem workloads stop using long-lived keys
  • Amazon Inspector continuously scans EC2, ECR images, and Lambda for CVEs
  • Read the Inspector Risk score as environment-adjusted CVSS, and export an SBOM
  • GuardDuty Runtime Monitoring detects threats on EC2, ECS, and EKS at runtime
  • Patch Manager applies fixes on a baseline during a maintenance window
  • Session Manager gives a logged shell with no inbound port or bastion
  • EC2 Instance Connect pushes a one-time SSH key valid for 60 seconds
  • Scan in the pipeline with Q Developer and CodeGuru Security to shift left
  • Bedrock Guardrails defend generative-AI apps against the OWASP LLM Top 10
  • Map Bedrock Guardrails filter categories to the specific LLM risk
  • AWS patches the Fargate and Lambda substrate; you own the dependencies
  • ECS injects secrets at startup with the task execution role, not the task role
  • Secrets injected as ECS env vars are frozen at startup until you redeploy or fetch via SDK
  • ApplyGuardrail evaluates content with no model call, and InvokeModel-with-guardrail needs bedrock:ApplyGuardrail
  • Bedrock guardrails are edited on a mutable DRAFT and pinned in production by published version
  • Bedrock model-invocation logging needs a service-role and S3 for large or binary payloads

Unlock with Premium — includes all practice exams and the complete study guide.

Also tested in

References

  1. What is EC2 Image Builder?
  2. Amazon managed STIG hardening components for Image Builder
  3. Use an IAM role to grant permissions to applications running on Amazon EC2 instances
  4. Use the Instance Metadata Service to access instance metadata (IMDSv2)
  5. What is AWS Identity and Access Management Roles Anywhere?
  6. What is Amazon Inspector?
  7. Export SBOMs with Amazon Inspector
  8. GuardDuty Runtime Monitoring
  9. AWS Systems Manager Patch Manager
  10. AWS Systems Manager Session Manager
  11. Connect to a Linux instance using EC2 Instance Connect
  12. Amazon CodeGuru
  13. Amazon Q Developer security scans
  14. OWASP Top 10 for LLM Applications Whitepaper
  15. Amazon Bedrock Guardrails