turbot/tailpipe-mod-github-audit-log-detections

Detection: Organization User Granted Owner Role

Overview

Detect when an organization's user was granted the owner role. Assigning the owner role provides elevated access to repositories and settings, potentially leading to unauthorized control over organization resources. Monitoring these events ensures that privilege escalations are intentional and comply with security policies.

References:

Usage

Run the detection in your terminal:

powerpipe detection run github_audit_log_detections.detection.organization_user_granted_owner_role

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe detection run github_audit_log_detections.detection.organization_user_granted_owner_role --share

SQL

This detection uses a named query:

select
tp_timestamp as timestamp,
action as operation,
concat('https://github.com/', user) as resource,
actor,
tp_source_ip as source_ip,
tp_index as organization,
split_part(repo, '/', 2) as repository,
tp_id as source_id,
*
exclude (actor, timestamp)
from
github_audit_log
where
action = 'org.update_member'
and (additional_fields ->> 'permission') = 'admin'
order by
tp_timestamp desc;

Tags