Skip to content

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

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

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

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

Integrate Harness (Qwiet) SAST and SCA into the repository via a new GitHub Actions workflow and initial security build rules.

New Features:

  • Add a GitHub Actions workflow that runs Harness SAST and SCA on pull requests and manual dispatches using the ShiftLeft CLI.
  • Introduce a shiftleft.yml configuration defining initial security build rules and vulnerability thresholds for the application.

CI:

  • Configure a new CI job to perform static analysis using Harness/ShiftLeft on every pull request and optional workflow dispatch.

Summary by cubic

Add a GitHub Action to run Harness (Qwiet) SAST and SCA on every PR and on manual runs. Adds initial build rules to define vulnerability thresholds.

  • New Features

    • Adds a Harness SAST and SCA workflow that triggers on pull_request and workflow_dispatch, posting a status check.
    • Uses JDK 11 and the sl CLI to run sl analyze --strict --wait against app RACS, tagging the PR branch and scanning JS sources; requires SHIFTLEFT_ACCESS_TOKEN.
    • Adds shiftleft.yml with rules: 0 critical allowed; up to 1 OSS or container finding; no reachable OSS vulnerabilities.
  • Migration

    • Ensure the SHIFTLEFT_ACCESS_TOKEN secret exists in the repo.
    • To gate PRs by these rules, uncomment the “Build-Rules” job in .github/workflows/shiftleft.yml.

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

Review in cubic

@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
racs Error Error Jul 26, 2026 7:27am

@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

@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.

@difflens

difflens Bot commented Jul 26, 2026

Copy link
Copy Markdown

View changes in DiffLens

@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

@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 bf2f7a8 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

@codesherlock-ai

codesherlock-ai Bot commented Jul 26, 2026

Copy link
Copy Markdown

PR Summary

  • Adds a new GitHub Actions workflow to run Harness (ShiftLeft) SAST/SCA scans on pull requests and a shiftleft configuration file defining build rules for accepting/rejecting findings.
File Name Summary of Modifications
.github/workflows/shiftleft.yml New workflow "Harness SAST and SCA": checks out code, sets up Java 11, downloads ShiftLeft CLI, runs sl analyze --strict --wait against the repo on PRs/manual dispatch, and includes a commented example job to validate build rules; requires SHIFTLEFT_ACCESS_TOKEN and external network/telemetry endpoints.
shiftleft.yml New ShiftLeft configuration (version: 2) declaring build_rules: disallow critical findings, allow up to one OSS/container finding, and block reachable OSS vulnerabilities; intended to be used by the CLI's analysis/check steps.

Impact

  • Introduces automated static analysis into CI, improving security visibility and gating but requires configured secrets (SHIFTLEFT_ACCESS_TOKEN), network access to ShiftLeft endpoints, and will increase CI run time when scans execute.

Flow Diagram

+-------------------------------------------+
| Trigger: pull_request / workflow_dispatch |
+-------------------------------------------+
                     │
       ▼ start workflow on PR / manual

+-------------------------------------+
| actions/checkout@v3 (checkout repo) |
+-------------------------------------+
                  │
        ▼ prepare Java runtime

+----------------------------------------+
| Setup Java JDK 11 (actions/setup-java) |
+----------------------------------------+
                    │
             ▼ download sl CLI

+---------------------------------------------------------+
| Download ShiftLeft CLI (curl -> ${GITHUB_WORKSPACE}/sl) |
+---------------------------------------------------------+
                            │
                    ▼ invoke sl analyze

+-----------------------------------------------------------------------------------+
| Static Analysis: sl analyze --strict --wait (--app RACS, --tag branch, --jssrc .) |
+-----------------------------------------------------------------------------------+
                                         │
                                         ▼

├─ upload/analysis request ─►
+-------------------------------------------------------------+
| ShiftLeft Cloud
(api.shiftleft.io / telemetry.shiftleft.io) |
+-------------------------------------------------------------+
                              │
                ▼ analysis results / telemetry


