Skip to content

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

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

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

Conversation

@LCSOGthb

@LCSOGthb LCSOGthb commented Jul 26, 2026

Copy link
Copy Markdown
Owner

User description

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 on pull requests and optionally enforce build rules based on analysis results.

New Features:

  • Introduce a Harness SAST and SCA GitHub Actions workflow triggered on pull requests and manual dispatch.
  • Define build rules configuration to limit critical, open-source, container, and reachable vulnerabilities in analysis results.

Enhancements:

  • Prepare an optional build-rules job to validate analysis results and gate PRs based on configured policies.

CodeAnt-AI Description

Add automated Harness security analysis to pull requests

What Changed

  • Pull requests now run Harness SAST and SCA analysis against the repository’s JavaScript source
  • Security analysis waits for results and applies strict checks for critical, open-source, container, and reachable vulnerabilities
  • The analysis can also be started manually when needed

Impact

✅ Earlier detection of critical security findings
✅ Fewer vulnerable dependencies reaching review
✅ Security checks available on every pull request

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.


Summary by cubic

Adds a GitHub Action to run Harness SAST and SCA on every PR with a status check. Includes build rules to block critical issues and limit OSS/container findings.

  • New Features

    • Adds .github/workflows/shiftleft.yml to run on pull_request and workflow_dispatch.
    • Uses actions/checkout@v3, actions/setup-java@v3, downloads sl, and runs sl analyze --strict --wait --app Center --jssrc ..
    • Adds shiftleft.yml rules: no critical findings, max 1 oss_vuln or container finding, and no reachable oss_vuln.
  • Migration

    • Ensure the SHIFTLEFT_ACCESS_TOKEN repo secret exists.
    • Confirm the Harness app name Center is correct; update if needed.
    • Optionally uncomment the Build-Rules job to enforce checks in CI.

Written for commit 4b42fd2. Summary will update on new commits.

Review in cubic

@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

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

@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 4b42fd2 Jul 26, 2026 · 07:23 07:24

@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

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

@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

@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)
center Ready Ready Preview, Comment Jul 26, 2026 7:27am

@codesherlock-ai

codesherlock-ai Bot commented Jul 26, 2026

Copy link
Copy Markdown

PR Summary

  • Adds a GitHub Actions workflow that runs Harness/ShiftLeft SAST and SCA analysis on pull requests and a companion shiftleft.yml that defines build-rule thresholds.
File Name Summary of Modifications
.github/workflows/shiftleft.yml New CI workflow "Harness SAST and SCA": checks out code, sets up Java 11, downloads the ShiftLeft CLI, and runs sl analyze (strict, waits) against the repo on PRs or manually; includes env mapping for SHIFTLEFT_ACCESS_TOKEN and API hosts and contains a commented example job to validate build rules.
shiftleft.yml New ShiftLeft configuration (version: 2) with build rules: disallow critical findings, allow up to one OSS/container finding, and require no reachable OSS vulnerabilities (reachable: true).

Impact

  • Introduces security scanning into the PR pipeline (may block or fail PRs based on rules) and requires configuring SHIFTLEFT_ACCESS_TOKEN; it will increase CI runtime and depend on successful access to ShiftLeft services.

Flow Diagram

+----------------------------------------+
| GitHub Pull Request or Manual Dispatch |
+----------------------------------------+
                    │
                    ▼

├─ on: pull_request / workflow_dispatch ─►
+-------------------------------------------+
| Checkout repository (actions/checkout@v3) |
+-------------------------------------------+
                     │
         ▼ prepare Java environment

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

+-------------------------------------+
| Download ShiftLeft CLI (curl -> sl) |
+-------------------------------------+
                  │
         ▼ execute sl commands

+---------------------------------------------------------------------------------------------------------------+
| Static Analysis: run `sl --version` then `sl analyze --strict --wait --app Center --tag branch=... --jssrc .` |
+---------------------------------------------------------------------------------------------------------------+
                                                       │
                                                       ▼

