On this page
Code Observability
Report CI builds, Trivy findings and SBOM components from the pipeline you already run, without sending us source code or granting access to your repositories.
Code Observability adds a Code area that follows every repository whose CI reports in:
- Builds: each pipeline run's outcome, branch, commit, duration and who triggered it, so a change in your logs sits next to the build that shipped just before it.
- Trivy findings from all four of Trivy's scanners: vulnerabilities
(
vuln), committed secrets (secret), infrastructure-as-code misconfigurations (misconfig) and licences (license). Each finding has an identity and a lifecycle, so you can see when it opened, when it was fixed, and mute it with a reason. - Component inventory from the SBOM Trivy writes: every package in every artifact, searchable across the whole workspace, with what changed between versions.
- Newly disclosed findings: a vulnerability that appears on an artifact an earlier report already covered without it. Your code did not change; what is known about it did.
It is an add-on like every other. A workspace Owner or Admin turns it on from Add-ons in the app, and turning it on or off affects only that workspace. While it is off, the Code pages are hidden and reports from CI are refused rather than silently dropped.
Trivy runs in your own pipeline, with your own access. A small reporter step after it sends us what it wrote. That is the whole integration.
Set up
Open Connect Your Data and choose Code & CI:
- Name the input and create a Code & CI key. You can bind the key to one
repository URL, such as
https://github.com/your-org/your-repo, so that reports naming any other repository are refused and a leaked key cannot write to another repository's history. - The key is shown once. Save it as a CI secret named
OBISTACK_CODE_KEY, as shown for your CI provider below. The file reads the key from that secret and never contains it. - Pick your CI provider (GitHub Actions, GitLab CI, or Other), copy the file, and commit it to your repository.
- Let your pipeline run. The panel confirms the first build or report as soon as it arrives.
You never name what was scanned: it is read from the report. An image scan is
grouped under the image's repository, such as ghcr.io/your-org/your-image, whatever its
tag. A scan of the repository's own files is fs, and a scan of one directory
in it gets that directory as a suffix, such as fs:services/api, so two scans
in one monorepo keep separate findings. Scan with a path relative to the
checkout for that to work.
Each file below is complete and is the one the door generates: paste it in, add the secret, and commit. It reports the start of the run, runs Trivy over the repository's files, and reports the end with Trivy's JSON report and a CycloneDX SBOM. Each of those is its own job, and each waits for the one before it. The end is reported whether the run passed, failed or was cancelled, because a failed build is the one you most want to see, and the status it sends is that of the whole run rather than of a single job.
GitHub Actions
- In your GitHub repository, open Settings > Secrets and variables >
Actions and choose New repository secret. Name it
OBISTACK_CODE_KEYand paste your Code & CI key as its value. - Create the file
.github/workflows/obistack-code.ymlin your repository and paste the workflow below into it. A repository can have any number of workflow files, so this sits alongside the ones you already have. - Commit and push. The workflow runs on every push and pull request.
Trivy runs in Aqua Security's own aquasec/trivy image, and both reports run
in the stock curlimages/curl image, each pinned by digest, so nothing is
installed on the runner. Reporting is plain curl in run: steps: there is
no action of ours to install or trust. The only actions used are GitHub's own
actions/checkout and the artifact actions that hand Trivy's files to the
report job, all pinned by commit. The report job runs with if: always() and
sends failure if any job failed, cancelled if the run was cancelled, and
success otherwise.
# This is an example. Edit it to suit your repository.
#
# Save as .github/workflows/obistack-code.yml in your repository.
# It reads your key from the repository secret OBISTACK_CODE_KEY.
#
# When it runs: on every push to any branch, and on every pull request.
# A pull request that is updated by a push can therefore run it twice.
# To run it less often, narrow the triggers below. For example, to scan
# only pushes to main and pull requests aimed at main:
#
# on:
# push:
# branches: [main]
# pull_request:
# branches: [main]
name: ObiStack Code
on:
push:
pull_request:
permissions:
contents: read
env:
OBISTACK_URL: https://ingest.obistack.com
OBISTACK_CODE_KEY: ${{ secrets.OBISTACK_CODE_KEY }}
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
jobs:
start:
name: Report build start
runs-on: ubuntu-latest
container:
image: curlimages/curl:8.23.0@sha256:11e64e28c5f58c8d93ee95fcf22ac055f48b0bc440e0ce7d8013bbb5ad6aa8ac
options: --user root
defaults:
run:
shell: sh
steps:
- name: Report build start
run: |
curl -sS "$OBISTACK_URL/ingest/ci/builds" \
-H "Authorization: Bearer $OBISTACK_CODE_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<JSON || true
{
"repository": "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY",
"provider": "github",
"run_id": "$GITHUB_RUN_ID",
"attempt": "$GITHUB_RUN_ATTEMPT",
"status": "running",
"branch": "${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}",
"default_branch": "$DEFAULT_BRANCH",
"commit": "$GITHUB_SHA",
"url": "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
}
JSON
scan:
name: Trivy scan
needs: start
runs-on: ubuntu-latest
container:
image: aquasec/trivy:0.76.1@sha256:790fd66d1697395d8693d1acaa1ea702406a20f109b6fc7bac8db623eca6c06c
defaults:
run:
shell: sh
steps:
- name: Check out code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Run Trivy
run: |
trivy fs --format json --output trivy.json --scanners vuln,secret,misconfig,license .
trivy fs --format cyclonedx --output sbom.cdx.json .
- name: Keep the results for the report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: obistack-code-results
path: |
trivy.json
sbom.cdx.json
if-no-files-found: ignore
retention-days: 1
report:
name: Report results
needs: [start, scan]
if: always()
runs-on: ubuntu-latest
container:
image: curlimages/curl:8.23.0@sha256:11e64e28c5f58c8d93ee95fcf22ac055f48b0bc440e0ce7d8013bbb5ad6aa8ac
options: --user root
defaults:
run:
shell: sh
steps:
- name: Fetch the results
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
continue-on-error: true
with:
name: obistack-code-results
- name: Report results
env:
BUILD_STATUS: ${{ contains(needs.*.result, 'failure') && 'failure' || contains(needs.*.result, 'cancelled') && 'cancelled' || 'success' }}
run: |
curl -sS "$OBISTACK_URL/ingest/ci/builds" \
-H "Authorization: Bearer $OBISTACK_CODE_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<JSON || true
{
"repository": "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY",
"provider": "github",
"run_id": "$GITHUB_RUN_ID",
"attempt": "$GITHUB_RUN_ATTEMPT",
"status": "$BUILD_STATUS",
"branch": "${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}",
"default_branch": "$DEFAULT_BRANCH",
"commit": "$GITHUB_SHA",
"url": "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
}
JSON
upload() {
[ -f "$2" ] || return 0
gzip -c "$2" | curl -sS "$OBISTACK_URL/ingest/ci/$1" \
-H "Authorization: Bearer $OBISTACK_CODE_KEY" \
-H "Content-Type: application/json" \
-H "Content-Encoding: gzip" \
-H "X-Code-Repository: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
-H "X-Code-Provider: github" \
-H "X-Code-Branch: ${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}" \
-H "X-Code-Default-Branch: $DEFAULT_BRANCH" \
-H "X-Code-Commit: $GITHUB_SHA" \
--data-binary @- || true
}
upload trivy trivy.json
upload sbom sbom.cdx.json
GitLab CI
- In your GitLab project, open Settings > CI/CD > Variables and choose
Add variable. Set the key to
OBISTACK_CODE_KEY, paste your Code & CI key as the value, mark it Masked, and clear Protect variable so branches other than protected ones can report too. - Paste the file below into
.gitlab-ci.ymlin the root of your repository. GitLab reads only that one file, so if you already have one, save this asobistack-code.gitlab-ci.ymlinstead and add the twoincludelines from its header to your.gitlab-ci.yml. - Commit and push. The job runs in every pipeline.
The start is reported from a job in the .pre stage and the end from the
.post stage, which GitLab runs first and last in every pipeline. The scan
job runs in Aqua Security's own aquasec/trivy image and keeps Trivy's files
as artifacts even when it fails; the end report downloads them and runs in the
stock curlimages/curl image. Both images are pinned by digest, and nothing
of ours is downloaded into the pipeline. The end report is two jobs: one runs
when every earlier job passed and sends success, the other runs when any job
in the pipeline failed and sends failure, so the status is always that of
the whole pipeline. The scan job declares stage: test, one of GitLab's
default stages, so it slots into an existing pipeline. If your pipeline lists
its own stages:, add test to that list or change the scan job's stage:
to one you already have.
# This is an example. Edit it to suit your project.
#
# Save as .gitlab-ci.yml in the root of your repository.
# It reads your key from the CI/CD variable OBISTACK_CODE_KEY.
#
# When it runs: whenever a pipeline runs, so on every push to any branch and
# on merge request pipelines if your project has them. To run it less often,
# add a rules: block to the obistack-code-* jobs, for example
# rules:
# - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# - if: $CI_PIPELINE_SOURCE == "merge_request_event"
#
# Already have a .gitlab-ci.yml? Save this as obistack-code.gitlab-ci.yml instead
# and add these lines to your .gitlab-ci.yml:
# include:
# - local: obistack-code.gitlab-ci.yml
#
# The scan job runs in the test stage. GitLab includes it by default, so a file
# with no stages: list needs nothing more. If your .gitlab-ci.yml has its own
# stages: list, add test to it, or change stage: below to one you already use.
# The reports run in .pre and .post, which every pipeline has.
.obistack-code-report:
image:
name: curlimages/curl:8.23.0@sha256:11e64e28c5f58c8d93ee95fcf22ac055f48b0bc440e0ce7d8013bbb5ad6aa8ac
entrypoint: [""]
variables:
OBISTACK_URL: https://ingest.obistack.com
GIT_STRATEGY: none
obistack-code-start:
extends: .obistack-code-report
stage: .pre
script:
- |
curl -sS "$OBISTACK_URL/ingest/ci/builds" \
-H "Authorization: Bearer $OBISTACK_CODE_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<JSON || true
{
"repository": "$CI_PROJECT_URL",
"provider": "gitlab",
"run_id": "$CI_PIPELINE_ID",
"status": "running",
"branch": "$CI_COMMIT_REF_NAME",
"default_branch": "$CI_DEFAULT_BRANCH",
"commit": "$CI_COMMIT_SHA",
"url": "$CI_PIPELINE_URL"
}
JSON
obistack-code-scan:
stage: test
image:
name: aquasec/trivy:0.76.1@sha256:790fd66d1697395d8693d1acaa1ea702406a20f109b6fc7bac8db623eca6c06c
entrypoint: [""]
script:
- trivy fs --format json --output trivy.json --scanners vuln,secret,misconfig,license .
- trivy fs --format cyclonedx --output sbom.cdx.json .
artifacts:
when: always
expire_in: 1 day
paths:
- trivy.json
- sbom.cdx.json
# The end of the pipeline. Exactly one of the two jobs below runs.
.obistack-code-end:
extends: .obistack-code-report
stage: .post
dependencies:
- obistack-code-scan
script:
- |
curl -sS "$OBISTACK_URL/ingest/ci/builds" \
-H "Authorization: Bearer $OBISTACK_CODE_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<JSON || true
{
"repository": "$CI_PROJECT_URL",
"provider": "gitlab",
"run_id": "$CI_PIPELINE_ID",
"status": "$BUILD_STATUS",
"branch": "$CI_COMMIT_REF_NAME",
"default_branch": "$CI_DEFAULT_BRANCH",
"commit": "$CI_COMMIT_SHA",
"url": "$CI_PIPELINE_URL"
}
JSON
upload() {
[ -f "$2" ] || return 0
gzip -c "$2" | curl -sS "$OBISTACK_URL/ingest/ci/$1" \
-H "Authorization: Bearer $OBISTACK_CODE_KEY" \
-H "Content-Type: application/json" \
-H "Content-Encoding: gzip" \
-H "X-Code-Repository: $CI_PROJECT_URL" \
-H "X-Code-Provider: gitlab" \
-H "X-Code-Branch: $CI_COMMIT_REF_NAME" \
-H "X-Code-Default-Branch: $CI_DEFAULT_BRANCH" \
-H "X-Code-Commit: $CI_COMMIT_SHA" \
--data-binary @- || true
}
upload trivy trivy.json
upload sbom sbom.cdx.json
obistack-code-success:
extends: .obistack-code-end
when: on_success
variables:
BUILD_STATUS: success
obistack-code-failure:
extends: .obistack-code-end
when: on_failure
variables:
BUILD_STATUS: failure
Any other CI
- Add your Code & CI key to your CI system's secret store and expose it to
the build as an environment variable named
OBISTACK_CODE_KEY. - Save the script below as
obistack-code.shin the root of your repository and fill in the variables at the top from your CI system's own variables. - Run
sh obistack-code.shfrom your pipeline after it checks out the code, on a runner that has Trivy installed.
The same curl calls as a POSIX shell script. An exit trap reports the end of
the run whatever happens.
#!/bin/sh
# This is an example. Edit it to suit your pipeline.
#
# Save as obistack-code.sh in the root of your repository and run it from your
# pipeline with: sh obistack-code.sh
# It runs whenever your pipeline calls it, so how often is up to the trigger
# you give that pipeline: every push or only some branches.
# It needs Trivy on the runner, and OBISTACK_CODE_KEY set from your CI's secret store.
# Fill these in from your CI system's own variables.
OBISTACK_URL="https://ingest.obistack.com"
REPOSITORY_URL="https://github.com/your-org/your-repo"
RUN_ID="$YOUR_CI_RUN_ID"
BRANCH="$YOUR_CI_BRANCH"
DEFAULT_BRANCH="main"
COMMIT_SHA="$YOUR_CI_COMMIT"
RUN_URL="$YOUR_CI_RUN_URL"
curl -sS "$OBISTACK_URL/ingest/ci/builds" \
-H "Authorization: Bearer $OBISTACK_CODE_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<JSON || true
{
"repository": "$REPOSITORY_URL",
"provider": "other",
"run_id": "$RUN_ID",
"status": "running",
"branch": "$BRANCH",
"default_branch": "$DEFAULT_BRANCH",
"commit": "$COMMIT_SHA",
"url": "$RUN_URL"
}
JSON
upload() {
[ -f "$2" ] || return 0
gzip -c "$2" | curl -sS "$OBISTACK_URL/ingest/ci/$1" \
-H "Authorization: Bearer $OBISTACK_CODE_KEY" \
-H "Content-Type: application/json" \
-H "Content-Encoding: gzip" \
-H "X-Code-Repository: $REPOSITORY_URL" \
-H "X-Code-Provider: other" \
-H "X-Code-Branch: $BRANCH" \
-H "X-Code-Default-Branch: $DEFAULT_BRANCH" \
-H "X-Code-Commit: $COMMIT_SHA" \
--data-binary @- || true
}
# Report the end whatever happens, so a failed scan is still recorded.
report_end() {
if [ "$1" -eq 0 ]; then BUILD_STATUS=success; else BUILD_STATUS=failure; fi
curl -sS "$OBISTACK_URL/ingest/ci/builds" \
-H "Authorization: Bearer $OBISTACK_CODE_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<JSON || true
{
"repository": "$REPOSITORY_URL",
"provider": "other",
"run_id": "$RUN_ID",
"status": "$BUILD_STATUS",
"branch": "$BRANCH",
"default_branch": "$DEFAULT_BRANCH",
"commit": "$COMMIT_SHA",
"url": "$RUN_URL"
}
JSON
upload trivy trivy.json
upload sbom sbom.cdx.json
}
trap 'report_end $?' EXIT
set -e
trivy fs --format json --output trivy.json --scanners vuln,secret,misconfig,license .
trivy fs --format cyclonedx --output sbom.cdx.json .
Every call ends in || true: a reporting problem is printed and never fails
your pipeline. A Trivy report or SBOM larger than 25 MB compressed is refused
with a message saying so; narrow the scan with --severity or --scanners,
or send one SBOM per artifact.
Keeping results current
We never scan anything ourselves. We do not run Trivy, hold a vulnerability database, or re-check your components against new advisories. Results are as current as your pipeline's last Trivy run, and how often that runs is up to your CI. The files add no schedule of their own: Trivy runs whenever your pipeline runs.
The same applies to the SBOM. Components come from the newest SBOM your pipeline sent, and the overview shows how old it is.
What we never receive
No source code, registry credential or repository access is ever requested. There is no app to install on GitHub or GitLab and no token to grant. Only Trivy's own JSON report, its SBOM, and the build details the reporter reads from your CI's environment leave your pipeline.
We keep less than that. For a secret, we store which rule matched, the file and the line range, never the matched text or the lines around it. For a misconfiguration, we drop the code excerpt Trivy includes. An SBOM is read into its list of components and then discarded; the document itself is never stored.
Trivy stays yours
We never run Trivy for you, and the reporter never downloads a scanner. The
GitHub and GitLab files run Trivy in your own pipeline from Aqua Security's
aquasec/trivy image, pinned by digest, never from an unpinned install
script. If you already run Trivy your own way, replace the scan job with
yours: the reporter only needs the files Trivy wrote. Pin any Trivy container
image by digest or commit rather than by a tag that can move: in March 2026 malicious
Trivy releases were published and trivy-action tags were force-pushed. For
the same reason, reporting is plain curl, with no action or image of ours
in your pipeline.
Read results
Code in the navigation opens the repository overview. Four tiles across the top count repositories reporting, builds today, open critical fixable vulnerabilities, and vulnerabilities newly disclosed this week. The table below lists each repository with its last build, its seven-day build success rate, open vulnerabilities, secrets and misconfigurations, the age of its newest SBOM on the default branch, and how many of its artifact versions are running now.
Code > Dependencies lists every package your default-branch builds use,
with the versions in use, their licences, how many builds and repositories
carry each, and how many of those are running now. Search suggests packages as
you type. Open one to see every build that uses it, on every branch, and narrow
to a version range such as <4.17.21 when an advisory comes out.
A repository's page has six tabs:
- Builds: build history with status, branch, commit, duration and trigger, and a link back to the run in your CI.
- Vulnerabilities: open vulnerabilities per artifact and branch, with installed and fixed versions. Fixable ones are shown by default.
- Secrets: the rule, file and line range of each secret found. Never the secret.
- Misconfigurations: the check, resource, file and line range, and how to resolve it.
- Dependencies: the packages in an artifact version, with licences and whether each is a direct or transitive dependency, and what changed since the previous version. There is no original SBOM to download.
- Artifacts: each artifact version with its digest or commit, branch, the build that produced it, and whether and where it is running.
Findings are tracked per branch, so a feature branch cannot close a finding that is still open on your default branch. A report only closes findings of the scanners it ran: a vulnerability-only scan never marks secrets as fixed. Licence findings are kept with the others and drive the Restricted licence alert.
Two badges appear on findings:
- Newly disclosed means the same image or commit was scanned before without this vulnerability. The artifact did not change; the advisory is new.
- Running means your own services' telemetry named the artifact's commit
or image digest in the last day, through
vcs.ref.head.revision,service.version,container.image.idorcontainer.image.repo_digests. Running findings sort first and the findings table can show only them. Only this workspace's own telemetry is ever matched.
Running code also shows up elsewhere: a Code panel on the OpenTelemetry Service Overview lists what each service is running, the Log Explorer's histogram marks builds that went on to run, and a host's Vulnerabilities tab lists the code running on it, linking back to that artifact's findings. When Obi investigates an alert, it can also check which builds and deploys came just before the incident and cite the build that lines up.
Muting works as it does for host findings: a workspace Owner or Admin gives a reason and an optional expiry, for one artifact or for every artifact in the workspace.
Everything arrives as ordinary events, so the Log Explorer, your own alert rules and dashboards work on it too.
Alerts
Alerts under Code in the navigation opens the Code Observability Alerts. They are all switched on when you turn the add-on on, and notify your default notification groups. Switch off any you do not want; one you switch off stays off. An enabled alert evaluates, opens incidents and notifies like any other alert, but it belongs to the add-on rather than to your own alert rules. You can change when it fires, how often it evaluates, who it notifies and how its incidents behave, and reset any of that to the default. Its query and severity stay ours.
| Alert | Fires when | Severity |
|---|---|---|
| New fixable critical vulnerability | A critical or high vulnerability with a fixed version available opens on a repository's default branch. | High |
| Newly disclosed vulnerability | A critical or high vulnerability opens on an artifact version an earlier report already covered without it. | High |
| Newly disclosed in running code | As above, on an artifact version your own telemetry shows is running. | Critical |
| Secret detected | Trivy finds a secret in a repository, on any branch. | Critical |
| Restricted licence | A dependency under a licence Trivy classifies as forbidden or restricted appears on the default branch. | Medium |
| High-severity misconfiguration | A critical or high infrastructure-as-code misconfiguration appears on the default branch. | Medium |
| New dependency on the default branch | An SBOM shows a component the previous SBOM of the same artifact on the default branch did not have. | Low |
| Stale SBOM | The newest SBOM of an artifact on the default branch is older than 30 days. | Low |
| Default-branch builds failing | More than half of a repository's default-branch builds failed in the last hour, with at least three builds. | Medium |
| Stale pipeline | A repository that has reported builds sends none for 7 days. | Low |
A running Code alert is also listed on the Alerts Overview, where it can be snoozed. Turning the add-on off hides the alerts; nothing you configured is deleted, and it all comes back when the add-on is turned on again.
Tenant Isolation & Data Boundaries
The Code & CI key decides the workspace. The repository, artifact and commit named in a report are data inside that workspace and can never redirect it to another one. Builds, findings and components are read through the same workspace-scoped access as every other event. Running code is matched only against this workspace's own telemetry, so another workspace running the same public image never marks yours as running. See Tenant Isolation for the full model.