此 Nuclei Action 能让你轻松地通过 GitHub Action 编排 Nuclei。将你所有的 Nuclei 模板 集成到强大的持续安全工作流中,并使其成为你安全软件开发生命周期的一部分。
Nuclei Action
v3.0.0+ 运行于 Node.js v24,采用 CLI 优先的接口,接受 inputs(如 version、install-only、args 等),并且 outputs 仅输出至 stdout 和 stderr。v2.0.0+ 和 v2.x 依赖 action 特定的输入,如 target、urls、templates、workflows、flags,以及各种导出器/报告开关;v2.x 在 2026年3月1日 之后弃用且不再受支持。升级前请参阅 MIGRATION.md。v1+ 运行于 Node.js v16,使用 target、urls、templates、workflows、output、json、include-rr、config、report-config、github-report、github-token、sarif-export、markdown-export 和 flags 等输入。[!IMPORTANT]
config和config-path不能同时设置。args始终优先于config或config-path。
[!NOTE] 启用调试日志时,此 action 会自动向 Nuclei 添加
-debug和-verbose标志。
| name | description |
|---|---|
stdout | 运行 Nuclei 的标准输出 |
stderr | 运行 Nuclei 的标准错误 |
此 action 是一个 node24 action。
- uses: projectdiscovery/nuclei-action@v3
with:
version:
# Setup with specific version ("latest" or in format "vX.Y.Z").
#
# Required: true
# Default: latest
install-only:
# Install Nuclei without running scans.
#
# Required: false
# Default: false
args:
# Arguments to pass to Nuclei.
#
# Required: false
# Default: ""
config:
# Nuclei configuration file content.
#
# Required: false
# Default: ""
config-path:
# Path to Nuclei configuration file.
#
# Required: false
# Default: ""
cache:
# Enable caching of Nuclei caches, configs, templates, and browser.
#
# Required: false
# Default: true
token:
# GitHub Token. It is used to fetch Nuclei releases from GitHub.
#
# Required: true
# Default: ${{ github.token }}
默认设置(最新版 Nuclei)
- uses: projectdiscovery/nuclei-action@v3
with:
args: -u http://scanme.sh
使用特定版本进行设置
- uses: projectdiscovery/nuclei-action@v3
with:
version: v3.6.0
args: -u http://scanme.sh
仅设置或安装 Nuclei,不运行扫描
- uses: projectdiscovery/nuclei-action@v3
with:
version: v3.6.0
install-only: true
- run: nuclei -version
或仅安装且不使用缓存:
- uses: projectdiscovery/nuclei-action@v3
with:
version: v3.6.0
install-only: true
cache: false
- run: nuclei -version
使用 Nuclei 配置进行设置
- uses: projectdiscovery/nuclei-action@v3
with:
version: latest
config: |
target:
- http://scanme.sh
sarif-export: results.sarif
或通过变量传递:
- uses: projectdiscovery/nuclei-action@v3
with:
version: latest
config: ${{ vars.NUCLEI_CONFIG }}
或通过仓库管理的配置文件:
- uses: projectdiscovery/nuclei-action@v3
with:
version: latest
config-path: path/to/nuclei.yaml
使用 GitHub 代码扫描 进行设置
- uses: projectdiscovery/nuclei-action@v3
with:
version: latest
config: |
target:
- http://scanme.sh
sarif-export: results.sarif
- uses: github/codeql-action/upload-sarif@v3
if: success()
with:
sarif_file: results.sarif
category: nuclei-results
使用报告功能进行设置
- uses: projectdiscovery/nuclei-action@v3
with:
args: -u http://scanme.sh
config: |
report-config: issue-tracker-config.yaml
env:
GITHUB_BASE_URL: https://localhost:8443/github
GITHUB_USERNAME: test-username
GITHUB_OWNER: test-owner
GITHUB_TOKEN: ${{ secrets.GITHUB_PAT }}
GITHUB_PROJECT_NAME: test-project
issue-tracker-config.yaml(仓库文件):github:
# base-url is the optional self-hosted GitHub application url
base-url: $GITHUB_BASE_URL # read from environment variable
# username is the username of the GitHub user
username: $GITHUB_USERNAME # read from environment variable
# owner is the owner name of the repository for issues
owner: $GITHUB_OWNER # read from environment variable
# token is the token for GitHub account
token: $GITHUB_TOKEN # read from environment variable
# project-name is the name of the repository
project-name: $GITHUB_PROJECT_NAME # read from environment variable
# issue-label is the label of the created issue type
issue-label: bug
# allow-list sets a tracker level filter to only create issues for templates with
# these severity labels or tags (does not affect exporters. set those globally)
allow-list:
severity: high, critical
tags: network
# deny-list sets a tracker level filter to never create issues for templates with
# these severity labels or tags (does not affect exporters. set those globally)
deny-list:
severity: low
# duplicate-issue-check flag to enable duplicate tracking issue check.
duplicate-issue-check: false
请参阅 https://github.com/projectdiscovery/nuclei/blob/dev/cmd/nuclei/issue-tracker-config.yaml。
我们欢迎贡献!请参阅我们的贡献指南了解如何开始。
MIT。更多详情请参阅 LICENSE。
| name | description | required | default |
|---|
version | 使用特定版本进行设置("latest" 或格式 "vX.Y.Z")。 | true | latest |
install-only | 仅安装 Nuclei,不运行扫描。 | false | false |
args | 传递给 Nuclei 的参数。 | false | "" |
config | Nuclei 配置文件内容。 | false | "" |
config-path | Nuclei 配置文件的路径。 | false | "" |
cache | 启用对 Nuclei 缓存、配置、模板和浏览器的缓存。 | false | true |
token | GitHub Token。用于从 GitHub 获取 Nuclei 发行版。 | true | ${{ github.token }} |