Detection: SSH Key Created
Overview
Detect when a new SSH key is added to a GitHub account. While SSH keys are commonly used to enable secure repository access, attackers may add their own keys to maintain persistence or gain unauthorized access. Monitoring these events helps identify unexpected credential additions and reduce the risk of account compromise.
References:
Usage
Run the detection in your terminal:
powerpipe detection run github_security_log_detections.detection.ssh_key_created
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe detection run github_security_log_detections.detection.ssh_key_created --share
SQL
This detection uses a named query:
select tp_timestamp as timestamp,action as operation,fingerprint as resource,actor,tp_source_ip as source_ip,tp_id as source_id,*exclude (actor, timestamp)
from github_security_logwhere action = 'public_key.create'order by tp_timestamp desc;