Check ID:
Provider: AWS
Service:
Severity: CRITICAL
Categories:
Resource type:
codebuild_project_source_repo_url_no_sensitive_credentialsProvider: AWS
Service:
codebuildSeverity: CRITICAL
Categories:
secretsResource type:
AwsCodeBuildProjectWhat this check verifies
AWS CodeBuild projects with Bitbucket sources are assessed to confirm repository URLs do not embed credentials (for example,x-token-auth:<token>@ or user:password@). The assessment includes both the primary source and all secondary sources.
Risk
Credentials in URLs are plainly exposed in configs and logs, enabling unauthorized repo access. This can lead to:- Source code theft (C)
- Malicious commits/CI changes (I)
- Supply-chain compromise and lateral movement via token reuse
Recommendation
Use OAuth/CodeStar Connections or store tokens in Secrets Manager/SSM, never in the URL. Enforce least privilege, scope to needed repos, set short lifetimes, and rotate regularly. Audit configs and logs to remove leaked secrets. Apply to primary and secondary sources.Remediation
- Terraform
- Native IaC
- Dashboard steps
References
- https://docs.aws.amazon.com/securityhub/latest/userguide/codebuild-controls.html#codebuild-1
- https://docs.aws.amazon.com/config/latest/developerguide/codebuild-project-source-repo-url-check.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_source_repo_url_no_sensitive_credentials. 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