Repository navigation
Add GitHub Action: Qwiet AI by Harness Static Analysis #7
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: | ||||||
|
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 workflow does not define an explicit Prompt for AI agents |
||||||
| 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. P2: Prompt for AI agents
Suggested change
|
||||||
| - name: Setup Java JDK v11 | ||||||
| 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. P2: Prompt for AI agents |
||||||
| with: | ||||||
| distribution: zulu | ||||||
| java-version: 11 | ||||||
|
|
||||||
| - 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 RACS \ | ||||||
| --tag branch=${{ github.head_ref }} \ | ||||||
|
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 Suggested FixUse 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 env:
BRANCH: ${{ github.head_ref }}
run: |
... --tag branch=$BRANCH ...Prompt for AI agents |
||||||
| --jssrc . | ||||||
| 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: | ||||||
|
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 |
||||||
| # 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 RACS \ | ||||||
| # --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 }} | ||||||
|
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 Suggested FixRemove the extra 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. P2: The Prompt for AI agents |
||||||
| # | ||||||
| # 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
|
||||||
|
|
||||||
|
Comment on lines
+51
to
+61
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 Suggested FixUncomment the 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. |
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| version: 2 | ||
| 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.
P1: The
--tag branch=expression usesgithub.head_ref, which is only available forpull_requestevents. If this workflow is triggered manually viaworkflow_dispatch,github.head_refevaluates to an empty string, resulting in a malformed--tag branch=argument that could cause the CLI to error or attach an incorrect tag. Consider guarding the tag with a conditional or using a fallback like${{ github.head_ref || github.ref_name }}to handle both trigger types.Prompt for AI agents