├─ upload analysis / request scan ─►
+-----------------------------------------------------+
| ShiftLeft SAST & SCA Cloud Services (api/telemetry) |
+-----------------------------------------------------+
                          │
              ▼ return results & findings

+--------------------------------------------------------------+
| Analysis Complete / PR Status (results, enforce build rules) |
+--------------------------------------------------------------+


├─ optional: next job (commented) depends on analysis ─►
+----------------------------------------------------------------------------------------------------+
| Validate Build Rules (optional/commented): `sl check-analysis --app Center --github-pr-number ...` |
+----------------------------------------------------------------------------------------------------+
                                                  │
                             ▼ check-analysis call (requires GITHUB_TOKEN)


├─ optional/commented job: Build-Rules (needs NextGen-Static-Analysis) ─►

+---------------------------------------------------------------+
| Env: SHIFTLEFT_ACCESS_TOKEN & SHIFTLEFT_API_HOST / GRPC hosts |
+---------------------------------------------------------------+
                               │
               ▼ provides credentials & API hosts


+----------------------------------------------------------------------------------+
| shiftleft.yml (build rules: no critical, 1 OSS/container, no reachable OSS vuln) |
+----------------------------------------------------------------------------------+
                                         │
                           ▼ build rules applied/evaluated

@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: 88fce8ab-f927-4578-9838-7f8124cb8d5b

📥 Commits

Reviewing files that changed from the base of the PR and between 8c2afea and 4b42fd2.

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

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.

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

@codeant-ai codeant-ai Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Jul 26, 2026
@what-the-diff

what-the-diff Bot commented Jul 26, 2026

Copy link
Copy Markdown

PR Summary

  • Implementation of new GitHub Actions workflow
    We've included a new workflow within the GitHub Actions, which reveals itself in a new file called shiftleft.yml. This file will manage the integration of Harness' Static Application Security Testing (SAST) and Software Composition Analysis (SCA). This integration triggers when there's a pull request or a manual workflow. It also sets up Java JDK v11, handles the download of Harness SAST and SCA CLI, and performs static analysis with specified environment variables.

  • Introduction of new configuration file for managing potential security threats
    A new shiftleft.yml configuration file has been added to govern how we manage potential security risks. This new file asserts specific rules for handling critical findings, open-source software vulnerabilities, and container findings. It allows no critical findings, sets a threshold to permit a single open-source software or container finding, and ensures no reachable open-source software vulnerabilities.

@deepsource-io

deepsource-io Bot commented Jul 26, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 8c2afea...4b42fd2 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
Ansible Jul 26, 2026 7:23a.m. Review ↗
C# Jul 26, 2026 7:23a.m. Review ↗
C & C++ Jul 26, 2026 7:23a.m. Review ↗
Ruby Jul 26, 2026 7:23a.m. Review ↗
JavaScript Jul 26, 2026 7:23a.m. Review ↗
Rust Jul 26, 2026 7:23a.m. Review ↗
Python Jul 26, 2026 7:23a.m. Review ↗
Terraform Jul 26, 2026 7:23a.m. Review ↗
Shell Jul 26, 2026 7:23a.m. Review ↗
Scala Jul 26, 2026 7:23a.m. Review ↗
Swift Jul 26, 2026 7:23a.m. Review ↗
Secrets Jul 26, 2026 7:23a.m. Review ↗
SQL Jul 26, 2026 7:23a.m. Review ↗
Code coverage Jul 26, 2026 7:54a.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.

@mergify

mergify Bot commented Jul 26, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@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 Center \
--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]

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

@difflens

difflens Bot commented Jul 26, 2026

Copy link
Copy Markdown

View changes in DiffLens

@netlify

netlify Bot commented Jul 26, 2026

Copy link
Copy Markdown

Deploy Preview for lcenter ready!

Name Link
🔨 Latest commit 4b42fd2
🔍 Latest deploy log https://app.netlify.com/projects/lcenter/deploys/6a65b5eead370f0008b5ce7f
😎 Deploy Preview https://deploy-preview-21--lcenter.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.

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 Center \
--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 Center \
# --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
#
@difflens

