Command-based checks: scan, fix, verify, report
In this lesson you will run the skill's checks from a terminal with cehpoint-soc, read its exit codes, and use scan as a simple gate before a release.
The same engine, from a terminal
The skill package installs a terminal command, cehpoint-soc, with the same functions as the MCP tools. It is useful when your assistant cannot show confirmation forms, when you prefer the terminal, or when you want a check inside a script.
cehpoint-soc scan . # check this project
cehpoint-soc fix . # plan fixes and apply each one you confirm
cehpoint-soc verify . # check again after changes
cehpoint-soc report . --open # write the private HTML report and open it
Each command takes a directory (. is the current one). Add --json for machine-readable output.
scan
scan reads the project's lock files locally and checks the package names and versions against the online vulnerability lookup. It also looks for files that look like leaked secrets, locally, reporting only paths and counts. The supported lock files are listed in the next module.
fix
fix first builds a plan of the changes it would make. For each change you type yes in the terminal. A change is applied only if the file has not changed since the plan was made; if you or someone else edited it in between, the skill refuses and you plan again. No flag or piped input can answer for you, so yes | cehpoint-soc fix . does not work, by design.
verify and report
verify checks the project again after your changes, so you can see that the finding has gone. report writes a private HTML report of the project check that you can keep or share with your team; --open opens it.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Nothing found |
| 1 | Error (for example no network, or no supported lock file) |
| 2 | Findings present |
Because "findings present" has its own code, scan makes a simple gate:
cehpoint-soc scan . --json > cehpoint-scan.json
status=$?
if [ "$status" -eq 2 ]; then echo "Vulnerable libraries found: see cehpoint-scan.json"; exit 1; fi
if [ "$status" -eq 1 ]; then echo "Check failed to run"; exit 1; fi
Treat code 1 as a failure of the check, not as a pass. A gate that lets a release through when the check could not run is not a gate.
Other commands you will meet
The command also covers the account: status, devices, alerts, explain <id>, incident <id>, action <alert_id> <action>, check <device_id>, software <device_id>, connect [server|windows|mac], protect, block <ip> [days], unblock <ip>, intel, update [--check] and help. Actions and blocks still ask you to confirm.
Where results go
Results of a skill check are kept with your account for that device and project, so they appear in the console beside the agents' findings. Only the findings are kept (names, versions, fixed versions, severity, CVEs), never the lock-file text.
Hands-on lab
Environment: Your own computer with the skill installed (or follow along on paper)
- In a project with a lock file, run
cehpoint-soc scan .and thenecho $?(orecho $LASTEXITCODEin PowerShell). Note the exit code. - Run
cehpoint-soc scan . --jsonand find the list of findings. - Run
cehpoint-soc fix .. When it asks, answer anything other thanyesfor the first change, and confirm the file is unchanged. - Run
cehpoint-soc report . --openand read the report. - Write the three lines your build script would need to stop a release on exit code 2 and on exit code 1.
Summary
scan,fix,verify,report: the same flow as the skill, from a terminal.fixneeds a typedyesfor each change and refuses if the file changed since the plan.- Exit codes: 0 nothing found, 1 error, 2 findings present.
- Fail the gate on 2 and on 1.
Sources
- The Cehpoint skill: https://www.cehpoint.co.uk/docs/soc/skill