
A GitHub Action that performs a security scan of your GitHub actions.
This action is based on octoscan
Here is a basic example of how to use this action. This will work for both push and pull_request events.
---
name: Octoscan
on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/*'
push:
paths:
- '.github/workflows/*'
permissions:
security-events: write
actions: read
contents: read
jobs:
octoscan:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- id: octoscan
name: Run octoscan
uses: synacktiv/action-octoscan@v1
- name: Upload SARIF file to GitHub
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "${{steps.octoscan.outputs.sarif_output}}"
category: octoscan
Security results can the be reviewed in the code security tab if you have write access on the target repository:

Or directly in the pull request:

Inputs are based on the options of octoscan, you can find them here.
The following are optional as step.with keys:
💡 enable_rules と disable_rules を同時に使用することはできません。
The following outputs can be accessed via ${{ steps.<step-id>.outputs }} from this action
| Name | Type | Description |
|---|---|---|
sarif_output | String | SARIF 出力を含むファイルの名前。 |
このアクションでは、GitHub 統合トークンに以下の権限が必要です:
permissions:
security-events: write
actions: read
contents: read
security-events is used to push the output of octoscan to GitHub code scanning.
| Name | Type | Description |
|---|
workdir | String | ルートディレクトリからの相対パスで表した作業ディレクトリ。 |
filter_triggers | String | 特定のトリガーでワークフローをスキャンします(カンマ区切りリスト: "push,pull_request_target"、または事前設定: external/allnopr)。デフォルトは external です。 |
filter_run | Boolean | 式インジェクションを run シェルスクリプト内でのみ検索します。デフォルトは true です。 |
ignore | String | 無視したいエラーメッセージに一致する正規表現。 |
disable_rules | String | 特定のルールを無効にします。"," で区切ります。enable_rules と併用できません。 |
enable_rules | String | 特定のルールを有効にします。これにより他のすべてのルールが無効になります。"," で区切ります。disable_rules と併用できません。 |