difflens Bot commented Jul 26, 2026

Copy link
Copy Markdown

View changes in DiffLens

${GITHUB_WORKSPACE}/sl --version
${GITHUB_WORKSPACE}/sl analyze --strict --wait \
--app Center \
--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 on workflow_dispatch triggers, resulting in an empty branch tag (--tag branch=) for the ShiftLeft analysis.
Severity: MEDIUM

Suggested Fix

Provide a fallback value for the branch tag when github.head_ref is empty. For example, you can use github.ref_name, which is available on workflow_dispatch events. The expression could be branch=${{ github.head_ref || github.ref_name }}.

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 GitHub Actions workflow is triggered manually via
`workflow_dispatch`, the `github.head_ref` context variable is an empty string. This
causes the command on line 30 to pass an empty value to the `--tag branch=` argument.
This will either cause the workflow to fail due to the `--strict` flag, or it will
upload the analysis with an empty branch tag, making it difficult to identify and track
in the ShiftLeft dashboard.

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

@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
center 4b42fd2 Jul 26 2026, 07:26 AM

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

5 issues found across 2 files

Confidence score: 2/5

  • In .github/workflows/shiftleft.yml, interpolating ${{ github.head_ref }} directly inside a run script creates a command-injection path via crafted branch names, which could execute unintended commands in CI — pass the ref through a safely quoted env var or avoid shell interpolation entirely.
  • In .github/workflows/shiftleft.yml, the missing top-level permissions block means GITHUB_TOKEN may get broader write scopes than needed, increasing blast radius if any step is compromised — declare least-privilege permissions explicitly at workflow/job scope.
  • In .github/workflows/shiftleft.yml, github.head_ref is empty on workflow_dispatch, so --tag branch= may be blank and produce incorrect tagging/metadata behavior in manual runs — add an event-aware fallback (for example github.ref_name) before building the tag argument.
  • In .github/workflows/shiftleft.yml, using actions/checkout@v3 and actions/setup-java@v3 keeps this workflow on deprecated Node 16 and out of sync with other workflows, which risks warnings and future runner breakage — 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">
P2: This workflow does not declare a `permissions` block, so the `GITHUB_TOKEN` receives the repository's default permissions (often broad write access). Add a top-level `permissions` block to follow the principle of least privilege. A minimal starting point for this workflow would be:

```yaml
permissions:
  contents: read
```</violation>

<violation number="2" location=".github/workflows/shiftleft.yml:14">
P2: actions/checkout@v3 is inconsistent with the rest of the repo — all other workflows use @v4. The v3 tag runs on Node 16 (deprecated by GitHub Actions) and will produce deprecation warnings. Upgrade to actions/checkout@v4 for consistency and to avoid runtime warnings.</violation>

<violation number="3" location=".github/workflows/shiftleft.yml:16">
P2: actions/setup-java@v3 runs on Node 16 which is deprecated by GitHub Actions. Upgrade to @v4 to use Node 20 and avoid deprecation warnings. The distribution and java-version parameters remain the same.</violation>

<violation number="4" location=".github/workflows/shiftleft.yml:30">
P1: Using `${{ github.head_ref }}` directly in a `run` block is a script injection risk. An attacker can craft a branch name containing shell metacharacters (e.g., `'; malicious-command #`) that will be interpolated into the script before execution. Pass it through an environment variable instead:

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

<violation number="5" location=".github/workflows/shiftleft.yml:30">
P2: `github.head_ref` is only populated for `pull_request` and `pull_request_target` events. Since this workflow also triggers on `workflow_dispatch`, the `--tag branch=` argument will receive an empty string, which may cause the `--strict` flag to fail or produce an untagged analysis. Use a fallback like `${{ github.head_ref || github.ref_name }}` to handle non-PR triggers.</violation>
</file>

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

Re-trigger cubic

