Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow support #33

Merged
merged 4 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ jobs:

<ins>As default, all the default [nuclei-templates](https://github.com/projectdiscovery/nuclei-templates) are used for scan.</ins>

**GitHub Action running Nuclei with custom workflows**

```yaml
- name: Nuclei - DAST Scan
uses: projectdiscovery/nuclei-action@main
with:
target: https://example.com
workflows: custom_workflow_path
```

**GitHub Action running Nuclei on multiple URLs**

```yaml
Expand Down Expand Up @@ -139,6 +149,7 @@ Available Inputs
| `target` | Target URL to run nuclei scan | true |
| `urls` | List of urls to run nuclei scan | false |
| `templates` | Custom templates directory/file to run nuclei scan | false |
| `workflows` | Custom workflows file/files to check across hosts | false |
| `output` | File to save output result (default - nuclei.log) | false |
| `json` | Write results in JSON format | false |
| `include-rr` | Include request/response in results | false |
Expand Down
9 changes: 8 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ inputs:
description: "Templates input file/files to check across hosts"
required: false

workflows:
description: "Workflows input file/files to check across hosts"
required: false

output:
description: "File to save output result"
required: false
Expand Down Expand Up @@ -78,6 +82,7 @@ runs:
[ ! -z ${{ inputs.target }} ] && echo "nuclei-target=-target ${{ inputs.target}}" >> $GITHUB_ENV
[ ! -z ${{ inputs.urls }} ] && echo "nuclei-urls=-list ${{ inputs.urls}}" >> $GITHUB_ENV
[ ! -z ${{ inputs.templates }} ] && echo "nuclei-templates=-t ${{ inputs.templates }}" >> $GITHUB_ENV
[ ! -z ${{ inputs.workflows }} ] && echo "nuclei-workflows=-w ${{ inputs.workflows }}" >> $GITHUB_ENV
[ ! -z ${{ inputs.output }} ] && echo "nuclei-output=-o ${{ inputs.output}}" >> $GITHUB_ENV || echo "output=-o nuclei.log" >> $GITHUB_ENV
[ ! -z ${{ inputs.sarif-export }} ] && echo "nuclei-sarif-export=-se ${{ inputs.sarif-export}}" >> $GITHUB_ENV || echo "sarif-export=-se nuclei.sarif" >> $GITHUB_ENV
[ ! -z ${{ inputs.markdown-export }} ] && echo "nuclei-markdown-export=-me ${{ inputs.markdown-export}}" >> $GITHUB_ENV
Expand All @@ -96,15 +101,17 @@ runs:
&& echo -e " project-name: \"${GITHUB_REPOSITORY#*/}\"" >> ~/nuclei-github-config.yaml \
&& echo -e " issue-label: \"Nuclei\"" >> ~/nuclei-github-config.yaml \
&& echo "nuclei-githubconfig=-rc ~/nuclei-github-config.yaml" >> $GITHUB_ENV
nuclei -silent
shell: bash
- run: |
nuclei \
${{ env.nuclei-target }} \
${{ env.nuclei-urls }} \
${{ env.nuclei-templates }} \
${{ env.nuclei-workflows }} \
${{ env.nuclei-output }} \
${{ env.nuclei-sarif-export }} \
${{ env.nuclei-markdown-export }} \
Expand Down