Skip to content

Lesson 05 β€” Enterprise DevSecOps & Infrastructure as Code (IaC) Security Project & Module Review

Learning Path

☁️ Phase 02 – AWS Cloud Security

πŸ“˜ Module 11 – DevSecOps & Infrastructure as Code (IaC) Security


By the end of this capstone project, you will be able to:

  • Design an enterprise DevSecOps architecture.
  • Build secure Infrastructure as Code.
  • Design secure CI/CD pipelines.
  • Integrate automated security testing.
  • Secure application secrets.
  • Protect software supply chains.
  • Design deployment approval workflows.
  • Build secure production deployments.
  • Monitor the DevSecOps platform.
  • Present an executive security review.

πŸ“š Lesson Information

Estimated Time: 8–10 Hours

Difficulty: Advanced

Prerequisites: Lessons 01–04

Capstone Project: Yes


CloudNova Technologies has rapidly expanded into a global cloud provider delivering financial, healthcare and retail applications.

Current environment:

  • 120 AWS Accounts
  • 8 AWS Regions
  • 450 Developers
  • 70 DevOps Engineers
  • 40 Cloud Security Engineers
  • 300 GitHub Repositories
  • 150 Microservices
  • Amazon EKS Clusters
  • Amazon ECS Services
  • AWS Lambda Applications
  • Terraform Infrastructure
  • CloudFormation Templates
  • Multiple CI/CD Pipelines

The organization performs hundreds of deployments every week.

A recent third-party security assessment discovered:

  • AWS Access Keys committed to Git repositories.
  • Public S3 buckets deployed through Terraform.
  • Container images containing Critical CVEs.
  • Production deployments bypassing approvals.
  • Shared IAM roles across all environments.
  • Missing secret rotation.
  • Manual infrastructure changes causing drift.
  • No policy enforcement for Infrastructure as Code.
  • Developers deploying directly to production.
  • Security testing performed only before quarterly releases.

The Board of Directors has instructed the CISO to implement an enterprise DevSecOps platform that delivers:

  • Secure software delivery
  • Automated security testing
  • Infrastructure as Code governance
  • Secure secrets management
  • Production approval workflows
  • Continuous compliance
  • Continuous monitoring
  • Enterprise audit capability

As the Lead Cloud Security Engineer, you have been assigned to design the complete solution.


CloudNova operates the following AWS environments:

Developers
β”‚
GitHub Enterprise
β”‚
Secure Pull Requests
β”‚
AWS CodePipeline
β”‚
AWS CodeBuild
β”‚
Automated Security Validation
β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β”‚ β”‚
SAST Scan Secret Scan IaC Scan
β”‚ β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
Dependency Scan
β”‚
Container Scan
β”‚
Artifact Repository
β”‚
Staging Environment
β”‚
Manual Approval Gate
β”‚
Production Deployment
β”‚
CloudTrail β€’ CloudWatch β€’ Security Hub
β”‚
Continuous Monitoring

Perform a complete assessment.

Review:

  • Git repositories
  • CI/CD pipelines
  • IAM roles
  • Terraform templates
  • CloudFormation templates
  • Docker images
  • Secrets
  • AWS Accounts
  • Deployment process

Document:

  • Existing risks
  • Existing controls
  • Missing controls
  • Business impact

πŸ“‹ Phase 2 β€” Design Secure DevSecOps Architecture

Section titled β€œπŸ“‹ Phase 2 β€” Design Secure DevSecOps Architecture”

Design:

  • Source Control
  • Branch Protection
  • Secure Build Pipeline
  • Secure Deployment Pipeline
  • Multi-Account Strategy
  • Secrets Management
  • Monitoring
  • Security Operations

Deliverables:

  • Architecture Diagram
  • Security Controls
  • Data Flow
  • Trust Boundaries

Review all Infrastructure as Code.

Tasks:

  • Validate CloudFormation
  • Validate Terraform
  • Remove hardcoded values
  • Enable encryption
  • Enable logging
  • Apply least privilege
  • Configure tagging
  • Enable drift detection
  • Configure policy validation

Document:

  • Issues identified
  • Remediation
  • Final architecture

Build a secure deployment pipeline.

Pipeline must include:

  • Pull Request
  • Peer Review
  • Build
  • Unit Tests
  • SAST
  • Secret Scan
  • Dependency Scan
  • IaC Scan
  • Container Scan
  • Manual Approval
  • Production Deployment