${GITHUB_WORKSPACE}/sl --version
${GITHUB_WORKSPACE}/sl analyze --strict --wait \
--app Center \
--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 block is a script injection risk. An attacker can craft a branch name containing shell metacharacters (e.g., '; malicious-command #) that will be interpolated into the script before execution. Pass it through an environment variable instead:

env:
  BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
  ... --tag branch=${BRANCH_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>Using `${{ github.head_ref }}` directly in a `run` block is a script injection risk. An attacker can craft a branch name containing shell metacharacters (e.g., `'; malicious-command #`) that will be interpolated into the script before execution. Pass it through an environment variable instead:

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

<file context>
@@ -0,0 +1,62 @@
+        ${GITHUB_WORKSPACE}/sl --version
+        ${GITHUB_WORKSPACE}/sl analyze --strict --wait \
+          --app Center \
+          --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 Node 16 which is deprecated by GitHub Actions. Upgrade to @v4 to use Node 20 and avoid deprecation warnings. The distribution and java-version parameters remain the same.

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 Node 16 which is deprecated by GitHub Actions. Upgrade to @v4 to use Node 20 and avoid deprecation warnings. The distribution and java-version parameters remain the same.</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 is inconsistent with the rest of the repo — all other workflows use @v4. The v3 tag runs on Node 16 (deprecated by GitHub Actions) and will produce deprecation warnings. Upgrade to actions/checkout@v4 for consistency and to avoid runtime 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 14:

<comment>actions/checkout@v3 is inconsistent with the rest of the repo — all other workflows use @v4. The v3 tag runs on Node 16 (deprecated by GitHub Actions) and will produce deprecation warnings. Upgrade to actions/checkout@v4 for consistency and to avoid runtime warnings.</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

@@ -0,0 +1,62 @@
---

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 declare a permissions block, so the GITHUB_TOKEN receives the repository's default permissions (often broad write access). Add a top-level permissions block to follow the principle of least privilege. A minimal starting point for this workflow 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 6:

<comment>This workflow does not declare a `permissions` block, so the `GITHUB_TOKEN` receives the repository's default permissions (often broad write access). Add a top-level `permissions` block to follow the principle of least privilege. A minimal starting point for this workflow would be:

```yaml
permissions:
  contents: read
```</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 Center \
--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: github.head_ref is only populated for pull_request and pull_request_target events. Since this workflow also triggers on workflow_dispatch, the --tag branch= argument will receive an empty string, which may cause the --strict flag to fail or produce an untagged analysis. Use a fallback like ${{ github.head_ref || github.ref_name }} to handle non-PR triggers.

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>`github.head_ref` is only populated for `pull_request` and `pull_request_target` events. Since this workflow also triggers on `workflow_dispatch`, the `--tag branch=` argument will receive an empty string, which may cause the `--strict` flag to fail or produce an untagged analysis. Use a fallback like `${{ github.head_ref || github.ref_name }}` to handle non-PR triggers.</comment>

<file context>
@@ -0,0 +1,62 @@
+        ${GITHUB_WORKSPACE}/sl --version
+        ${GITHUB_WORKSPACE}/sl analyze --strict --wait \
+          --app Center \
+          --tag branch=${{ github.head_ref }} \
+          --jssrc .
+      env:
</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: No integrity verification for downloaded SAST CLI binary.

Review details and evidence
Priority File Finding Evidence
P2 .github/workflows/shiftleft.yml No integrity verification for downloaded SAST CLI binary confirmed

Finding details

P2 · No integrity verification for downloaded SAST CLI binary

.github/workflows/shiftleft.yml

The sl binary is downloaded from a remote CDN over HTTPS and immediately executed without any integrity check (no pinned version, checksum, or signature verification). Later steps run the binary with SHIFTLEFT_ACCESS_TOKEN in the environment. A compromise of the CDN or a man-in-the-middle attack could substitute a malicious binary that exfiltrates secrets or tampers with the build. This is a supply-chain hardening gap; the attack requires CDN compromise, which is credible but not trivial.

Verification boundary: confirmed; scope: changed region.

Conceptual guidance (not a committable GitHub suggestion):

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

LlamaPReview checks

  • Read the complete PR-head file .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

size/M size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants