Panther informational experimental python
GitHub Workflow Contains Checkout Action
Detects when a GitHub Actions workflow job contains a checkout step. The checkout action (actions/checkout) pulls repository code into the workflow runner. In certain contexts, especially with pull_request_target triggers or workflows with elevated permissions, checking out untrusted code can pose security risks. This detection helps identify workflows that interact with repository code for security review.
Detection Logic
def rule(event):
"""Alert when a GitHub workflow job contains a checkout action step."""
# Only check completed workflow jobs
if event.get("action") != "completed":
return False
# Get the steps array from workflow_job
steps = event.deep_get("workflow_job", "steps", default=[])
# Iterate through each step and check if the name contains "checkout" (case-insensitive)
for step in steps:
step_name = step.get("name", "").lower()
if "checkout" in step_name:
return True
return False Field Validations
Loading…
Comments (0)
Loading comments...