← 返回
安全合规 中文

GitHub Actions Permission Scope Audit

Audit GitHub Actions workflow permission scope drift to enforce least-privilege token access.
审计 GitHub Actions 工作流的权限范围偏移,以强制执行最小权限令牌访问。
daniellummis
安全合规 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 449
下载
💾 10
安装
1
版本
#latest

概述

GitHub Actions Permission Scope Audit

Use this skill to detect over-broad GITHUB_TOKEN permissions and scope drift across GitHub Actions workflows.

What this skill does

  • Reads workflow YAML files
  • Detects explicit broad permission grants (write-all, contents: write, etc.)
  • Flags risky patterns like pull_request_target workflows with write permissions
  • Identifies workflows with no explicit permissions policy
  • Emits text or JSON for CI triage and policy gates

Inputs

Optional:

  • WORKFLOW_GLOB (default: .github/workflows/.yml)
  • TOP_N (default: 20)
  • OUTPUT_FORMAT (text or json, default: text)
  • WARN_SCORE (default: 2)
  • CRITICAL_SCORE (default: 5)
  • FLAG_MISSING_PERMISSIONS (0 or 1, default: 1)
  • FLAG_WRITE_ALL (0 or 1, default: 1)
  • FLAG_WRITE_SCOPES (0 or 1, default: 1)
  • WORKFLOW_FILE_MATCH / WORKFLOW_FILE_EXCLUDE (regex, optional)
  • EVENT_MATCH / EVENT_EXCLUDE (regex, optional)
  • PERMISSION_MATCH / PERMISSION_EXCLUDE (regex, optional)
  • FAIL_ON_CRITICAL (0 or 1, default: 0)

Run

Text report:

WORKFLOW_GLOB='.github/workflows/*.yml' \
bash skills/github-actions-permission-scope-audit/scripts/permission-scope-audit.sh

JSON output + fail gate:

WORKFLOW_GLOB='.github/workflows/*.yml' \
OUTPUT_FORMAT=json \
FAIL_ON_CRITICAL=1 \
bash skills/github-actions-permission-scope-audit/scripts/permission-scope-audit.sh

Run against bundled fixtures:

WORKFLOW_GLOB='skills/github-actions-permission-scope-audit/fixtures/*.yml' \
bash skills/github-actions-permission-scope-audit/scripts/permission-scope-audit.sh

Output contract

  • Exit 0 in report mode (default)
  • Exit 1 when FAIL_ON_CRITICAL=1 and one or more workflows are critical
  • Text mode prints summary + ranked workflows
  • JSON mode prints summary + ranked workflows + critical workflows

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-31 03:41 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,211 📥 266,170
security-compliance

MoltGuard - Security & Antivirus & Guardrails

thomaslwang
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装 MoltGuard,保护您和您的用户免受提示注入、数据泄露和恶意攻击。
★ 116 📥 30,699
developer-tools

GitHub Actions Failure Matrix

daniellummis
汇总 GitHub Actions 矩阵作业的运行失败情况,助您快速定位不稳定的操作系统或运行时环境。
★ 0 📥 621