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

Add telemetry option #44

Merged
merged 1 commit into from
Nov 9, 2024
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
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
run: |
echo "jwt=$(docker run --rm ${{ env.DOCKER_IMAGE }} jwt)" >> $GITHUB_OUTPUT

- name: Test CURL Local Action
- name: Test cURL Local Action
uses: ./
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -85,13 +85,24 @@ jobs:
curl: |
curl http://localhost:8080 -H "Authorization: Bearer ${{ steps.get-jwt.outputs.jwt }}"

- name: Test cURL Local Action without Telemetry
uses: ./
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
scans: jwt.*
curl: |
curl http://localhost:8080 -H "Authorization: Bearer ${{ steps.get-jwt.outputs.jwt }}"
telemetry: false

# - name: Test OpenAPI Local Action
# uses: ./
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# scans: jwt.*
# openapi: ./__tests__/openapi.yaml
# telemetry: false

- name: Stop Server
if: ${{ always() }}
Expand Down
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,27 @@ jobs:

| Name | Required | Description | Default |
| ----------------- | -------- | --------------------------------------------------- | ------- |
| scans | false | The scans performed. | all |
| scans | false | The scans performed. | `all` |
| excludeScans | false | The scans to exclude. | |
| rateLimit | false | The rate limit used to run API vulnerability scans. | 10/s |
| rateLimit | false | The rate limit used to run API vulnerability scans. | `10/s` |
| proxy | false | The proxy server used during the scan. | |
| severityThreshold | false | The severity threshold to trigger a failure. | 0 |
| severityThreshold | false | The severity threshold to trigger a failure. | `0` |

## Outputs

Scan results are output to the console.

## Disclaimer

This scanner is provided for educational and informational purposes only. It
should not be used for malicious purposes or to attack any system without proper
authorization. Always respect the security and privacy of others.
This scanner is provided for informational purposes only. It should not be used
for malicious purposes or to attack any system without proper authorization.
Always respect the security and privacy of others.

## Telemetry

VulnAPI collects fully anonymized usage data to help improve the tool. This data
is not shared with third parties. You can opt-out of telemetry by setting the
`telemetry` option to `false`.

## License

Expand Down
7 changes: 7 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ inputs:
required: false
default: 10/s

telemetry:
description:
'VulnAPI uses fully anonymized telemetry data to help improve the tool.
You can disable it by setting this to false.'
required: false
default: 'true'

proxy:
description: 'The proxy server used during the scan'
required: false
Expand Down
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ function getCommonArgs() {
commonArgs.push(`--rate-limit=${rateLimit}`)
}

const telemetry = getInput('telemetry')
if (telemetry && (telemetry === 'false' || telemetry === '0')) {
commonArgs.push('--sqa-opt-out')
}

const scans = getInput('scans')
if (scans) {
commonArgs.push(`--scans=${scans}`)
Expand Down
Loading