SEC01-BP05 Automate deployment of standard security controls
Manually-applied security controls can drift, vary between environments, and are hard to audit. Define controls as code, version them, test them, and deploy them through a pipeline to keep them consistent, reviewable, and repeatable.
Desired outcome:
-
Your standard controls are defined as code and committed to a version control system.
-
Your CI/CD pipelines detect changes and automate testing and deployment across your environments.
-
Your guardrails catch template misconfigurations before deployment proceeds.
-
Your workload teams deploy approved configurations through a self-service mechanism.
-
You have secure backup and recovery for control definitions, scripts, and related data.
Common anti-patterns:
-
Teams change standard security controls manually through a console or command line.
-
A central team defines controls but relies on each workload team to implement them manually.
-
Workload teams wait on a central security team to deploy workload-level controls on request.
-
The same individuals develop, test, and deploy control automation with no separation of duties.
Benefits of establishing this best practice:
-
Version control makes every change to a control trackable and comparable over time.
-
Automated testing and deployment increase consistency and reduce repetitive manual work.
-
Self-service deployment of approved configurations lowers the risk of misconfiguration and misuse.
-
Teams incorporate security controls earlier in development, where issues cost less to fix.
Level of risk exposed if this best practice is not established: Medium
Implementation guidance
Once you separate workloads into multiple accounts, you may encounter a scaling problem. Each environment requires a consistent set of security controls, and applying them manually across many accounts guarantees inconsistency. Many controls are standard across the organization, such as integrating a central identity provider, defining networks and firewalls, and configuring standard locations for storing and analyzing logs. Infrastructure as code (IaC) lets you define these standard controls declaratively and apply the same rigor to them that you apply to application code.
Declarative definitions provide three useful capabilities that do
not exist when performing manual configuration. Storing templates
in AWS CloudFormation
A pipeline built from services such as
AWS CodePipeline
With Service Catalog
Some services provide declarative policies to control specific security configurations across all AWS accounts in an AWS Organization. After you attach the policy, the configuration persists as the service adds new features or APIs. For example, a declarative policy can be set to force enabling Block Public Access on all S3 buckets across the AWS Organization, without configuring it in each account.
Implementation steps
-
Store control templates in version control: Decide how you will store and maintain your control templates in a version control system, so that every change is tracked and reviewable.
-
Build CI/CD pipelines for your templates: Create pipelines that test and deploy your templates, with checks that catch misconfigurations and confirm templates meet your organization's standards.
-
Integrate SAST and DAST: Add static analysis of code and IaC templates and dynamic testing of deployed environments into the pipeline, so vulnerabilities are caught before and after deployment.
-
Scan third-party dependencies: Add software composition analysis to identify known vulnerabilities in external libraries and components your controls and workloads rely on.
-
Publish a catalog of standardized templates: Build a catalog of approved templates that workload teams use to deploy accounts and services according to your requirements through self-service.
-
Implement secure backup and recovery: Establish secure backup and recovery for your control configurations, scripts, and related data so you can restore them after loss or corruption. SEC08-BP03 Automate data at rest protection covers how to automate encrypted, recoverable backups.
-
Use declarative policies when available: Declarative policies allow you to centrally manage and configure select security-related features on AWS services across all accounts in an AWS Organization, without the need to configure that feature for every account.
Resources
Related best practices:
Related documents:
Related videos:
Related examples:
Related tools: