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.

A dated record for NIS2 in the Netherlands

NIS2 Article 21 includes vulnerability handling in development and maintenance. A pipeline that fails on known-exploited and high-severity issues, with every finding dated in the portal, shows that handling as part of how you ship.

The parts of CyberSpec that do this

For teams in Netherlands

In the Netherlands, the security duties buyers ask about are GDPR Article 32 and NIS2 Article 21, which includes vulnerability handling. CyberSpec gives dated external-scan evidence for both and maps findings to ISO 27001. A personal data breach goes to the Autoriteit Persoonsgegevens within 72 hours where feasible, unless it is unlikely to put people at risk (Article 33). The national cyber agency is NCSC-NL.

CyberSpec is €17 per client a month for up to 5 assets, a €119 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