Skip to content

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

Merged
LCSOGthb merged 2 commits into
mainfrom
shiftleft-action-config-1785050591
Aug 30, 2026
Merged

Add GitHub Action: Qwiet AI by Harness Static Analysis#107
LCSOGthb merged 2 commits into
mainfrom
shiftleft-action-config-1785050591

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 GitHub Actions workflow and configuration to run Harness SAST/SCA on pull requests with defined security build rules.

New Features:

  • Introduce a Harness SAST and SCA GitHub Actions workflow triggered on pull requests and manual dispatch.
  • Configure static analysis of the repository’s JavaScript/TypeScript code using the Harness CLI with GitHub integration.
  • Add a shiftleft.yml configuration file defining security build rules and thresholds for findings.

Summary by cubic

Add a GitHub Action to run Harness SAST and SCA on every PR, plus baseline build rules to gate risk. This adds a status check and blocks critical findings.

  • New Features
    • Adds .github/workflows/shiftleft.yml to run analysis on pull_request and workflow_dispatch.
    • Uses actions/checkout@v3 and actions/setup-java@v3 (Zulu JDK 8), downloads the sl CLI, and runs sl analyze --strict --wait for JS/TS.
    • Reads SHIFTLEFT_ACCESS_TOKEN and posts results as a PR status check.
    • Adds shiftleft.yml build rules: block critical findings; allow up to 1 OSS or container finding; block reachable OSS vulnerabilities.

Written for commit ee700b8. 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)
tools Canceled Canceled Jul 26, 2026 7:26am

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

@codesherlock-ai

Copy link
Copy Markdown

CodeSherlock.AI is currently reviewing the changes in this pull request.

Smaller PRs typically take 1–2 minutes, medium ones 3–4 minutes, and larger PRs may take up to 5–6 minutes.

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

@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

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

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

@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

codereviewbot-ai Bot commented Jul 26, 2026

Copy link
Copy Markdown

🤖 Review complete!


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

@guardrails

guardrails Bot commented Jul 26, 2026

Copy link
Copy Markdown

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

Hard-Coded Secrets (1)
Severity Details Docs
Medium Title: Secret Keyword
📚

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


Insecure Processing of Data (2)
Severity Details Docs
Medium Title: Unescaped user input in React dangerouslySetInnerHTML
📚
Medium Title: Unescaped user input in React dangerouslySetInnerHTML
📚

More info on how to fix Insecure Processing of Data in JavaScript.


👉 Go to the dashboard for detailed results.

📥 Happy? Share your feedback with us.

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 Tools \
--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 Tools \
# --github-pr-number=${{github.event.number}} \
# --github-pr-user=${{ github.repository_owner }} \
# --github-pr-repo=${{ github.event.repository.name }} \
# --github-token=${{ secrets.GITHUB_TOKEN }}
# env:
# # SHIFTLEFT_ACCESS_TOKEN: ${{ secrets.SHIFTLEFT_ACCESS_TOKEN }}
#
# SHIFTLEFT_API_HOST: www.shiftleft.io
# SHIFTLEFT_GRPC_TELEMETRY_HOST: telemetry.shiftleft.io:443
# SHIFTLEFT_GRPC_API_HOST: api.shiftleft.io:443
#
@what-the-diff

what-the-diff Bot commented Jul 26, 2026

Copy link
Copy Markdown

PR Summary

  • Introduction of GitHub Actions Workflow
    A new course of action, specifically known as a "workflow," has been added. This provides an integration of Harness Security Testing tools with the GitHub platform, improving the level of security checks that our software undergoes. This new process triggers automatically whenever updates are made or manually upon request.
    The steps it goes through include inspecting the code, setting up critical tools like Java JDK v8, acquiring the Harness CLI, and performing a thorough static analysis.

  • Inception of ShiftLeft Configuration File
    A new rule book or "configuration file" has been created, named shiftleft.yml, enhancing our command over vulnerability management. Inside this file, we've outlined specific rules that limit the level and number of potential problems that are acceptable in our code. Additionally, it grants us freedom to permit certain severities and types of problematic findings. This helps us to further refine our risk management strategy, enhancing the overall security profile of our software.

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

@deepsource-io

deepsource-io Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

DeepSource Code Review