├─ NextGen-Static-Analysis completes (optional) ─►
+----------------------------------------------------+
| Optional: Validate Build Rules (sl check-analysis) |
+----------------------------------------------------+
                          │
                          ▼

├─ job starts (needs: NextGen-Static-Analysis) ─►
+-------------------------------------------------------------+
| Optional job: actions/checkout@v3 (checkout for validation) |
+-------------------------------------------------------------+
                              │
                 ▼ download sl for validation

+--------------------------------------+
| Optional job: Download ShiftLeft CLI |
+--------------------------------------+
                   │
  ▼ invoke sl check-analysis --app RACS


├─ check-analysis queries ShiftLeft service ─►

+--------------------------------+
| Secret: SHIFTLEFT_ACCESS_TOKEN |
+--------------------------------+
                │
     ▼ provides authentication


+--------------------------------------------------+
| Env: SHIFTLEFT_API/GRPC_TELEMETRY/GRPC_API hosts |
+--------------------------------------------------+
                         │
                         ▼

├─ provides API/telemetry endpoints ─►

├─ uses ShiftLeft API endpoints ─►

+-----------------------------+
| shiftleft.yml (build_rules) |
+-----------------------------+
              │
              ▼

├─ build rules applied (shiftleft.yml) ─►

├─ validation uses build_rules (shiftleft.yml) ─►

+----------------------+
| Secret: GITHUB_TOKEN |
+----------------------+
           │
▼ used by sl check-analysis for PR metadata

@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

@codereviewbot-ai

Copy link
Copy Markdown

🤖 Review skipped: Repository Owner rate limit exceeded. Free accounts are limited to 3 reviews per 4 hours across all repositories. Upgrade to a paid plan for unlimited reviews.

@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: 557eced6-d684-45d4-8e7b-f9495404c00a

📥 Commits

Reviewing files that changed from the base of the PR and between 4e9fef7 and bf2f7a8.

📒 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-1785050593
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch shiftleft-action-config-1785050593

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.

@guardrails

guardrails Bot commented Jul 26, 2026

Copy link
Copy Markdown

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

Hard-Coded Secrets (3)
Severity Details Docs
Medium Title: Github Key
uses: endorlabs/github-action@b51bd06466b545f01a6ac788e3e1147695d3936c
📚
Medium Title: Github Key
uses: endorlabs/github-action@b51bd06466b545f01a6ac788e3e1147695d3936c
📚
Medium Title: Github Key
uses: pmd/pmd-github-action@967a81f8b657c87f7c3e96b62301cb1a48efef29
📚

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


Vulnerable Libraries (5)
Severity Details
Medium pkg:npm/@tailwindcss/postcss@4.2.2 (t) upgrade to: > 4.2.2
Medium pkg:npm/@supabase/supabase-js@2.101.0 upgrade to: > 2.101.0
High pkg:npm/eslint-config-next@16.2.1 upgrade to: > 16.2.1
High pkg:npm/shadcn@4.1.2 upgrade to: > 4.1.2
Low pkg:npm/next@16.2.1 upgrade to: 15.5.16,16.2.5

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

  • Introduction of Harness Integration
    A new workflow file has been added for integrating a tool called Harness, used for static analysis and software composition analysis, with GitHub. This workflow file, named shiftleft.yml, has been placed within .github/workflows directory.

    • This file describes a task that performs a static analysis of the code. This task will be performed on the latest version of the Ubuntu operating system.
    • The task also includes setting up Java JDK, version 11, and retrieving the necessary tool to perform the static analysis.
    • The tool is then used to conduct the analysis, taking into account the provided environment variables as parameters.
  • ShiftLeft Configuration File
    A new configuration file shiftleft.yml has been added, which includes the parameters for the Harness tool.

    • It outlines rules meant to govern the results of the analysis. The rules state that no critical issues are permissible, only one open-source or container issue is allowed, and no open-source vulnerabilities that can be exploited are tolerated.

