⌂ Home

Security in AWS CodePipeline

Embed encryption, least-privilege roles, and auditability into every stage.

Pipeline architecture & security touchpoints

SourceWebhook secrets, branch policies
BuildSAST, deps scan
TestDAST, IAM least priv
DeployArtifact signing, approvals
ProdDrift detection

Each stage should use its own IAM role (least privilege) and emit audit events.

KMS encryption flow (conceptual)

Artifacts, S3 buckets, and SNS notifications can use customer-managed keys (CMKs) with key policies + IAM.

CodePipelinekms:Decrypt / GenerateDataKeyEncrypted artifact in S3

IAM per stage (illustrative)

StageRole intentExample actions (scoped)
SourceRead repo onlycodecommit:GitPull or GitHub OIDC subject
BuildBuild projectlogs:* to project log group; s3:GetObject on input prefix
DeployTarget envcloudformation:* or codedeploy:* on approved ARNs

CloudTrail audit integration

  • Log data events on pipeline buckets if required by policy
  • Alert on ConsoleLogin + pipeline StartPipelineExecution anomalies
  • Centralize to organization trail + SIEM

Compliance badges (examples)

PCI-DSS segmentationSOC 2 change mgmtISO 27001 logging

Map pipeline controls to frameworks your assessors expect.

Use case: banking CI/CD