Skip to content

Commit 1e206d8

Browse files
committed
docs: adds nuclei in CI/CD
Signed-off-by: Dwi Siswanto <git@dw1.io>
1 parent 736973e commit 1e206d8

5 files changed

Lines changed: 158 additions & 17 deletions

File tree

mint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@
227227
"opensource/nuclei/overview",
228228
"opensource/nuclei/install",
229229
"opensource/nuclei/running",
230+
"opensource/nuclei/ci-cd",
230231
"opensource/nuclei/input-formats",
231232
"opensource/nuclei/authenticated-scans",
232233
"opensource/nuclei/mass-scanning-cli",

opensource/nuclei/ci-cd.mdx

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
---
2+
title: 'Running Nuclei in CI/CD'
3+
description: 'Automate Nuclei scans in CI/CD pipelines with GitHub Actions'
4+
sidebarTitle: 'CI/CD'
5+
---
6+
7+
## Why run Nuclei in CI/CD?
8+
9+
Adding Nuclei to CI/CD helps catch regressions earlier and keeps security checks close to code changes.
10+
11+
Common patterns:
12+
13+
- Scan staging endpoints on every push.
14+
- Run template-based regression checks for known issues.
15+
- Export SARIF and publish findings in GitHub Code Scanning.
16+
17+
## GitHub Actions with `nuclei-action`
18+
19+
Use [projectdiscovery/nuclei-action](https://github.com/projectdiscovery/nuclei-action) to install and run Nuclei directly in a workflow.
20+
21+
### Minimal scan example
22+
23+
```yaml
24+
name: nuclei-scan
25+
26+
on:
27+
push: {}
28+
pull_request: {}
29+
30+
jobs:
31+
scan:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- name: Run Nuclei
37+
uses: projectdiscovery/nuclei-action@v3
38+
with:
39+
args: -u https://example.com
40+
```
41+
42+
### Install only + run manually
43+
44+
```yaml
45+
name: nuclei-install-only
46+
47+
on:
48+
workflow_dispatch: {}
49+
50+
jobs:
51+
scan:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v4
55+
56+
- name: Install Nuclei
57+
uses: projectdiscovery/nuclei-action@v3
58+
with:
59+
version: latest
60+
install-only: true
61+
62+
- name: Verify install
63+
run: nuclei -version
64+
```
65+
66+
### Use config file from repository
67+
68+
```yaml
69+
name: nuclei-config-scan
70+
71+
on:
72+
push: {}
73+
74+
jobs:
75+
scan:
76+
runs-on: ubuntu-latest
77+
steps:
78+
- uses: actions/checkout@v4
79+
80+
- name: Run Nuclei with config
81+
uses: projectdiscovery/nuclei-action@v3
82+
with:
83+
config-path: .github/nuclei/nuclei.yaml
84+
```
85+
86+
## Upload SARIF to GitHub Code Scanning
87+
88+
Nuclei can export SARIF and upload it to GitHub Code Scanning.
89+
90+
```yaml
91+
name: nuclei-sarif
92+
93+
on:
94+
push: {}
95+
pull_request: {}
96+
97+
jobs:
98+
scan:
99+
runs-on: ubuntu-latest
100+
permissions:
101+
security-events: write
102+
contents: read
103+
steps:
104+
- uses: actions/checkout@v4
105+
106+
- name: Run Nuclei and export SARIF
107+
uses: projectdiscovery/nuclei-action@v3
108+
with:
109+
config: |
110+
target:
111+
- https://example.com
112+
sarif-export: results.sarif
113+
114+
- name: Upload SARIF
115+
uses: github/codeql-action/upload-sarif@v3
116+
if: success()
117+
with:
118+
sarif_file: results.sarif
119+
category: nuclei-results
120+
```
121+
122+
## Inputs and precedence
123+
124+
* `args` passes CLI flags directly to Nuclei.
125+
* `config` passes inline Nuclei config.
126+
* `config-path` points to a config file in the repository.
127+
* Do not set `config` and `config-path` together.
128+
* If `args` is set, it takes precedence over `config` and `config-path`.
129+
130+
## Best practices
131+
132+
* Pin `nuclei-action` to `@v3`.
133+
* Store sensitive values in GitHub Secrets.
134+
* Keep custom templates/config in the repository for reproducibility.
135+
* Use SARIF upload when your team relies on GitHub-native triage.
136+
137+
For the full action interface and examples, see the official repository: [github.com/projectdiscovery/nuclei-action](https://github.com/projectdiscovery/nuclei-action).

opensource/nuclei/overview.mdx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ New to scanners and Nuclei? Try it out today with a quick example through our [G
1616

1717
## What are Nuclei's features?
1818

19-
| Feature | Description |
20-
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
21-
| [Extensive Template Library](#) | Nuclei offers a vast collection of community-powered templates for targeted scans of various vulnerabilities and attack vectors. |
22-
| [Versatile Target Specification](#) | Support for various target specification options, such as URLs, IP ranges, ASN range, and file input, allowing flexibility in defining the scanning scope. |
23-
| [Bulk Scanning](#) | Perform bulk scanning by specifying multiple targets at once, enabling efficient scanning of a large number of assets or websites. |
24-
| [Flexible Customization](#) | Customize scanning templates to fit specific needs, allowing tailored scanning and focusing on relevant security checks. |
25-
| [Parallel Scanning](#) | Supports parallel scanning, reducing scanning time and improving efficiency, especially for large-scale targets. |
26-
| [Comprehensive Reporting `cloud`](#) | Generates detailed reports with actionable insights, including vulnerability details, severity levels, affected endpoints, and suggested remediation steps. |
27-
| [Integration with CI/CD Pipelines](#) | Seamlessly integrate Nuclei into CI/CD pipelines for automated security testing as part of the development and deployment process. |
28-
| [CI/CD Integration `cloud`](#) | Actively maintained and developed by the ProjectDiscovery team, introducing new features, bug fixes, and enhancements to provide an up-to-date scanning framework. |
29-
| [Ticketing integration `cloud`](#) | Two-way ticketing integration with Jira, Splunk, and many others to easily remediate and retest vulnerabilities. |
30-
| [Customizable Output Format](#) | Configure the output format of Nuclei's scan results to suit your needs, including options for JSON, YAML, and more. |
31-
| [Dynamic Variables](#) | Utilize dynamic variables in templates to perform parameterized scanning, enabling versatile and flexible scanning configurations. |
32-
| [Inclusion and Exclusion Filters](#) | Apply inclusion and exclusion filters to specify targets, reducing scanning scope and focusing on specific areas of interest. |
33-
| [Authentication Support](/opensource/nuclei/authenticated-scans) | Nuclei supports various authentication mechanisms, including HTTP basic authentication, JWT token authentication, and more. |
34-
| [Embedding custom code in templates](#) | Execute custom code within Nuclei templates to incorporate user-defined logic, perform advanced scanning actions, and more. |
35-
| [AI-Powered Template Generation](#) | Generate and run vulnerability templates on-the-fly using natural language descriptions powered by ProjectDiscovery's AI capabilities. |
19+
| Feature | Description |
20+
| --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
21+
| [Extensive Template Library](#) | Nuclei offers a vast collection of community-powered templates for targeted scans of various vulnerabilities and attack vectors. |
22+
| [Versatile Target Specification](#) | Support for various target specification options, such as URLs, IP ranges, ASN range, and file input, allowing flexibility in defining the scanning scope. |
23+
| [Bulk Scanning](#) | Perform bulk scanning by specifying multiple targets at once, enabling efficient scanning of a large number of assets or websites. |
24+
| [Flexible Customization](#) | Customize scanning templates to fit specific needs, allowing tailored scanning and focusing on relevant security checks. |
25+
| [Parallel Scanning](#) | Supports parallel scanning, reducing scanning time and improving efficiency, especially for large-scale targets. |
26+
| [Comprehensive Reporting `cloud`](#) | Generates detailed reports with actionable insights, including vulnerability details, severity levels, affected endpoints, and suggested remediation steps. |
27+
| [Integration with CI/CD Pipelines](/opensource/nuclei/ci-cd) | Seamlessly integrate Nuclei into CI/CD pipelines for automated security testing as part of the development and deployment process. |
28+
| [CI/CD Integration `cloud`](#) | Actively maintained and developed by the ProjectDiscovery team, introducing new features, bug fixes, and enhancements to provide an up-to-date scanning framework. |
29+
| [Ticketing integration `cloud`](#) | Two-way ticketing integration with Jira, Splunk, and many others to easily remediate and retest vulnerabilities. |
30+
| [Customizable Output Format](#) | Configure the output format of Nuclei's scan results to suit your needs, including options for JSON, YAML, and more. |
31+
| [Dynamic Variables](#) | Utilize dynamic variables in templates to perform parameterized scanning, enabling versatile and flexible scanning configurations. |
32+
| [Inclusion and Exclusion Filters](#) | Apply inclusion and exclusion filters to specify targets, reducing scanning scope and focusing on specific areas of interest. |
33+
| [Authentication Support](/opensource/nuclei/authenticated-scans) | Nuclei supports various authentication mechanisms, including HTTP basic authentication, JWT token authentication, and more. |
34+
| [Embedding custom code in templates](#) | Execute custom code within Nuclei templates to incorporate user-defined logic, perform advanced scanning actions, and more. |
35+
| [AI-Powered Template Generation](#) | Generate and run vulnerability templates on-the-fly using natural language descriptions powered by ProjectDiscovery's AI capabilities. |
3636

3737

3838
## How can I use Nuclei?

opensource/nuclei/resources.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ sidebarTitle: 'Resources'
55
---
66

77
- [Finding bugs with Nuclei with PinkDraconian (Robbe Van Roey)](https://www.youtube.com/watch?v=ewP0xVPW-Pk) by **[@PinkDraconian](https://twitter.com/PinkDraconian)**
8+
- [Running Nuclei in CI/CD (GitHub Actions)](/opensource/nuclei/ci-cd)
89
- [Nuclei: Packing a Punch with Vulnerability Scanning](https://bishopfox.com/blog/nuclei-vulnerability-scan) by **Bishopfox**
910
- [The WAF efficacy framework](https://www.fastly.com/blog/the-waf-efficacy-framework-measuring-the-effectiveness-of-your-waf) by **Fastly**
1011
- [Scanning Live Web Applications with Nuclei in CI/CD Pipeline](https://blog.escape.tech/devsecops-part-iii-scanning-live-web-applications/) by **[@TristanKalos](https://twitter.com/TristanKalos)**

opensource/nuclei/running.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Nuclei templates offer two primary execution methods:
1414

1515
### Supported Input Formats
1616

17+
For automation in pipelines, see [Running Nuclei in CI/CD](/opensource/nuclei/ci-cd).
18+
1719
Nuclei supports various input formats to run template against, including urls, hosts, ips, cidrs, asn, openapi, swagger, proxify, burpsuite exported data and more. To learn more on using input specify options, you can refer [nuclei input formats](/opensource/nuclei/input-formats).
1820

1921
These inputs can be given to nuclei using `-l` and `-input-mode` flags.

0 commit comments

Comments
 (0)