-
Notifications
You must be signed in to change notification settings - Fork 0
Add GitHub Action: Qwiet AI by Harness Static Analysis #107
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
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. P1: The workflow executes mutable action tags in a job that handles the SAST access token. Pin both third-party action references to full commit SHAs (with version comments) to make reviewed workflow execution reproducible. 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. P2: 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 | ||||||
|
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 step executes an unpinned, unverified remote binary with Prompt for AI agents |
||||||
|
|
||||||
| - name: Static Analysis | ||||||
| run: | | ||||||
|
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 Tools \ | ||||||
| --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 a variable that is available for all trigger types, or provide a fallback. For example, you can use 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: When this workflow is triggered manually via 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: Using Pass the value through an environment variable instead: env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
... --tag branch=${BRANCH_NAME} ...Prompt for AI agents |
||||||
| --js $(pwd) -- --ts | ||||||
| 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. P2: Fork-originated PRs run 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 | ||||||
|
|
||||||
| # 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 Tools \ | ||||||
| # --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
Comment on lines
+50
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. 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.
P2: The workflow does not define a
permissionsblock, so theGITHUB_TOKENwill inherit the repository's default permissions, which are often overly broad. Adding an explicit permissions block scoped to only what's needed (e.g.,contents: read) follows the principle of least privilege and reduces blast radius if the workflow is compromised.Prompt for AI agents