secure-github-actions
|
Works with
---
name: secure-github-actions
description: |
license: MIT
---
# Secure GitHub Actions
Create, review, and audit GitHub Actions workflows with supply-chain-safe defaults.
## CRITICAL RULES
1. **Read the relevant reference files first.** When the user's request involves any topic in the reference table below, read those files before doing anything else. Briefly mention which files you are reading so the user can confirm the skill is active.
2. **Pin every non-local `uses:` reference to a full 40-character commit SHA.** Treat `@v*`, `@main`, `@master`, branch names, and short SHAs as security debt.
3. **Never invent SHAs.** Resolve them from GitHub or ask the user; if you cannot verify the right SHA, say so explicitly instead of fabricating one.
4. **Do not introduce `pull_request_target`** unless the user explicitly requires it and the workflow never executes untrusted code with secrets or write permissions.
5. **Never splice untrusted context directly into shell.** Move `${{ github.* }}`, `${{ inputs.* }}`, and similar values into `env:` and quote the shell variable.
6. **Set explicit least-privilege `permissions:`.** Default to read-only and grant write scopes only to the specific job that needs them.
7. **Always run the full audit checklist** when asked to "audit", "harden", or "security scan" a repository.
8. **Never silently skip a check.** If a tool is missing (gitleaks, trufflehog, zizmor), report it and suggest installation.
9. **After compaction or context loss**, re-read this SKILL and the reference files before continuing.
## Operating procedure
### For writing or editing workflows
1. Classify the task: new workflow, workflow edit, reusable workflow, or security review.
2. Read [references/workflows.md](references/workflows.md) and [references/secure-patterns.md](references/secure-patterns.md).
3. Audit every `uses:` reference:
- Local actions like `./.github/actions/foo` are fine.
- Step-level actions and job-level reusable workflows must use full SHAs.
- Preserve the human release label in a comment (e.g., `# v4.3.1`).
4. Audit the trust boundary:
- Prefer `pull_request` over `pull_request_target`.
- Assume forked PR data is untrusted.
- Avoid exposing secrets or write tokens to untrusted code paths.
5. Audit every `run:` step:
- Pass dynamic values through `env:`.
- Quote shell variables.
- Prefer simple shell over adding a new third-party action when either works.
6. Add or update maintenance guardrails:
- Ensure Dependabot updates the `github-actions` ecosystem.
- Call out transitive risk: pinned actions can still reference mutable actions internally.
### For full security audits
When asked to "audit", "harden", or "security scan" a repository:
1. Read [references/audit-checklist.md](references/audit-checklist.md).
2. Execute all checks, using subagents to parallelize where possible.
3. Present findings grouped by severity: CRITICAL, HIGH, MEDIUM, LOW.
4. End with a summary table and prioritized action list.
## Reference files
| Topic | File | Read when... |
|-------|------|-------------|
| Workflow hardening patterns | [references/workflows.md](references/workflows.md) | Creating, editing, or reviewing workflows |
| Secure workflow templates | [references/secure-patterns.md](references/secure-patterns.md) | Writing new workflows from scratch |
| Full audit procedure | [references/audit-checklist.md](references/audit-checklist.md) | Running a security audit on a repository |
| SHA pinning automation | [references/sha-pinning.md](references/sha-pinning.md) | Pinning actions to commit SHAs |
## Tools
The audit checks for these tools and reports missing ones:
| Tool | Purpose | Install |
|------|---------|---------|
| `gitleaks` | Scan git history for secrets | `brew install gitleaks` |
| `trufflehog` | Deep secrets scanning with verification | `brew install trufflehog` |
| `zizmor` | Static analysis for GH Actions | `brew install woodruffw/tap/zizmor` |
| `gh` | GitHub CLI for API calls | `brew install gh` |More Deployment & CI/CD skills
azure-enterprise-infra-planner
microsoft/azure-skills
Architect and provision enterprise Azure infrastructure from workload descriptions. For cloud architects and platform engineers planning networking, identity, security, compliance, and multi-resource topologies with WAF alignment. Generates Bicep or Terraform directly (no azd). WHEN: 'plan Azure infrastructure', 'architect Azure landing zone', 'design hub-spoke network', 'plan multi-region DR topology', 'set up VNets firewalls and private endpoints', 'subscription-scope Bicep deployment', 'Azure Backup for VM workloads'. PREFER azure-prepare FOR app-centric workflows.
azure-kubernetes-app-deploy
microsoft/azure-skills
Use when deploying an existing web application or API to an already-running Azure Kubernetes Service cluster. Detects the framework, generates a Dockerfile and Kubernetes manifests, validates against AKS Deployment Safeguards, and deploys with verification. WHEN: deploy app to AKS, deploy to existing AKS cluster, containerize app for Kubernetes, generate K8s manifests for Azure, set up CI/CD for AKS, my AKS deployment is failing safeguard checks, I have a Django/Express/Spring Boot app to run on AKS. DO NOT USE FOR: creating or provisioning an AKS cluster (use azure-kubernetes), assessing migration to AKS Automatic (use azure-kubernetes-automatic-readiness), or deploying to non-AKS targets like Web Apps, Container Apps, or Functions.
finetuning
microsoft/azure-skills
Fine-tune models on Microsoft Foundry using SFT (supervised), DPO (preference), or RFT (reinforcement with graders). Covers dataset preparation, training job submission, deployment, and evaluation. USE FOR: fine-tune, SFT, DPO, RFT, training data, grader, distillation, fine-tuned model, training job, large file upload, calibrate grader, deploy fine-tuned model, evaluate fine-tuned model. DO NOT USE FOR: general model deployment without fine-tuning (use deploy-model), agent creation (use agents), prompt optimization without training (use prompt-optimizer).