We reviewed changes in 90cc400...ee700b8 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
Scala Jul 26, 2026 7:23a.m. Review ↗
Swift Jul 26, 2026 7:23a.m. Review ↗
JavaScript Jul 26, 2026 7:23a.m. Review ↗
Ruby Jul 26, 2026 7:23a.m. Review ↗
C & C++ Jul 26, 2026 7:23a.m. Review ↗
C# Jul 26, 2026 7:23a.m. Review ↗
Rust Jul 26, 2026 7:23a.m. Review ↗
Shell Jul 26, 2026 7:23a.m. Review ↗
Terraform Jul 26, 2026 7:23a.m. Review ↗
Code coverage Jul 26, 2026 7:53a.m. Review ↗
SQL Jul 26, 2026 7:23a.m. Review ↗
Secrets 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.

@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

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

@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: 58 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: 664f226e-263c-45c2-bdc1-e85cbfcd008f

📥 Commits

Reviewing files that changed from the base of the PR and between 90cc400 and ee700b8.

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

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.

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

@cloudflare-workers-and-pages

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

Copy link
Copy Markdown
Contributor

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
tools ee700b8 Jul 26 2026, 07:25 AM

@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

@difflens

difflens Bot commented Jul 26, 2026

Copy link
Copy Markdown

View changes in DiffLens

@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 Tools \
--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 used for tagging, but it's empty on workflow_dispatch triggers, which will cause the sl analyze step to fail.
Severity: MEDIUM

Suggested Fix