Workflow:

Developer
↓
GitHub
↓
Pull Request
↓
Code Review
↓
Security Validation
↓
AWS CodeBuild
↓
Artifact
↓
Approval
↓
Production

Automate:

  • Static Analysis
  • Dependency Scanning
  • Secret Scanning
  • IaC Scanning
  • Container Image Scanning

Define:

  • Severity Levels
  • Blocking Criteria
  • Exception Process
  • Approval Workflow

Replace:

❌ Hardcoded Passwords

❌ API Keys

❌ Database Credentials

With:

βœ… AWS Secrets Manager

βœ… Parameter Store

Configure:

  • IAM Policies
  • KMS Encryption
  • Secret Rotation
  • Logging
  • Monitoring

Review:

  • Docker Images
  • Base Images
  • Image Tags
  • Root Users
  • Image Vulnerabilities

Implement:

  • Amazon ECR
  • Image Scanning
  • Immutable Tags
  • Image Signing
  • Deployment Policies

πŸ“‹ Phase 8 β€” Monitoring & Incident Response

Section titled β€œπŸ“‹ Phase 8 β€” Monitoring & Incident Response”

Implement monitoring using:

  • CloudTrail
  • CloudWatch
  • EventBridge
  • Security Hub
  • GuardDuty
  • Inspector

Create alerts for:

  • Failed Builds
  • Secret Access
  • Pipeline Failure
  • Production Deployment
  • Drift Detection
  • Vulnerability Detection
  • Failed Security Gates

Prepare dashboards showing:

  • Deployment Frequency
  • Failed Builds
  • Critical Vulnerabilities
  • High Vulnerabilities
  • Secret Rotation Status
  • Security Gate Failures
  • Drift Detection
  • Production Deployments
  • Mean Time to Recovery
  • Compliance Status

Submit the following documents.

  • Enterprise DevSecOps Architecture
  • CI/CD Architecture
  • Multi-Account Design
  • Trust Boundaries

  • Terraform Modules
  • CloudFormation Templates
  • IAM Design
  • KMS Design

  • Security Standards
  • Pipeline Security Controls
  • Secret Management Policy
  • Container Security Policy
  • IaC Standards
  • Build Security Standard

  • Monitoring Strategy
  • Incident Response Plan
  • Secret Rotation Plan
  • Deployment Process
  • Change Management

  • Risk Assessment
  • Security Scorecard
  • Lessons Learned
  • Final Recommendations

You have been hired to redesign CloudNova’s complete DevSecOps platform.

Your platform must include:

βœ… GitHub

βœ… AWS CodePipeline

βœ… AWS CodeBuild

βœ… Terraform

βœ… CloudFormation

βœ… Secrets Manager

βœ… Parameter Store

βœ… IAM Roles

βœ… Amazon ECR

βœ… Security Hub

βœ… CloudTrail

βœ… CloudWatch

βœ… Amazon Inspector

All deployments must follow enterprise security standards.



Terminal window
aws codepipeline list-pipelines

Terminal window
aws codebuild list-projects

Terminal window
aws secretsmanager list-secrets

Terminal window
aws ssm describe-parameters

Terminal window
aws ecr describe-repositories

Terminal window
aws inspector2 list-findings

Terminal window
aws cloudformation validate-template \
--template-body file://template.yaml

Terminal window
aws cloudformation detect-stack-drift \
--stack-name SecureStack

Terminal window
aws sts get-caller-identity

Review the environment.

Verify:

βœ” Infrastructure as Code

βœ” Secure CI/CD

βœ” Secrets Management

βœ” Security Testing

βœ” Container Security

βœ” IAM

βœ” Encryption

βœ” Monitoring

βœ” Logging

βœ” Compliance

βœ” Production Controls


CloudNova experienced the following incident.

Timeline:

09:00 β€” Developer commits AWS Secret Key

09:02 β€” Secret Scan detects credential

09:03 β€” Build automatically fails

09:04 β€” Security Team notified

09:06 β€” Secret rotated

09:12 β€” Repository cleaned

09:20 β€” Build rerun successfully

Questions:

  • Which security controls worked?
  • How was the incident contained?
  • What additional improvements would you recommend?

CloudNova standards:

  • Security built into every stage
  • Shift Left Security
  • Least Privilege IAM
  • Infrastructure as Code
  • Automated Security Testing
  • Immutable Infrastructure
  • Continuous Monitoring
  • Secure Secrets Management
  • Automated Compliance
  • Continuous Improvement

