Repository navigation
Add GitHub Action: Qwiet AI by Harness Static Analysis #62
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,62 @@ | ||||||
| --- | ||||||
| # This workflow integrates Harness SAST and SCA with GitHub | ||||||
| # Visit https://docs.shiftleft.io for help | ||||||
| name: Harness SAST and SCA | ||||||
|
|
||||||
| on: | ||||||
| pull_request: | ||||||
| workflow_dispatch: | ||||||
|
|
||||||
| jobs: | ||||||
| NextGen-Static-Analysis: | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - uses: actions/checkout@v3 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: Using Prompt for AI agents |
||||||
| - name: Setup Java JDK v8 | ||||||
| uses: actions/setup-java@v3 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: Using Prompt for AI agents
Suggested change
|
||||||
| with: | ||||||
| distribution: zulu | ||||||
| java-version: 8 | ||||||
|
|
||||||
| - name: Download Harness SAST and SCA CLI | ||||||
| run: | | ||||||
| curl https://cdn.shiftleft.io/download/sl > ${GITHUB_WORKSPACE}/sl && chmod a+rx ${GITHUB_WORKSPACE}/sl | ||||||
|
|
||||||
| - name: Static Analysis | ||||||
| run: | | ||||||
|
Check failure on line 26 in .github/workflows/shiftleft.yml
|
||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "github.head_ref" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs\.github\.com/en/actions/reference/security/secure\-use\#good\-practices\-for\-mitigating\-script\-injection\-attacks for more details [actionlint:expression] |
||||||
| ${GITHUB_WORKSPACE}/sl --version | ||||||
| ${GITHUB_WORKSPACE}/sl analyze --strict --wait \ | ||||||
| --app Games \ | ||||||
| --tag branch=${{ github.head_ref }} \ | ||||||
|
Check failure on line 30 in .github/workflows/shiftleft.yml
|
||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: The workflow will fail or produce untagged results when run manually via Suggested FixUse a fallback value for the branch tag to ensure it is populated for both Prompt for AI AgentDid we get this right? 👍 / 👎 to inform future reviews. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: Using Pass the value through an environment variable instead: env:
BRANCH: ${{ github.head_ref || github.ref_name }}Then reference it as Prompt for AI agentsThen reference it as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: When this workflow is triggered via Use a fallback: Prompt for AI agents |
||||||
| --js $(pwd) -- --ts | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: The Prompt for AI agents |
||||||
| 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 Harness SAST and SCA 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 Games \ | ||||||
| # --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 | ||||||
| # | ||||||
|
Comment on lines
+12
to
+60
|
||||||
|
|
||||||
|
|
||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| version: 2 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: This file is placed in Prompt for AI agentsThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: Build rules defined in Prompt for AI agents |
||
| build_rules: | ||
| - id: Allow no critical findings | ||
| severities: | ||
| - critical | ||
| - id: Allow one OSS or container finding | ||
| finding_types: | ||
| - oss_vuln | ||
| - container | ||
| threshold: 1 | ||
| - id: Allow no reachable OSS vulnerability | ||
| finding_types: | ||
| - oss_vuln | ||
| options: | ||
| reachable: true | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: This workflow does not define a
permissionsblock, so it inherits the repository's defaultGITHUB_TOKENpermissions (which may be overly broad). Add an explicit permissions block at the workflow or job level to follow the principle of least privilege. A minimal starting point would be:Prompt for AI agents