yhlsec
v1.0.1
Published
CLI security checker for directories/files/zips
Readme
yhlsec
CLI security checker for directories / single files / zip archives.
Requirements
- Node.js >= 18
Install
npm i -g yhlsecThis provides the yhlsec command.
Quick start
Scan current directory:
yhlsecScan a directory and write JSON report:
yhlsec ./dist --output report.jsonWrite HTML report:
yhlsec ./dist --output report.htmlScan a zip archive:
yhlsec ./archive.zip --output report.jsonScan a single file:
yhlsec ./src/app.jsOutput formats
- Stdout (when
--outputis omitted):--format text|json(default:text) - File output (when
--outputis set):.html/.htm-> HTML.json-> JSON- other extensions -> JSON
CI / exit codes
- Exit code
0: scan completed and did not meet the fail threshold - Exit code
2: max severity met/exceeded the threshold
Examples:
yhlsec ./src --ci-fail-on-high
yhlsec ./src --fail-on mediumConfiguration
Config file names:
.yhlsec.jsonyhlsec.config.json
Resolution order:
--config <path>if provided- search upwards from the target directory
- search upwards from current working directory
Generate a full example config:
yhlsec init-configWrite to a custom path:
yhlsec init-config -w yhlsec.config.jsonWhat it checks
- Built-in rules (glob / regex / string / meta)
- External engines (configurable):
@ziul285/gitleaks(secret scanning)npm audit(dependency vulnerabilities)- OSV API (dependency vulnerabilities)
retire(vulnerable JS libraries)
- Risk package denylist (from lockfiles)
- Zip Slip risk (unsafe zip entry paths)
