Security checks in CI/CD

Fail a build on vulnerable dependencies or known-exploited findings, using the npm package and its CLI.

  • npx @cyberspec/sdk deps --yes --fail-on high in any pipeline (SDK 0.2.0 or later)
  • Start a scan of a verified asset from code and wait for it to finish
  • Read findings in fix order and set the exit code yourself
  • Typed Node.js client, no runtime dependencies, Node 20 or later
  • API keys created in the portal and revocable at once
CyberSpec dashboard: risk score, open findings by severity, a seven-day trend and recent scans
The CyberSpec portal.

The @cyberspec/sdk package puts the same API the portal uses into your own tooling. In CI, the dependency CLI checks your lockfiles and fails the build at the severity you choose. After a deploy, a script can start a full scan of a verified asset, wait for it, and fail if anything known-exploited or critical turns up.

Step 1: fail the build on vulnerable dependencies

Add one step to the pipeline. --yes skips the confirmation prompt and --fail-on high exits non-zero on high or critical findings. The CLI ships in @cyberspec/sdk 0.2.0 and later.

npx @cyberspec/sdk deps --yes --fail-on high

Step 2: scan after the deploy

After a deploy, start a full scan of the verified asset, wait for it, and fail on anything known-exploited or critical.

import { CyberSpec } from '@cyberspec/sdk';

const cs = new CyberSpec({ apiKey: process.env.CYBERSPEC_API_KEY });
const scan = await cs.scans.create({ assetIds: ['<asset id>'], type: 'full' });
const done = await cs.scans.wait(scan._id);
if (done.status !== 'completed') throw new Error(`Scan ${done.status}: ${done.error}`);

for await (const f of cs.findings.all({ scanId: done._id, status: 'open' })) {
  if (f.kev || f.severity === 'critical') {
    console.error(`${f.cve ?? f.checkKey} on ${f.hostPort}: ${f.remediation}`);
    process.exitCode = 1;
  }
}

What the SDK can and cannot do

Through the SDK you can list assets, run and cancel scans, read and triage findings, ask for explanations and create reports. You cannot add a network asset: that needs ownership verification and a person’s consent to scan, so it happens in the portal. A codebase is the exception, because uploading its own lockfiles is the proof.

Keys and limits

An API key carries the role of the person who created it and is shown once. Keep it in your CI secret store. AI explanations and triage count against your organisation’s daily AI limit; a 429 tells you it has been reached and resets at 00:00 UTC.

The parts of CyberSpec that do this

For teams in United States

US buyers mostly meet security questions through SOC 2, ISO 27001 or PCI DSS. CyberSpec maps every open CVE finding to the controls in all three, from live scans, so the evidence is current when an auditor or a customer asks.

CyberSpec is $19 per client a month for up to 5 assets, a $129 one-off report, or free for one asset.

See your own exposure in minutes

Free for one asset, no card. Add a domain, prove you own it, and run your first scan.

More in Solutions