-
Notifications
You must be signed in to change notification settings - Fork 26
Vulnerability Scanner V2.0 Development #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ChaohuiLi0321
wants to merge
45
commits into
Gopher-Industries:master
Choose a base branch
from
ChaohuiLi0321:Vulnerability_Scanner_V2.0_Development
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Vulnerability Scanner V2.0 Development #133
ChaohuiLi0321
wants to merge
45
commits into
Gopher-Industries:master
from
ChaohuiLi0321:Vulnerability_Scanner_V2.0_Development
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…and implement the plugin base class system.
…dular security scanner main program.
…ture is built correctly.
…ctionality of the security scanning tool named Vulnerability_Tool_V2.
…ttp://localhost:8001/scanner/docs. Run the following command: python -m uvicorn api.scanner_api:app --host 0.0.0.0 --port 8001 --reload
…ent with the report generated by scanning in Swagger UI.
…tput security_report.html --verbose" to generate a debugged report
…te reports in the updated debug format (use the command "python -m uvicorn api.scanner_api:app --host 0.0.0.0 --port 8001 --reload" to start the SwaggerUI integration of NutriHelp Security Scanner V2.0)
…lhost/api-docs, and test the GET and POST methods in the API interface separately.
…grate them into the API interface scanning function in Swagger UI.
- Introduced a comprehensive set of security rules in `rules_v1.yaml` to detect vulnerabilities such as SQL injection, XSS, hardcoded credentials, and insecure file handling across JavaScript, Python, and text files. - Implemented tests for the new rules in `test_general_security_legacy_rules.py`, ensuring detection of hardcoded API keys and permissive CORS configurations. - Enhanced the testing framework with new test cases for excluding paths in `test_exclude_paths.py` and verifying JSON output fields in `test_output_json_fields.py`. - Added a script `rename_reports_security_to_vulnerability.py` for batch renaming legacy security report files to a new naming convention. - Improved the debug rules toggle functionality and HTML report generation in `test_debug_rules_and_html.py`.
…lp-api into Vulnerability_Scanner_V2.0_Development
…nner_V2.0_Development
…cumentation generation
…canner.js to use new report paths
…nner_V2.0_Development
- Introduced a GitHub Actions workflow for manual vulnerability scanning and optional unit tests. - Updated README to include instructions on running the new workflow and details about inputs and artifacts. - Enhanced the vulnerability scanner to include sensible default global excludes to reduce noise during scans. - Implemented a CI helper script to check for critical findings in the vulnerability report and fail the job if any are found.
…nner_V2.0_Development
…nner_V2.0_Development
- Added `hasInstallScript` to package-lock.json for npm install script support. - Updated package.json with new scripts for scanner preparation and environment validation. - Improved `scanner.js` to allow for explicit Python executable overrides and enhanced progress tracking. - Introduced `bootstrap.js` for one-shot setup of Node and Python dependencies, including environment validation. - Created `ensureScannerReady.js` to check and prepare the scanner environment if necessary. - Implemented `prepareScanner.js` to manage the creation of the Python virtual environment and installation of dependencies.
merge from upstream/master
…y assessment workflow
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Integrate Vulnerability Scanner V2.0 (Automated) into NutriHelp
Summary
This PR integrates the new plugin‑based Vulnerability Scanner V2.0 under Vulnerability_Tool_V2 and exposes a set of API endpoints for starting, monitoring, and retrieving scan results (JSON / HTML).
Local developer onboarding is now automated: a postinstall bootstrap prepares (or gracefully skips) the Python scanner environment.
CI workflows were updated to align with local behavior, and the scheduled security assessment now also runs a full V2 scan.
Key Changes
Scanner Core (Vulnerability_Tool_V2)
Node Integration (scanner.js)
New endpoints under
/api/scanner:GET /api/scanner/test– simple availability checkGET /api/scanner/health– scanner presence & versionGET /api/scanner/plugins– enumerate available/enabled pluginsPOST /api/scanner/scan– start an asynchronous scan (returnsscan_id)GET /api/scanner/scan/:scanId/status– live status & progress (0–100%, message)GET /api/scanner/scan/:scanId/result– final JSON results (with severity summary & findings)GET /api/scanner/scan/:scanId/report?format=html|json– generate/download HTML (lazy) or retrieve JSONGET /api/scanner/scan/:scanId/raw– raw diagnostic / salvage output for debuggingPOST /api/scanner/quick-scan– synchronous, fast scan (salvages JSON even on non‑zero exit)Features:
PROGRESS|pct|message)Automation & Scripts
npm run setupCI Updates
node scripts/prepareScanner.js(aligned with local behavior), runs JSON + HTML V2 scanDocumentation
Resilience / Quality
.deps_hashWhy
How to Test (Current Flow)
Local:
Then (examples):
CI (GitHub Actions):
.htmlsecurity-report-v2.json/.htmlin artifactsRisk & Mitigations
Vulnerability_Tool_V2/reports+ fallback logicReviewer Focus
Follow-Up Suggestions (Not part of this PR)
npm run doctorfor single-shot environment diagnosticsRequest Reviewers: @madhavi2809