This repository was archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eac7043
commit dc703ad
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
include: | ||
files: | ||
- "**/*" | ||
|
||
exclude: | ||
files: | ||
- __pycache__|\.eggs|build|dev|\.vscode|\.git|\.github | ||
- .*/(locale|spec|test|mock)s?/ | ||
- integration|node_modules | ||
- (package(-lock)?|npm-shrinkwrap)\.json | ||
|
||
keys: | ||
- .*(public|project).* | ||
|
||
values: | ||
- ^(true|false|yes|no|1|0)$ | ||
- .*_(user|password|token|key|placeholder|name)$ | ||
- ^aws_(access_key_id|secret_access_key|session_token)$ | ||
- ^arn:aws:.* | ||
- ^((cn?trl|alt|shift|del|ins|esc|tab|f[\d]+) ?[\+_\-\\/] ?)+[\w]+$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: secrets | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
scan: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: scan | ||
run: | | ||
export DEBIAN_FRONTEND=noninteractive && \ | ||
echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections && \ | ||
sudo apt-get update && \ | ||
python3 -m pip install --upgrade pip && \ | ||
pip3 install whispers && \ | ||
mkdir /home/runner/reports/ && \ | ||
whispers --severity BLOCKER,CRITICAL -o /home/runner/reports/whispers.json -c ${GITHUB_WORKSPACE}/.github/workflows/config/whispers-config.yml ${GITHUB_WORKSPACE} && \ | ||
echo "::set-output name=found-count::$(wc -l /home/runner/reports/whispers.json | cut -d' ' -f1)" | ||
- name: Fail if found | ||
if: steps.scan.outputs.found-count != 0 | ||
uses: actions/github-script@v5 | ||
with: | ||
script: | | ||
echo {{steps.scan.outputs.found-count}} && \ | ||
core.setFailed('Secrets found. Please check the uploaded report') | ||
- name: Upload scan reports | ||
uses: actions/[email protected] | ||
if: failure() | ||
with: | ||
name: whispers-report | ||
path: /home/runner/reports/whispers.json |