Comment on lines +12 to +60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Java JDK v11
uses: actions/setup-java@v3
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: |
${GITHUB_WORKSPACE}/sl --version
${GITHUB_WORKSPACE}/sl analyze --strict --wait \
--app RACS \
--tag branch=${{ github.head_ref }} \
--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:
# 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 }}
#
# SHIFTLEFT_API_HOST: www.shiftleft.io
# SHIFTLEFT_GRPC_TELEMETRY_HOST: telemetry.shiftleft.io:443
# SHIFTLEFT_GRPC_API_HOST: api.shiftleft.io:443
#
@bito-code-review

Copy link
Copy Markdown

The workflow file .github/workflows/shiftleft.yml currently lacks an explicit permissions block, which means it defaults to broad permissions for the GITHUB_TOKEN. To follow security best practices, you should add a permissions block to the job to restrict access to only what is necessary, such as contents: read.

.github/workflows/shiftleft.yml

NextGen-Static-Analysis:
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:

@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.

@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

# 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 v11
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 RACS \
--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]

@deepsource-io

deepsource-io Bot commented Jul 26, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 4e9fef7...bf2f7a8 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 ↗
Secrets 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.

@github-actions

Copy link
Copy Markdown

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 2 package(s) with unknown licenses.
See the Details below.

License Issues

.github/workflows/shiftleft.yml

PackageVersionLicenseIssue Type
actions/checkout3.*.*NullUnknown License
actions/setup-java3.*.*NullUnknown License

OpenSSF Scorecard

PackageVersionScoreDetails
actions/actions/checkout 3.*.* 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1024 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 10all changesets reviewed
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies🟢 3dependency not pinned by hash detected -- score normalized to 3
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
SAST🟢 10SAST tool is run on all commits
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
actions/actions/setup-java 3.*.* 🟢 5.3
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 3Found 7/21 approved changesets -- score normalized to 3
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Binary-Artifacts🟢 10no binaries found in the repo
Packaging⚠️ -1packaging workflow not detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
SAST🟢 9SAST tool is not run on all commits -- score normalized to 9
Security-Policy🟢 9security policy file detected

Scanned Files

  • .github/workflows/shiftleft.yml

@difflens

difflens Bot commented Jul 26, 2026

Copy link
Copy Markdown

View changes in DiffLens

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 26, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
racs bf2f7a8 Jul 26 2026, 07:26 AM

Comment on lines +51 to +61
# --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
#

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 Build-Rules job is commented out, so security policies defined via sl check-analysis are not being enforced on pull requests.
Severity: CRITICAL

Suggested Fix

Uncomment the Build-Rules job (lines 38-61) in .github/workflows/shiftleft.yml to re-enable the sl check-analysis step. This will ensure that the defined security policies are enforced on pull requests.

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#L38-L61

Potential issue: The `Build-Rules` job in the `shiftleft.yml` workflow, responsible for
enforcing security gates with `sl check-analysis`, is entirely commented out. Although
build rules are defined to block critical findings, these rules are never evaluated. As
a result, pull requests containing critical security vulnerabilities will not be blocked
from merging, bypassing the intended security checks.

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

${GITHUB_WORKSPACE}/sl --version
${GITHUB_WORKSPACE}/sl analyze --strict --wait \
--app RACS \
--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 github.head_ref variable is empty for workflow_dispatch triggers, causing manual analysis runs to have an empty branch tag in the Qwiet dashboard.
Severity: MEDIUM

Suggested Fix

Use github.ref_name instead of github.head_ref. The github.ref_name variable correctly provides the branch or tag name for all event types, including workflow_dispatch and pull_request, ensuring consistent tagging.

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: When the workflow is triggered manually via `workflow_dispatch`, the
`github.head_ref` context variable is empty. This causes the `--tag branch=${{
github.head_ref }}` argument to pass an empty string to the `sl analyze` command. As a
result, SAST results from manual runs are stored without a proper branch identifier in
the Qwiet dashboard, making it difficult to track and correlate findings.

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

