Skip to content

Commit a54be74

Browse files
authored
Bug fixes and Nuclei update (#16)
* Minor updates (#15) * Minor updates * Update action.yml * Update action.yml * Update action.yml * more fixes * example updates * Reverted Custom UA support + examples
1 parent 7bf5459 commit a54be74

File tree

2 files changed

+51
-13
lines changed

2 files changed

+51
-13
lines changed

README.md

+32
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,37 @@ Example Usage
4141
urls: urls.txt
4242
```
4343
44+
**GitHub Action running Nuclei with CLI flags**
45+
46+
```yaml
47+
- name: Nuclei - DAST Scan
48+
uses: projectdiscovery/nuclei-action@main
49+
with:
50+
urls: urls.txt
51+
flags: "-severity critical,high,medium,low -stats"
52+
```
53+
54+
**GitHub Action running Nuclei with Custom UA**
55+
56+
```yaml
57+
- name: Nuclei - DAST Scan
58+
uses: projectdiscovery/nuclei-action@main
59+
with:
60+
urls: urls.txt
61+
user-agent: "User-Agent: Nuclei"
62+
```
63+
64+
**GitHub Action running Nuclei with Config files**
65+
66+
```yaml
67+
- name: Nuclei - DAST Scan
68+
uses: projectdiscovery/nuclei-action@main
69+
with:
70+
urls: urls.txt
71+
config: config.yaml
72+
report-config: issues.yaml
73+
```
74+
4475
**GitHub Example Action running Nuclei with GitHub Issue reporting**
4576
4677
```yaml
@@ -117,6 +148,7 @@ Available Inputs
117148
| `include-rr` | Include request/response in results | false |
118149
| `config` | Set custom nuclei config file to use | false |
119150
| `user-agent` | Set custom user-agent header | false |
151+
| `report-config` | Issue reporting configuration file | false |
120152
| `github-report` | Set `true` to generate Github issue with the report | false |
121153
| `github-token` | Set the Github Token | false |
122154
| `sarif-export` | File to export result (default - sarif.nuclei) | false |

action.yml

+19-13
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,16 @@ inputs:
3131
required: false
3232
default: false
3333

34+
user-agent:
35+
description: "Set a Custom User-Agent header"
36+
required: false
37+
3438
config:
3539
description: "Nuclei configuration file"
3640
required: false
3741

38-
user-agent:
39-
description: "Set a Custom User-Agent header"
42+
report-config:
43+
description: "Issue reporting configuration file"
4044
required: false
4145

4246
github-report:
@@ -56,27 +60,29 @@ inputs:
5660
description: "Export nuclei results in Markdown format"
5761
required: false
5862

59-
nuclei-flags:
63+
flags:
6064
description: "Extra nuclei CLI flags to use"
6165
required: false
6266

6367
runs:
6468
using: "composite"
6569
steps:
6670
- run: |
67-
[ ! -x /home/runner/go/bin/nuclei ] && GO111MODULE=on go get -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@v2.3.8
71+
[ ! -x /home/runner/go/bin/nuclei ] && GO111MODULE=on go get -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@v2.4.0
6872
echo "/home/runner/go/bin/" >> $GITHUB_PATH
6973
shell: bash
74+
7075
- run: |
7176
[ ! -z ${{ inputs.target }} ] && echo "target=-target ${{ inputs.target}}" >> $GITHUB_ENV
7277
[ ! -z ${{ inputs.urls }} ] && echo "urls=-list ${{ inputs.urls}}" >> $GITHUB_ENV
73-
[ ! -z ${{ inputs.templates }} ] && echo "templates=-t ${{ inputs.templates }}" >> $GITHUB_ENV || echo "templates=-t ./nuclei-templates" >> $GITHUB_ENV
78+
[ ! -z ${{ inputs.templates }} ] && echo "templates=-t ${{ inputs.templates }}" >> $GITHUB_ENV
7479
[ ! -z ${{ inputs.output }} ] && echo "output=-o ${{ inputs.output}}" >> $GITHUB_ENV || echo "output=-o nuclei.log" >> $GITHUB_ENV
7580
[ ! -z ${{ inputs.sarif-export }} ] && echo "sarif-export=-se ${{ inputs.sarif-export}}" >> $GITHUB_ENV || echo "sarif-export=-se nuclei.sarif" >> $GITHUB_ENV
7681
[ ! -z ${{ inputs.markdown-export }} ] && echo "markdown-export=-me ${{ inputs.markdown-export}}" >> $GITHUB_ENV
77-
[ ! -z ${{ inputs.config }} ] && cp ${{ inputs.config }} /.config/nuclei/config.yaml
78-
[ ! -z "${{ inputs.user-agent }}" ] && echo 'useragent=-H "${{ inputs.user-agent }}"' >> $GITHUB_ENV
79-
[ ! -z "${{ inputs.nuclei-flags }}" ] && echo 'flags="${{ inputs.nuclei-flags }}"' >> $GITHUB_ENV
82+
[ ! -z ${{ inputs.report-config }} ] && echo "reportconfig=-rc ${{ inputs.report-config}}" >> $GITHUB_ENV
83+
[ ! -z ${{ inputs.config }} ] && echo "config=-config ${{ inputs.config}}" >> $GITHUB_ENV
84+
[ ! -z "${{ inputs.user-agent }}" ] && echo "useragent=-H ${{ inputs.user-agent }}" >> $GITHUB_ENV
85+
[ ! -z "${{ inputs.flags }}" ] && echo "flags=${{ inputs.flags }}" >> $GITHUB_ENV
8086
${{ inputs.json }} && echo "json=-json" >> $GITHUB_ENV
8187
${{ inputs.include-rr }} && echo "includerr=-irr" >> $GITHUB_ENV
8288
${{ inputs.github-report }} \
@@ -89,22 +95,22 @@ runs:
8995
&& echo -e " issue-label: \"Nuclei\"" >> ~/nuclei-github-config.yaml \
9096
&& echo "githubconfig=-rc ~/nuclei-github-config.yaml" >> $GITHUB_ENV
9197
92-
nuclei -silent \
93-
-update-templates \
94-
-update-directory ./nuclei-templates
98+
nuclei -silent
9599
shell: bash
96100
- run: |
97-
101+
98102
nuclei \
99103
${{ env.target }} \
100104
${{ env.urls }} \
101105
${{ env.templates }} \
102-
${{ env.useragent }} \
103106
${{ env.output }} \
104107
${{ env.sarif-export }} \
105108
${{ env.markdown-export }} \
106109
${{ env.json }} \
107110
${{ env.flags }} \
111+
${{ env.config }} \
112+
${{ env.reportconfig }} \
108113
${{ env.githubconfig }} \
114+
${{ env.useragent }} \
109115
${{ env.includerr }}
110116
shell: bash

0 commit comments

Comments
 (0)