Prerequisites
To follow the steps in this tutorial, you need to:- Setup Snyk on your machine.
- Install Helm if you want to try Snyk IaC attestations, otherwise skip.
- Install Docker if you want to try Snyk container attestations, otherwise skip.
- Create a Kosli account (Skip if you already have one).
- Install Kosli CLI.
- Get a Kosli API token.
Setup
Set theKOSLI_ORG environment variable to your personal org name and KOSLI_API_TOKEN to your token:
Create a Flow and Trail
We will start by creating a flow in Kosli to contain trails and artifacts for this tutorial:flow snyk-demo was created.
Then start a trail to bind our Snyk attestations to:
trail 'test-1' was begun.
Attest Snyk scans
We can now run Snyk scans and attest them to the trail. After each attestation, you can verify the result by navigating to https://app.kosli.com/`your-personal-org-name`/flows/snyk-demo/trails/test-1 in the Kosli app.Open Source scan
Snyk Open Source finds vulnerabilities in the open-source libraries used by your application:snyk attestation 'open-source-scan' is reported to trail: test-1.
Code scan
Snyk Code scans your source code for security issues:snyk attestation 'code-scan' is reported to trail: test-1.
Container scan
Snyk Container scans container images for security issues:snyk attestation 'container-scan' is reported to trail: test-1.
IaC scan
Snyk IaC scans IaC configuration files (Terraform, Kubernetes, Helm) for security issues:snyk attestation 'helm-scan' is reported to trail: test-1.
What you’ve accomplished
You have run four types of Snyk scans and attested each result to a Kosli trail. The trail now holds a tamper-proof record of your scan findings, linked to a specific git commit. From here you can:- Explore the trail in the Kosli app
- Attest scans to an artifact in a trail — see
kosli attest snykfor details - Add Snyk attestations to your CI pipeline using the GitHub Actions integration