# --github-pr-repo=${{ github.event.repository.name }} \
# --github-token=${{ secrets.GITHUB_TOKEN }}
# env:
# # SHIFTLEFT_ACCESS_TOKEN: ${{ secrets.SHIFTLEFT_ACCESS_TOKEN }}

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 SHIFTLEFT_ACCESS_TOKEN secret is double-commented and will remain commented out even if the surrounding job is uncommented, causing authentication failure.
Severity: MEDIUM

Suggested Fix

Remove the extra # from the SHIFTLEFT_ACCESS_TOKEN line (line 55) so that it is commented at the same level as the rest of the Build-Rules job. This ensures it will be correctly activated when the job is uncommented.

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#L55

Potential issue: In the commented-out `Build-Rules` job, the `SHIFTLEFT_ACCESS_TOKEN`
secret is double-commented. If a developer uncomments the job block by removing the
leading `#` from each line, the line for the access token will remain commented (`#
SHIFTLEFT_ACCESS_TOKEN: ...`). This will cause the `sl check-analysis` command to fail
with an authentication error, preventing security rules from being checked.

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

@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.

7 issues found across 2 files

Confidence score: 2/5

  • In .github/workflows/shiftleft.yml, interpolating ${{ github.head_ref }} directly inside an inline run script creates a command-injection path via crafted branch names, which could execute unintended shell commands in CI — pass the ref through a quoted environment variable (or otherwise sanitize it) before use.
  • In .github/workflows/shiftleft.yml, --tag branch= depends on github.head_ref, which is empty for workflow_dispatch, so manual runs can emit blank branch tags and weaken scan traceability or downstream logic — add a fallback like github.ref_name for non-PR triggers.
  • In .github/workflows/shiftleft.yml, the Build-Rules job being fully commented out means critical policy checks are not enforced, so vulnerable changes can pass without blocking — re-enable Build-Rules and fix the malformed double-comment on SHIFTLEFT_ACCESS_TOKEN so required env wiring is restored when uncommented.
  • In .github/workflows/shiftleft.yml, the workflow lacks an explicit permissions block and still uses actions/checkout@v3/actions/setup-java@v3 on deprecated Node 16, increasing privilege and maintenance risk — define least-privilege permissions and upgrade both actions to @v4.
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=".github/workflows/shiftleft.yml">

<violation number="1" location=".github/workflows/shiftleft.yml:6">
P1: The `--tag branch=` expression uses `github.head_ref`, which is only available for `pull_request` events. If this workflow is triggered manually via `workflow_dispatch`, `github.head_ref` evaluates 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.</violation>

<violation number="2" location=".github/workflows/shiftleft.yml:10">
P2: The workflow does not define an explicit `permissions` block, so the `GITHUB_TOKEN` will have the repository's default permissions (often `write-all`). Following the principle of least privilege, add a top-level `permissions` block with minimal scopes needed. For a static analysis workflow, `contents: read` should be sufficient for the main job.</violation>

<violation number="3" location=".github/workflows/shiftleft.yml:14">
P2: `actions/checkout@v3` runs on the deprecated Node 16 runtime. GitHub Actions will show deprecation warnings — upgrade to `@v4` to use Node 20.</violation>

<violation number="4" location=".github/workflows/shiftleft.yml:16">
P2: `actions/setup-java@v3` runs on the deprecated Node 16 runtime — upgrade to `@v4` to use Node 20 and avoid deprecation warnings.</violation>

<violation number="5" location=".github/workflows/shiftleft.yml:30">
P1: Using `${{ github.head_ref }}` directly in an inline `run` script is a script injection risk. An attacker can create a PR from a branch with a malicious name (e.g., containing shell metacharacters or backticks) to execute arbitrary commands. GitHub's security documentation explicitly warns against this pattern. Pass the value through an environment variable instead:

