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

Detection: Personal Access Token Granted

Overview

Detect when a GitHub fine-grained personal access token (PAT) was granted access to resources. Personal access tokens grant access to repositories, actions, or APIs, and unauthorized token creation can lead to credential leaks or compromised accounts. Monitoring these events helps ensure secure access management and compliance with security policies.

References:

Usage

Run the detection in your terminal:

powerpipe detection run github_audit_log_detections.detection.personal_access_token_granted

Snapshot and share results via Turbot Pipes:

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

SQL

This detection uses a named query:

select
tp_timestamp as timestamp,
action as operation,
additional_fields ->> 'user_programmatic_access_name' 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 in ('personal_access_token.access_granted')
order by
tp_timestamp desc;

Tags