turbot/tailpipe-mod-aws-cloudtrail-log-detections

Detection: CodeBuild Project Visibility Set Public

Overview

Detect when a CodeBuild project's visibility was set to public. Publicly accessible projects expose sensitive environments to unauthorized access, increasing the risk of data breaches, malicious builds, or resource abuse. Restricting access to trusted users and roles ensures the security and integrity of build processes.

References:

Usage

Run the detection in your terminal:

powerpipe detection run aws_cloudtrail_log_detections.detection.codebuild_project_visibility_set_public

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe detection run aws_cloudtrail_log_detections.detection.codebuild_project_visibility_set_public --share

SQL

This detection uses a named query:

select
tp_timestamp as timestamp,
string_split(event_source, '.')[1] || ':' || event_name as operation,
request_parameters ->> 'projectArn' as resource,
user_identity.arn as actor,
tp_source_ip as source_ip,
tp_index as account_id,
aws_region as region,
tp_id as source_id,
*
from
aws_cloudtrail_log
where
event_source = 'codebuild.amazonaws.com'
and event_name = 'UpdateProjectVisibility'
and (request_parameters ->> 'projectVisibility') = 'PUBLIC_READ'
and error_code is null
order by
event_time desc;

Tags