The following flags are defaulted (which means you don’t need to provide the flags, they’ll be automatically set to values listed below) as follows in the CI systems below:
GitHub
GitLab
Azure DevOps
Bitbucket Cloud
AWS CodeBuild
CircleCI
Teamcity
View defaulted Kosli command flags in Github Actions.
To use Kosli in Github Actions workflows, you can use the kosli CLI setup action to install the CLI on your Github Actions Runner.
Then, you can use all the CLI commands in your workflows.
Keep in mind that secrets in Github actions are not automatically exported as environment variables. You need to add required secrets to your GITHUB environment explicitly. E.g. to make kosli_api_token secret available for all cli commands as an environment variable use following:
The Kosli CLI repository ships an Alpine-based Dockerfile.alpine intended for use as a CI runner image. Unlike the default ghcr.io/kosli-dev/cli image (which has the kosli binary as its entrypoint), the Alpine variant has no entrypoint and bundles git, curl, and ca-certificates alongside the CLI — so it can be used as a general-purpose job image where you also need to clone repos, hit HTTP APIs, or run other shell tooling next to kosli.Build and push it to your own registry, pinning the CLI version you want:
# Clone or copy Dockerfile.alpine from https://github.com/kosli-dev/clidocker build \ --build-arg KOSLI_VERSION=2.13.2 \ -f Dockerfile.alpine \ -t registry.example.com/ci/kosli-runner:2.13.2 .docker push registry.example.com/ci/kosli-runner:2.13.2
Then use it as the job image in .gitlab-ci.yml:
variables: KOSLI_ORG: my-org KOSLI_HOST: https://app.kosli.comattest: image: registry.example.com/ci/kosli-runner:2.13.2 script: - kosli version - kosli attest generic --flow my-flow --trail "$CI_COMMIT_SHA" --name build --compliant=true # KOSLI_API_TOKEN should be set as a masked GitLab CI/CD variable
The image runs as the non-root kosli user with /workspace as the working directory. KOSLI_ORG and KOSLI_HOST are exposed as environment variables so they can be overridden in your CI configuration; KOSLI_API_TOKEN should be supplied via a masked CI variable rather than baked into the image.
View defaulted Kosli command flags in Azure DevOps.