```yaml
env:
  BRANCH: ${{ github.head_ref }}
run: |
  ... --tag branch=$BRANCH ...
```</violation>

<violation number="6" location=".github/workflows/shiftleft.yml:38">
P2: The `Build-Rules` job is entirely commented out, meaning the security policies defined in `shiftleft.yml` (blocking critical findings, OSS vulnerabilities) will never be evaluated. Pull requests with critical security findings won't be blocked from merging. If this is intentional for an initial rollout, consider adding a comment explaining when it should be enabled; otherwise, uncomment the job to enforce the defined policies.</violation>

<violation number="7" location=".github/workflows/shiftleft.yml:55">
P2: The `SHIFTLEFT_ACCESS_TOKEN` line has a double comment (`# ... # SHIFTLEFT_ACCESS_TOKEN`). If someone uncomments the `Build-Rules` job by removing the leading `#` from each line, this environment variable will remain commented out, causing `sl check-analysis` to fail with an authentication error. Remove the inner `#` so it's at the same comment level as the rest of the block.</violation>
</file>

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

Re-trigger cubic

# Visit https://docs.shiftleft.io for help
name: Harness SAST and SCA

on:

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: The --tag branch= expression uses github.head_ref, which is only available for pull_request events. If this workflow is triggered manually via workflow_dispatch, github.head_ref evaluates 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
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/shiftleft.yml, line 6:

<comment>The `--tag branch=` expression uses `github.head_ref`, which is only available for `pull_request` events. If this workflow is triggered manually via `workflow_dispatch`, `github.head_ref` evaluates 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.</comment>

<file context>
@@ -0,0 +1,62 @@
+# Visit https://docs.shiftleft.io for help
+name: Harness SAST and SCA
+
+on:
+  pull_request:
+  workflow_dispatch:
</file context>

${GITHUB_WORKSPACE}/sl --version
${GITHUB_WORKSPACE}/sl analyze --strict --wait \
--app RACS \
--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 an inline run script is a script injection risk. An attacker can create a PR from a branch with a malicious name (e.g., containing shell metacharacters or backticks) to execute arbitrary commands. GitHub's security documentation explicitly warns against this pattern. Pass the value through an environment variable instead:

env:
  BRANCH: ${{ github.head_ref }}
run: |
  ... --tag branch=$BRANCH ...
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 an inline `run` script is a script injection risk. An attacker can create a PR from a branch with a malicious name (e.g., containing shell metacharacters or backticks) to execute arbitrary commands. GitHub's security documentation explicitly warns against this pattern. Pass the value through an environment variable instead:

```yaml
env:
  BRANCH: ${{ github.head_ref }}
run: |
  ... --tag branch=$BRANCH ...
```</comment>

<file context>
@@ -0,0 +1,62 @@
+        ${GITHUB_WORKSPACE}/sl --version
+        ${GITHUB_WORKSPACE}/sl analyze --strict --wait \
+          --app RACS \
+          --tag branch=${{ github.head_ref }} \
+          --jssrc .
+      env:
</file context>

steps:
- uses: actions/checkout@v3
- name: Setup Java JDK v11
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.

P2: actions/setup-java@v3 runs on the deprecated Node 16 runtime — upgrade to @v4 to use Node 20 and avoid deprecation warnings.

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>`actions/setup-java@v3` runs on the deprecated Node 16 runtime — upgrade to `@v4` to use Node 20 and avoid deprecation warnings.</comment>

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

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.

P2: actions/checkout@v3 runs on the deprecated Node 16 runtime. GitHub Actions will show deprecation warnings — upgrade to @v4 to use Node 20.

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>`actions/checkout@v3` runs on the deprecated Node 16 runtime. GitHub Actions will show deprecation warnings — upgrade to `@v4` to use Node 20.</comment>

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

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

# Build-Rules:

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 Build-Rules job is entirely commented out, meaning the security policies defined in shiftleft.yml (blocking critical findings, OSS vulnerabilities) will never be evaluated. Pull requests with critical security findings won't be blocked from merging. If this is intentional for an initial rollout, consider adding a comment explaining when it should be enabled; otherwise, uncomment the job to enforce the defined policies.

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 38:

