Skip to content

Commit 18eec9a

Browse files
authored
v1.0.3 (#12)
* More feature additions (#10) * Adding sarif and markdown support * misc changes * Version lock * Example updates * misc changes * support to use any nuclei flag as extra argument * Example branch update (#11) * Adding sarif and markdown support * misc changes * Version lock * Example updates * misc changes * support to use any nuclei flag as extra argument * branch update As latest tag will always in sync with main
1 parent 626a759 commit 18eec9a

File tree

2 files changed

+84
-34
lines changed

2 files changed

+84
-34
lines changed

README.md

+51-28
Original file line numberDiff line numberDiff line change
@@ -11,53 +11,67 @@ Integrate all of your [Nuclei Templates](https://github.com/projectdiscovery/nuc
1111
Example Usage
1212
-----
1313

14-
**GitHub Action running nuclei on single URL**
14+
**GitHub Action running Nuclei on single URL**
1515

1616
```yaml
17-
- name: Nuclei Scan
18-
uses: projectdiscovery/nuclei-action@v1.0.1
17+
- name: Nuclei - DAST Scan
18+
uses: projectdiscovery/nuclei-action@main
1919
with:
2020
target: https://example.com
2121
```
2222
23-
**GitHub Action running nuclei with custom templates**
23+
**GitHub Action running Nuclei with custom templates**
2424
2525
```yaml
26-
- name: Nuclei Scan
27-
uses: projectdiscovery/nuclei-action@v1.0.1
26+
- name: Nuclei - DAST Scan
27+
uses: projectdiscovery/nuclei-action@main
2828
with:
2929
target: https://example.com
3030
templates: custom_template_path
3131
```
3232
3333
<ins>As default, all the default [nuclei-templates](https://github.com/projectdiscovery/nuclei-templates) are used for scan.</ins>
3434
35-
**GitHub Action running nuclei on multiple URLs**
35+
**GitHub Action running Nuclei on multiple URLs**
3636
3737
```yaml
38-
- name: Nuclei Scan
39-
uses: projectdiscovery/nuclei-action@v1.0.1
38+
- name: Nuclei - DAST Scan
39+
uses: projectdiscovery/nuclei-action@main
4040
with:
4141
urls: urls.txt
4242
```
4343
44-
**GitHub Example Action running nuclei with GitHub Issue reporting**
44+
**GitHub Example Action running Nuclei with GitHub Issue reporting**
4545
4646
```yaml
47-
- name: Nuclei Scan
48-
uses: projectdiscovery/nuclei-action@v1.0.1
47+
- name: Nuclei - DAST Scan
48+
uses: projectdiscovery/nuclei-action@main
4949
with:
5050
target: https://example.com
5151
github-report: true
5252
github-token: ${{ secrets.GITHUB_TOKEN }}
5353
```
5454
55+
**GitHub Example Action running Nuclei with GitHub Security Dashboard reporting**
5556
56-
Workflow - `.github/workflows/nuclei.yml`
57+
```yaml
58+
- name: Nuclei - DAST Scan
59+
uses: projectdiscovery/nuclei-action@main
60+
with:
61+
target: https://example.com
62+
63+
- name: GitHub Security Dashboard Alerts
64+
uses: github/codeql-action/upload-sarif@v1
65+
with:
66+
sarif_file: nuclei.sarif
67+
```
68+
69+
70+
**Workflow** - `.github/workflows/nuclei.yml`
5771

5872

5973
```yaml
60-
name: Nuclei - DAST
74+
name: Nuclei - DAST Scan
6175
6276
on:
6377
schedule:
@@ -73,29 +87,38 @@ jobs:
7387
with:
7488
go-version: 1.15
7589
76-
- name: Nuclei Scan
77-
uses: projectdiscovery/nuclei-action@v1.0.1
90+
- name: Nuclei - DAST Scan
91+
uses: projectdiscovery/nuclei-action@main
7892
with:
7993
target: https://example.com
8094
95+
- name: GitHub Workflow artifacts
8196
- uses: actions/upload-artifact@v2
8297
with:
8398
name: nuclei.log
8499
path: nuclei.log
100+
101+
- name: GitHub Security Dashboard Alerts update
102+
uses: github/codeql-action/upload-sarif@v1
103+
with:
104+
sarif_file: nuclei.sarif
85105
```
86106

87107
Available Inputs
88108
------
89109

90-
| Key | Description | Required |
91-
| --------------- | --------------------------------------------------- | -------- |
92-
| `target` | Target URL to run nuclei scan | true |
93-
| `urls` | List of urls to run nuclei scan | false |
94-
| `templates` | Custom templates directory/file to run nuclei scan | false |
95-
| `output` | File to save output result (default - nuclei.log) | false |
96-
| `json` | Write results in JSON format | false |
97-
| `include-rr` | Include request/response in results | false |
98-
| `config` | Set custom nuclei config file to use | false |
99-
| `user-agent` | Set custom user-agent header | false |
100-
| `github-report` | Set `true` to generate Github issue with the report | false |
101-
| `github-token` | Set the Github Token | false |
110+
| Key | Description | Required |
111+
| ----------------- | --------------------------------------------------- | -------- |
112+
| `target` | Target URL to run nuclei scan | true |
113+
| `urls` | List of urls to run nuclei scan | false |
114+
| `templates` | Custom templates directory/file to run nuclei scan | false |
115+
| `output` | File to save output result (default - nuclei.log) | false |
116+
| `json` | Write results in JSON format | false |
117+
| `include-rr` | Include request/response in results | false |
118+
| `config` | Set custom nuclei config file to use | false |
119+
| `user-agent` | Set custom user-agent header | false |
120+
| `github-report` | Set `true` to generate Github issue with the report | false |
121+
| `github-token` | Set the Github Token | false |
122+
| `sarif-export` | File to export result (default - sarif.nuclei) | false |
123+
| `markdown-export` | Directory to export markdown results | false |
124+
| `nuclei-flags` | More Nuclei CLI flags to use | false |

action.yml

+33-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Nuclei Action"
1+
name: "Nuclei - DAST Scan"
22
description: "Nuclei is a fast and customisable vulnerability scanner based on simple YAML based DSL"
33
branding:
44
icon: "activity"
@@ -8,53 +8,77 @@ inputs:
88
target:
99
description: "Target to run nuclei scan"
1010
required: true
11+
1112
urls:
1213
description: "List of urls to run templates"
1314
required: false
15+
1416
templates:
1517
description: "Templates input file/files to check across hosts"
1618
required: false
19+
1720
output:
1821
description: "File to save output result"
1922
required: false
23+
2024
json:
2125
description: "Write nuclei output in JSON format"
2226
required: false
2327
default: false
28+
2429
include-rr:
2530
description: "Write requests/responses for matches in JSON output"
2631
required: false
2732
default: false
33+
2834
config:
2935
description: "Nuclei configuration file"
3036
required: false
37+
3138
user-agent:
3239
description: "Set a Custom User-Agent header"
3340
required: false
41+
3442
github-report:
35-
description: "Nuclei Reporting Module for Github"
43+
description: "Nuclei Reporting Module for Github Issues"
3644
required: false
3745
default: false
46+
3847
github-token:
3948
description: "Github token for Github reporting"
4049
required: false
41-
50+
51+
sarif-export:
52+
description: "Export nuclei results in SARIF format"
53+
required: false
54+
55+
markdown-export:
56+
description: "Export nuclei results in Markdown format"
57+
required: false
58+
59+
nuclei-flags:
60+
description: "Extra nuclei CLI flags to use"
61+
required: false
62+
4263
runs:
4364
using: "composite"
4465
steps:
4566
- run: |
46-
[ ! -x /home/runner/go/bin/nuclei ] && GO111MODULE=on go get -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei
67+
[ ! -x /home/runner/go/bin/nuclei ] && GO111MODULE=on go get -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@v2.3.8
4768
echo "/home/runner/go/bin/" >> $GITHUB_PATH
4869
shell: bash
4970
- run: |
5071
[ ! -z ${{ inputs.target }} ] && echo "target=-target ${{ inputs.target}}" >> $GITHUB_ENV
5172
[ ! -z ${{ inputs.urls }} ] && echo "urls=-list ${{ inputs.urls}}" >> $GITHUB_ENV
5273
[ ! -z ${{ inputs.templates }} ] && echo "templates=-t ${{ inputs.templates }}" >> $GITHUB_ENV || echo "templates=-t ./nuclei-templates" >> $GITHUB_ENV
5374
[ ! -z ${{ inputs.output }} ] && echo "output=-o ${{ inputs.output}}" >> $GITHUB_ENV || echo "output=-o nuclei.log" >> $GITHUB_ENV
54-
${{ inputs.json }} && echo "json=-json" >> $GITHUB_ENV
55-
${{ inputs.include-rr }} && echo "includerr=-irr" >> $GITHUB_ENV
75+
[ ! -z ${{ inputs.sarif-export }} ] && echo "sarif-export=-se ${{ inputs.sarif-export}}" >> $GITHUB_ENV || echo "sarif-export=-se nuclei.sarif" >> $GITHUB_ENV
76+
[ ! -z ${{ inputs.markdown-export }} ] && echo "markdown-export=-me ${{ inputs.markdown-export}}" >> $GITHUB_ENV
5677
[ ! -z ${{ inputs.config }} ] && cp ${{ inputs.config }} /.config/nuclei/config.yaml
5778
[ ! -z "${{ inputs.user-agent }}" ] && echo 'useragent=-H "${{ inputs.user-agent }}"' >> $GITHUB_ENV
79+
[ ! -z "${{ inputs.nuclei-flags }}" ] && echo 'flags="${{ inputs.nuclei-flags }}"' >> $GITHUB_ENV
80+
${{ inputs.json }} && echo "json=-json" >> $GITHUB_ENV
81+
${{ inputs.include-rr }} && echo "includerr=-irr" >> $GITHUB_ENV
5882
${{ inputs.github-report }} \
5983
&& touch ~/nuclei-github-config.yaml \
6084
&& echo -e "github:" >> ~/nuclei-github-config.yaml \
@@ -77,7 +101,10 @@ runs:
77101
${{ env.templates }} \
78102
${{ env.useragent }} \
79103
${{ env.output }} \
104+
${{ env.sarif-export }} \
105+
${{ env.markdown-export }} \
80106
${{ env.json }} \
107+
${{ env.flags }} \
81108
${{ env.githubconfig }} \
82109
${{ env.includerr }}
83110
shell: bash

0 commit comments

Comments
 (0)