/devsecops-skills:snyk-vulnerability-and-license-scanningfrom devsecops-skills
Configures Snyk for unified scanning of dependencies, containers, and IaC (Terraform, K8s, CloudFormation) with license-compliance policy enforcement. Use for CI integration, PR checks, and .snyk policy files.
Ships in devsecops-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Snyk is a commercial scanning platform whose operational value is
consolidation under one account, one policy model, and one PR-check
surface: snyk test covers open-source dependency vulnerabilities (Snyk
Open Source), snyk container test covers OS packages and app
dependencies baked into a container image (Snyk Container), and snyk iac test covers Terraform/CloudFormation/Kubernetes misconfigurations (Snyk
IaC) — three scan types that other toolchains often split across three
separate products. Snyk also treats license compliance as a first-class
policy category, separate from vulnerability severity — a package can be
perfectly secure and still fail a Snyk gate because its license (GPL,
AGPL, or anything not on an org's allow-list) is incompatible with a
proprietary product, which is a different enforcement question than "is
this CVE exploitable." This skill covers configuring Snyk itself
(CLI/token setup, .snyk policy files, PR-check integration, license
policy) — for the vendor-neutral SCA concept (tool selection, remediation
SLA, SBOM relationship) see
software-composition-analysis-sca,
and for a different IaC-scanning tool with a narrower, misconfiguration-
only focus see
checkov-and-tfsec-iac-security-scanning.
snyk test (dependencies), snyk container test (image), and snyk iac test (Terraform/K8s/CloudFormation) for a
given target and isn't sure which applies..snyk policy file (ignore rules
with expiry, patch entries, language-specific settings).snyk monitor) versus a one-shot point-in-time check (snyk test).SNYK_TOKEN).npm install -g snyk or the standalone binary) — pin
a specific version in CI rather than floating on latest, since Snyk's
vulnerability DB and CLI both update independently of your pipeline.snyk test needs the same
lockfiles SCA tools generally need (package-lock.json, poetry.lock/
requirements.txt, go.sum, pom.xml, Gemfile.lock) to resolve
transitive dependencies accurately — a bare manifest with no lockfile
gives an incomplete result.snyk container test: either a locally built/pulled image or
registry credentials Snyk can authenticate with; Snyk needs to inspect
image layers, so a .tar from docker save also works.snyk iac test: no network target, just the IaC source tree
(Terraform, CloudFormation, Kubernetes YAML, Helm charts, ARM templates).--severity-threshold=high) and license
policy (allow-list/deny-list) agreed with legal/compliance before
wiring a hard PR-blocking gate — without one, teams either block on
everything (noise) or nothing (a gate nobody respects).Authenticate and scope the org before any scan runs in CI:
snyk auth "${SNYK_TOKEN}" # interactive/local use only
# In CI, set SNYK_TOKEN as an env var instead — never `snyk auth` inline
snyk config set org=my-org-slug
Run snyk test for open-source dependencies, choosing a severity
threshold and failing the build on it:
snyk test --severity-threshold=high --fail-on=upgradable
--fail-on=upgradable fails only on findings with an available fix,
mirroring the "don't block on unfixable CVEs" pattern from generic SCA
— track unfixable findings separately instead of blocking indefinitely.
Run snyk container test against the built image, not the
Dockerfile source, since OS-layer packages only exist once the image
is assembled:
snyk container test myorg/myapp:1.4.2 \
--severity-threshold=high \
--file=Dockerfile # optional: lets Snyk suggest a base-image upgrade
Run snyk iac test against Terraform/Kubernetes/CloudFormation
source for misconfigurations — a different finding class from
dependency CVEs, with its own severity model:
snyk iac test ./infra/terraform --severity-threshold=medium
Wire all three into CI as separate, clearly-labeled jobs so a failure is immediately traceable to which scan type caught it (GitHub Actions example):
name: snyk
on: [pull_request]
jobs:
snyk-oss:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --severity-threshold=high --fail-on=upgradable
snyk-container:
needs: snyk-oss
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: docker build -t myorg/myapp:${{ github.sha }} .
- uses: snyk/actions/docker@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
image: myorg/myapp:${{ github.sha }}
args: --severity-threshold=high
snyk-iac:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: snyk/actions/iac@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --severity-threshold=medium infra/terraform
GitLab CI equivalent (single job shown; repeat per scan type with
distinct snyk subcommands):
snyk_oss:
image: snyk/snyk:node
variables:
SNYK_TOKEN: $SNYK_TOKEN
script:
- snyk test --severity-threshold=high --fail-on=upgradable
Enforce license compliance as its own gate, separate from
vulnerability severity — Snyk evaluates license policy per-org via
the web UI ("Manage license rules") or programmatically via
.snyk policy, denying specific SPDX identifiers regardless of
whether the package has any known CVE:
# .snyk — org-level org policy still applies; this scopes project overrides
version: v1.5.0
# license rules are primarily configured in the Snyk org settings UI/API;
# a project-level .snyk file can add exceptions on top, e.g.:
exclude:
global:
- vendor/**
Enforce license failures the same way as vulnerability failures —
snyk test --severity-threshold=... does not evaluate license policy
by itself; license policy violations surface via
snyk monitor's continuous dashboard or the org-level PR check, so
confirm which enforcement path your CI actually gates on before
assuming a license violation blocks the build.
Suppress with an expiry and reason, never a bare ignore, using
.snyk's ignore block (CLI: snyk ignore --id=<SNYK-ID> --reason="..." --expiry=2026-10-15T00:00:00.000Z):
# .snyk
version: v1.5.0
ignore:
SNYK-JS-EXAMPLE-1234567:
- '*':
reason: >
No fix available upstream yet; library used only in build
tooling, not shipped to production. Tracked in JIRA-4821.
expires: 2026-10-15T00:00:00.000Z
Use snyk monitor for continuous tracking, distinct from
snyk test's point-in-time CI check — monitor snapshots the
current dependency tree to the Snyk dashboard so newly-disclosed CVEs
against already-deployed versions surface later without needing a new
commit/PR to trigger a re-scan:
snyk monitor --project-name="checkout-api@main"
snyk test (CI gate, point-in-time) and snyk monitor
(continuous, dashboard-driven) as complementary, not redundant — a
clean snyk test on merge day says nothing about a CVE disclosed
against that same dependency version next month; monitor is what
catches that.snyk/license vs.
snyk/vulnerabilities) — a license violation and a CVE require
different owners (legal/compliance vs. security) and different fixes
(swap the dependency vs. patch/upgrade it).snyk test/monitor runs
independent of code changes.--severity-threshold per scan type deliberately; a single
blanket threshold across OSS, container, and IaC scans often
over-blocks one category and under-blocks another because their
finding volumes and false-positive rates differ.snyk container test --exclude-base-image-vulns (or
equivalent base-image filtering) for cases where the base image is
genuinely out of the application team's control, and track the
excluded findings against the platform/image-maintenance team instead
of silently dropping them.Symptom: A PR is blocked by a Snyk finding that traces to a base OS package in the container image, which the application team has no direct way to patch. Fix: Bump the base image tag/digest rather than trying to patch individual OS packages by hand; see container-image-hardening for a broader minimal-base-image strategy that reduces this category of finding at the source.
Symptom: A dependency with a permissive-sounding license (e.g. MIT) still fails the Snyk license gate, confusing the team. Fix: Check the org's actual license policy configuration — Snyk license rules are matched per-SPDX-identifier against an explicit allow/deny list, and a misconfigured or overly broad deny rule (e.g. denying an entire license family instead of the specific problematic variant) can catch packages the policy didn't intend to block. Review the org-level license policy before assuming the finding itself is wrong.
Symptom: snyk test passes locally but the same commit fails in
CI, or vice versa.
Fix: Confirm the CLI version and vulnerability DB snapshot match
between environments — Snyk's DB updates continuously, so a local run
hours apart from a CI run can legitimately see a different result;
this is expected drift, not a tooling bug, and should be handled the
same way as a newly-disclosed-CVE re-scan failure.
Symptom: .snyk ignore entries accumulate for months with no
review, and the file becomes a blanket "everything is suppressed"
document nobody trusts.
Fix: Require every ignore entry to carry both reason and
expires; treat an ignore entry past its expires date the same as
an unaddressed finding, and review the .snyk file on a regular
cadence (e.g. quarterly) rather than only when someone happens to
notice it.
Symptom: Snyk and another scanner (Trivy, Grype) report different severity for the same CVE on the same dependency, and the team can't agree which gate to trust. Fix: Pick one primary source of truth for gating decisions (often the vendor/GitHub Advisory Database CVSS score, or whichever tool is designated as the org's blocking gate) and treat the other tool's score as supplementary context — running two blocking scanners with no severity-reconciliation rule produces contradictory, ignorable gates.
Scenario: A Node.js service, packaged as a Docker image and deployed via Terraform, adds all three Snyk scan types to its GitHub Actions pipeline, blocking merge on fixable HIGH+ vulnerabilities and any disallowed license, with one documented suppression.
.snyk:
version: v1.5.0
ignore:
SNYK-JS-EXAMPLELIB-7654321:
- '*':
reason: >
Fix requires a major-version upgrade with breaking API changes;
library is used only in an internal CLI tool, not exposed to
untrusted input. Tracked in JIRA-4902.
expires: 2026-10-01T00:00:00.000Z
.github/workflows/snyk.yml:
name: snyk
on: [pull_request]
jobs:
snyk-oss:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --severity-threshold=high --fail-on=upgradable
snyk-container:
needs: snyk-oss
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: docker build -t checkout-api:${{ github.sha }} .
- uses: snyk/actions/docker@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
image: checkout-api:${{ github.sha }}
args: --severity-threshold=high
snyk-iac:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: snyk/actions/iac@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --severity-threshold=medium infra/terraform
Sample blocking finding on the snyk-oss job:
✗ High severity vulnerability found in ejs
Description: Server-Side Template Injection
Info: https://security.snyk.io/vuln/SNYK-JS-EJS-EXAMPLE
Introduced through: [email protected] > [email protected]
Fixed in: 3.1.10
Remediation: npm install [email protected], commit the updated lockfile, and
re-run — the license gate and IaC gate remain green, so only the OSS
vulnerability finding needs a fix before merge.
snyk iac test scans; this skill doesn't repeat Terraform module/state guidance.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
snyk, sca, container-scanning, iac-scanning, license-compliance, devsecops
17 skills in this plugin
/checkov-and-tfsec-iac-security-scanningConfigures Checkov and tfsec to scan Terraform/CloudFormation/Kubernetes IaC source for misconfigurations — hardcoded secrets, overly permissive IAM policies, unencrypted storage, open security groups — before `terraform apply` or `aws cloudformation deploy` ever runs. Use when a user asks to "scan my Terraform for security issues," "add Checkov/tfsec to CI," "find overly permissive IAM in my IaC," "write a Checkov suppression," "compare Checkov and tfsec," or "catch misconfigured cloud resources before they're provisioned."
/complete-devsecops-pipeline-for-kubernetes-from-scratchBuilds the complete security-gate sequence for a Kubernetes-targeted DevSecOps pipeline from scratch — SAST, SCA, container image scanning, a policy-as-code (OPA/Kyverno) admission gate placed before the GitOps handoff, and a secrets model where plaintext credentials never touch the pipeline because an External Secrets Operator pulls them cluster-side instead. Use when the user asks to "build a DevSecOps pipeline for Kubernetes from scratch," "add a policy gate before our GitOps commit," "make sure secrets never touch CI for our K8s deploys," or "sequence SAST/SCA/image-scan/policy gates for a container pipeline end-to-end."
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin devsecops-skillsOther plugins' skills for the same job