<comment>The `Build-Rules` job is entirely commented out, meaning the security policies defined in `shiftleft.yml` (blocking critical findings, OSS vulnerabilities) will never be evaluated. Pull requests with critical security findings won't be blocked from merging. If this is intentional for an initial rollout, consider adding a comment explaining when it should be enabled; otherwise, uncomment the job to enforce the defined policies.</comment>

<file context>
@@ -0,0 +1,62 @@
+        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
</file context>

pull_request:
workflow_dispatch:

jobs:

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 workflow does not define an explicit permissions block, so the GITHUB_TOKEN will have the repository's default permissions (often write-all). Following the principle of least privilege, add a top-level permissions block with minimal scopes needed. For a static analysis workflow, contents: read should be sufficient for the main job.

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 10:

<comment>The workflow does not define an explicit `permissions` block, so the `GITHUB_TOKEN` will have the repository's default permissions (often `write-all`). Following the principle of least privilege, add a top-level `permissions` block with minimal scopes needed. For a static analysis workflow, `contents: read` should be sufficient for the main job.</comment>

<file context>
@@ -0,0 +1,62 @@
+  pull_request:
+  workflow_dispatch:
+
+jobs:
+  NextGen-Static-Analysis:
+    runs-on: ubuntu-latest
</file context>

# --github-pr-repo=${{ github.event.repository.name }} \
# --github-token=${{ secrets.GITHUB_TOKEN }}
# env:
# # SHIFTLEFT_ACCESS_TOKEN: ${{ secrets.SHIFTLEFT_ACCESS_TOKEN }}

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 SHIFTLEFT_ACCESS_TOKEN line has a double comment (# ... # SHIFTLEFT_ACCESS_TOKEN). If someone uncomments the Build-Rules job by removing the leading # from each line, this environment variable will remain commented out, causing sl check-analysis to fail with an authentication error. Remove the inner # so it's at the same comment level as the rest of the block.

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 55:

<comment>The `SHIFTLEFT_ACCESS_TOKEN` line has a double comment (`# ... # SHIFTLEFT_ACCESS_TOKEN`). If someone uncomments the `Build-Rules` job by removing the leading `#` from each line, this environment variable will remain commented out, causing `sl check-analysis` to fail with an authentication error. Remove the inner `#` so it's at the same comment level as the rest of the block.</comment>

<file context>
@@ -0,0 +1,62 @@
+#             --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
</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 — No blocking issues found

One non-blocking finding was retained: CLI binary downloaded without integrity verification.

Review details and evidence
Priority File Finding Evidence
P2 .github/workflows/shiftleft.yml CLI binary downloaded without integrity verification needs verification

Finding details

P2 · CLI binary downloaded without integrity verification

.github/workflows/shiftleft.yml

The sl CLI binary is downloaded from https://cdn.shiftleft.io/download/sl with no version pinning or integrity verification. While HTTPS provides transport security, a compromised CDN or endpoint could serve a malicious binary. Pinning a specific release and verifying its checksum would reduce this supply-chain risk. This is the vendor-recommended installation path, so the practical risk is low.

Verification boundary: needs verification; scope: changed region.

Conceptual guidance (not a committable GitHub suggestion):

      - name: Download Harness SAST and SCA CLI (vX.Y.Z)
        run: |
          curl -L https://github.com/ShiftLeftSecurity/sast-cli/releases/download/vX.Y.Z/sl > ${GITHUB_WORKSPACE}/sl
          echo "<expected_sha256> ${GITHUB_WORKSPACE}/sl" | sha256sum --check
          chmod a+rx ${GITHUB_WORKSPACE}/sl

LlamaPReview checks

  • Reviewed changed regions in .github/workflows/shiftleft.yml.
  • Read bounded PR-head context from .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