SEC06-BP05 Automate compute protection
Manual security operations do not keep pace with the rate at which compute resources change and vulnerabilities appear. Automating scanning, patching, verification, and remediation reduces the chance of a misconfiguration reaching production and shortens the time from detection to remediation.
Desired outcome:
-
Your automation performs the scanning and patching of your compute resources.
-
Your automated verification confirms that images and dependencies come from trusted sources and are unaltered.
-
Your workloads are checked automatically for current dependencies and are signed to establish trust before they run.
-
Your automated remediation starts when a non-compliant resource is detected, with a manual override available.
Common anti-patterns:
-
Teams adopt immutable infrastructure but have no plan for emergency patching or replacing production systems.
-
Automation fixes misconfigured resources, but no manual override exists to suspend it while requirements change.
Benefits of establishing this best practice:
-
Automation reduces the risk of unauthorized access to and use of your compute resources.
-
Misconfigurations are caught before they reach production, and corrected quickly when they do occur.
-
Faster detection and response shrink the overall scope of impact from an issue.
-
Consistent, automated controls remove the variability of manual security operations.
Level of risk exposed if this best practice is not established: Medium
Implementation guidance
Hardened images, signature verification, vulnerability scanning, and patching can all drift, lag, or get skipped when performed manually. Automated pipelines and fleet operations run them continuously. A pipeline that builds hardened images, verifies signatures, checks dependencies, and scans for known CVEs lets a workload reach production only when those checks pass.
Preventive controls stop a bad state from being created, while detective controls find existing bad states. For example, a pipeline gate that blocks an unsigned image is preventive, and a fleet scan that flags an instance using an outdated metadata service is detective. Pair the scan with automated remediation to resolve the finding without waiting for a person. At design time, choose which risks you want to prevent and which risks you want to detect and correct.
Automated remediation introduces its own risk where performs its exact function even after a requirement has changed. If a control automatically reverts a configuration and a legitimate change needs that configuration, the automation will continue to revert the change. Build a manual override or suspension mechanism from the start so an operator can pause a remediation while requirements are updated.
AWS Security Hub CSPM offers standards such as
NIST SP 800-53 Rev. 5, which includes a
check that EC2 instances use Instance Metadata Service Version 2 (IMDSv2). IMDSv2 requires session-oriented requests, blocks
requests that carry an X-Forwarded-For header,
and sets a network TTL of 1 to stop external sources from
retrieving instance metadata. When Security Hub CSPM detects an
instance still using IMDSv1, it can initiate an automated
remediation. Around this control,
EC2 Image Builder
Implementation steps
-
Automate hardened image creation: Use EC2 Image Builder to produce images that incorporate CIS Benchmark or DISA STIG controls from base AWS and APN partner images.
-
Automate configuration and compliance management: Enforce and validate secure configurations automatically with AWS Config
, and manage your security and compliance posture with AWS Security Hub CSPM . -
Automate patching or replacement: Use AWS Systems Manager Patch Manager to patch managed instances with operating system and application updates, and redeploy from fresh images where components are immutable.
-
Automate vulnerability scanning: Scan compute resources for CVEs with Amazon Inspector
, and embed Amazon ECR image scanning in your build pipeline. -
Automate threat and malware detection: Use Amazon GuardDuty
to detect malware and threats against your compute resources, including issues raised when an AWS Lambda function is invoked in your environment. -
Preserve a manual override: Build a mechanism to suspend automated remediation so an operator can pause it while you update requirements, then re-enable it once the change is complete.
-
Evaluate AWS Partner solutions where they fill gaps: Consider AWS Partner infrastructure security products
that complement native controls across your cloud and on-premises environments.
Resources
Related best practices:
Related documents:
Related videos:
Related examples:
Related services: