SEC05-BP04 Automate network protection
Automate deployment of network protections with infrastructure as code and continuous integration and delivery pipelines. With automation, you can version network changes, deploy them faster, detect drift from intended configuration, and make protections repeatable across teams and accounts.
Desired outcome:
-
You define your network protections as templates held in a version control system.
-
Your automated pipelines test and deploy changes whenever a template is updated.
-
Your policy checks and static tests validate changes before they deploy.
-
You promote changes through a staging environment and then to production after the controls are approved.
Common anti-patterns:
-
Each workload team defines its complete network stack and protections independently, with no standard components published centrally to reuse.
-
A central team defines every aspect of the network and protections and delegates nothing to the workload teams that understand their own requirements.
-
Teams balance central and delegated ownership well but apply inconsistent testing and deployment standards across templates and pipelines.
-
Teams leave required configurations out of the tooling that checks templates for adherence.
Benefits of establishing this best practice:
-
Version-controlled templates let you track and compare protection changes over time.
-
Automated testing and deployment produce predictable, repeatable releases.
-
Standardized pipelines reduce repetitive manual configuration and the errors it introduces.
-
Drift detection surfaces unintended changes before they weaken your protections.
Level of risk exposed if this best practice is not established: Medium
Implementation guidance
AWS WAF managed rules, AWS Shield Advanced automatic application layer DDoS mitigation, and AWS Network Firewall managed rule groups keep signatures and low-reputation domain lists current without your intervention. For the protections you define yourself, use infrastructure as code and pipelines.
Capture VPCs, security groups, firewall deployments, resolver rules, and DNS firewall configurations as templates in AWS CloudFormation or another infrastructure-as-code tool. You get predictable releases, automated policy checks with tools such as AWS CloudFormation Guard, and drift detection between deployed and intended state.
Decide how to split ownership of network controls between central and workload teams. If every workload team builds its own complete network stack, effort duplicates and protection is inconsistent. If a central team owns everything, it becomes a bottleneck and loses touch with workload-specific needs. A hybrid model usually works best: a central team publishes standard components, and each workload team maintains the parts specific to its application. Whichever split you choose, apply consistent testing and deployment standards across all templates.
To centralize network protections, use a dedicated network account. The AWS Security Reference Architecture describes a network infrastructure account that holds VPCs for ingress, egress, and inspection. Define the VPCs your workloads use in that account, along with their security groups, firewall deployments, and resolver rules. Share them to other accounts with AWS Resource Access Manager. Your automation then has a single target to test and deploy against. Workload teams still own other controls in their own accounts.
Implementation steps
-
Assign ownership of controls: Decide which network components and protections are defined centrally and which each workload team maintains. Document this split so the boundary between central and delegated ownership is explicit.
-
Create test and production environments: Set up separate environments for validating and running your network protections, such as a network testing account and a network production account. Use the test environment to confirm controls behave as expected before promotion.
-
Store templates in version control: Keep central templates in a repository separate from workload repositories, and store workload-specific templates in repositories owned by each workload. Use the version control system to track and review every change.
-
Build pipelines to test and deploy templates: Create CI/CD pipelines that run static checks for misconfigurations and confirm templates meet your company standards, then deploy approved changes. Use tools such as AWS CloudFormation Guard to enforce policy before deployment.
Resources
Related best practices:
Related documents:
Related videos:
Related examples:
Related tools: