Check ID: codepipeline_project_repo_private
Provider: AWS
Service: codepipeline
Severity: MEDIUM
Categories: software-supply-chain, secrets
Resource type: AwsCodePipelinePipeline

What this check verifies

CodePipeline pipeline should configure its source stage to use a private repository with authenticated connection rather than a public GitHub or GitLab repository. This ensures deployment configurations, build artifacts, and CI/CD logic remain protected from unauthorized access.

Risk

Using public repositories as pipeline sources exposes deployment configurations and CI/CD workflows to the internet, increasing risk of supply chain attacks, credential exposure, and intellectual property theft. Adversaries can inject malicious code or leverage exposed secrets to compromise production systems.

Recommendation

Configure CodePipeline source stages to use private repositories with AWS CodeStar Connections for GitHub or GitLab. Apply least privilege to connection permissions, enable branch protection, require code review, use signed commits, and monitor pipeline execution logs. Consider AWS CodeCommit for fully managed private Git hosting with native IAM integration.

Remediation

aws codestar-connections create-connection —provider-type GitHub —connection-name my-github-connection aws codepipeline update-pipeline —pipeline file://pipeline-config.json

References

Where this check fires

This check runs on every scheduled scan against your AWS account. Findings appear at Cloud Security → Findings filterable by Check ID = codepipeline_project_repo_private. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to AWS checks