❌ Deploying directly to production.

❌ Hardcoding credentials.

❌ Skipping Pull Requests.

❌ Ignoring security scans.

❌ AdministratorAccess for pipelines.

❌ Manual infrastructure changes.

❌ No drift detection.

❌ No secret rotation.

❌ Sharing production credentials.

❌ No monitoring.


CloudNova plans to expand globally.

Design a complete enterprise DevSecOps platform supporting:

  • 500+ Developers
  • 1,000+ Repositories
  • Multi-Region
  • Multi-Account
  • Kubernetes
  • Serverless
  • Hybrid Cloud
  • Continuous Deployment
  • Compliance Automation
  • Zero Trust
  • AI-assisted Security Reviews
  • Enterprise Governance

Prepare:

  • Architecture
  • Network Diagram
  • IAM Design
  • CI/CD Design
  • Terraform Repository Structure
  • CloudFormation Repository
  • Security Controls Matrix
  • Secrets Strategy
  • Monitoring Strategy
  • Incident Response Plan
  • Executive Presentation

Throughout Module 11 you learned:

  • DevSecOps Fundamentals
  • Secure SDLC
  • Shift Left Security
  • DevSecOps Culture

  • Infrastructure as Code
  • AWS CloudFormation
  • Terraform
  • Secure Templates
  • Drift Detection

  • CI/CD Pipeline Security
  • AWS CodePipeline
  • AWS CodeBuild
  • Secure Deployments
  • Pipeline Monitoring

  • SAST
  • DAST
  • SCA
  • Secret Scanning
  • Secrets Manager
  • Parameter Store
  • Container Security
  • Amazon Inspector

  1. Why is DevSecOps important?
  2. What is Shift Left Security?
  3. Why should Infrastructure as Code be scanned?
  4. What are the stages of a secure CI/CD pipeline?
  5. Why should production require approvals?
  6. What is the purpose of SAST?
  7. How does DAST differ from SAST?
  8. Why should secrets never be stored in source code?
  9. What is the purpose of AWS Secrets Manager?
  10. How does Amazon Inspector improve container security?
  11. What is Infrastructure Drift?
  12. Why is least privilege important for pipelines?
  13. Why should all deployments be monitored?
  14. How should security findings be prioritised?
  15. What are the key characteristics of an enterprise DevSecOps platform?

After completing Module 11, you should be able to:

  • Design and implement a secure DevSecOps operating model that integrates security throughout the software development lifecycle.
  • Build Infrastructure as Code using CloudFormation and Terraform while applying secure defaults, policy validation and drift detection.
  • Design CI/CD pipelines with automated security gates, least-privilege IAM roles, protected branches and controlled production approvals.
  • Integrate multiple layers of security testing, including SAST, DAST, SCA, IaC validation, secret scanning and container image scanning.
  • Protect application credentials using AWS Secrets Manager and Systems Manager Parameter Store with encryption, least privilege and rotation.
  • Secure container-based workloads and software supply chains through image scanning, immutable artefacts and continuous monitoring.
  • Detect, investigate and respond to DevSecOps security incidents using CloudTrail, CloudWatch, Security Hub, Amazon Inspector and related AWS services.
  • Produce enterprise-ready documentation, governance artefacts and executive reports that support operational excellence, compliance and continuous improvement.

Congratulations!

You have successfully completed:

Module 11 β€” DevSecOps & Infrastructure as Code (IaC) Security

Section titled β€œModule 11 β€” DevSecOps & Infrastructure as Code (IaC) Security”

You now understand how modern enterprises securely build, test, deploy and operate cloud-native applications using DevSecOps principles, Infrastructure as Code, secure CI/CD pipelines, automated security testing and cloud-native security controls.


➑️ Module 12 β€” AWS Security Architecture

In the next module, you will design secure enterprise AWS architectures covering:

  • AWS Well-Architected Framework
  • Secure Multi-Account Architecture
  • Landing Zones
  • Network Segmentation
  • Identity Federation
  • Zero Trust Architecture
  • Hybrid Cloud Security
  • High Availability & Resiliency
  • Secure Application Architecture
  • Enterprise Security Design Patterns
  • Security Governance at Scale
  • End-to-End Enterprise AWS Security Architecture