Check ID:
Provider: AWS
Service:
Severity: MEDIUM
Categories:
Resource type:
codebuild_project_user_controlled_buildspecProvider: AWS
Service:
codebuildSeverity: MEDIUM
Categories:
software-supply-chain, ci-cdResource type:
AwsCodeBuildProjectWhat this check verifies
AWS CodeBuild projects are evaluated for use of a user-controlled buildspec, identified when the project references a repository file like*.yml or *.yaml. Projects using non file-based build instructions are treated as centrally managed.
Risk
Repository-controlled buildspecs let unreviewed changes run in CI, endangering integrity (tampered artifacts), confidentiality (secret leakage), and availability (resource abuse). Attackers can weaponize PRs to execute code and pivot via the build role.Recommendation
Adopt a centrally managed buildspec that contributors cannot modify.- Enforce protected branches and required reviews for build instructions
- Apply least privilege to the build role and minimize secrets
- Separate duties for pipeline admins vs code authors
Remediation
- Terraform
- Native IaC
- Dashboard steps
References
- https://docs.aws.amazon.com/codebuild/latest/userguide/security.html
- https://support.icompaas.com/support/solutions/articles/62000229579-ensure-codebuild-project-with-an-user-controlled-buildspec
- https://docs.aws.amazon.com/codebuild/latest/userguide/change-project.html
Where this check fires
This check runs on every scheduled scan against your AWS account. Findings appear at Cloud Security → Findings filterable byCheck ID = codebuild_project_user_controlled_buildspec. 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