Skip to content

Commit

Permalink
Update Secret Scan Log Forwarding (#146)
Browse files Browse the repository at this point in the history
* send failed result to panther

* rename variables

* remove unnecessary `<`

* add continue on error

* send logs to panther for all scans

* remove redundant "

* bump trufflehog to 3.82.13

* missing double quote
  • Loading branch information
Jeffreyhung authored Oct 30, 2024
1 parent cb8c3b9 commit db5a9a8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/secret-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
# echo "latest_tag_name=$LATEST_TAG_NAME" >> "$GITHUB_OUTPUT"
# echo "latest_release=$LATEST_RELEASE" >> "$GITHUB_OUTPUT"
run: |
echo "latest_tag_name=v3.80.3" >> "$GITHUB_OUTPUT"
echo "latest_release=3.80.3" >> "$GITHUB_OUTPUT"
echo "latest_tag_name=v3.82.13" >> "$GITHUB_OUTPUT"
echo "latest_release=3.82.13" >> "$GITHUB_OUTPUT"
- name: Download and verify TruffleHog release
run: |
Expand Down Expand Up @@ -64,11 +64,10 @@ jobs:
fi
- name: Send Alert to Panther
id: alert
if: steps.scan.outcome != 'success'
run: |
curl "${{vars.SECRET_SCAN_PANTHER_WEBHOOK_URL}}" \
--header "Authorization: Bearer ${{ secrets.SECRET_SCAN_PANTHER_WEBHOOK_HEADER }}" \
--data '{"event":"github_secret_scanning_failed", createdAt:"${{ github.event.pull_request.created_at }}", "repo":"${{ github.repository }}","pull_request":"https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}"","actor":"${{ github.event.pull_request.user.login }}"}'
--data '{"event":"github_secret_scanning", "status":${{steps.scan.outcome}}, "createdAt":"${{ github.event.pull_request.created_at }}", "repo":"${{ github.repository }}","pull_request":"https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}","actor":"${{ github.event.pull_request.user.login }}"}'
- name: Fail workflow if secret detected
if: steps.scan.outcome != 'success'
run: exit 1

0 comments on commit db5a9a8

Please sign in to comment.