CodeBuild project has been invoked in the last 90 days
AWS CodeBuild projects are assessed for recent activity using the last build invocation timestamp. Projects not invoked within 90 days or never built are treated as inactive.
Risk
Inactive projects increase attack surface. Dormant webhooks or source credentials can be abused, and attached IAM roles may retain excessive permissions. Stale configs can expose secrets in env vars or logs, threatening build integrity and data confidentiality, while adding avoidable cost and operational sprawl.
Run this check with Prowler
Run in Prowler Cloudprowler aws --checks codebuild_project_older_90_daysRecommendation
Implement lifecycle management: review projects idle over 90 days, confirm ownership and need, then delete or archive. Revoke unused webhooks, tokens, and service roles; rotate any secrets. Enforce least privilege, tagging, and periodic audits to reduce attack surface and keep the build environment tidy and defensible.
Remediation
Other
Check Code
from datetime import datetime, timezone
from prowler.lib.check.models import Check, Check_Report_AWS
from prowler.providers.aws.services.codebuild.codebuild_client import codebuild_client
class codebuild_project_older_90_days(Check):
def execute(self):
findings = []
for project in codebuild_client.projects.values():
report = Check_Report_AWS(metadata=self.metadata(), resource=project)
report.status = "PASS"
report.status_extended = f"CodeBuild project {project.name} has been invoked in the last 90 days."
if project.last_invoked_time:
if (datetime.now(timezone.utc) - project.last_invoked_time).days > 90:
report.status = "FAIL"
report.status_extended = f"CodeBuild project {project.name} has not been invoked in the last 90 days."
else:
report.status = "FAIL"
report.status_extended = (
f"CodeBuild project {project.name} has never been built."
)
findings.append(report)
return findings