Skip to content
Open
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
57 changes: 57 additions & 0 deletions .github/workflows/sl-modify-findings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
# This workflow integrates qwiet.ai preZero with GitHub
# Visit https://docs.shiftleft.io for help
name: Severity Upgrade Or Downgrade

on:
pull_request:
workflow_dispatch:

jobs:
NextGen-Static-Analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download ShiftLeft CLI
run: |
curl https://cdn.shiftleft.io/download/sl > ${GITHUB_WORKSPACE}/sl && chmod a+rx ${GITHUB_WORKSPACE}/sl

- name: preZero Static Analysis
run: |
pip install -r requirements.txt

${GITHUB_WORKSPACE}/sl --version
${GITHUB_WORKSPACE}/sl analyze --strict --wait \
--app shiftleft-python-example \
--tag branch=${{ github.head_ref }} \
--pythonsrc --container 18fgsa/s3-resource $(pwd)
${GITHUB_WORKSPACE}/sl modify-findings --app shiftleft-python-example
env:
SHIFTLEFT_ACCESS_TOKEN: ${{ secrets.SHIFTLEFT_ACCESS_TOKEN }}
SHIFTLEFT_API_HOST: www.shiftleft.io
SHIFTLEFT_GRPC_TELEMETRY_HOST: telemetry.shiftleft.io:443
SHIFTLEFT_GRPC_API_HOST: api.shiftleft.io:443

Build-Rules:
runs-on: ubuntu-latest
permissions: write-all
needs: NextGen-Static-Analysis
steps:
- uses: actions/checkout@v3
- name: Download ShiftLeft CLI
run: |
curl https://cdn.shiftleft.io/download/sl > ${GITHUB_WORKSPACE}/sl && chmod a+rx ${GITHUB_WORKSPACE}/sl
- name: Validate Build Rules
run: |
${GITHUB_WORKSPACE}/sl check-analysis --app shiftleft-python-example \
--github-pr-number=${{github.event.number}} \
--github-pr-user=${{ github.repository_owner }} \
--github-pr-repo=${{ github.event.repository.name }} \
--github-token=${{ secrets.GITHUB_TOKEN }}
env:
SHIFTLEFT_ACCESS_TOKEN: ${{ secrets.SHIFTLEFT_ACCESS_TOKEN }}

SHIFTLEFT_API_HOST: www.shiftleft.io
SHIFTLEFT_GRPC_TELEMETRY_HOST: telemetry.shiftleft.io:443
SHIFTLEFT_GRPC_API_HOST: api.shiftleft.io:443

23 changes: 23 additions & 0 deletions ngsast.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
inspect:
- app:
name: shiftleft-python-example
modify-findings:
- any-name

finding-modifications:
any-name:
# Use filter to specify the category
filter:
category:
- Cross-Site Request Forgery
# Specify the value for the tags such as cvss_score, severity that you would like to use
# Optionally, you can add any custom tag. Eg: a reason tag is added here
tags:
- key: cvss_score
value: 9.5
- key: severity
value: critical
- key: cvss_31_severity_rating
value: critical
- key: reason
value: appsec_approved