Skip to content

fix: resolve SonarCloud security hotspots for clear-text protocols and npm ignore-scripts#397

Merged
marcusquinn merged 1 commit intomainfrom
fix/sonarcloud-security-hotspots
Feb 6, 2026
Merged

fix: resolve SonarCloud security hotspots for clear-text protocols and npm ignore-scripts#397
marcusquinn merged 1 commit intomainfrom
fix/sonarcloud-security-hotspots

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 6, 2026

Summary

Resolves all 9 open SonarCloud security hotspots on the main branch (new code period):

  • 8x shell:S5332 ("Make sure that using clear-text protocols is safe here.") in agent-test-helper.sh - Added NOSONAR comments documenting that HTTP is intentional for localhost-only OpenCode dev server communication (loopback, no TLS needed)
  • 1x shell:S6505 ("Omitting --ignore-scripts can lead to execution of shell scripts.") in schema-validator-helper.sh - Added --ignore-scripts flag to npm install to prevent arbitrary script execution from npm packages

Changes

agent-test-helper.sh

  • Added descriptive comment explaining localhost-only HTTP usage
  • Added # NOSONAR suppression on URL construction and each curl call to the local OpenCode server API
  • No functional changes - all HTTP calls remain to localhost:4096 (loopback only)

schema-validator-helper.sh

  • Added --ignore-scripts to npm install command for @adobe/structured-data-validator, @marbec/web-auto-extractor, and node-fetch (pure JS packages that don't require post-install scripts)
  • Removed now-unnecessary # NOSONAR comment that was insufficient to suppress the hotspot

SonarCloud Reference

https://sonarcloud.io/project/security_hotspots?id=marcusquinn_aidevops&branch=main&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true

Summary by CodeRabbit

  • Chores
    • Updated dependency installation process to skip npm lifecycle scripts during setup.

…d npm ignore-scripts

- Add NOSONAR comments to localhost-only HTTP URLs in agent-test-helper.sh
  (OpenCode dev server on localhost:4096, TLS not needed for loopback)
- Add --ignore-scripts to npm install in schema-validator-helper.sh
  (prevents arbitrary script execution from npm packages)
@gemini-code-assist
Copy link

Summary of Changes

Hello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the project's security posture by resolving all identified SonarCloud security hotspots within shell scripts. It clarifies intentional use cases for clear-text protocols in local development environments and mitigates potential risks associated with npm install by preventing unintended script execution.

Highlights

  • Clear-text Protocols Hotspots Resolved: Addressed 8 SonarCloud shell:S5332 hotspots in agent-test-helper.sh by adding NOSONAR comments, clarifying that HTTP is intentionally used for localhost-only OpenCode dev server communication.
  • NPM Ignore-Scripts Hotspot Resolved: Fixed 1 SonarCloud shell:S6505 hotspot in schema-validator-helper.sh by incorporating the --ignore-scripts flag into npm install commands to prevent arbitrary script execution.
Changelog
  • .agent/scripts/agent-test-helper.sh
    • Added a comment explaining the localhost-only nature of the OpenCode server and the intentional use of HTTP.
    • Applied # NOSONAR suppressions to the OPENCODE_URL definition and all curl commands interacting with the local OpenCode server to address shell:S5332 hotspots.
  • .agent/scripts/schema-validator-helper.sh
    • Modified the npm install command to include --ignore-scripts for @adobe/structured-data-validator, @marbec/web-auto-extractor, and node-fetch.
    • Removed a redundant # NOSONAR comment that was no longer needed after applying --ignore-scripts.
Activity
  • The pull request was initiated by marcusquinn.
  • The primary goal is to resolve 9 open SonarCloud security hotspots on the main branch.
  • The author provided a detailed breakdown of the resolved hotspots and specific file changes in the PR description.
  • A direct link to the SonarCloud reference for the project's security hotspots was included.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 6, 2026

Walkthrough

Two helper shell scripts are updated: .agent/scripts/agent-test-helper.sh receives NOSONAR comments and explanatory notes without functional changes, while .agent/scripts/schema-validator-helper.sh modifies npm install to skip lifecycle scripts via the --ignore-scripts flag.

Changes

Cohort / File(s) Summary
Annotation & Documentation
.agent/scripts/agent-test-helper.sh
Added NOSONAR markers and clarifying comments around OpenCode server references to reduce noise in static analysis while preserving all existing behavior.
Dependency Installation
.agent/scripts/schema-validator-helper.sh
Modified install_deps function to invoke npm install --ignore-scripts, preventing npm lifecycle scripts from executing during dependency installation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

Scripts polished with precision fine,
NOSONAR marks and logic clean,
npm's lifecycle steps decline,
Zero debt in DevOps machine! 🚀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly matches the PR objectives: resolving SonarCloud security hotspots by adding NOSONAR comments for clear-text protocols and adding --ignore-scripts flag to npm install.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/sonarcloud-security-hotspots

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 and usage tips.

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 24 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 6 18:37:59 UTC 2026: Code review monitoring started
Fri Feb 6 18:38:00 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 24
Fri Feb 6 18:38:00 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Fri Feb 6 18:38:02 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 24
  • VULNERABILITIES: 0

Generated on: Fri Feb 6 18:38:05 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 6, 2026

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively addresses the identified SonarCloud security hotspots. The additions of NOSONAR comments in agent-test-helper.sh are well-justified, clearly documenting that clear-text HTTP is intentional for localhost-only development server communication, which does not require TLS. Furthermore, the inclusion of --ignore-scripts in the npm install command within schema-validator-helper.sh is a significant security enhancement, preventing potential arbitrary script execution from npm packages. Overall, these changes improve the project's security posture and clarity regarding intentional design choices.

@marcusquinn marcusquinn merged commit 11f0db4 into main Feb 6, 2026
11 checks passed
@marcusquinn marcusquinn deleted the fix/sonarcloud-security-hotspots branch February 21, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant