Skip to content
Back to skills

Collection

ASecurity

GitHub Actions ワークフローのセキュリティ強化スキル。 📚 リソース参照: このスキルには以下のリソースが含まれています。 必要に応じて該当するリソースを参照してください: - `.claude/skills/workflow-security/resources/permission-hardening.md`: Permission Hardeningリソース - `.claude/skills/workflow-security/resources/supply-chain-security.md`: Supply Chain Securityリソース - `.claude/skills/workflow-security/templates/secure-workflow.yaml`: Secure Workflowテンプレート - `.claude/skills/workflow-security/scripts/audit-workflow.mjs`: Audit Workflowスクリプト 専門分野: - 最小権限の原則(GITHUB_TO...

  • 24 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 8, 2026
devopsrustbashnodeexpressawsterraformgitsecurity

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add mattnigh/skills_collection --skill collection --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Collection?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Collection
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mattnigh-collection-bd46e10c/badge)](https://www.skillsdirectory.com/skills/mattnigh-collection-bd46e10c)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: .claude/skills/workflow-security/SKILL.md
description: |
  GitHub Actions ワークフローのセキュリティ強化スキル。

  📚 リソース参照:
  このスキルには以下のリソースが含まれています。
  必要に応じて該当するリソースを参照してください:

  - `.claude/skills/workflow-security/resources/permission-hardening.md`: Permission Hardeningリソース
  - `.claude/skills/workflow-security/resources/supply-chain-security.md`: Supply Chain Securityリソース

  - `.claude/skills/workflow-security/templates/secure-workflow.yaml`: Secure Workflowテンプレート

  - `.claude/skills/workflow-security/scripts/audit-workflow.mjs`: Audit Workflowスクリプト

  専門分野:
  - 最小権限の原則(GITHUB_TOKEN権限の最小化)
  - サプライチェーン攻撃対策(アクションの固定、依存関係レビュー)
  - シークレット管理とトークンのスコープ制御
  - pull_request vs pull_request_targetの安全な使用
  - 環境保護とデプロイメント承認フロー

  使用タイミング:
  - セキュリティ脆弱性の検出時(トークン露出、過剰な権限、未検証のアクション)
  - ワークフローのセキュリティレビュー時
  - PRワークフローの作成時(pull_request_targetの使用)
  - サードパーティアクションの追加時
  - 本番環境へのデプロイワークフロー設計時

  Use proactively when implementing GitHub Actions workflows with security concerns,
  permission management, or supply chain protection.
version: 1.0.0
---

# GitHub Actions Workflow Security

## ディレクトリ構造

```
workflow-security/
├── SKILL.md                          # 本ファイル(セキュリティ概要)
├── resources/
│   ├── permission-hardening.md       # 権限最小化の詳細
│   └── supply-chain-security.md      # サプライチェーン対策
├── templates/
│   └── secure-workflow.yaml          # セキュア設定例
└── scripts/
    └── audit-workflow.mjs            # セキュリティ監査スクリプト
```

## コマンドリファレンス

```bash
# 権限強化の詳細
cat .claude/skills/workflow-security/resources/permission-hardening.md

# サプライチェーンセキュリティ
cat .claude/skills/workflow-security/resources/supply-chain-security.md

# セキュアなワークフロー例
cat .claude/skills/workflow-security/templates/secure-workflow.yaml

# ワークフローのセキュリティ監査
node .claude/skills/workflow-security/scripts/audit-workflow.mjs .github/workflows/ci.yml
```

## セキュリティチェックリスト

### 🔴 Critical(必須対応)

- [ ] **GITHUB_TOKEN 権限を最小化**: `permissions:`で明示的に制限
- [ ] **サードパーティアクションをコミット SHA で固定**: `uses: actions/checkout@a81bbbf`
- [ ] **pull_request_target の安全な使用**: untrusted コードを実行しない
- [ ] **シークレットを PR から保護**: `if: github.event_name != 'pull_request'`
- [ ] **本番環境に承認フロー設定**: `environment:`で保護

### 🟡 Important(推奨対応)

- [ ] 依存関係レビューの有効化(Dependabot)
- [ ] コードスキャンの統合(CodeQL、Trivy)
- [ ] OpenID Connect(OIDC)の使用
- [ ] ワークフロー実行ログの監視

### 🟢 Best Practice(最適化)

- [ ] Sigstore でアクション署名検証
- [ ] ネットワーク制限(self-hosted runners)
- [ ] 監査ログの保存
- [ ] 定期的なセキュリティレビュー(四半期)

## 主要なセキュリティ原則

### 1. 最小権限の原則

```yaml
permissions:
  contents: read # ソースコード読み取り専用
  pull-requests: write # PRコメントのみ書き込み
```

**リポジトリ設定**: Settings → Actions → "Read repository contents and packages permissions"

### 2. サプライチェーン攻撃対策

```yaml
# ❌ 危険: タグは変更可能
uses: actions/checkout@v4

# ✅ 安全: コミットSHAは不変
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675  # v4.1.1
```

### 3. PR ワークフローの安全な設計

```yaml
# ❌ 危険: untrustedコードが実行される
on: pull_request_target
steps:
  - uses: actions/checkout@v4
  - run: pnpm test  # 攻撃者のコード実行

# ✅ 安全: ベースブランチのコードのみ
on: pull_request_target
steps:
  - uses: actions/checkout@v4
    with:
      ref: ${{ github.base_ref }}
```

### 4. シークレット保護

```yaml
- name: Deploy
  if: github.event_name != 'pull_request'
  env:
    AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
  run: aws s3 sync ./dist s3://bucket
```

## セキュリティ監査フロー

```
権限レビュー → アクション固定確認 → シークレット使用箇所チェック
  ↓              ↓                    ↓
pull_request_target検証 → 環境保護設定確認 → 監査レポート生成
```

## 関連スキル

| スキル名                        | パス                                                  | 関連性           |
| ------------------------------- | ----------------------------------------------------- | ---------------- |
| **.claude/skills/github-actions-syntax/SKILL.md**       | `.claude/skills/github-actions-syntax/SKILL.md`       | 構文基礎         |
| **.claude/skills/secrets-management-gha/SKILL.md**      | `.claude/skills/secrets-management-gha/SKILL.md`      | シークレット管理 |
| **.claude/skills/deployment-environments-gha/SKILL.md** | `.claude/skills/deployment-environments-gha/SKILL.md` | 環境保護         |
| **.claude/skills/github-actions-expressions/SKILL.md**  | `.claude/skills/github-actions-expressions/SKILL.md`  | セキュリティ制御 |
| **.claude/skills/reusable-workflows/SKILL.md**          | `.claude/skills/reusable-workflows/SKILL.md`          | 集中管理         |

## 使用上の注意

### 対処する問題

- 過剰な権限(`permissions: write-all`)
- サプライチェーン攻撃(タグベース参照)
- トークン露出(PR からのシークレットアクセス)
- untrusted コード実行(pull_request_target 誤用)
- 環境保護不足(本番デプロイ承認なし)

### 対処しない問題

- アプリケーションコード脆弱性(SAST/DAST 使用)
- インフラストラクチャセキュリティ(Terraform 等)
- コンテナイメージ脆弱性(Trivy 等)

### 推奨フロー

1. **新規作成**: テンプレート使用
2. **既存改善**: 監査スクリプト実行
3. **インシデント後**: チェックリスト全確認
4. **定期レビュー**: 四半期ごと監査

---

**メンテナンス**: 四半期ごと更新
**バージョン管理**: セキュリティ勧告の重大変更時にメジャーバージョンアップ

Files in this skill

  • 0Chan-smc__claude-code-workflow-lab__claude__skills__frontend-dev-guidelines__SKILL.md15.1 KB
  • 17hz__nextjs-template__claude__skills__example-skill__SKILL.md316 B
  • 1ambda__dataops-platform__claude__skills__context-synthesis__SKILL.md3.5 KB
  • 1natsu172__dotfiles__claude__skills__git-analysis__SKILL.md5.4 KB
  • 1natsu172__dotfiles__claude__skills__github-pr-best-practices__SKILL.md7.7 KB
  • 23Maestro__prospect-pipeline__claude__skills__npid-fastapi-skill.md26.1 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-code-javascript__SKILL.md15.7 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-code-python__SKILL.md17.5 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-expression-syntax__SKILL.md9.4 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-mcp-tools-expert__SKILL.md12.5 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-node-configuration__SKILL.md16.6 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-workflow-patterns__SKILL.md11.2 KB
  • 3x-Projetos__claude-memory-framework__claude__skills__scientist__SKILL.md14.8 KB
  • 5MinFutures__futures-arena__claude__skills__migration-tracker__SKILL.md16.2 KB
  • 5MinFutures__futures-arena__claude__skills__planning-guidelines__SKILL.md11.8 KB
  • 92Bilal26__TaskPilotAI__claude__skills__assessment-builder__SKILL.md17.5 KB
  • 92Bilal26__TaskPilotAI__claude__skills__book-scaffolding__SKILL.md19.1 KB
  • 92Bilal26__TaskPilotAI__claude__skills__code-validation-sandbox__SKILL.md6.2 KB
  • 92Bilal26__TaskPilotAI__claude__skills__exercise-designer__SKILL.md18.1 KB
  • 92Bilal26__TaskPilotAI__claude__skills__learning-objectives__SKILL.md24.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in devops →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.