Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion getting_started/attestations.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ The following sections show how to make each of the four attestations defined in
In this case the Kosli CLI will calculate the fingerprint of the docker image called `my_company/backend:latest` and attest it as the `backend` artifact `name` in the trail.

<Info>
In all attestation commands the Kosli CLI automatically gathers the git commit and other information from the current git repository and the [CI environment](/integrations/ci_cd). This is how the git commit is used to match attestations to artifacts.
In all attestation commands the Kosli CLI automatically gathers the git commit and other information from the current git repository and the [CI environment](/integrations/ci_cd). This is how the git commit is used to match attestations to artifacts. If the job that attests runs in a different repository from the trail's, see [Attest to a trail from another repository](/integrations/ci_cd#attest-to-a-trail-from-another-repository).
</Info>
</Step>
<Step title="Attest a security scan to the backend artifact">
Expand Down
25 changes: 24 additions & 1 deletion integrations/ci_cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,27 @@ description: Use Kosli in CI Systems like GitHub Actions, GitLab CI, and more.

Where `<PLACEHOLDERS>` are Teamcity predefined variables. See [here](https://www.jetbrains.com/help/teamcity/predefined-build-parameters.html) for more details.
</Tab>
</Tabs>
</Tabs>

## Attest to a trail from another repository

Sometimes the job that attests runs in a different repository from the one the trail belongs to. For example, a security scan pipeline in its own repository attests to the trails of your application builds. With the defaults above, the attestation records the commit and repository of the scanning job, not those of the trail's build.

Pass `--no-commit-info` to send the attestation without git commit info and without the repository info defaulted from the CI environment. The flag is available on the attestation commands that attach evidence to a trail, such as `kosli attest generic`, `junit`, `snyk` and `custom`. `kosli attest artifact` and `kosli attest in-toto` don't support it.

```shell
kosli attest generic \
--flow backend-ci \
--trail "$TRAIL_NAME" \
--name security-scan \
--compliant=true \
--no-commit-info
```

- Repository flags that you pass explicitly, or set through their `KOSLI_` environment variables, are still sent. To name the repository the trail belongs to, set all three of `--repository`, `--repo-url` and `--repo-id`. `--repo-provider` is optional.
- The origin URL still points to the CI run that sent the attestation.
- `--no-commit-info` can't be combined with `--commit`, whether you pass it as a flag or set it through `KOSLI_COMMIT` or the config file.
- Pull request and Jira attestations need the commit, so they fail with `--no-commit-info`.
- Without a commit, Kosli can't bind an attestation to an artifact that doesn't exist yet. Report the artifact first, or pass `--fingerprint`.

See [`kosli attest generic`](/client_reference/kosli_attest_generic) for the full flag reference.
Loading