Use a variable that is available for all trigger types, or provide a fallback. For example, you can use github.ref_name as it is populated for both pull_request and workflow_dispatch triggers. A robust expression would be ${{ 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: The workflow uses `github.head_ref` to tag the analysis branch. This
variable is only populated during `pull_request` events. Since the workflow can also be
triggered manually via `workflow_dispatch`, `github.head_ref` will be an empty string in
that context. This will cause the `sl analyze` command to be run with an empty branch
tag (`--tag branch=`), which will cause the step to fail because `--strict` mode is
enabled.

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

Comment on lines +50 to +60
# --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
#

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, which disables all security policy enforcement, allowing PRs with critical vulnerabilities to be merged.
Severity: CRITICAL

Suggested Fix

Uncomment the Build-Rules job (lines 38-60) to re-enable the security policy checks. Additionally, ensure the SHIFTLEFT_ACCESS_TOKEN secret is correctly configured and uncommented within the job's environment variables.

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-L60

Potential issue: The `Build-Rules` job, which is responsible for enforcing security
policies by running `sl check-analysis`, is completely commented out. This means that
security rules defined in the `shiftleft.yml` file, such as blocking critical findings
or reachable OSS vulnerabilities, are never evaluated. As a result, pull requests
containing critical security vulnerabilities will pass CI checks, defeating the purpose
of the security scan.

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

@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 combination of interpolating ${{ github.head_ref }} in a run: script and executing an unverified remote binary before/around token use creates the highest-risk path: attacker-controlled command execution and possible SHIFTLEFT_ACCESS_TOKEN theft — sanitize/quote branch input, pin a specific artifact, and verify checksum/signature before execution.
  • In .github/workflows/shiftleft.yml, third-party actions are referenced by mutable tags and no explicit permissions block is set, so workflow behavior can change unexpectedly and a compromised step may get broader GITHUB_TOKEN access than needed — pin actions to full commit SHAs and set least-privilege permissions explicitly.
  • In .github/workflows/shiftleft.yml, github.head_ref is empty for workflow_dispatch and fork PRs run with empty auth, which can produce empty tagging and failing required scans for external contributors — use event-aware branch variables and gate/authenticate scan steps for forked PRs.
  • In .github/workflows/shiftleft.yml, the commented-out Build-Rules job means policy enforcement is effectively disabled, and actions/setup-java@v3 adds compatibility risk as runner runtimes evolve — re-enable policy checks and upgrade to actions/setup-java@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:11">
P2: The workflow does not define a `permissions` block, so the `GITHUB_TOKEN` will inherit the repository's default permissions, which are often overly broad. Adding an explicit permissions block scoped to only what's needed (e.g., `contents: read`) follows the principle of least privilege and reduces blast radius if the workflow is compromised.</violation>

<violation number="2" location=".github/workflows/shiftleft.yml:14">
P1: The workflow executes mutable action tags in a job that handles the SAST access token. Pin both third-party action references to full commit SHAs (with version comments) to make reviewed workflow execution reproducible.</violation>

<violation number="3" location=".github/workflows/shiftleft.yml:16">
P2: `actions/setup-java@v3` uses a deprecated Node.js runtime version on GitHub-hosted runners. Update to `actions/setup-java@v4` to ensure continued compatibility.</violation>

<violation number="4" location=".github/workflows/shiftleft.yml:23">
P1: This step executes an unpinned, unverified remote binary with `SHIFTLEFT_ACCESS_TOKEN` available to the next step. Pin a release artifact and verify its published checksum/signature before making it executable.</violation>

<violation number="5" location=".github/workflows/shiftleft.yml:30">
P1: When this workflow is triggered manually via `workflow_dispatch`, the branch tag will be empty because `github.head_ref` is only available for `pull_request` events. This means `--tag branch=` will be passed with no value, which can produce untagged/mislabeled analysis results in the Harness platform. Consider using `${{ github.head_ref || github.ref_name }}` or splitting the tag assignment into a conditional step to handle both trigger types correctly.</violation>

<violation number="6" location=".github/workflows/shiftleft.yml:30">
P1: Using `${{ github.head_ref }}` directly in a `run:` step is a script injection vulnerability. An attacker can craft a branch name containing shell metacharacters or injected commands (e.g., `'; malicious-command #`) which will be interpolated directly into the shell script before execution.

Pass the value through an environment variable instead:
```yaml
env:
  BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
  ... --tag branch=${BRANCH_NAME} ...
```</violation>

<violation number="7" location=".github/workflows/shiftleft.yml:33">
P2: Fork-originated PRs run `sl analyze` with an empty access token, so this required scan/status check will fail for external contributors. Gate this authenticated step for non-fork PRs, or configure a supported unauthenticated fork-scanning path.</violation>

<violation number="8" location=".github/workflows/shiftleft.yml:38">
P2: The `Build-Rules` job is entirely commented out, which means the security policies defined in `shiftleft.yml` (blocking critical findings, reachable OSS vulnerabilities) will never be enforced. PRs with critical vulnerabilities can pass CI without any security gate. If this is intentional for initial setup, consider adding a TODO or timeline for enabling it.</violation>
</file>

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

Re-trigger cubic

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.

P1: The workflow executes mutable action tags in a job that handles the SAST access token. Pin both third-party action references to full commit SHAs (with version comments) to make reviewed workflow execution reproducible.

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

<comment>The workflow executes mutable action tags in a job that handles the SAST access token. Pin both third-party action references to full commit SHAs (with version comments) to make reviewed workflow execution reproducible.</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>


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

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 step executes an unpinned, unverified remote binary with SHIFTLEFT_ACCESS_TOKEN available to the next step. Pin a release artifact and verify its published checksum/signature before making it executable.

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

<comment>This step executes an unpinned, unverified remote binary with `SHIFTLEFT_ACCESS_TOKEN` available to the next step. Pin a release artifact and verify its published checksum/signature before making it executable.</comment>

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

${GITHUB_WORKSPACE}/sl --version
${GITHUB_WORKSPACE}/sl analyze --strict --wait \
--app Tools \
--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: When this workflow is triggered manually via workflow_dispatch, the branch tag will be empty because github.head_ref is only available for pull_request events. This means --tag branch= will be passed with no value, which can produce untagged/mislabeled analysis results in the Harness platform. Consider using ${{ github.head_ref || github.ref_name }} or splitting the tag assignment into a conditional step to handle both trigger types correctly.

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 manually via `workflow_dispatch`, the branch tag will be empty because `github.head_ref` is only available for `pull_request` events. This means `--tag branch=` will be passed with no value, which can produce untagged/mislabeled analysis results in the Harness platform. Consider using `${{ github.head_ref || github.ref_name }}` or splitting the tag assignment into a conditional step to handle both trigger types correctly.</comment>

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

${GITHUB_WORKSPACE}/sl --version
${GITHUB_WORKSPACE}/sl analyze --strict --wait \
--app Tools \
--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: step is a script injection vulnerability. An attacker can craft a branch name containing shell metacharacters or injected commands (e.g., '; malicious-command #) which will be interpolated directly into the shell script before execution.

Pass the value through an environment variable instead:

env:
  BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
  ... --tag branch=${BRANCH_NAME} ...
Prompt for AI agents
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:` step is a script injection vulnerability. An attacker can craft a branch name containing shell metacharacters or injected commands (e.g., `'; malicious-command #`) which will be interpolated directly into the shell script before execution.

Pass the value 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 Tools \
+          --tag branch=${{ github.head_ref }} \
+          --js $(pwd) -- --ts
+      env:
</file context>

--tag branch=${{ github.head_ref }} \
--js $(pwd) -- --ts
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: Fork-originated PRs run sl analyze with an empty access token, so this required scan/status check will fail for external contributors. Gate this authenticated step for non-fork PRs, or configure a supported unauthenticated fork-scanning path.

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

<comment>Fork-originated PRs run `sl analyze` with an empty access token, so this required scan/status check will fail for external contributors. Gate this authenticated step for non-fork PRs, or configure a supported unauthenticated fork-scanning path.</comment>

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

P2: actions/setup-java@v3 uses a deprecated Node.js runtime version on GitHub-hosted runners. Update to actions/setup-java@v4 to ensure continued compatibility.

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` uses a deprecated Node.js runtime version on GitHub-hosted runners. Update to `actions/setup-java@v4` to ensure continued compatibility.</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@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, which means the security policies defined in shiftleft.yml (blocking critical findings, reachable OSS vulnerabilities) will never be enforced. PRs with critical vulnerabilities can pass CI without any security gate. If this is intentional for initial setup, consider adding a TODO or timeline for enabling it.

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, which means the security policies defined in `shiftleft.yml` (blocking critical findings, reachable OSS vulnerabilities) will never be enforced. PRs with critical vulnerabilities can pass CI without any security gate. If this is intentional for initial setup, consider adding a TODO or timeline for enabling it.</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>

workflow_dispatch:

jobs:
NextGen-Static-Analysis:

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 a permissions block, so the GITHUB_TOKEN will inherit the repository's default permissions, which are often overly broad. Adding an explicit permissions block scoped to only what's needed (e.g., contents: read) follows the principle of least privilege and reduces blast radius if the workflow is compromised.

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

<comment>The workflow does not define a `permissions` block, so the `GITHUB_TOKEN` will inherit the repository's default permissions, which are often overly broad. Adding an explicit permissions block scoped to only what's needed (e.g., `contents: read`) follows the principle of least privilege and reduces blast radius if the workflow is compromised.</comment>

<file context>
@@ -0,0 +1,62 @@
+  workflow_dispatch:
+
+jobs:
+  NextGen-Static-Analysis:
+    runs-on: ubuntu-latest
+    steps:
</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: Workflow pins deprecated action versions targeting end-of-life Node.js 20 runtime.

Review details and evidence
Priority File Finding Evidence
P2 .github/workflows/shiftleft.yml Workflow pins deprecated action versions targeting end-of-life Node.js 20 runtime confirmed

Finding details

P2 · Workflow pins deprecated action versions targeting end-of-life Node.js 20 runtime

.github/workflows/shiftleft.yml

actions/checkout@v3 and actions/setup-java@v3 target the deprecated Node.js 20 runner. GitHub currently force-runs them on Node.js 24 with warnings, but eventual removal of Node.js 20 support will cause hard CI failures that mask real analysis results. The CI annotation on the NextGen-Static-Analysis check confirms the deprecation is already triggering.

Verification boundary: confirmed; scope: changed region.

Conceptual guidance (not a committable GitHub suggestion):

Update `actions/checkout` to v4 and `actions/setup-java` to v4 (or the latest supported major version).

Material unknowns

  • The repository's default GITHUB_TOKEN permissions may already be restricted to read-only, in which case the omitted explicit permissions block does not grant excessive access.
    • Check: Check the repository's Actions settings under Settings > Actions > General > Workflow permissions, or inspect the GITHUB_TOKEN permissions in a recent workflow run log.

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

@LCSOGthb
LCSOGthb merged commit fba59ed into main Aug 30, 2026
86 of 154 checks passed
@LCSOGthb
LCSOGthb deleted the shiftleft-action-config-1785050591 branch August 30, 2026 16:25
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