# CI/lock
> CI/lock captures the work: it wraps a build, test, scan or deploy command and records a signed in-toto attestation of what ran, on which inputs, in which environment, and what it produced. It is part of TestifySec's platform for developer and agent trust: CI/lock captures the work; Pushgate checks the push; the platform manages gates and technical-control evidence.
The CI/lock documentation and blog live on testifysec.com. Retired cilock.dev documentation and blog URLs redirect there permanently, so cite the testifysec.com URLs below. Every page is also published as Markdown at the same path with a `.md` suffix.
Match commands and supported capabilities to the installed release (`cilock version`). Some imported reference tracks development source. Retain version limits, correction notes, and trust boundaries when quoting. A signature establishes attribution and integrity under configured trust; it does not prove that a producer was honest or that code is safe. Check the support matrix before claiming a SLSA Build level for a workflow. Blog posts are dated context, not the current command reference.
This file (/llms-full.txt) is the full-text corpus of the CI/lock docs, concatenated per the llmstxt.org convention. Each section below is one doc page, preceded by a source header with the URL that serves it on testifysec.com. Append .md to that URL (without the trailing slash) for the page as Markdown.
---
# agent-session
Source: https://www.testifysec.com/docs/cilock/attestors/agent-session/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/agent-session.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/agent-session.json';
# `agent-session` attestor
`agent-session` records one checkpoint of a coding-agent session: it started,
named its ticket, waited, dispatched work to another machine, got the result
back, claimed it was done, or ended. A harness hook (Claude Code, Codex and
others) calls cilock at each checkpoint, and the agent's principal signs the
record. The timestamp authority dates it.
## Validated invocation
```bash
cilock attest --step agent-session -a agent-session \
--attestor-agent-session-checkpoint input-bound \
--attestor-agent-session-session 0193b2c4-1a2b-7c3d-8e4f-5a6b7c8d9e0f \
--attestor-agent-session-tier hooks \
--attestor-agent-session-adapter claude-code \
--attestor-agent-session-input prompt=github:testifysec/judge#22919
```
## What gets captured
- `checkpoint`: one of `start`, `input-bound`, `waiting`, `resumed`, `dispatch`, `joined`, `done-claimed`, `end`.
- `session`: cilock's session id, the harness's session id, and the parent session for a spawned one. Each is a lowercase UUID.
- `capture`: the tier (`hooks`, `plugin`, `proxy`, `launcher`, `remote-node`, `vendor-api`, `mcp`) and the adapter name.
- `inputs`: tickets or design docs the session named, each as a reference (`github:owner/repo#N`, `linear:KEY-N`, `jira:KEY-N`, `design:@`) with where it was read (`prompt`, `explicit`, `branch`).
- `waitingOn` (for `waiting`) and `job` (for `dispatch` and `joined`).
- `promptDigests`: salted SHA-256 digests of human prompts. Never the text.
- `observedAt` and a fixed `caveat`.
## Why this shape
Every field comes from the agent's own harness, so the record can say what
the session claimed about itself and nothing stronger. It has no subjects,
materials, products, backrefs or exports, because any of them would let an
agent-chosen string shape what a policy resolves. It refuses malformed input
instead of recording it: a wrong checkpoint is better unsigned than signed.
## Validate it locally
Run the invocation above with any valid UUID. Each of these is refused: an
unknown checkpoint, an uppercase or path-shaped session id, a ticket written as
a URL or prose, prompt text where a digest belongs, `--waiting-on` on anything
but `waiting`, and `--job` on anything but `dispatch` or `joined`.
## How a verifier consumes this
It satisfies no policy requirement by itself. The platform's `work-trace`
verdict may read one fact from it, whether a captured prompt named the ticket,
and carries that in its own signed verdict labelled Observed (harness). A repo
that must hold against a lying agent requires the `assignment` basis, which
this record cannot supply.
## Notes
- The session id joins this record to `alps-evidence` on the push.
- A `dispatch` and a node's launch receipt naming the same `job` make a
two-sided record of work that moved to another machine.
## Gotchas
- The checkpoint set is closed. An adapter maps vendor events onto it and drops
an event with no mapping, rather than inventing a kind.
- Prompt digests must be salted per session by the caller. A plain hash of a
short prompt can be guessed.
## FAQ
**Does this prove the agent worked on the ticket?** No. It proves the session
said so, signed by the agent's principal. Proof that a person authorized the
work comes from the ticket system (an assignment) or the AAL2 ceremony.
## See also
- `alps-evidence`: which coding agent invoked cilock.
- `code-review`, `change-approval`: review and approval records.
---
# alps-evidence
Source: https://www.testifysec.com/docs/cilock/attestors/alps-evidence/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/alps-evidence.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/alps-evidence.json';
# `alps-evidence` attestor
`alps-evidence` records the nearest supported coding-agent process visible in
cilock's ancestry. It supports Claude Code and Codex with product-specific
inspection, plus bounded fingerprint-only observations for Cursor, Gemini CLI,
Copilot CLI, Aider, Goose, and OpenCode.
This is observational attribution, not identity. The process being described
runs as the same user and can forge its name, arguments, environment, and
files. Every predicate carries `assurance.enforcement: false` and a caveat that
states this boundary.
## Validated invocation
Run this command from inside a supported coding agent. Signing identity is a
separate ceremony and is never inferred from the observed process:
```bash
cilock run \
--step alps-evidence-observation \
--platform-url "$PLATFORM_URL" \
--attestations alps-evidence,environment,git \
-- true
```
The detector can also add `alps-evidence` during automatic planning when a
known agent marker is present. An explicit `--attestations` list is exact, so
include `alps-evidence` yourself when you want it in a manual set.
## What gets captured
- `status`: `detected`, `not-detected`, `incomplete`, or `unavailable`.
- `assurance`: the fixed non-enforcing mode and caveat.
- `invoker`: observed vendor/product, bounded version, process reference, and
the exact fingerprint basis that matched.
- `environment_claim`: only when the walk ended `not-detected` or `incomplete`
with no process matched, and cilock's own environment carries an agent's
marker (Claude Code's `CLAUDECODE=1`). This is the detached-launch case,
where `nohup` reparents cilock away from the agent. It never changes
`status`, carries no process or model, and is always graded
`environment-observed`: any process can export the variable.
- `model`, `session`, and `settings`: only when a provider can name the source;
each value carries its own observation assurance.
- `configuration`: bounded, single-read snapshots with digests. A digest proves
the bytes cilock read, not that the running agent loaded the file.
- `environment`: provider-allowlisted keys only. Credential-shaped keys and
run-wide redaction rules suppress values; presence may remain.
- `ancestry` and `warnings`: a bounded, basename-only walk plus explicit gaps.
Raw argv, raw environment blocks, file contents, subjects, materials, products,
backrefs, and exports are not emitted.
## Why this shape
The attestor separates three questions that are easy to conflate:
1. What process context could cilock observe?
2. Which authenticated principal signed the evidence?
3. Did a policy accept the exact commit?
`alps-evidence` answers only the first. Fulcio/OIDC answers the second, and a
verified policy decision answers the third. A UI may label this predicate
“Observed”; it must never label it “Verified agent identity.”
## Validate it locally
```bash
cd subtrees/rookery
./examples/alps-evidence/reproduce.sh
```
The script builds the canonical in-tree cilock binary, creates an ephemeral
test-only key, runs the attestor, and checks the decoded collection for the
predicate type, status vocabulary, and `enforcement: false`. When run under a
supported agent, the expected status is `detected`; a terminal or unsupported
platform may truthfully report `not-detected` or `unavailable`.
## How a verifier consumes this
It does not. The attestor deliberately implements no `Subjecter`, `Materialer`,
`Producer`, `BackReffer`, or `Exporter` interface, so it cannot select an
artifact, connect a verification graph, or satisfy a policy requirement.
Consumers may display it as bounded audit context linked by the surrounding
collection. Any policy or UI that treats its vendor, product, model, sandbox,
or fingerprint as authenticated identity is using the predicate incorrectly.
## Notes
- Linux reads `/proc`; macOS reads `KERN_PROCARGS2`. Other platforms publish a
signed `unavailable` observation instead of failing the wrapped command.
- The nearest recognized ancestor wins. A deeper, outer agent cannot claim
credit for a command driven by a nearer supported agent.
- Executables and configuration files are opened once, bounded, and checked as
regular files. Symlinked config paths are refused; legitimate symlinked agent
executables are resolved and rebound to the opened handle.
- Every agent-influenced predicate string is capped and marked when truncated.
## Gotchas
- `detected` does not mean authenticated. A process can choose a matching name.
- A configuration-derived model is a configured default, not proof of the model
that served a session.
- `incomplete` means some ancestry was not examinable. It must not be rendered
as `not-detected`.
- `unavailable` is signed data and does not make `cilock run` fail.
- Do not add subjects or backrefs. That would let self-description influence
artifact selection or policy traversal.
## FAQ
### Can Pushgate require a particular coding agent or model from this predicate?
No. The observed process controls these values. Use authenticated workload or
agent principals at the signing boundary for identity, and independently
verified evidence for enforcement.
### Does this prove a human reviewed the change?
No. Human presence requires its own interactive ceremony. A process tree, TTY,
or agent name cannot establish it.
### Why record it at all?
It provides useful fleet, debugging, and audit context without overstating its
assurance: which tools appeared in delivery loops, which settings were visible,
and where observation was incomplete.
## See also
- [Agent, policy, and provenance contract](https://pushgate.dev/docs/agent-sandbox)
- [`environment`](./environment.mdx)
- [`git`](./git.mdx)
---
# asff
Source: https://www.testifysec.com/docs/cilock/attestors/asff/
# `asff` attestor
Reads an AWS Security Hub ASFF (AWS Security Finding Format) JSON report from the attestation products, validates it, and signs a condensed summary (counts, severity breakdown, failed findings) as the attestation predicate.
| | |
|---|---|
| Name | `asff` |
| Predicate type | `https://aflock.ai/attestations/asff/v0.1` |
| Lifecycle | `postproduct` |
| Default binary? | **Yes** |
## What it captures
The predicate is a `Summary` object with:
- `awsAccountId` — taken from the first finding that populates it.
- `totalFindings` — count of all findings in the report.
- `bySeverity` — map of uppercased severity label (`CRITICAL`, `HIGH`, `MEDIUM`, `LOW`, `INFORMATIONAL`) to `{ count }`.
- `byComplianceStatus` — map of uppercased compliance status (`PASSED`, `FAILED`, `WARNING`, `NOT_AVAILABLE`) to a count.
- `failedFindings` — array of condensed records, one per finding whose `Compliance.Status == "FAILED"`. Each entry contains `findingArn`, `title`, `severity`, `productArn`, `awsAccountId`, and the list of `resources` (`Type`, `Id`, capitalised as in the ASFF input). The full ASFF record is intentionally not embedded.
- `reportFile` — path of the JSON file consumed from products.
- `reportDigest` — `cryptoutil.DigestSet` of that file, matching the product digest recorded by the attestation context.
Subjects emitted for graph linking (SHA-256 of the identifier string):
- `aws:account:` — the account ID from the summary.
- `aws:finding:` — the finding ARN for every `CRITICAL` or `HIGH` failed finding.
- `aws:arn:` — each unique resource ARN referenced by any failed finding.
## When to use
When running an AWS Security Hub `get-findings` query (or any pipeline that emits ASFF JSON) during or after a build and you want the security posture snapshot bound into the signed attestation graph. The summary lets policy gate on failed-finding counts, severity labels, or specific finding ARNs without carrying the full ASFF stream inline.
## Flags
None.
## Output shape
```json
{
"summary": {
"awsAccountId": "123456789012",
"totalFindings": 412,
"bySeverity": {
"CRITICAL": { "count": 3 },
"HIGH": { "count": 14 },
"MEDIUM": { "count": 102 },
"LOW": { "count": 280 },
"INFORMATIONAL": { "count": 13 }
},
"byComplianceStatus": {
"PASSED": 360,
"FAILED": 38,
"WARNING": 6,
"NOT_AVAILABLE": 8
},
"failedFindings": [
{
"findingArn": "arn:aws:securityhub:us-east-1:123456789012:subscription/aws-foundational-security-best-practices/v/1.0.0/IAM.6/finding/abc",
"title": "IAM.6 Hardware MFA should be enabled for the root user",
"severity": "CRITICAL",
"productArn": "arn:aws:securityhub:us-east-1::product/aws/securityhub",
"awsAccountId": "123456789012",
"resources": [
{ "Type": "AwsAccount", "Id": "AWS::::Account:123456789012" }
]
}
],
"reportFile": "securityhub-findings.json",
"reportDigest": { "sha256": "..." }
}
}
```
## Gotchas
- The attestor consumes a **product**, not a free-form file path. The ASFF JSON report must be registered with the attestation context as a product with MIME type `text/plain` or `application/json` — other MIME types are skipped.
- The input must be the top-level envelope `{ "Findings": [ ... ] }` produced by `aws securityhub get-findings --output json`. Bare arrays are not accepted.
- Each candidate file is re-digested and compared against the product digest; mismatches are silently skipped and the next candidate is tried.
- Validation rejects empty `Findings` arrays and requires every record to have a non-empty `Id`, a `Severity.Label` in {`CRITICAL`, `HIGH`, `MEDIUM`, `LOW`, `INFORMATIONAL`}, and a `Compliance.Status` in {`PASSED`, `FAILED`, `WARNING`, `NOT_AVAILABLE`}. Anything else falls through with "no ASFF JSON output file found in products".
- `awsAccountId` on the summary is taken from the first finding that has one. Multi-account exports collapse to that single account on the summary line (failed findings retain their own `awsAccountId` and resource IDs).
- Only `FAILED` findings are expanded into `failedFindings`. `WARNING` and `NOT_AVAILABLE` show up in counts only.
- `aws:finding:` subjects are emitted only for failed findings whose severity is `CRITICAL` or `HIGH`. Resource ARN subjects are emitted for every unique resource across all failed findings regardless of severity.
## CLI example
See the constraint summary + reproduction recipe at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/34-asff](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/34-asff). This attestor is currently blocked or doc-only — the linked example explains why and shows the recipe to validate once the constraint is removed.
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [Build a custom CI/lock](../guides/build-a-custom-cilock.md)
- [`prowler`](./prowler.mdx), [`aws-config`](./aws-config.md)
---
# aws-codebuild
Source: https://www.testifysec.com/docs/cilock/attestors/aws-codebuild/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/aws-codebuild.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/aws-codebuild.json';
# `aws-codebuild` attestor
Captures AWS CodeBuild build identity from the `CODEBUILD_*` environment variables and, when AWS credentials are available, calls the CodeBuild API to record the full `Build` object returned by `BatchGetBuilds`.
## What it captures
The top-level attestation has exactly two fields:
| Field | Type | Source |
|---|---|---|
| `build_info` | `BuildInfo` (object) | `CODEBUILD_*` env vars + CodeBuild API call |
| `raw_build_details` | string | JSON-marshalled `types.Build` returned by `BatchGetBuilds` (empty if the API call fails) |
`BuildInfo` carries the env-derived fields plus an optional nested `build_details` populated from the AWS SDK:
| `build_info` field | json tag | Source env var |
|---|---|---|
| BuildID | `build_id` | `CODEBUILD_BUILD_ID` (required) |
| BuildARN | `build_arn` | `CODEBUILD_BUILD_ARN` |
| BuildNumber | `build_number` | `CODEBUILD_BUILD_NUMBER` |
| ProjectName | `project_name` | `CODEBUILD_PROJECT_NAME`, else the `project/` tail of `CODEBUILD_PROJECT_ARN` |
| Initiator | `initiator` | `CODEBUILD_INITIATOR` |
| SourceVersion | `source_version` | `CODEBUILD_RESOLVED_SOURCE_VERSION` |
| SourceRepo | `source_repo` | `CODEBUILD_SOURCE_REPO_URL`, with any credential in the URL replaced by `******` |
| BatchBuildID | `batch_build_id` | `CODEBUILD_BATCH_BUILD_IDENTIFIER` |
| WebhookEvent | `webhook_event` | `CODEBUILD_WEBHOOK_EVENT` |
| WebhookHeadRef | `webhook_head_ref` | `CODEBUILD_WEBHOOK_HEAD_REF` |
| WebhookActorID | `webhook_actor_id` | `CODEBUILD_WEBHOOK_ACTOR_ACCOUNT_ID` |
| Region | `region` | `AWS_REGION` |
| BuildDetails | `build_details` | `codebuild:BatchGetBuilds` API (`types.Build`) |
`build_details` is the full AWS SDK `types.Build` shape, including `Arn`, `Artifacts`, `AutoRetryConfig`, `BuildBatchArn`, `BuildComplete`, `BuildNumber`, `BuildStatus`, `Cache`, `CurrentPhase`, `DebugSession`, `EncryptionKey`, `StartTime`/`EndTime`, `Environment`, `ExportedEnvironmentVariables`, `FileSystemLocations`, `Initiator`, `Logs`, `NetworkInterface`, `Phases`, `ProjectName`, `QueuedTimeoutInMinutes`, `ReportArns`, `ResolvedSourceVersion`, `SecondaryArtifacts`, `SecondarySources`, `SecondarySourceVersions`, `ServiceRole`, `Source`, `SourceVersion`, `TimeoutInMinutes`, and `VpcConfig`.
Subjects emitted: `codebuild-build-id:`, `codebuild-project:`, `codebuild-source-version:` (each non-empty field becomes one subject; backrefs mirror subjects).
## When to use
In any CodeBuild project. Pair with [`aws`](./aws.mdx) (EC2 IID) for a cryptographically-verified host identity alongside the CodeBuild-side build identity.
## Flags
None.
## Output shape
```json
{
"build_info": {
"build_id": "my-project:abc-123",
"build_arn": "arn:aws:codebuild:us-east-1:...:build/my-project:abc-123",
"project_name": "my-project",
"source_version": "",
"region": "us-east-1",
"build_details": { "Arn": "...", "AutoRetryConfig": { }, "Phases": [ ] }
},
"raw_build_details": "{\"Arn\":\"...\",\"AutoRetryConfig\":{...}}"
}
```
## Gotchas
- **Not compiled into the default binary.** The AWS attestors (`aws-iid`, `aws-codebuild`, `aws-config`) link the AWS SDK, so the release `cilock` leaves them out and refuses `-a aws-codebuild` with the build to use. Build cilock with `GOWORK=off go build -tags aws_attestors ./cmd/cilock` (or `rookery-builder --with github.com/aflock-ai/rookery/plugins/attestors/aws-codebuild`).
- **Fails outside CodeBuild.** `Attest` returns an error if `CODEBUILD_BUILD_ID` is unset. Do not include this attestor on non-CodeBuild hosts.
- **Uses the AWS SDK.** `New()` calls `config.LoadDefaultConfig`, then `Attest` invokes `codebuild:BatchGetBuilds` to populate `build_details` and `raw_build_details`. The build's service role must have `codebuild:BatchGetBuilds`; otherwise the API call is logged at warn level and the attestor continues with env-var-only data.
- **`AWS_REGION` overrides** the SDK-discovered region when present.
- **Build ID parsing.** The SDK call splits `CODEBUILD_BUILD_ID` on `:` and uses the second segment; malformed IDs skip the API call but still produce env-derived `build_info`.
## CLI example
The attestor reads the CodeBuild environment variables in the table above (`CODEBUILD_BUILD_ID`, `CODEBUILD_BUILD_ARN`, `CODEBUILD_PROJECT_ARN`, `CODEBUILD_SOURCE_REPO_URL`, `CODEBUILD_RESOLVED_SOURCE_VERSION` and the rest). It does not read `CODEBUILD_PUBLIC_BUILD_URL` or `CODEBUILD_SOURCE_VERSION`.
```bash
# Inside a CodeBuild buildspec.yml phase:
cilock run --step codebuild \
--signer-file-key-path key.pem --outfile attestation.json --workingdir . \
--attestations aws-codebuild,environment \
-- echo "captured CodeBuild context"
```
Validated by synthesizing real-format CodeBuild env vars on the validation VM. The attestor reads from env, no other inputs. See the full real-data example at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/24-aws-codebuild](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/24-aws-codebuild).
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [`aws`](./aws.mdx)
- Upstream: [witness/aws-codebuild.md](https://github.com/in-toto/witness/blob/main/docs/attestors/aws-codebuild.md)
---
# aws-config
Source: https://www.testifysec.com/docs/cilock/attestors/aws-config/
# `aws-config` attestor
Reads an AWS Config `get-compliance-details-by-config-rule` JSON report from the attestation products, aggregates rule-level compliance counts, and signs the summary as the attestation predicate.
| | |
|---|---|
| Name | `aws-config` |
| Predicate type | `https://aflock.ai/attestations/aws-config/v0.1` |
| Lifecycle | `postproduct` |
| Default binary? | **No**, build with `-tags aws_attestors` |
## What it captures
The predicate has three top-level fields:
- `reportFile` — path of the JSON file consumed from products.
- `reportDigestSet` — `cryptoutil.DigestSet` of that file. Must match the product digest the attestation context recorded; mismatched files are silently skipped.
- `summary` — a `ComplianceSummary` aggregating the report:
- `totalRules` — count of distinct `ConfigRuleName` values seen in `EvaluationResults`.
- `compliantCount` — number of evaluation results whose `ComplianceType` is `COMPLIANT`.
- `nonCompliantCount` — number of evaluation results whose `ComplianceType` is `NON_COMPLIANT`.
- `nonCompliantResources` — list of `/` strings for every non-compliant result (one entry per result, not deduplicated).
Subjects emitted for graph linking (SHA-256 of the identifier string):
- `aws-config:rule:` — one per distinct rule.
- `aws-config:resource:/` — one per evaluation result.
- `aws:account:` — for every account ID extracted from a `ResourceId` that looks like an ARN (`arn:aws::::...`, position 4 in the `:`-split).
## When to use
In AWS pipelines where you already run `aws configservice get-compliance-details-by-config-rule` and want the continuous-compliance signal bound into the signed attestation graph alongside your build artifacts. The signed summary lets policy gate on `nonCompliantCount` or specific non-compliant `aws-config:rule:*` subjects without carrying the raw evaluation results inline.
## Flags
None.
## Output shape
```json
{
"reportFile": "config-compliance.json",
"reportDigestSet": { "sha256": "..." },
"summary": {
"totalRules": 12,
"compliantCount": 47,
"nonCompliantCount": 3,
"nonCompliantResources": [
"AWS::S3::Bucket/example-public-bucket",
"AWS::IAM::User/legacy-svc",
"AWS::EC2::SecurityGroup/sg-0a1b2c3d"
]
}
}
```
## Gotchas
- Data source is a **file**, not a live SDK call. The attestor does not invoke the AWS Config service — you must produce the JSON yourself (e.g. `aws configservice get-compliance-details-by-config-rule --config-rule-name `) and register it as a product. There is no AWS SDK dependency in this attestor.
- The attestor only considers products whose path ends in `.json`. Other files are skipped.
- Each candidate file is re-digested and compared against the product digest; mismatches are silently skipped and the next candidate is tried.
- The file must unmarshal into `{ "EvaluationResults": [...] }` and contain at least one result. Empty or non-matching JSON is skipped with "no aws config evaluation results JSON found in products".
- Only the **first** matching JSON file wins. If multiple `get-compliance-details-by-config-rule` outputs are registered as products, the rest are ignored — aggregate them yourself before attesting.
- `nonCompliantResources` is one entry per evaluation result. The same resource evaluated by multiple non-compliant rules appears multiple times.
- Account-ID extraction only fires when `ResourceId` itself is an ARN. Reports whose `ResourceId` is a bare name (e.g. `example-public-bucket`) emit no `aws:account:*` subject.
- `ComplianceType` values other than `COMPLIANT` / `NON_COMPLIANT` (e.g. `NOT_APPLICABLE`, `INSUFFICIENT_DATA`) are counted in `totalRules` but contribute to neither `compliantCount` nor `nonCompliantCount`.
## CLI example
See the constraint summary + reproduction recipe at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/33-aws-config](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/33-aws-config). This attestor is currently blocked or doc-only — the linked example explains why and shows the recipe to validate once the constraint is removed.
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [Build a custom CI/lock](../guides/build-a-custom-cilock.md)
- [`prowler`](./prowler.mdx), [`asff`](./asff.md)
---
# aws (aws-iid)
Source: https://www.testifysec.com/docs/cilock/attestors/aws/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/aws.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/aws.json';
# `aws` attestor
Fetches the EC2 instance identity document (IID) from the AWS instance metadata service and verifies its RSA-SHA256 signature against the per-region AWS public certificate, binding a step to a specific EC2 instance, account, AMI, and private IP.
## What it captures
The attestor reads `instance-identity/document` and `instance-identity/signature` from IMDS, unmarshals the document into the AWS SDK's `imds.InstanceIdentityDocument` (embedded), and retains the raw bytes plus the public key used for verification.
Embedded IID fields (15): `devpayProductCodes`, `marketplaceProductCodes`, `availabilityZone`, `privateIp`, `version`, `region`, `instanceId`, `billingProducts`, `instanceType`, `accountId`, `pendingTime`, `imageId`, `kernelId`, `ramdiskId`, `architecture`.
Top-level fields (3): `rawiid` (raw JSON document as returned by IMDS), `rawsig` (base64 signature as returned by IMDS), and `publickey` (PEM-encoded RSA public key extracted from the AWS region certificate used for verification).
Verification: `sha256(rawiid)` is checked against `base64-decode(rawsig)` via `rsa.VerifyPKCS1v15`. The signature algorithm is RSA-SHA256 — this is the `instance-identity/signature` endpoint, not the PKCS#7 endpoint. The region certificate must use RSA; non-RSA public keys are rejected.
Subjects: `instanceid:`, `accountid:`, `imageid:`, `privateip:` (each hashed with SHA-256).
## When to use
Add to any cilock step that runs on an EC2 instance and where you want downstream policy to constrain by AWS account, AMI, instance type, or region. Particularly useful for self-hosted GitHub Actions runners and build agents on EC2, where the IID provides cryptographic proof of host identity.
## Flags
| Flag | Description |
|---|---|
| `--attestor-aws-region-cert` | A public x509 certificate (PEM) or path to a PEM file used to verify the AWS instance identity document signature. If unset or empty, the attestor falls back to a bundled certificate for the IID's region. |
## Output shape
```json
{
"devpayProductCodes": null,
"marketplaceProductCodes": null,
"availabilityZone": "us-east-1a",
"privateIp": "10.0.0.42",
"version": "2017-09-30",
"region": "us-east-1",
"instanceId": "i-0abcd1234ef567890",
"billingProducts": null,
"instanceType": "m5.large",
"accountId": "123456789012",
"pendingTime": "2026-05-21T15:04:05Z",
"imageId": "ami-0123456789abcdef0",
"kernelId": "",
"ramdiskId": "",
"architecture": "x86_64",
"rawiid": "{\"accountId\":\"123456789012\", ...}",
"rawsig": "base64-encoded-rsa-signature",
"publickey": "-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----\n"
}
```
## Gotchas
- **Not compiled into the default binary.** The AWS attestors (`aws-iid`, `aws-codebuild`, `aws-config`) link the AWS SDK, so the release `cilock` leaves them out and refuses `-a aws` with the build to use. Build cilock with `GOWORK=off go build -tags aws_attestors ./cmd/cilock` (or `rookery-builder --with github.com/aflock-ai/rookery/plugins/attestors/aws-iid`).
- **IMDSv2 by default.** The attestor builds its IMDS client via `imds.NewFromConfig(awsConfig)` with SDK defaults, which enable the token provider — calls go out as IMDSv2 (PUT `/api/token`, then GET with `X-aws-ec2-metadata-token`). The SDK transparently falls back to IMDSv1 when the token PUT fails, so hosts still on IMDSv1-only continue to work.
- **Non-EC2 hosts hard-fail the step.** `getIID()` returns `failed to get instance identity document` when IMDS is unreachable (no `169.254.169.254`, blocked by hop limit, or running outside EC2). `Attest()` surfaces this as a hard error.
- **Signature verification is mandatory.** If `Verify()` fails — bad signature, expired region cert, missing region cert for an unknown region, or non-RSA cert — the entire attestation fails. There is no opt-out.
- **Region cert source.** When `--attestor-aws-region-cert` is unset, the attestor uses the region from the loaded AWS config (or, if empty, the region inside the IID itself) to look up a certificate from an embedded map covering 38 regions, including `us-gov-east-1`, `us-gov-west-1`, `cn-north-1` and `cn-northwest-1`. Regions not in the map (new launches, Secret regions, etc.) must supply a cert via the flag.
- **Cert validity is checked.** The embedded certificates have `NotBefore`/`NotAfter` windows; expired or not-yet-valid certs are rejected before signature verification. Keep cilock builds current as AWS rotates region certs.
- **AWS config required.** `Attest()` calls `config.LoadDefaultConfig` when no config was injected; this can fail on hosts with no AWS configuration even where IMDS itself would have worked.
## CLI example
Real EC2 instance identity document fetched from IMDSv2, verified against the AWS-published regional certificate.
```bash
cilock run --step ec2-identity \
--signer-file-key-path key.pem --outfile attestation.json --workingdir . \
--attestations aws \
--attestor-aws-region-cert /path/to/aws-us-east-1.pem \
-- echo "captured EC2 instance identity"
```
Validated against a real EC2 t3.small in us-east-1f. The us-east-1 cert is embedded in the attestor, so `--attestor-aws-region-cert` is optional there. See the full real-data example at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/25-aws](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/25-aws).
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [`aws-codebuild`](./aws-codebuild.mdx)
- Upstream: [witness/aws.md](https://github.com/in-toto/witness/blob/main/docs/attestors/aws.md)
---
# base-ancestry
Source: https://www.testifysec.com/docs/cilock/attestors/base-ancestry/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/base-ancestry.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/base-ancestry.json';
# `base-ancestry` attestor
`base-ancestry` answers one question about the commit under test: does it
include the base branch it claims to be built on? It records the head commit,
the base ref, the base commit the local clone could see for that ref, the
merge-base of the two, and the relationship those hashes imply.
It is the client half of Pushgate's **Current with base** rule. The attestor
signs what the LOCAL commit graph showed at test time; the platform reads the
provider's CURRENT base with its own repository-scoped identity and joins the
two. A base that advanced after the tests ran shows up as a mismatch between
the attested base and the provider's, and the gate can refuse the push with a
precise reason instead of GitHub's broad "mergeable" state.
## Validated invocation
Run it beside `git` — the git attestor is what binds the collection to the
exact head commit — from a clone that has fetched the base branch:
```bash
cilock run \
--step push-tests \
--platform-url "$PLATFORM_URL" \
--attestations git,alps-evidence,base-ancestry \
--attestor-base-ancestry-base-ref main \
-- go test ./...
```
`alps-evidence` rides along for a reason unrelated to the base: passing ANY
explicit attestor list disables cilock's workload auto-detection, and that
attestor is what the Pushes ledger reduces to attribute a push to a coding
agent. A `push-tests` list that stops at `git,base-ancestry` mints evidence
with no agent record, and every push it gates reads `agent=NULL`.
`--attestor-base-ancestry-base-ref` names the base branch. Omit it and the
attestor falls back to `GITHUB_BASE_REF` (set by GitHub Actions on
`pull_request` events), then in a GitLab CI job to
`CI_MERGE_REQUEST_TARGET_BRANCH_NAME` (set on merge request pipelines), then
to the remote's recorded default branch (`refs/remotes/origin/HEAD`, written
by `git clone`). With none of these the predicate records `relationship: unknown` and a warning saying so.
`--attestor-base-ancestry-remote` changes the remote whose tracking refs
supply the base (default `origin`).
## What gets captured
- `head`: the commit under test (HEAD of the working directory).
- `base_ref` and `base_ref_source`: the base branch by short name, and who
chose it — `flag`, `env:GITHUB_BASE_REF`,
`env:CI_MERGE_REQUEST_TARGET_BRANCH_NAME`, or `remote-head`.
- `base_resolved_from`: the full local ref the base commit was read from,
normally `refs/remotes/origin/`. A local branch of the same name is the
fallback and is named as such, because it may never have been fetched.
- `base`: the base commit **as the clone saw it** — not the provider's current
base, which only the platform can observe.
- `merge_base`: `git merge-base head base`.
- `relationship`: `current` (the base is an ancestor of the head), `behind`
(the head is an ancestor of the base), `diverged` (each side has commits the
other lacks — a statement about the graph, not about conflicts), or
`unknown`.
- `shallow`: whether the clone has grafted history.
- `observed_at`: when the graph was read.
- `remotes`: configured remote URLs with credentials stripped, the same
repository identity the git attestor records.
- `warnings`: why a relationship could not be established. Never empty when
`relationship` is `unknown`.
No subjects, backrefs, materials, or products are emitted.
## Why this shape
The rule needs two independent observations of the same fact. The client can
only sign what its clone contained; the platform can only read what the
provider serves now. Neither alone proves that the tested commit includes the
current base: the client's base may be stale, and the platform has no signed
record of what was tested. Keeping this predicate strictly local means it needs
no provider credential, cannot be confused by one, and stays honest about what
it is — an observation of a graph at a moment.
`unknown` is a first-class answer rather than a failure. A shallow clone, an
unfetched base, or no base ref at all each yield a signed predicate that says
the relationship could not be established and why. A gate in Enforce mode
refuses it; one in Observe mode shows it; neither can mistake it for `current`.
## Validate it locally
Build the in-tree binary and run the attestor in a throwaway clone with an
ephemeral key, once per state you want to see:
```bash
cd subtrees/rookery/cilock && GOWORK=off go build -o /tmp/cilock ./cmd/cilock
openssl genpkey -algorithm ed25519 -out /tmp/key.pem
cd /path/to/a/clone && git fetch origin main
/tmp/cilock run --step base-ancestry-check --workload manual --offline \
--signer-file-key-path /tmp/key.pem --enable-archivista=false \
--attestations git,base-ancestry --attestor-base-ancestry-base-ref main \
--outfile /tmp/attestation.json -- true
```
Decode the collection and read the `base-ancestry` entry. Advance `origin/main`
past the head (`git fetch` after a merge upstream) and rerun to see `diverged`;
`git clone --depth 1` a repository and commit once on top of it to see
`shallow: true` with `unknown` (a fresh shallow clone whose HEAD is still the
base reports `current`, because a commit trivially includes itself).
## How a verifier consumes this
Pushgate's evaluate endpoint reduces the predicate out of the verified
collection for the pushed commit, then compares four things: the predicate's
`head` equals the pushed commit; its `base_ref` equals the pull request's
target branch (or the repository's configured base); its `base` equals the
base commit the platform read from the provider; and its `merge_base` equals
that base. All four hold only when the exact commit being pushed includes the
base as it stands now. The joined result travels in the signed verdict as
`base_ancestry` — with `target_source` saying whether a pull request, a
configured base, or nothing selected the target — and is reported on the push
ledger. The attestor itself proves nothing on its own: without the platform's
read of the provider it is one side of a comparison.
## Notes
- The remote-tracking ref is preferred over a local branch of the same name
because it is what the clone last **fetched**; the local branch is only what
the developer last checked out. `base_resolved_from` says which was used.
- Criss-cross histories have several merge-bases. The relationship is decided
by whether the base itself is among them; the first is recorded and a
warning notes the ambiguity.
- A base ref whose object is missing from the store (a partial clone, a
hand-written ref) yields `unknown` with a warning naming the ref.
- The attestor never contacts the provider and never reads credentials.
## Gotchas
- `current` means current with the base **the clone saw**. If the base
advanced upstream after the last fetch, the platform's join reports it, not
this predicate. Fetch before testing to keep the two in step.
- A rebase changes the head SHA, so the collection this predicate travels in no
longer matches the pushed commit. Re-run CI/lock after rebasing; that is the
rule working as designed.
- `diverged` does not mean the merge would conflict, and `current` does not
mean reviews, checks, or policy passed. Those are separate observations.
- Passing `--attestations` replaces cilock's default set, so name `git`
explicitly beside `base-ancestry`; without it nothing binds the collection
to the commit.
## FAQ
### Can the platform trust `base` as the provider's current base?
No, and it is not meant to. `base` is the client's view. The platform reads
the provider itself and compares; a difference is exactly what the rule exists
to catch.
### What happens on the first push of a branch, before a pull request exists?
The attestor still records the relationship against whatever base it chose.
Whether that is enforced depends on the gate: with no pull request and no
configured base, Pushgate reports "not evaluated" rather than guessing a
target.
### Why not read the base from the `git` predicate?
The git attestor records the head commit and its parents, which is not enough
to say whether an arbitrary base is an ancestor. Ancestry needs the merge-base,
and overloading the git predicate with a base-relative field would blur what a
verified `commithash` subject means.
## See also
- `git` — binds the collection to the exact head commit; run it beside this.
- `github-review` — records pull request head and base SHAs as the API showed
them, without proving ancestry.
---
# buildpacks
Source: https://www.testifysec.com/docs/cilock/attestors/buildpacks/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/buildpacks.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/buildpacks.json';
# `buildpacks` attestor
Parses the Cloud Native Buildpacks lifecycle's own outputs — `report.toml` from `pack build --report-output-dir` and a JSON dump of the `io.buildpacks.*` image labels — and binds them into one predicate whose subject is the built image's digest.
kpack signs SLSA provenance for builds inside its Kubernetes controller; every other `pack` invocation (laptops, generic CI) produces no verifiable evidence. This attestor closes that gap wherever `cilock run -- pack build …` runs, and records the buildpacks-specific facts generic SLSA has no fields for.
## What it captures
- `imagedigest` — a `DigestSet` holding the SHA256 of the built image, from `report.toml [image].digest`. Present for registry (`--publish`) exports only; see Gotchas for daemon exports.
- `imagetags`, `imageid`, `manifestsize` — the rest of the report's image section. Context, never identity.
- `runimage` — the base image under the app from the `io.buildpacks.lifecycle.metadata` label: `reference` (digest-resolved by the lifecycle at export), `image`, and `toplayer`. The policy-pinnable field.
- `buildpacks` — the group that ran (`id`, `version`, `homepage`) from `io.buildpacks.build.metadata`.
- `launcher` — the lifecycle's own provenance from the same label: version plus the source repository and commit it was built from.
- `basedistro`, `stackid` — run-image OS distribution and stack labels.
- `sbomlayer` — the digest (diffID) of the image's SBOM layer, from the `io.buildpacks.lifecycle.metadata` label. Loose `--sbom-output-dir` files are deliberately **not** read (see Gotchas).
Every label-derived field (`runimage`, `buildpacks`, `launcher`, `basedistro`, `stackid`, `sbomlayer`) is read **only** from the image's own OCI config blob, reached by content address from the report: `report [image].digest` is the image manifest's digest, the manifest names the config blob's digest, and the config carries the labels. Each hop is checked by sha256, so a claim can never be hung on a digest it does not belong to.
Subjects exported: `imagedigest:` (real content digest), `imagereference:` per tag, and `runimagedigest:` — the subject a run-image-pinning policy verifies against.
## When to use
Any step that runs `pack build`. The wrapped command must produce every input the attestor reads — the report, the image **manifest**, and the image **config** blob — so they are all products of the SAME signed run. Export the manifest and config by the report's immutable digest inside the wrapped script (the attestor itself never talks to a registry or daemon):
```bash
cilock run --step build -a buildpacks -- bash -c '
pack build registry.example/app --publish --report-output-dir ./out &&
DIGEST=$(grep -oE "sha256:[0-9a-f]{64}" ./out/report.toml | head -1) &&
crane manifest "registry.example/app@$DIGEST" > ./out/manifest.json &&
crane config "registry.example/app@$DIGEST" > ./out/config.json
'
```
The manifest and config are exported by the report's **immutable digest**, not a tag, so what the attestor reads is exactly what that digest commits to. `crane manifest` returns bytes that hash to the report digest and name the config blob's digest; `crane config` returns the config blob, which hashes to that name and carries the `io.buildpacks.*` labels. The attestor verifies both hops by sha256, so a fabricated dump that merely *claims* to be image A's labels is ignored rather than misattributed — this is why a plain `docker image inspect` dump (whose `RepoDigests` are self-declared and unverifiable) is **not** used. `skopeo inspect --raw` / `skopeo inspect --config --raw` are equivalent if `crane` is unavailable. A manifest/config exported *after* `cilock run` exits is NOT captured — it is not a product of the completed attestation.
## Flags
None. Detection is by product shape: any product named `report.toml` that parses as a lifecycle report, plus the image manifest and config blob, which are selected by content address (their sha256 must equal the report digest and the manifest's config digest). Loose SBOM files, and any JSON that matches no hop, are ignored.
## Output shape
```json
{
"imagedigest": {"sha256": "0f067a8e…"},
"imagetags": ["localhost:5001/demo-app"],
"manifestsize": 1538,
"runimage": {
"image": "docker.io/heroku/heroku:24",
"reference": "index.docker.io/heroku/heroku@sha256:26197de1…",
"toplayer": "sha256:d72a839c…"
},
"buildpacks": [{"id": "heroku/go", "version": "4.1.0", "homepage": "…"}],
"launcher": {"version": "0.21.18", "repository": "github.com/buildpacks/lifecycle", "commit": "4bd4b13e"},
"basedistro": {"name": "ubuntu", "version": "24.04"},
"stackid": "heroku-24",
"sbomlayer": {"sha256": "fd794d63…"}
}
```
## Gotchas
- **Daemon exports mint no identity.** Without `--publish`, `report.toml` carries only a daemon-local `image-id` — recorded for context, but no `imagedigest` subject exists and the attestor warns. A tag is repointable and an image-id is daemon-local; only a registry digest is durable identity.
- **No report, no attestation.** Without `--report-output-dir` the lifecycle writes nothing on the host; the pre-gate warns and suggests the flag.
- **A `docker image inspect` dump is not trusted.** Its `RepoDigests` are a self-declared string a build script can fabricate — naming image A while carrying another image's `runImage.reference` — so it is not evidence of what image A actually is. Export the OCI manifest + config by digest instead; the attestor reads labels only from the config that the report digest cryptographically commits to.
- **Multi-arch (image index) builds mint no labels.** If `report [image].digest` resolves to an OCI image index rather than a single image manifest, there is no one config to read, so the label-derived fields are left unset (identity still stands). Single-arch app images — pack's default — are unaffected. Relatedly, an amd64-only builder crashes on arm64 hosts under emulation (e.g. Paketo's jammy builders); multi-arch builders such as `heroku/builder:24` run natively.
- **Loose `--sbom-output-dir` files are not attested.** A file exported by `--sbom-output-dir` carries no image identity, so nothing on the filesystem binds it to the reported image. The attestor records only `sbomlayer`, the image's own SBOM-layer digest from its content-chained config. To attest SBOM *contents*, run a dedicated SBOM attestor (e.g. `syft`/`trivy`) that binds them to the image itself; the SBOM layers are also inside the image the `imagedigest` subject already covers.
- A file merely *named* `report.toml` that does not parse as a lifecycle report is skipped — a name is not evidence.
## CLI example
Build and sign — this writes the attestation to `att.json`:
```bash
cilock run --step build -a buildpacks --signer-file-key-path key.pem -o att.json -- bash -c '
pack build localhost:5001/demo-app --publish --network host \
--builder heroku/builder:24 --report-output-dir ./out &&
D=$(grep -oE "sha256:[0-9a-f]{64}" ./out/report.toml | head -1) &&
crane manifest "localhost:5001/demo-app@$D" > ./out/manifest.json &&
crane config "localhost:5001/demo-app@$D" > ./out/config.json'
```
Then read the buildpacks predicate back out of `att.json`:
```bash
jq '.payload | @base64d | fromjson
| .predicate.attestations[]
| select(.type | contains("buildpacks"))' att.json
```
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [`docker`](./docker.mdx) — the same identity rules for `docker buildx` builds
- [`oci`](./oci.mdx) — attesting OCI image tarballs directly
- Upstream: [buildpacks.io platform spec](https://buildpacks.io/docs/reference/spec/platform-api/)
---
# change-approval
Source: https://www.testifysec.com/docs/cilock/attestors/change-approval/
# `change-approval` attestor
Records one person's approval of one exact change: the repository, the base and head commits, the digest of the changed paths the gate showed, the policy release the approval is for, and the sensitive watchpoints the person reviewed.
| | |
|---|---|
| Name | `change-approval` |
| Predicate type | `https://testifysec.com/attestations/change-approval/v0.1` |
| Lifecycle | `prematerial` |
| Default binary? | **Yes** |
## What it captures
The predicate fields, as the attestor signs them:
- `repository`: `github.com//`.
- `base_commit`, `head_commit`: full commit ids. The approval covers `base..head` and nothing else.
- `changes_digest`: hex sha256 of the observed changes the gate showed for `base..head`.
- `release_digest`: hex sha256 of the policy release the approval is for.
- `watchpoints[]`: `{ id, path, category }` for each touched sensitive watchpoint the person reviewed. Empty when none were touched.
- `decision`: always `approve`.
- `signer_email`: the email the person signs in as. A verifier requires it to equal the certificate's email.
- `approved_at`: UTC, truncated to the second.
Subjects emitted: `commitsha:` (the head commit id), `changes:`, and, for a SHA-1 head, `https://testifysec.com/attestations/change-approval/v0.1/commithash:`. That last one is the shape an external attestation's `commitSubject` can declare, so a verify seeded by the commit (`--subjects sha1:`) finds the approval.
## When to use
When a policy needs proof that a named person looked at a specific change before it landed, for example a gate that holds a push touching sensitive paths until a person approves that exact `base..head` and policy release. A person signs it; an agent cannot.
## Flags
Each is a `cilock run` / `cilock attest` flag (see `cilock run --help-advanced`).
| Flag | Required | Purpose |
|---|---|---|
| `--attestor-change-approval-repository` | Yes | Repository the change is in, `github.com//`. |
| `--attestor-change-approval-base` | Yes | Full commit id the change is based on (the protected branch tip the gate diffed from). |
| `--attestor-change-approval-head` | Yes | Full commit id of the exact change being approved. |
| `--attestor-change-approval-changes-digest` | Yes | Hex sha256 of the observed changes for `base..head`. |
| `--attestor-change-approval-release-digest` | Yes | Hex sha256 of the policy release the approval is for. |
| `--attestor-change-approval-signer-email` | Yes | Email you sign in as. |
| `--attestor-change-approval-watchpoints` | No | Path to a JSON array of `{id, path, category}`. A relative path resolves against the working directory. |
## Gotchas
- **Human only.** `Attest` refuses unless the run signs through `--human` (the platform's browser login). An enrolled agent or a stored key would sign an approval no person gave, so the attestor returns an error instead. See [`cilock run`](../reference/cli.md#cilock-run-cmd).
- **Never auto-detected.** The detector fires only when `CILOCK_CHANGE_APPROVAL` is set. Name the attestor with `-a change-approval`; the run still needs every required flag or it refuses.
- Every field is validated before signing. A missing or malformed value fails the run rather than producing a partial approval.
## CLI example
```bash
cilock attest --human --step change-approval -a change-approval \
--attestor-change-approval-repository github.com/acme/widget \
--attestor-change-approval-base "$BASE_SHA" \
--attestor-change-approval-head "$HEAD_SHA" \
--attestor-change-approval-changes-digest "$CHANGES_DIGEST" \
--attestor-change-approval-release-digest "$RELEASE_DIGEST" \
--attestor-change-approval-signer-email you@example.com
```
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [`design-signoff`](./design-signoff.md), the same human-only pattern for a design document
- [`github-review`](./github-review.mdx), [`gitlab-review`](./gitlab-review.mdx), [`code-review`](./code-review.mdx)
---
# code-review
Source: https://www.testifysec.com/docs/cilock/attestors/code-review/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/code-review.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/code-review.json';
# `code-review` attestor
Reads the result JSON a direct-review runner wrote (`jade review worker-run` in testifysec/judge), checks its shape, and exports it as a bare in-toto statement, never inside a collection.
## What it captures
The predicate is the runner's result field for field. A field the attestor does not know is refused, never dropped.
- `head`, `base`: the 40-hex commits of the reviewed diff.
- `verdict`: `APPROVED`, `CHANGES_REQUESTED` or `INCOMPLETE`. `severity`, `scope` (`full`, `partial`, or under v0.3 `carry`).
- `config`: `source` (always `default-branch`), `mainSha`, `promptDigest`, `rubricDigest`, `model`, `effort`, `threatModel`, `threatModelDigest`, `requestedModel`, `servedModel`, `servedModelSource`.
- `execution`: `shellTool`, `sandbox`, `diffInline`, `checkout`.
- `reviewer` (`account`, `session`) and `requester` (`agent`, `session`).
- `transcriptDigest`, `findingsDigest`, `codexExit`, `reason`, `diffBytes`, `worker`, `startedAt`, `finishedAt`, `phases`.
- `timeVerified`: `finishedAt` as RFC 3339, the signed time a policy orders reviews of one head by.
- With `--attestor-code-review-v02`: `authors` (`id`, `kind` `agent` or `human`, `source`, `commit`) and `needsHuman` (`required`, `reason`). A result carrying either is signed as `https://aflock.ai/attestations/code-review/v0.2`; one carrying neither stays v0.1.
- With `--attestor-code-review-v03`: `excluded`, the files of base..head the reviewer was not shown, each as `path` (a clean repository path) and `blob` (the 40-hex blob the head holds there, all zeros for a file the head deleted). A result that lists any is signed as `https://aflock.ai/attestations/code-review/v0.3`; the list is never empty, and a person's approval never carries it.
- With `--attestor-code-review-v03`, scope `carry`: a validity review, not a code review. It says a person's approval of an earlier head still holds on this rebased head, and carries `carriedFrom` (`head` and `base` the person approved, `approval`: the sha256 gitoid of that signed approval), `interdiffDigest` (sha256 of the interdiff the validator read) and `mechanical` (`eligible`, `ruleVersion`, `rangeDiffDigest`: the mechanical carry gate's verdict). The four come together, only as v0.3, never beside `excluded`, and an `APPROVED` carry only over an eligible gate. A gate that admits code reviews reads scope `full`, so a carry never satisfies one.
- With `--attestor-code-review-v04`: `decisions`, the signed residual decisions the reviewer's prompt carried, each as `id` (`RD-NNNN`) and `gitoid` (the 64-hex gitoid of the design sign-off that signs the record). A result that lists any is signed as `https://aflock.ai/attestations/code-review/v0.4`; the list is never empty, each id and gitoid appears once, and a person's approval never carries it.
- With `--attestor-code-review-v05`: `changeId`, the change the reviewed head belongs to (a lowercase v4 UUID the worker read from the head commit's `Change-Id` trailer, never the requester's word) with `repository`, the lower-case `owner/name` from the worker's own configuration, and `findings`, the review message itself (its sha256 must equal `findingsDigest`, at most 256 KiB), so the next review can be handed it from the signed record, and `priors`, the earlier signed reviews of that change the reviewer was given (more than one when sibling reviews raced), each as `head` (40-hex; the reviewed head itself for a rerun) and `findingsDigest` (the 64-hex `findingsDigest` of that review), each listed once. A result carrying any of them is signed as `https://aflock.ai/attestations/code-review/v0.5`; one that names its change (`changeId` with `repository`, which then must carry `findings` unless its message is empty) has a second subject, `https://aflock.ai/attestations/code-review/v0.5/changeid:/` with `sha256=`, so a gate can find every signed review of one change; `priors` needs `changeId`, `changeId` and `repository` come together, neither is for scope `carry`, and a person's approval carries neither.
- With `--attestor-code-review-v06`: `diffDigest`, the lowercase sha256 hex of exactly the diff bytes the reviewer's prompt carried (the kept prefix when `scope` is `partial`, the diff without the `excluded` files when it lists any), so the review is bound to what it was shown, not to what head and base re-derive later. A result carrying it is signed as `https://aflock.ai/attestations/code-review/v0.6`, whatever older fields it also carries (each still needs its own switch); a result without it keeps its older type. It is never null or empty, never for scope `carry` (a carry signs `interdiffDigest`), and a person's approval never carries it. A v0.6 result that names its change has its change subject named under v0.6: `https://aflock.ai/attestations/code-review/v0.6/changeid:/`.
- With `--attestor-code-review-v07`: `targetRef`, the full ref of the branch (`refs/heads/`) that held both `base` and `config.mainSha` when the review was signed, as the signer read that branch from Pushgate's copy of `repository` with its own agent credential, never the requester's word or the worker's own refs. It comes with `repository` (the lower-case `owner/name` from the signer's configuration, with or without `changeId`) and `diffDigest`. A result carrying it is signed as `https://aflock.ai/attestations/code-review/v0.7` (each older field still needs its own switch); a signer that could not verify the branch signs no v0.7 copy. It is never null or empty, never for scope `carry`, and a person's approval never carries it. A v0.7 result that names its change has its change subject named under v0.7.
A person's approval is the second form the result can take. It has an `approval` block (`kind`: `review` or `bypass`, plus a non-blank `reason`) and only `head`, `base`, `verdict` (`APPROVED` or `CHANGES_REQUESTED`), `severity`, `scope`, `startedAt`, `finishedAt` and, under v0.2, `authors`. It has no `config`, `execution`, `reviewer` or `requester`; the signer's certificate says who the person is.
One subject per review, and a second for a v0.5 review that names its change: `/commithash:` (for example `https://aflock.ai/attestations/code-review/v0.1/commithash:`; a carry is always v0.3) with digest `sha1=`. Base and main are not subjects, so a digest search never finds the review as evidence about another commit. A v0.5 result also carries `https://aflock.ai/attestations/code-review/v0.5/changeid:/` with digest `sha256=`, which names a change, never a commit.
The attestor records every verdict as it is. It does not decide whether a push is admitted; write that rule in policy.
## When to use
On the machine that ran the review, signed by the reviewer's own identity:
```
cilock attest --step code-review -a code-review --attestor-code-review-result review.json
```
## Flags
- `--attestor-code-review-result `: the runner's result JSON. Default: `$CODE_REVIEW_RESULT`.
- `--attestor-code-review-v02`: accept a result carrying `authors` or `needsHuman` and sign it as v0.2. Default: `false`.
- `--attestor-code-review-v03`: accept a result carrying `excluded` and sign it as v0.3. Default: `false`.
- `--attestor-code-review-v04`: accept a result carrying `decisions` and sign it as v0.4. Default: `false`.
- `--attestor-code-review-v05`: accept a result carrying `changeId`, `repository`, `priors` or `findings` and sign it, and every result but a carry, a person's approval too, as v0.5. Default: `false`.
- `--attestor-code-review-v06`: accept a result carrying `diffDigest` and sign it as v0.6. Default: `false`.
- `--attestor-code-review-v07`: accept a result carrying `targetRef` and sign it as v0.7. Default: `false`.
## How a verifier consumes this
A policy external of `predicateType` `https://aflock.ai/attestations/code-review/v0.1` with `commitSubject` `https://aflock.ai/attestations/code-review/v0.1/commithash:` binds the statement to the pushed commit, its functionaries pin the reviewer identities, and a `timestampConstraint` makes the newest review of the head decide.
---
# command-run
Source: https://www.testifysec.com/docs/cilock/attestors/command-run/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/command-run.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import VersionedDoc, {VersionPane} from '@site/src/components/Catalog/VersionedDoc';
import meta_v0_3 from '@catalog/command-run-v0.3.json';
import meta_v0_2 from '@catalog/command-run.json';
import meta_v0_1 from '@catalog/command-run-v0.1.json';
# `command-run` attestor
Records the command `cilock run` executed — argv, exit code, captured stdout/stderr, and (when `--trace` is enabled on Linux) a per-process ptrace record of opened files, network activity, file mutations, and security-sensitive syscalls.
## What it captures
Top-level `CommandRun` fields (json tags from the struct):
- `cmd` — the argv slice that was executed.
- `stdout` — the verbatim stdout the process wrote (captured into a `bytes.Buffer` and stored as a string).
- `stderr` — the verbatim stderr, same mechanism.
- `exitcode` — the child's exit status.
- `processes` — populated only when `--trace` is on; one `ProcessInfo` entry per traced PID.
- `program`: the program `argv[0]` started, recorded on **every** run, traced or not, on every platform. There is no flag to turn it off. See [The program record](#the-program-record).
In memory, each `ProcessInfo` carries the fields below; the signed body names most of them by index instead (see [The signed body](#the-signed-body)). `program`, `processid`, `parentpid`, `programdigest`, `comm`, `cmdline`, `exedigest`, `exedigestSource` (what `exedigest` measures: `mapped-image` is SHA-256 of `/proc//exe` read through a single descriptor, claimed only when the backend can PROVE both that the measured file is the image this exec mapped and that the image stayed write-protected across the whole measurement - today only the ptrace backend, which holds the tracee stopped at the execve return; `path-hash` means the value is a copy of `programdigest`, the bytes at the caller-named path when the tracer opened it, which is not proof of what executed; empty means unlabelled, never "mapped image"; a policy comparing `exedigest` against an image allowlist must require `mapped-image`), `exedigestDowngradeReason` (why a backend that would otherwise report the mapped image reported a path hash: `not-kernel-bound` - the exec event carries no kernel identity to bind the measurement to, which is the case for the eBPF backend because its execve event comes from a syscall-entry kprobe fired before the kernel resolves or maps anything, so that backend always downgrades; `unprotected-measurement` - write protection could not be GUARANTEED for the whole measurement, so the bytes hashed need never have executed. This covers the process no longer mapping the image (ETXTBSY lapses once the last executing reference goes away), running on Linux 6.11 or 6.12 where an in-place write to a mapped image is not ETXTBSY-denied, and being unable to determine the kernel version at all - an unknown answer downgrades exactly as a negative one does, because a producer that cannot tell whether writes were possible is in the position of one that knows they were. Empty means no downgrade. It exists so a verifier can tell "the producer declined to claim what it could not prove" from "this producer never populated the field"), `environ`, `specbypassisvuln`, `exitcode` (per-process exit status; for signal-terminated processes uses the shell convention `128 + signal_number`; absent/zero means "still running when trace ended"), `openedfiles` (a `map[path]DigestSet` populated from `openat` syscalls and re-resolved at trace end), plus three nested structures:
- `network` (`NetworkActivity`): `sockets[]`, `connections[]` (each with `syscall`, `family`, `address`, `port`, `fd`, `timestamp`, and `hostname` for TLS SNI from ClientHello on port 443), `dnsLookups[]`.
- `fileOps` (`FileActivity`): `writes[]`, `renames[]`, `deletes[]`, `permChanges[]` (mode bits + `setExec`). A write is named by the file behind the descriptor, not by the descriptor number's last open: the eBPF backend reads the file's identity when the write starts, and the ptrace backend pins the descriptor at entry and checks it at exit. `/proc//fd/N` is used only when it still names that same file. A write to a socket, pipe or device is not a file write; a write to a regular file through stdout or stderr (a shell's `> out`) is. When a large trace moves to its companion, writes are stored one record per process and file; see [Large builds](../guides/large-builds.md#the-trace-companion-format-command-run-tracev02).
- `syscallEvents[]` — notable syscalls: `memfd_create`, `ptrace`, `mount`, `clone` (with namespace flags), `dup2` (socket→stdio = reverse-shell pattern), `mprotect` (PROT_EXEC), `prctl` (PR_SET_NAME / PR_SET_DUMPABLE / PR_SET_NO_NEW_PRIVS), `setsid`, `setns`, `init_module`/`finit_module`.
### The signed body
The `command-run/v0.2` predicate is an interned form of the record above, not the `ProcessInfo` JSON. It carries `_meta` (version, capture mode, trace backend) and `summary`, then the tables `digests[]` (each `{digests, src}`), `paths[]`, `comms[]` and `cmdlines[]`. Each `processes[]` entry keeps `processid`, `parentpid`, `exitcode`, `network` and `fileOps` inline and names everything else by index into those tables: `commId`, `execPathId`, `cmdlineId`, `programDigestId`, `exeDigestId` (`-1` when absent), and `openedFiles` / `writtenFiles` as lists of `{pathId, digestId}`. `exedigestSource` is signed as `exeDigestSource`, `exedigestDowngradeReason` as `exeDigestDowngrade`, and `syscallEvents` as `syscalls`. `environ` and `specbypassisvuln` are dropped and never signed. A Rego rule reads an opened file's path as `input.paths[f.pathId]`. `cmd`, `exitcode`, `stdout`, `stderr` and `program` stay top-level and inline.
A trace whose v0.2 body would exceed `--attestor-command-run-trace-split-threshold` (default 4 MiB) is signed as a `command-run/v0.3` skeleton instead, with the process trace moved to a `command-run-trace` companion bound by digest; see [Large builds](../guides/large-builds.md). A policy keyed on `command-run/v0.2`, or on `processes[*].openedFiles`, does not see that trace in the skeleton.
## The program record
`cmd` is the text the caller typed, and `terraform` names whatever `PATH` found. `program` names the file:
- `lookup`: `path-search` (a bare name searched on `PATH`), `workdir-relative` (a name with a separator, resolved against the working directory) or `absolute`.
- `path`: the absolute path the exec's own lookup produced, not lexically cleaned (`./t` run in `/w` is `/w/./t`). On Windows it carries the `PATHEXT` extension `Start` would add (`.\tool` records `...\.\tool.exe`), and cilock hands `Start` that same resolved name, so the file hashed and the file started are one string. With no working directory cilock can name, a relative `path` stays relative, opened against the directory the exec uses.
- `realPath`, `realPathSource`: the real path after every symlink, read back from the descriptor that was hashed (`proc-self-fd` on Linux, `f-getpath` on macOS), never from a second walk of the name. When the descriptor cannot answer, the name is resolved and kept only if it is the same file (`evalsymlinks-confirmed`); otherwise `realPath` is empty, `realPathSource` is `unresolved`, `realPathReason` says why, and the digest is kept. An unreadable program reports `name`, or on Linux `proc-self-fd` through an `O_PATH` descriptor.
- `digest`, `sizeBytes`: sha256 (plus any `--hashes` algorithm) of the **whole** file, with no size limit, taken through the same settle-and-bracket read the tracers use.
- `file`: device, inode, link count, `setId` (setuid, setgid, or a Linux file capability) and `fsType` of the same descriptor. `setId` is always emitted: `true` or `false` only when established, `null` with `setIdReason` when it is not. On Linux the capability is read through the hashed descriptor, and only "no such attribute" or "this file system carries none" establishes `false`; any other error leaves `null`. A rule that requires `setId == false` refuses `null`.
- `format`: `elf`, `mach-o`, `mach-o-universal`, `pe`, `script` or `other`, from the first bytes the hash read; absent when those bytes could not be read.
- `host` (`GOOS/GOARCH`) and `workdir`, the directory the child started in.
- `checkout.relation`: always emitted, and `unknown` in this release with the reason "containment is not computed by this CI/lock build". A rule that requires `outside` refuses it.
- `wrapper`: present when cilock itself started another program first: `sandbox-exec` under `--trace` on macOS, with its own path and digest.
- `unresolved`: why there is no `digest`. The only expected cause is a program cilock cannot read (`permission denied: the program is executable but not readable`, for an execute-only file). The command still runs.
- `executionBinding`: always emitted, in the `scripts[]` vocabulary. It is always `unverified` in this release: the digest is of the file the lookup named, read before the command started, and nothing proves those bytes are the ones the kernel then executed. `bindingReason` says so, or says "the exec target changed after the program was recorded" when anything other than a wrapper cilock names rewrote the exec target before it started. On Linux under `sudo` that includes the `setpriv` privilege drop, which searches `PATH` again as the invoking user.
A pin on `program.digest.sha256` is a pin on `argv[0]` only. `env A=1 tool`, `sh -c "..."`, `timeout 600 tool` and `npx tool` record the launcher, and a shim (`pyenv`, `rustup`, the macOS xcrun `/usr/bin/git`) records the shim, not the tool it starts.
**Absolute paths, including home directories.** `path`, `realPath` and `workdir` are absolute, so on a laptop they carry the login name (`/Users//.nvm/...`) into every signed attestation and to every place the attestation goes: Archivista, a platform that stores evidence, and the provider of any AI policy, which receives the whole command-run attestor as its input.
Older verifiers ignore the field: it is additive, and the predicate type stays `command-run/v0.2`. A verifier built before it shows Rego no `program`, whatever the signed bytes carry.
## When to use
Always — it's the spine of every `cilock run`. `--trace` turns the attestor from "I ran this command and here is its stdio" into a forensic record of what the process did at the syscall level.
## Flags
| Flag | Shorthand | Default | What it does |
|---|---|---|---|
| `--trace` | `-r` | `false` | Sets `SysProcAttr.Ptrace = true` on the child and enables the ptrace loop in `tracing_linux.go`. On macOS, enables the sandbox-report tracer. Unsupported platforms refuse tracing. |
| `--trace-file-content` | — | `false` | With tracing on macOS, records bounded workspace text snapshots from file-access reports. Requires explicit opt-in. |
| `--attestor-command-run-trace-split-threshold` | — | `4194304` | The v0.2 body size in bytes above which the process trace moves to a `command-run-trace` companion and the statement is signed as `command-run/v0.3`. `0` never splits. |
| `--attestor-command-run-keep-arg` | — | none | Repeatable. An exact argv element the URL-userinfo scrub leaves as it is in the signed `cmd`, for an argument shaped like `user:password@host` that is not a credential, such as the Maven goal `codex:getLatestBuild@secret.store`, whose dotted execution id reads as a proxy host. Each value is one whole element, matched byte for byte; commas are part of the value. |
**Keeping an argv element.** The argv scrub redacts an element shaped like a proxy credential, because shape cannot tell which program reads it. A positional argument of `mvn`, `mvnw` or `mvnd` that is a Maven goal with a plain execution id (`codex:getLatestBuild@secretStoreBuild`, `docker:tag@tag`) is kept in `cmd` with no declaration. The same bytes given to any other program, as the value of a Maven option, in a traced `cmdline` or in output are still redacted, and so is a goal whose execution id has a dot, a port or token-like bytes: `mvn clean codex:getLatestBuild@secret.store` is signed as `mvn clean ******@secret.store`. An element `KEY=value` whose key names a secret (`-Dpassword=`, `--client-secret=`, `NPM_TOKEN=`) keeps its key and loses its value, and so does the element after a flag that names one (`--password `). Declare the element to keep it:
```bash
cilock run --attestor-command-run-keep-arg 'codex:getLatestBuild@secret.store' -- mvn -B clean codex:getLatestBuild@secret.store install
```
Only an element equal to a declared string skips the scrub. A longer element that contains it (`-Dgoal=codex:...`) or a near-miss is redacted as before. Sensitive environment values are masked first, so a declaration cannot sign a secret from the environment. The traced `cmdlines[]` table and stdout/stderr keep their redaction. The record carries the declaration in `_meta.argvKept`: `declared` (sorted), `cmdIndexes` (the `cmd` indexes kept that would otherwise have been redacted) and `cmdlines: "redacted"`. It is absent when nothing was declared, and the predicate type stays `command-run/v0.2`. A policy can refuse any relaxation with `not input._meta.argvKept`. Do not declare a credential: it is already in your pipeline config, and declaring it signs it.
## Output shape
```json
{
"cmd": ["go", "build", "./..."],
"stdout": "...verbatim bytes the child wrote to stdout...",
"stderr": "...verbatim bytes the child wrote to stderr...",
"exitcode": 0,
"program": {
"lookup": "path-search",
"path": "/usr/local/go/bin/go",
"realPath": "/usr/local/go/bin/go",
"realPathSource": "proc-self-fd",
"digest": {"sha256": "..."},
"sizeBytes": 16100000,
"file": {"device": 2049, "inode": 1311234, "links": 1, "setId": false, "fsType": "ext4"},
"format": "elf",
"host": "linux/amd64",
"workdir": "/home/runner/work/app/app",
"checkout": {"relation": "unknown", "reason": "containment is not computed by this CI/lock build"},
"executionBinding": "unverified",
"bindingReason": "this CI/lock build does not bind the program to the exec: the digest is of the file the lookup named, read before the command started"
},
"_meta": {"version": "v0.2"},
"digests": [{"digests": {"sha256": "..."}}, {"digests": {"sha256": "..."}}],
"paths": ["/usr/local/go/bin/go", "/path/to/go.mod"],
"comms": ["go"],
"cmdlines": ["go build ./..."],
"processes": [
{
"processid": 12345,
"parentpid": 12344,
"commId": 0,
"execPathId": 0,
"cmdlineId": 0,
"programDigestId": 0,
"exeDigestId": 0,
"exeDigestSource": "mapped-image",
"openedFiles": [{"pathId": 1, "digestId": 1}],
"network": {
"sockets": [{"family": "AF_INET", "type": "SOCK_STREAM", "protocol": 0, "fd": -1}],
"connections": [{"syscall": "connect", "family": "AF_INET", "address": "140.82.112.3", "port": 443, "fd": 7, "timestamp": "2026-05-21T12:00:00Z", "hostname": "proxy.golang.org"}],
"dnsLookups": [{"serverAddress": "1.1.1.1", "serverPort": 53}]
},
"fileOps": {
"writes": [{"path": "/tmp/go-build/main", "bytes": 4096, "timestamp": "..."}]
},
"syscalls": [{"syscall": "memfd_create", "detail": "...", "timestamp": "..."}]
}
]
}
```
## Gotchas
- **`stdout` / `stderr` are raw bytes, not digests.** The attestor stores `stdoutBuffer.String()` and `stderrBuffer.String()` into the predicate byte for byte, with two redactions that also apply to `cmd` and every traced `cmdline`: the value of an environment variable whose name marks it as a secret (`TOKEN`, `SECRET`, `PASSWORD`, ...) becomes `[REDACTED]`, and the userinfo of a URL (`http://user:pass@proxy:3128`, `user:pass@proxy:3128`) becomes `******`, the rule the environment attestor applies to its values, read word by word. A URL is never recorded with a host the command did not use: where Go, Python, WHATWG and curl do not read one userinfo and one host, the URL keeps only its scheme and `******@/`, so `https://a@evil.example@github.com/x`, `evil.example:8080/x@github.com` and `pip install git+https://github.com/org/repo@v1.2.3` all lose their host and path. An argv element that is a URL, or a flag whose value is one, is read whole, so `--proxy=http://u:my pw@proxy:3128` is redacted. So is one that is a URL once its tabs and newlines are removed, as WHATWG removes them (`http://u:pass@proxy:3128`). A `KEY=` prefix on a word or an element is not taken on trust, because `=` is also base64 padding: the positional proxy value `dG9rZW4=@proxy:3128` is a token and a proxy, not a key and an empty userinfo. Such a word is read whole as well as after its key, and where the whole reading finds a credential the key goes with it, so `HTTPS_PROXY=user:pass@proxy:3128` in output becomes `******@proxy:3128`. The name-based redaction runs first, because it finds a value byte for byte and the URL redaction rewrites the bytes: a secret variable whose value holds a URL (`API_TOKEN=https://u:p@host/?token=...`) becomes `[REDACTED]` whole, query token included. In a traced `cmdline` it runs before the elements are read apart, with the NULs between them read as spaces, so a value the shell split into two elements is masked too; in `cmd` each element is matched on its own. Nothing else is changed. Large output goes into the signed envelope as-is, and so does a secret that is neither: a password with a space in it inside a line of output, a token on its own, or a credential glued to more text (`u:p@proxy:3128,localhost`).
- **Trace capabilities differ by backend.** Linux supports eBPF/ptrace; macOS uses sandbox reports with the limitations below. Unsupported platforms refuse tracing.
- **macOS tracing needs `log stream`, which macOS runs only for the `admin` group.** A user outside `admin` (a CI account, say) either joins it (`dseditgroup -o edit -a -t user admin`) or gets a sudoers rule for exactly the command cilock runs, and cilock then starts the collector as `sudo -n` without ever prompting. Install it with `visudo -f /etc/sudoers.d/cilock-logstream`:
```text
ALL=(root) NOPASSWD: /usr/bin/log stream --style ndjson --predicate senderImagePath CONTAINS\[c\] "sandbox"
```
The escaped `\[c\]` is required: unescaped, sudoers reads `[c]` as a glob class and the rule stops matching. The rule lets the user read, as root, the Sandbox kext's reports for every process on the machine, which an admin can already do, and nothing else. Without either fix, `--trace` refuses before running the command and prints both. The attestation is the same whichever way the collector started.
- **Tracing needs `ptrace(2)`.** Default Docker drops it; you need `--cap-add=SYS_PTRACE` (and to not be under a restrictive seccomp profile). Kubernetes pods need an equivalent `securityContext.capabilities.add: [SYS_PTRACE]`.
- **The ptrace and eBPF backends kill what the command leaves running.** When the traced command exits, every process of its tree that is still running (a `nohup server &`, a database started for later steps, a Gradle or Kotlin daemon, a `setsid` child) is killed, and cilock prints `cilock-trace: killed N process(es) the traced command left running, so none acts after the trace (diagnostics.ptraceDescendantsKilled): pid 1234 sleep (sleep 300)` (`diagnostics.ebpfDescendantsKilled` under eBPF, which finds them by the kernel's fork lineage, so a `setsid` or double-forked child is found wherever it was reparented). Everything such a process did before the kill is in the trace. Before, under ptrace it sat frozen in a ptrace stop until cilock exited and then ran on untraced, and under eBPF it simply ran on untraced. A process that cannot be confirmed dead, or (eBPF) checked, is the coverage gap `descendants-unconfirmed-dead`. There is no opt-out: start a long-lived service outside the traced step, or run Gradle with `--no-daemon`.
- **`openedfiles` is populated from `openat`** — and digested at open time, with a retry pass at trace end (`retryOpenedFiles`) for files that didn't exist yet. Files opened-but-never-read still appear.
- **TLS SNI extraction is best-effort.** The tracer peeks the first write on any fd that connected to port 443 and parses the ClientHello for the `server_name` extension. Only one peek per fd; non-printable hostnames are discarded.
- **DNS detection is a heuristic** — any `connect()` to port 53 is recorded as a DNS lookup. Non-DNS traffic to port 53 will be misclassified.
## Host context (`_meta.host`)
A traced run (`--trace`) records the machine it ran on in `_meta.host`, read once before the command starts. It is additive under v0.2 and absent from an untraced run. It exists so a reviewer can tell why two traces of the same build differ: a different kernel, a missing capability, a container, or the other tracer.
| Field | What it holds |
|---|---|
| `kernel` | `sysname`, `release`, `version`, `machine` from uname, plus `lockdown`, `lsm`, `btf` and `seccompActions`. `cmdline` keeps only allowlisted boot parameters (`mitigations`, `lockdown`, `lsm`, `preempt`, `isolcpus` and similar) with short values; `cmdlineOtherParams` counts the rest |
| `sysctl` | `kernel.unprivileged_bpf_disabled`, `kernel.perf_event_paranoid`, `kernel.kptr_restrict`, `kernel.bpf_stats_enabled`, `kernel.yama.ptrace_scope`, `net.core.bpf_jit_enable`, `net.core.bpf_jit_harden` |
| `cpu` | `onlineSet`, `affinity` (CPUs the build may use) and `model` |
| `cgroup` | `unified` (cgroup v2), `cpuMax`, `memoryMax` |
| `process` | `capEffective`, `capPermitted`, `seccompMode`, `noNewPrivs` of cilock itself |
| `virtualization` | `hypervisor`, `dmiVendor`, `dmiProduct`, and `container`: every indicator found (`/.dockerenv`, `/run/.containerenv`, `systemd:`, `kubernetes`), `[]` when none |
| `tracer` | `backend` (`ebpf` or `ptrace+seccomp`), `requested` (`CILOCK_TRACE_MODE`, `auto` when unset) and `reason`, such as `auto; eBPF probe passed` or `auto; eBPF unavailable: `; and `privilege` when cilock ran from Linux file capabilities (see "Traced build privileges") |
| `tracee` | what the traced build was started with: `drop`, `uid`, `gid`, and for `root-capless`, `user`, `sudo` and `ambient` the `capBounding`, `capInheritable`, `capAmbient` and `noNewPrivs` read back from the thread the build was forked from. See "Traced build privileges" below |
| `cilock` | `version`, `revision` and `modified` of the cilock build that signed the trace |
| `unreadable` | a map from each dotted field name that could not be read to why |
Every value is read back from the host. A value cilock could not read is absent and named in `unreadable`, never recorded as zero or empty. Off Linux only `cilock` is filled and `unreadable.kernel` is `not linux`. The record names no host or user: uname's nodename is never read, the cgroup path is not recorded, and environment variables count only by presence. No policy reads `_meta.host` today; treat it as context for a reviewer, not as a check.
### Traced build privileges (`_meta.host.tracee`)
On Linux the tracer holds `CAP_BPF`, `CAP_PERFMON`, `CAP_SYS_ADMIN` and `CAP_SYS_PTRACE`. A build that inherited them could unload or blind the eBPF programs, attach to cilock, or write its memory, so a traced build never starts with them unless the operator says so. `drop` records which rule applied:
| `drop` | When | The build |
|---|---|---|
| `root-capless` | cilock runs as root with no sudo invoker: a container (`docker --privileged`, `--cap-add`), a Kubernetes pod | keeps uid 0, so it can still write its own tree, and execs with no capabilities, an empty bounding set and `no_new_privs`. A setuid or file-capability program cannot give them back |
| `user` | `CILOCK_TRACEE_USER=:`, cilock running as root | runs as that uid and gid with no supplementary groups, no capabilities and `no_new_privs` |
| `sudo` | root under sudo with a non-zero `SUDO_UID` | runs as `SUDO_UID:SUDO_GID`, under `setpriv --no-new-privs` when setpriv is on `PATH`, with the same empty bounding, inheritable and ambient sets and `no_new_privs` as the other drops |
| `inherited` | `CILOCK_TRACEE_USER=inherit` | keeps cilock's root and every capability in `process.capEffective` |
| `file-capabilities` | cilock is not root and runs from Linux file capabilities | keeps cilock's uid and starts with every set empty, an empty bounding set and `no_new_privs` |
| `ambient` | cilock is not root and holds capabilities its parent gave it, not file capabilities (systemd `AmbientCapabilities=`, `setpriv --ambient-caps`) | keeps cilock's uid and starts with every set empty, an empty bounding set and `no_new_privs`. Emptying the bounding set needs `CAP_SETPCAP` among those capabilities; without it the run stops |
| `none` | cilock is not root and holds no capabilities | has cilock's own uid |
If cilock cannot prove the drop (for example a container without `CAP_SETPCAP` cannot empty the bounding set), the run stops before the build starts and names the remedy. A uid-0 build without capabilities can still read and write files root owns and can signal cilock, so it can stop or kill it. Set `CILOCK_TRACEE_USER` to a build user to close that too. A trace with no `tracee` record comes from an older cilock, and a policy must read it as `inherited`.
For every drop but `none` and `inherited`, `tracee.exec` is the build's own `capPermitted`, `capEffective`, `capInheritable`, `capAmbient`, `capBounding` and `noNewPrivs`, read from `/proc//status` after its exec. A build that exited before the read leaves it absent, with the reason in `unreadable["tracee.exec"]`.
When cilock runs from file capabilities (`setcap ...=p` on the binary), `tracer.privilege` records it: `source` (`file-capabilities`), `permitted` (the set at exec), `keptPastSetup` (what the drop before the build kept, only to leave the build's mount namespace), `threads` (how many threads the last drop read back) and `dropped`, true only when the final drop to no capabilities read back on every thread. cilock holds the capabilities effective only on the thread loading the tracer, drops them on every thread before it reads any path the caller named or starts the build, and refuses environment that changes what the tracer loads (`CILOCK_DEV_BPF_*`, `CILOCK_DIAGNOSE`, `CILOCK_OPEN_CAPTURE`, ...). Every other cilock command drops them at start.
## Trace overhead (`summary.diagnostics.overhead`)
Every traced run on Linux records what the tracer cost the build in `summary.diagnostics.overhead`. `total.seconds` is the wall time the tracer put on the build's critical path: attaching, the time some traced process was blocked on the tracer, and detaching. `total.parts` names what was summed, and `total.ratio` divides it by the untraced-equivalent wall time. The parts are `attach`, `fanotifyWait` (the fanotify permission wait, under both backends), `ptraceStop` (the ptrace tracer loop's busy time) and `detach`.
Each figure has a `status` of `measured` or `not_measured`, and a figure that was not measured carries a `reason` instead of a 0. `CILOCK_TRACE_OVERHEAD_STATS=1` adds the detail: per-event sums (`threadSeconds`), the hashing share of the fanotify wait (`fanotifyHash`), and the eBPF programs' run time (`bpf`). That last one turns on `BPF_ENABLE_STATS`, which is host-wide while held, so it stays opt-in, and it is CPU time across every CPU, never part of the headline. The field is informational; no policy reads it.
## CLI example
Builtin. cilock always runs this when it wraps a command. Naming `command-run` in `--attestations` is accepted: cilock logs a warning and records it once, the same as when it is left out. With `--trace`, captures ptrace-level syscall info per child process.
```bash
cilock run --step my-step \
--signer-file-key-path key.pem --outfile attestation.json \
--trace \
-- make build
```
Validated. Always part of every cilock run. See the full real-data example at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/01-command-run](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/01-command-run).
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [Defending against supply-chain attacks](../tutorials/defending-against-supply-chain-attacks.md)
- Upstream: [witness/command-run.md](https://github.com/in-toto/witness/blob/main/docs/attestors/command-run.md)
## macOS traced file content (opt-in)
`cilock run --trace --trace-file-content` extends the `sandbox-exec+oslog`
backend with kernel `file-read-data` reports scoped to the working directory
using a sandbox `subpath` filter. System and toolchain reads outside that scope
are not requested; they are not collected and then discarded in Go. A startup canary must demonstrate
that this channel delivers file-access reports; otherwise requested capture
refuses before the workload starts. Ordinary tracing and `--script-capture`
retain their existing defaults. The flag currently requires macOS.
The scope is deliberately incomplete for reads outside the workspace, including
external dependencies and symlink targets outside it. The startup probe uses a
separate literal-path reporting rule for its private temporary file; that rule
is not applied to the workload.
This captures observed access to workspace files including scripts, Makefiles,
includes, and files read by child processes. Each attributed event appears in
`processes[].syscalls[]` in v0.2 (`syscallEvents[]` in the expanded representation),
with `syscall: "file-read-data"`, a path, timestamp, and
`outcome: "permitted-not-confirmed"`. The sandbox reports permission to access,
not a successful read or its returned bytes.
`fileAtCollectorOpen` holds a snapshot with `status`, optional `content`,
`digest`, and `sizeBytes`. `captured-at-collector-open` means the collector read
those bytes after delivery of the report. It is **not execution binding** or
proof of what the process consumed. Generated files deleted before delivery
may be unavailable; a replacement before collector access can yield different
bytes. Nothing is promoted into `openedfiles` or verified `scripts` from these
observations. Absence of an event does not establish absence of access.
Content is opt-in separately from script operand capture. Only regular UTF-8
text without NUL bytes under the run's working directory is eligible. Scoped
opens refuse symlink escapes; FIFOs/devices are not read. Limits are 64 KiB per
file, 4 MiB read per run, and 256 attempted workspace snapshots. Repeated reads
consume the same budget because the contents may have changed. No partial body
is emitted when a size/budget limit is reached. Status records distinguish
outside-workspace, unavailable, binary, non-regular, oversize, changed-during-
capture, and exhausted-budget cases. Policies requiring full coverage must
refuse these omissions rather than treat them as negative findings.
`summary.diagnostics.darwin.fileReadsObserved` records the capability probe,
`fileContentScope` names the workspace, `fileReadReports` counts attributed
reports, and `unprovenFileReadReports` counts reports whose process ownership
was not established. No content is opened for a process lacking capture-time
attribution. These are observations, not a completeness guarantee.
Captured content can contain credentials. Review the capture scope and secret
handling before publishing the signed evidence; this flag does not redact
source bytes or authorize uploading them. For Jev, use these snapshots as
context, not proof that an adversarial build consumed the pictured bytes.
---
# compliance-evidence
Source: https://www.testifysec.com/docs/cilock/attestors/compliance-evidence/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/compliance-evidence.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/compliance-evidence.json';
# `compliance-evidence` attestor
Stores audit evidence inside the signed attestation, so the evidence itself is kept in Archivista, not only its digest. Each record names the controls it supports, the audit it belongs to, and the systems and changes it is about.
## What it captures
The command cilock wraps captures the evidence and writes a manifest, `compliance-evidence.json` by default, that lists each file. For every manifest entry the attestor:
1) refuses the entry if the file is not a product of the same run;
2) re-hashes the file and refuses it if it changed after the run recorded its digest;
3) embeds the exact bytes (base64 in JSON) with their sha256, media type and size.
Fields:
- `controls[]`: the controls the evidence supports, as `:`, for example `soc2:CC8.1` or `secureframe:Code integration testing`.
- `audit`: the audit engagement, for example `soc2-2026`.
- `request`: the auditor's request, verbatim.
- `assets[]`: `type` and `id` of each system or change the evidence is about.
- `references[]`: gitoids of other attestations the evidence cites.
- `collectedAt`: when the attestor read the evidence, RFC 3339 UTC.
- `items[]`: `path`, `kind` (`screenshot`, `api-response`, `document`, `file`), `source` (the URL or the exact command), `title`, `description`, `capturedAt`, `mediaType`, `size`, `sha256`, `content`.
The attestor records evidence. It does not decide whether a control passes; write that rule in policy.
## When to use
When an auditor needs evidence that a tool or a web console cannot export in a signed form: console screenshots, admin-API responses, configuration exports. Run the capture command under `cilock run`, so the same signed record shows the command that captured the evidence and the bytes it produced.
## Flags
- `--attestor-compliance-evidence-control`: control the evidence supports. Repeatable; at least one is required.
- `--attestor-compliance-evidence-audit`: audit engagement.
- `--attestor-compliance-evidence-request`: the auditor's request.
- `--attestor-compliance-evidence-asset`: `type=id`. Repeatable. Types: `commitsha`, `repo`, `pr` (`/#`), `accountid` (AWS), `github-org`, `google-domain`, `cloudflare-account`, `saas-org` (`:`). Other types are refused, because a misspelled type would bind to nothing.
- `--attestor-compliance-evidence-reference`: gitoid of a cited attestation. Repeatable.
- `--attestor-compliance-evidence-manifest`: manifest product path. Default `compliance-evidence.json`.
- `--attestor-compliance-evidence-max-bytes`: most evidence bytes to embed. Default 2,949,120 bytes (2.8 MiB): base64 grows the bytes by a third, so this is the most raw evidence whose encoding fits under cilock's 4 MiB statement limit with 256 KiB left for item metadata and subjects. Above it the run fails; evidence is never truncated.
## Output shape
Subjects, each with a sha256 digest:
- `compliance-evidence:`: digest of the file's bytes, to find the record that holds one exact file.
- `compliance-control:`, `audit:`, `attestation:`: digest of the value, to find every record for one control, audit or cited attestation.
- `:` for each asset: digest of the id. `commitsha:`, `repo:` and `pr:` use the keys and digests of the `github-review` attestor (for `pr:` the digest is of the number alone), and `accountid:` matches `aws-iid`, so evidence joins those records.
## Gotchas
- Evidence is embedded, so envelopes grow with it. A full-page screenshot of a long page is 1 to 1.5 MB, so capture one or two pages per run.
- A screenshot proves what the browser showed to the signed-in user at capture time. It does not prove the page was not altered in the browser before capture. Pair it with an `api-response` item for the same setting where an API exists.
- `capturedAt` comes from the capture command. `collectedAt` and the signature timestamp come from cilock.
## CLI example
`-d out` makes `out/` the directory the wrapped command runs in, so the script path is relative to it and `--out .` writes the manifest where the attestor looks for it (`compliance-evidence.json` in that directory). cilock refuses a `-d` that does not exist.
```sh
mkdir -p out
cilock run --step soc2-pr-9278 -d out -a compliance-evidence -a github-review \
--attestor-github-review-pr 9278 \
--attestor-compliance-evidence-control 'secureframe:Code integration testing' \
--attestor-compliance-evidence-audit soc2-2026 \
--attestor-compliance-evidence-asset pr=testifysec/judge#9278 \
--attestor-compliance-evidence-asset repo=testifysec/judge \
-- node ../compliance/scripts/capture-evidence.mjs --out . \
--url https://github.com/testifysec/judge/pull/9278 \
--exec 'pr.json=gh api repos/testifysec/judge/pulls/9278'
```
## See also
- [`github-review`](./github-review.mdx): signed snapshot of a commit's pull request reviews.
- [Catalog row](../reference/attestor-catalog.md)
---
# configuration
Source: https://www.testifysec.com/docs/cilock/attestors/configuration/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/configuration.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/configuration.json';
# `configuration` attestor
Captures the cilock CLI flags that drove this run. cilock is args-only — there is no config file — so the flags (plus the working directory) are the complete invocation surface this attestor records.
## What it captures
The attestor reads `os.Args` directly — it does not call into cilock's option resolver, so it records the raw CLI surface, not post-resolution defaults.
- `flags` — map of flag name to value, parsed from `os.Args` up to (but not including) the `--` separator that delimits cilock args from the wrapped command. Handles `--flag value`, `-f value`, `--flag=value`, `-f=value`, and bare boolean flags (recorded as `"true"`). Leading dashes are stripped from keys.
- `working_directory` — the process working directory at attest time (`os.Getwd()`).
Environment variables are **not** captured by this attestor — see [`environment`](./environment.mdx) for that.
## When to use
Audit trails where "which flags produced this attestation" needs to be provable after the fact. Most pipelines do not need it; reach for it when a single runner invokes cilock with varying flag sets and each variant's settings must be frozen alongside its attestation.
## Flags
None.
## Output shape
```json
{
"flags": {
"step": "build",
"trace": "true"
},
"working_directory": "/workspace"
}
```
All fields are `omitempty`; absent fields mean the corresponding source was missing or unreadable.
## Gotchas
- The flag parser is positional and naive: it does not consult cilock's option definitions. A value that happens to start with `-` (e.g. a negative number) will be treated as the next flag, not as the previous flag's value, and the previous flag will be recorded as `"true"`. The exception is a flag with a sensitive name (below): it always takes the next token as its value.
- `flags` reflects what was typed on the command line, not the resolved configuration. Defaults applied by cilock and values sourced from env vars are not merged into `flags`.
- The value of any flag whose name contains `token`, `password`, `passphrase`, `secret`, `credential` or `header` (case-insensitive) is recorded as `[REDACTED]`, for example `--signer-fulcio-token` and `--archivista-headers`. Flags named with `key` are not redacted, because they carry file paths. Any other flag's value is scrubbed by shape only: the userinfo of a URL, the value of a credential-named query parameter, an Authorization header token and a JWT are removed. A secret of any other shape passed through such a flag is recorded verbatim; prefer env vars or file-based secret flags for sensitive values.
## CLI example
```bash
cilock run --step my-step \
--signer-file-key-path key.pem --outfile attestation.json \
--attestations configuration \
-- echo hi
```
Validated. See the full real-data example at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/06-configuration](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/06-configuration).
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [Configuration reference](../reference/configuration.md)
---
# content-facts
Source: https://www.testifysec.com/docs/cilock/attestors/content-facts/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/content-facts.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/content-facts.json';
# `content-facts` attestor
Records two facts about every file the traced build read, computed at attest time while the read files and the products are both still on disk: what the file's bytes are, and whether those bytes appear verbatim inside a product. A verifier that holds only digests cannot compute either one later. The vulnhash engine reads them to tell a start-up configuration read (a locale table, a zoneinfo file, `openssl.cnf`) from data the build put into its product.
## What it captures
The attestor runs after command-run and product. Its inputs are the sha256 of every file in each traced process's `openedfiles` and `versionReads`, and the leaves of the product tree. For each read file whose bytes on disk still hash to the recorded digest (8 MiB or less), it sniffs a class, and records it only when it is `data` or `text-config`:
- `data`: TZif (zoneinfo), a glibc locale category file, a gettext `.mo`, `ld.so.cache`, `locale-archive`, `gconv-modules.cache`;
- `text-config`: UTF-8 INI text with at least one `[section]` and only comments, sections and `key = value` lines;
- `code`: ELF, Mach-O, PE, `#!` scripts, wasm, JVM class, Lua bytecode, CPython `.pyc`, `ar`, zip;
- `unknown`: anything else.
Each `data` or `text-config` file of at least 16 bytes is then searched for, with `bytes.Contains`, in every product file. Gzip, zip (stored and deflated) and tar are expanded, nested to depth 4, so an npm `.tgz`, a wheel and a container image tar are searched member by member. Only plain zips are read: no prefix other than a launcher script (a Python zipapp, an executable jar), unique entry names, store or deflate, every byte accounted for by the listed entries and the central directory; any other zip shape makes the scan incomplete. A pre-POSIX tar is found by its header checksum, and GNU sparse entries are read reconstructed. A product is scanned only when its bytes on disk hash to the digest in the product tree.
Predicate fields, all keyed by hex sha256:
- `class`, `size`: per `data` or `text-config` read file, the only classes searched. A read with no `class` is `code`, `unknown`, or changed since the trace hashed it.
- `checked`, `inProduct`: per searched file; `inProduct` means the bytes were found.
- `complete`, `reason`: `false` with a reason when any product could not be searched completely. Then `checked` and `inProduct` are empty.
- `productDigests`: sorted digests of the products scanned.
- `scanner`: the rule set, `contentfacts/v0.4` (v0.3's rules, recording only the searched classes; v0.3 also recorded `code` and `unknown`, which on a traced build of jade was 2.7 MB of a 5.3 MB statement).
## Why this shape
The predicate carries facts about bytes, never a verdict about a package. Whether a read is build environment is decided by the engine from these facts plus the trace. The rules are a copy of the vulnhash engine's `content.go`; `scanner` names the copy so the two cannot drift silently.
## Validate it locally
```bash
cilock run --step build --trace -o build.att.json -- go build -o app .
jq '.payload | @base64d | fromjson | .predicate.attestations[] | select(.type | contains("content-facts")) | .attestation' build.att.json
```
A Go binary that imports `time/tzdata` shows its zoneinfo reads with `inProduct: true`.
## How a verifier consumes this
Use the facts only when `complete` is true and `productDigests` equals the set of product digests in the same signed collection. A read file with no `class`, or with `checked` absent, has no content fact: treat it as unknown.
## Notes
- On by default for a traced run: `cilock run --trace` without `-a` attaches it through auto-detection, beside the attestors cilock detects anyway, and changes no other attestor. An explicit `-a` list is exact and runs no detection, so name it there (`-a content-facts`). An untraced run attaches it only with `-a content-facts` or `CILOCK_CONTENT_FACTS` set, and `--workload manual` turns detection off. Without a traced command-run, or without products, it records `complete: false`.
- cilock-action builds its own attestor list and runs no auto-detection: add `content-facts` to `attestations` with `trace: true`.
- It never fails the build. An error records `complete: false` with the reason.
- Cost: one read of each product and each expanded member, and one `bytes.Contains` per member per data file still unfound. Bounded at 2 GiB per product, 8 GiB expanded, 1 GiB per member, 64 GiB of total search work, 256 MiB of data files held for the search, and 512 MiB for a product plus the expanded buffers alive at once (Go may hold up to about twice that before a collection); over a bound the scan is incomplete.
## Gotchas
- A transformed copy (compressed by a format other than gzip, zip or tar, base64, re-encoded) is not found. xz, zstd, bzip2, 7z, lz4, lzma, lzop, compress, rpm, deb/ar, cpio, cab, xar, squashfs, rar and lzip products or members make the scan incomplete rather than claim absence.
- A product that changed after the product attestor hashed it, or a directory product, makes the scan incomplete.
- A `#!` script that carries a compressed stream or a tar after its text (a self-extracting installer) makes the scan incomplete. An archive appended to or compressed inside a binary is not expanded: a compressed embed is the accepted residual.
- A read file that changed after the trace hashed it gets no fact.
## See also
- [`command-run`](./command-run.mdx)
- [`product`](./product.mdx)
- [Catalog row](../reference/attestor-catalog.md)
---
# cred-leak
Source: https://www.testifysec.com/docs/cilock/attestors/cred-leak/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/cred-leak.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import VersionedDoc, {VersionPane} from '@site/src/components/Catalog/VersionedDoc';
import meta_v0_2 from '@catalog/cred-leak.json';
import meta_v0_1 from '@catalog/cred-leak-v0.1.json';
# `cred-leak` attestor
Runs a Gitleaks pattern scan over every product and every prior attestor's JSON, with recursive base64/hex/URL decoding (default 3 layers) so secrets hidden inside encoded blobs still surface.
**Renamed from `secretscan`.** A cilock that does not list `cred-leak` in `cilock attestors list` is older than the rename and takes `-a secretscan` and `--attestor-secretscan-
---
# dagger
Source: https://www.testifysec.com/docs/cilock/attestors/dagger/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/dagger.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/dagger.json';
# `dagger` attestor
## When to use
You run your checks with [Dagger](https://dagger.io) (`dagger check`) and want a policy to ask what ran, instead of trusting the exit code or scraping the text report. The `dagger` attestor records each check's name, whether it passed, whether Dagger served it from cache, the tests it reported, and a digest of the source content it read.
The exit code is not enough. A `dagger.toml` that filters the tests out (`[modules.go.settings] test = ["!**"]`) makes `dagger check` print `✔ PASSED` and exit 0, because every check it was asked to run passed and it was asked to run none of the tests. The record shows that the Go test check is missing, so a policy can refuse it.
Tested with Dagger v1.0.0-beta.19 and the `dagger.io/go` module. Dagger 1.0 is a beta; see [Limits](#limits).
## How it works
`dagger check` exports an OpenTelemetry (OTLP) trace to whatever `OTEL_EXPORTER_OTLP_ENDPOINT` names. The attestor runs before the wrapped command (it is a `prematerial` attestor): it opens an OTLP/HTTP receiver on `127.0.0.1` at a random port and sets these variables in the environment the wrapped command inherits:
| Variable | Value |
|---|---|
| `OTEL_EXPORTER_OTLP_ENDPOINT` | `http://127.0.0.1:` |
| `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` | `http://127.0.0.1:/v1/traces` |
| `OTEL_EXPORTER_OTLP_PROTOCOL`, `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL` | `http/protobuf` |
After the command exits, the attestor stops the receiver, puts the variables back as they were, and builds the record from the spans it received. A value you had set for one of these variables is replaced for the run, with a warning.
It reads the trace, not the `--progress report` text, because the trace carries structured attributes (`dagger.io/check.name`, `dagger.io/check.passed`, the cache outcome of every container exec, the sha256 content digest of every host directory a check read) and the report is a display format with no schema.
**Nothing leaves the machine through the attestor.** The receiver listens on the loopback interface only, makes no outbound connection, and keeps the trace in memory. It accepts log and metric exports and discards them.
**Dagger Cloud is a separate path.** If the Dagger CLI is logged in to Dagger Cloud, or telemetry is on, Dagger can also send the trace there. Run with `DO_NOT_TRACK=1` and an empty `XDG_CONFIG_HOME` so it does not. The attestor records whether `DO_NOT_TRACK` was set (`doNotTrack`), so a policy can require it.
## CLI example
From a real run on 28 October 2026 (Dagger v1.0.0-beta.19, a clone of [testifysec/dagger-pushgate-demo](https://github.com/testifysec/dagger-pushgate-demo)):
```bash
export DO_NOT_TRACK=1 XDG_CONFIG_HOME=$(mktemp -d)
cilock run --step dagger-check -a environment,git,dagger \
--signer-file-key-path key.pem --offline \
--outfile dagger-check.att.json -- dagger check
```
The run summary lists the attestor and one subject per check (abridged):
```text
cilock run summary:
step: dagger-check
anchor: git remote https://github.com/testifysec/dagger-pushgate-demo
signer: file
subjects (11): dagger/v0.1/dagger:input:dag://?check=go/packages/generate/stale&go-package=cmd/semver&go-package=semver, dagger/v0.1/dagger:input:dag://?check=go/packages/tests/test&go-package=semver&go-test=TestSuiteLoad&go-test=TestParse&go-test=TestParseRejects&go-test=TestSpecOrdering&go-test=TestBuildMetadataIgnored&go-test=TestNumericBeforeAlphanumeric&go-test=TestMajorDominates, git/v0.1/commithash:6e6cbce2bfd7694913477b3edc673d7f40baeb7b, ...
attestor: environment — ran
attestor: git — ran
attestor: dagger — ran
command exit: 0
```
`-a` replaces the default set (`environment,git,platform`), so name `git` too: the commit subject is what a commit-bound gate such as Pushgate matches. When you pass no `-a`, `--workload auto` attaches the `dagger` attestor for a command that starts with `dagger check`.
## Output shape
The `dagger/v0.1` predicate, from the run above with the Go tests executed (abridged to one check):
```json
{
"daggerVersion": "v1.0.0-beta.19",
"traceReceived": true,
"doNotTrack": true,
"invocations": [{"command": "dagger check --progress report", "status": "ok", "durationMs": 4317}],
"checks": [
{
"name": "dag://?check=go/packages/tests/test&go-package=semver&go-test=TestSuiteLoad&go-test=TestParse&...",
"check": "go/packages/tests/test",
"params": {"go-package": ["semver"], "go-test": ["TestSuiteLoad", "TestParse", "..."]},
"passed": true,
"status": "ok",
"durationMs": 3519,
"cached": false,
"processes": [["otelgotest", "./semver"]],
"inputDigests": ["sha256:2e8e24530a73a7005e502dea61b6638c807095d645d01af4f26cbe6a67e7588a", "sha256:b90c34157620defb326b682c1295f28a884eab4c80121893589028da2afba2c6"],
"inputKey": "sha256:c3c0f211a756c42884a8d7a2e082b4a70b739f4d0948e8d809d3cce140cfc514",
"tests": [
{"suite": "github.com/testifysec/dagger-pushgate-demo/semver", "name": "TestBuildMetadataIgnored", "result": "pass"}
]
}
],
"summary": {"checks": 2, "checksPassed": 2, "checksFailed": 0, "checksCached": 1, "tests": 7, "testsPassed": 7, "testsFailed": 0},
"receiver": {"requests": 2, "spans": 648, "truncated": false}
}
```
| Field | Meaning |
|---|---|
| `daggerVersion` | the Dagger CLI release that exported the trace (`dagger.io/client.version`); comma-joined if the command ran more than one |
| `traceReceived` | at least one trace export decoded. `false` means the wrapped command sent no trace: it did not run Dagger, or ran it with the variables overridden |
| `doNotTrack` | `DO_NOT_TRACK` was set (not empty, `0` or `false`) when the command started |
| `invocations[]` | one per Dagger CLI command in the trace: `command`, `status` (`ok`, `error`, `unset`), `durationMs` |
| `checks[].name` | the check's full `dag://` link; `check` is its path, `params` its other query parameters |
| `checks[].passed` | Dagger's `dagger.io/check.passed` is true and the span status is not ERROR |
| `checks[].cached` | affirmative cache evidence: at least one `Container.withExec` under the check was a cache hit, none executed, and no process started. A check with no exec observations at all is `false` |
| `checks[].processes` | argv of each process the check started |
| `checks[].inputDigests`, `inputKey` | sha256 content digests of the host directories the check read, and sha256 over them joined by newlines. Same content, same key |
| `checks[].tests[]` | `suite`, `name`, `result` (`pass`, `fail`, `skip`, or `unknown`) for each test the check's runner reported |
| `summary` | counts over `checks` and their `tests` |
| `receiver` | trace exports decoded (`requests`), spans decoded (`spans`), whether the 1,048,576-span or 256 MiB cap was hit (`truncated`), and exports refused with the reason (`rejected`, at most 16) |
**Dagger batches.** One check span can cover several selections. In the run above a single `go/packages/tests/test` check ran all seven tests listed in its `go-test` parameter, and reports each under `tests`.
**A cache hit reports no tests.** When Dagger serves the test exec from cache, the test runner does not run, so `cached` is `true` and `tests` is empty. The `go-test` parameter still lists the selected tests. The tests ran in an earlier run with the same `inputKey`.
Subjects: `dagger:input:` for each check with an input key, with the input key as its sha256 digest. A rebased commit whose check read the same content has the same subject, so earlier evidence for that content can be found by it. It is a lookup subject: it finds evidence and never vouches for its value, so a verdict is never bound to it.
## Example policy
The Go test check ran, passed and selected at least one test; a run that executed the tests reported at least one passing test and no failing one. It refuses a failing test, a `dagger.toml` that filters the tests out, a run with zero checks, and a capture the receiver truncated or partly refused. The attestor's tests run this exact module through cilock's verifier against recorded Dagger traces of each case.
```rego
package dagger_go_tests
import rego.v1
# The Go test check must appear, pass, and select at least one test. A run
# that executed the tests must report at least one passing test and no
# failing one. A cache hit reports no tests (the runner did not run), so it
# is admitted on Dagger's cache claim; drop the `c.cached` branch to require
# that the tests ran in this very run.
go_test_check := "go/packages/tests/test"
checks := object.get(input, "checks", [])
go_checks := [c | some c in checks; c.check == go_test_check]
deny contains msg if {
count(checks) == 0
msg := "dagger ran zero checks"
}
# An incomplete capture can drop a failing check, so it proves nothing.
deny contains msg if {
object.get(input, ["receiver", "truncated"], true) != false
msg := "the dagger trace was truncated or the receiver record is missing"
}
deny contains msg if {
count(object.get(input, ["receiver", "rejected"], [])) > 0
msg := sprintf("the receiver refused part of the dagger trace: %v", [input.receiver.rejected])
}
deny contains msg if {
count(go_checks) == 0
msg := sprintf("no %s check in the dagger run (are the tests filtered out in dagger.toml?)", [go_test_check])
}
deny contains msg if {
some c in go_checks
not c.passed
msg := sprintf("check failed: %s", [c.name])
}
deny contains msg if {
some c in go_checks
count(object.get(c, ["params", "go-test"], [])) == 0
msg := sprintf("check selected no tests: %s", [c.name])
}
deny contains msg if {
some c in go_checks
not c.cached
count([t | some t in c.tests; object.get(t, "result", "") == "pass"]) == 0
msg := sprintf("check ran but reported no passing test: %s", [c.name])
}
deny contains msg if {
some c in go_checks
some t in c.tests
result := object.get(t, "result", "")
result != "pass"
result != "skip"
msg := sprintf("test %s %s: %s", [object.get(t, "suite", ""), object.get(t, "name", ""), result])
}
```
`cilock policy prove` on a policy whose `dagger-check` step lists `command-run/v0.2` (exit code 0) and `dagger/v0.1` with this module, on the same workspace with the tests switched off:
```text
Local verify: REFUSED by dagger-check: no go/packages/tests/test check in the dagger run (are the tests filtered out in dagger.toml?)
```
## Limits
- **Dagger 1.0 is a beta, and these span attributes are not a published schema.** The attestor reads span names and attributes of Dagger v1.0.0-beta.19 and the `test.case.*` attributes of Dagger's Go test runner. If a later Dagger renames one, checks or tests disappear from the record. A policy that requires a named check then refuses; a failed check never reads as passed.
- **The attestor records what the trace says; it does not prove the trace is true.** Test results are emitted from inside the test container, so the code under test can write them. The signature says "this machine saw this trace".
- **Any local process can reach the receiver.** It listens on `127.0.0.1` at a random port for the length of the run, without authentication, so another process on the machine that finds the port can send spans too. Run on a machine you trust, as for any evidence signed there.
- **A cached check is Dagger's claim.** `cached: true` means Dagger reused an earlier result for the same inputs. The tests did not run in this run.
- **Test results come from Dagger's Go runner.** Other modules' checks are recorded with name, result, cache state and inputs, but report tests only if their runner emits `test.case.name` spans.
- **The receiver needs loopback.** A wrapped command run in a network namespace without access to the host's `127.0.0.1` cannot reach it, and the record shows `traceReceived: false`.
- **Only the wrapped command is observed.** The attestor does not run `dagger check -l`, so it cannot say which checks the workspace offers but did not run; pin the checks you require in the policy.
- **The receiver reads `http/protobuf` only.** An exporter forced to `grpc` or JSON sends nothing the attestor can read; JSON exports are refused and listed in `receiver.rejected`.
## See also
- [Gate on Dagger checks](../guides/gate-pushes-on-dagger-checks.md): record `dagger check`, prove the policy offline, hand it to Pushgate
- [`test-results` attestor](../attestors/test-results.mdx) for JUnit or CTRF reports from other runners
- [`command-run` attestor](../attestors/command-run.mdx) for the wrapped command's argv and exit code
---
# data-inventory
Source: https://www.testifysec.com/docs/cilock/attestors/data-inventory/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/data-inventory.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/data-inventory.json';
# `data-inventory` attestor
Reads the repository at one commit and signs the data stores its **ent** schemas declare: each table with the fields the reader followed, the file and line each is declared at, and ent's own `StorageKey` and `Sensitive()` marks. It reads source only. It never connects to a database and never samples rows.
It signs **observations only**. There is no `complete`, `ok` or status field: the predicate lists, per Go package, what the reader saw and did not read (`unread[]`), and each store lists the parts it could not follow (`unresolved[]`). A field list is never "the columns of the table"; whether an inventory is enough is for policy, which knows the repository layout. The design and the full rule table are in `docs/design/planned/data-inventory-fail-closed.md` in the judge repository; rookery does not carry a copy.
It assigns no sensitivity classes. It is the deterministic, CI-signed list that an agent's data-discovery findings are checked against for recall: every ent-backed store the agent reports should match a store id and line here, and every store here should be reported or explained.
## Validated invocation
```bash
cilock run --step data-inventory \
--signer-file-key-path key.pem --outfile data-inventory.att.json \
-a data-inventory \
--attestor-data-inventory-search-root services/api/ent/schema \
-- true
```
`--attestor-data-inventory-scope-base` (default `auto`) says what the `ent/schema` directory test is relative to: `auto` is the nearest ancestor of the working directory that holds `.git`, else the working directory. Use `working-directory` when the source is an archive unpacked inside an unrelated checkout; the predicate's `scopeBase` records the choice.
`--attestor-data-inventory-search-root` (default `.`) narrows the walk. It does not change store ids: every path in the predicate is relative to the scope base (the git root, else the working directory), so two services of one repository never share an id.
## What gets captured
- `root`: the search root as a slash-separated path relative to the scope base (`.` for the base itself), never a host path.
- `scopeBase`: `git` when the `ent/schema` directory test was made relative to the nearest ancestor of the working directory that holds `.git`, else `working-directory`. The predicate never holds a host path, so one commit signs the same bytes wherever it is checked out.
- `sources[]`: every non-test `.go` file of every package that imports an ent package or is an `ent/schema` directory, with `framework` and the sha256 of the exact bytes parsed (each file is read once, hashed and parsed from the same buffer). A file that did not parse is still a source.
- `packages[]`, sorted by dir: `dir` and `unread[]` (fixed text, sorted): what the reader saw in that directory and did not read: a build-constrained file, a symlink, a file that does not parse, an import outside its allowlist, a type or method it does not follow, a `_test.go` file. Every `ent/schema` directory (by repository-relative path) is listed even with no ent import, and one whose only Go files are tests is listed with them; one with no readable store says so. An empty `unread` is a fact about the reader, not a verdict.
- `stores[]`, sorted by id. Each has `id` (`ent:#`), `framework`, `kind` (`table`), `name` (the Go type name), `source` (`path`, `line`), `fields[]` and `unresolved[]`.
- Each field: `name`, `column` (ent `StorageKey` when set), `type` (the ent kind word), `sensitive` (ent `Sensitive()`), `source` (`path`, `line`).
- `counts`: `stores`, `fields`, `packages`, `packagesWithUnread`.
A store is read only when it is a struct embedding `ent.Schema` directly, with `Fields()` in the same file, whose body is a single `return` of a `[]ent.Field` literal made of `field.("name")` chains. When a `StorageKey` is set more than once, the last call wins, as in ent. A field the reader cannot follow (a helper call, a non-literal name) is listed in the store's `unresolved` with the line and reason, never dropped.
Not read in this version, and so reported rather than guessed: mixins, edges (foreign-key columns and join tables), `entsql` table annotations, project and third-party imports, aliases and defined types, other schema methods, build variants. Later versions read them one at a time.
Subjects: one per store, `data-store:`, digest `sha256()`. It is a lookup key: it joins a store across evidence and vouches for no artifact bytes. In the signed statement cilock prefixes the name with the predicate type.
## Why this shape
- **Facts, not a verdict.** Everything in the predicate is something the schema states. `sensitive` is the schema author's own marking, not a judgement about the data.
- **Exact positions.** Every store and field carries the file and line it is declared at, so another tool's claim about a column can be checked against the source line.
- **No caps.** The walk visits every file under the root except directories named `.git`, `.svn`, `.hg`, `node_modules`, `vendor`, `__pycache__`, `venv` and `.venv`, and does not follow symlinks. Other dot-directories are walked. An I/O error fails the attestor; a partial inventory is never signed.
- **Stable ids.** A store id depends only on the file path relative to the scope base and the type name, so it joins across runs and attestors by `sha256(id)`.
## Validate it locally
```bash
cilock run --step data-inventory --signer-file-key-path key.pem \
-a data-inventory -o att.json -- true
jq -r .payload att.json | base64 -d \
| jq '.predicate.attestations[] | select(.type|test("data-inventory")) | .attestation.counts'
```
The testkit fixture `plugins/attestors/data-inventory/testdata/fixtures/ent-schema` replays five real ent schema files in workdir mode. Every one declares `Mixin()` or `Edges()`, so the fixture's package lists them as unread and its stores list them as unresolved: the fixture proves the reader reports what it does not read on real schemas.
## How a verifier consumes this
The fields are explicit field declarations only. Ent also adds an implicit `id` column and, through edges and mixins, more columns; the list of fields is never an exhaustive column inventory of the database.
The completeness verdict is policy's. Rego over the predicate: refuse an inventory with an unread package, and read only stores with nothing unresolved as "the data this product stores":
```rego
package datainventory
deny contains msg if {
p := input.packages[_]
count(p.unread) > 0
msg := sprintf("%s was not read completely: %v", [p.dir, p.unread])
}
read_stores := {s.id | count(deny) == 0; s := input.stores[_]; count(s.unresolved) == 0}
```
A policy that knows the repository can also require that every directory it expects (for example `ent/schema`) has an entry in `packages[]`.
## Notes
- v0.2 is structure only. v0.1 carried rule-assigned classes and was never released. This is the first slice: it signs only what it can prove.
- Only ent is read. Other ORMs, SQL migrations and infrastructure-as-code stores are left to the agentic data-discovery workflow.
## Gotchas
- `sensitive` is ent `Sensitive()`, which some schemas use only to keep a field off an API (a public key, say). It says the author marked the field, nothing more.
- The table name is not in the predicate yet (it needs `Annotations()`, which this version does not read). Ent default table names are never computed.
- A schema with `Edges()` or `Mixin()` lists them as unresolved and its package as unread: those add columns and join tables this version does not read. Most real ent schemas are in this state until the later versions land.
- Directories named `node_modules`, `vendor`, `.git`, `.svn`, `.hg`, `__pycache__`, `venv` and `.venv` are not walked, and a schema under one is absent without an entry. A schema under `build`, `dist` or `target` is read.
- The pre-gate fires on `ent/schema/*.go`. A repository that keeps its schema elsewhere needs `-a data-inventory`.
## FAQ
**Does it read the database?** No. Source only.
**Why no PII or secret classes?** Classes come from the agentic data-discovery workflow, which reads how the code uses each field. This attestor gives that workflow a signed list to be checked against.
## See also
- [`lockfiles`](./lockfiles.mdx), the same committed-source shape.
- [`k8smanifest`](./k8smanifest.mdx), for joining stores to the workloads that reach them.
---
# design-signoff
Source: https://www.testifysec.com/docs/cilock/attestors/design-signoff/
# `design-signoff` attestor
Records a person's sign-off on one design document at one git commit: the document's full text, the digests that name those exact bytes, the decision and any conditions, and the 21 CFR Part 11 section 11.50 fields (printed name, time, meaning of the signature).
| | |
|---|---|
| Name | `design-signoff` |
| Predicate type | `https://testifysec.com/attestations/design-signoff/v0.1` |
| Lifecycle | `prematerial` |
| Default binary? | **Yes** |
## What it captures
- `source`: `{ uri, digest: { gitCommit } }`: the repository (from `remote.origin.url`) and the full commit the document was read at.
- `path`, `blob`: the repo-relative path and the git blob id at that commit.
- `doc_sha256`, `doc_bytes`, `content`: sha256, size and full text of the document. The text must be valid UTF-8 and at most 1 MiB.
- `decision`: `approve`, `approve-with-conditions` or `reject`.
- `meaning`: what the signature means: `approval`, `review`, `responsibility` or `authorship`.
- `conditions[]`: `{ id, text, verifiable }`, ids `C1`, `C2`, and so on.
- `answers[]`: `{ id, choice, note }` answering the document's `D-` decisions; `choice` is `recommended`, `other` or `defer`.
- `signer`: `{ name, email, kind }`; `kind` is always `human`.
- `signedAt`: RFC 3339 time, set just before signing.
- `supersedes`: Archivista gitoid (64 hex) of an earlier sign-off of the same path, or empty.
Subjects emitted: `doc:` (sha256 and git blob id of the document) and `commithash:`.
## When to use
When a design document must carry a recorded, attributable decision before work proceeds, and a policy needs to check that the document it gates on is the one that was signed. The attestor reads the document from the committed blob, not the working tree.
## Flags
| Flag | Required | Purpose |
|---|---|---|
| `--attestor-design-signoff-path` | Yes, exactly once | Repo-relative path of the document. |
| `--attestor-design-signoff-signer-name` | Yes | Printed name of the signer (21 CFR 11.50). |
| `--attestor-design-signoff-signer-email` | Yes | Email you sign in as; a verifier requires it to equal the certificate's email. |
| `--attestor-design-signoff-commit` | No, default `HEAD` | Commit to read the document at, resolved to a full SHA once. |
| `--attestor-design-signoff-decision` | No, default `approve` | `approve`, `approve-with-conditions` or `reject`. |
| `--attestor-design-signoff-meaning` | No, default `approval` | `approval`, `review`, `responsibility` or `authorship`. |
| `--attestor-design-signoff-conditions` | With `approve-with-conditions` | Path to a JSON array of `{id, text, verifiable}`. Refused with any other decision. |
| `--attestor-design-signoff-answers` | No | Path to a JSON array of `{id, choice, note}`. An `approve` answers every `D-` decision in the document; `defer` approves without deciding. |
| `--attestor-design-signoff-supersedes` | No | Gitoid of the earlier sign-off of the same path. |
## Gotchas
- **Human only.** The run must sign through `--human`; otherwise `Attest` refuses with `a design sign-off is signed only through the --human browser login`. See [`cilock run`](../reference/cli.md#cilock-run-cmd).
- **Clean working copy.** If the file on disk differs from the blob at the chosen commit, the attestor refuses, so you sign what you read. Commit or discard the edit first.
- **Never auto-detected.** The detector fires only when `CILOCK_DESIGN_SIGNOFF` is set. Name the attestor with `-a design-signoff`.
- A symlink, submodule, missing path, non-UTF-8 file, or a document over 1 MiB is refused. The predicate must also serialize under the 4 MiB statement limit; JSON escaping can grow a large document past it.
- Giving `--attestor-design-signoff-path` twice is refused. One sign-off covers one document.
## CLI example
```bash
cilock attest --human --step design-signoff -a design-signoff \
--attestor-design-signoff-path docs/design/policy-drafting.md \
--attestor-design-signoff-signer-name "Ada Example" \
--attestor-design-signoff-signer-email ada@example.com
```
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [`change-approval`](./change-approval.md), the same human-only pattern for a code change
---
# docker-bench
Source: https://www.testifysec.com/docs/cilock/attestors/docker-bench/
# `docker-bench` attestor
Captures CIS Docker Benchmark results produced by `docker-bench-security --json` and rolls them up into a signed attestation.
| | |
|---|---|
| Name | `docker-bench` |
| Predicate type | `https://aflock.ai/attestations/docker-bench/v0.1` |
| Lifecycle | `postproduct` |
| Default binary? | **Yes** |
## What it captures
The attestor scans the step's products for a docker-bench-security JSON report: a top-level `dockerbenchsecurity` version plus a non-empty `tests` array (the shape the real tool writes). A legacy shape, a top-level `desc` containing `CIS Docker Benchmark` with a non-empty `results` array, is still accepted as a fallback. It then records:
- `report_file` — the path of the docker-bench JSON output that was matched.
- `report_digest_set` — cryptographic digests of the report file, computed with the context's hash set.
- `benchmark_id` — always the constant `docker-bench-security`.
- `version` — the report's `dockerbenchsecurity` value (for example `1.3.4`); for the legacy shape, the `desc` with the `CIS Docker Benchmark` prefix stripped. Omitted when the report carries no version.
- `container_names` — the running container names listed in the `items` of section `5` (Container Runtime), reduced to the bare name (`:` and `:` items keep only the name); sorted and de-duplicated.
- `summary` — aggregated counts plus the list of non-passing checks:
- `total_checks`, `total_pass`, `total_warn`, `total_info`, `total_note`
- `checks` and `score` — the tool's own top-level rollup, copied as is
- `failed_checks[]` with `id`, `desc`, `result` for every `WARN` result and any unknown status. `PASS`, `INFO`, and `NOTE` are not added to `failed_checks`.
### Subjects
Two kinds of in-toto subjects are emitted, each as a SHA-256 digest over a synthetic key:
- `benchmark:cis-docker@` (falls back to `benchmark:cis-docker` when no version is parsed).
- `container:` for every entry in `container_names`.
## When to use
Run as a post-product step on a Docker host (or in a privileged sidecar) after the build that produced your images, so the host-hardening posture is bound to the rest of the supply chain. Pair with [`kube-bench`](./kube-bench.mdx) for Kubernetes nodes.
## Flags
None. The attestor takes no CLI options — point your step at the `docker-bench-security --json` output via the step's product declaration and it will pick the file up automatically.
## Output shape
```json
{
"report_file": "docker-bench.json",
"report_digest_set": { "sha256": "..." },
"benchmark_id": "docker-bench-security",
"version": "1.3.4",
"container_names": ["web"],
"summary": {
"total_checks": 120,
"total_pass": 95,
"total_warn": 20,
"total_info": 3,
"total_note": 2,
"checks": 120,
"score": 75,
"failed_checks": [
{ "id": "2.1", "desc": "Restrict network traffic between containers", "result": "WARN" }
]
}
}
```
## Gotchas
- **Strict product validation.** A candidate file is skipped if it has a MIME type other than `text/plain` or `application/json` (an empty MIME type is accepted), if its on-disk digest does not match the product digest in the attestation context, or if it is not recognized as docker-bench output (see above). If no product passes, `Attest` returns `no docker-bench report found in products`.
- **Only `WARN` (and unknown statuses) populate `failed_checks`.** `INFO` and `NOTE` results are counted but not enumerated, and the upstream `docker-bench-security` tool does not emit a `FAIL` status.
- **Container names come from section 5 only.** Items in other sections (for example image references in section 4) do not produce `container:` subjects. The legacy report shape has no sections, so it yields no container names.
- **Products only.** The attestor reads from the context's products, not materials, so the report must be declared as a product of the step.
## CLI example
See the constraint summary + reproduction recipe at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/17-docker-bench](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/17-docker-bench). This attestor is currently blocked or doc-only — the linked example explains why and shows the recipe to validate once the constraint is removed.
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [Build a custom CI/lock](../guides/build-a-custom-cilock.md)
- [`kube-bench`](./kube-bench.mdx)
---
# docker
Source: https://www.testifysec.com/docs/cilock/attestors/docker/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/docker.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/docker.json';
# `docker` attestor
Parses `docker buildx --metadata-file` JSON output from the products and records image digests, references, and SLSA-style materials per architecture.
## What it captures
The top-level field is `products`, keyed by the image's SHA256 digest (without the `sha256:` prefix). Each `DockerProduct` entry contains:
- `imagedigest` — a `DigestSet` holding the SHA256 of the container image (from `containerimage.digest` in the metadata file).
- `imagereferences` — list of image refs (populated from `image.name` in the metadata file).
- `materials` — `map[architecture][]Material`, where each `Material` has:
- `uri` — the source material URI from buildx provenance.
- `architecture` — the platform key (e.g. `linux/amd64`), extracted from the `buildx.build.provenance/` key or, for the single-arch `buildx.build.provenance` key, parsed from the `platform=` query parameter on the material URI.
- `digest` — a `DigestSet` containing the SHA256 from the provenance material.
`Subjects()` exposes four subject types: `imagedigest:`, `imagereference:`, `materialdigest:`, and `materialuri:`.
## When to use
When your pipeline builds container images with `docker buildx build --metadata-file ` and that JSON file lands in the products. Pair with [`oci`](./oci.mdx) when you also `docker save` a tarball, or with `slsa` for SLSA-shaped consumers.
Wrap the build itself, so `command-run` records the buildx argv and the metadata file it writes lands in `product`. A metadata file written by a build outside the step and then captured by a no-op command is only an imported file: nothing in the evidence shows how it was produced. `material`, `product` and `command-run` always run, so don't list them in `--attestations`:
```bash
cilock run --step image \
--attestations environment,git,docker \
-- docker buildx build --metadata-file dist/metadata.json -t myapp:dev .
```
## Flags
None.
## Output shape
```json
{
"products": {
"abc123...def": {
"materials": {
"linux/amd64": [
{
"uri": "https://github.com/example/repo.git#refs/heads/main",
"architecture": "linux/amd64",
"digest": { "sha256": "deadbeef..." }
}
]
},
"imagereferences": ["registry.example.com/myapp:dev"],
"imagedigest": { "sha256": "abc123...def" }
}
}
}
```
## Gotchas
- **Buildx only.** Classic `docker build` does not emit a metadata file with `containerimage.digest` / `buildx.build.provenance` keys. Without those, nothing attests.
- **Detection is MIME-based, not filename-based.** The attestor iterates `ctx.Products()` and tries to JSON-parse every product whose MIME type is `application/json`. Files that fail to parse as a `BuildInfo` struct are silently skipped (logged at debug). There is no fixed filename — name the metadata file anything you like as long as the product MIME detector recognizes it as JSON.
- **Multiple metadata files per attestation are supported.** Every JSON product that successfully unmarshals into a `BuildInfo` becomes its own entry in `products`, keyed by image digest.
- **Digest must be `sha256:`-prefixed.** Metadata files whose `containerimage.digest` doesn't start with `sha256:` are skipped with a warning.
- **`Attest` returns an error if no candidates produce a product** (`"no products to attest"`). A buildx metadata file with a missing or non-`sha256:` digest will trip this if it's the only candidate.
- **Per-arch provenance keys.** Multi-platform builds emit `buildx.build.provenance/` entries; single-platform builds emit a bare `buildx.build.provenance` key, and the architecture is recovered from the `platform=` query parameter of one of the material URIs.
## CLI example
Real `docker buildx build --metadata-file metadata.json` against a Dockerfile. The metadata file is a BuildKit JSON product consumed by the docker attestor.
```bash
cilock run --step docker-build \
--signer-file-key-path key.pem --outfile attestation.json \
--attestations docker,environment,git \
-- docker buildx build --metadata-file metadata.json --load -t app:latest .
```
Validated against a real built image (sha256:1c1ee1a2...). The `--metadata-file` flag produces a buildx JSON metadata that the docker attestor consumes as an `application/json` product. See the full real-data example at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/16-docker](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/16-docker).
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [`oci`](./oci.mdx) — for `docker save` tarballs (registry/distribution layout)
- Upstream: [witness/docker.md](https://github.com/in-toto/witness/blob/main/docs/attestors/docker.md)
---
# editor-extensions
Source: https://www.testifysec.com/docs/cilock/attestors/editor-extensions/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/editor-extensions.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/editor-extensions.json';
# `editor-extensions` attestor
Inventories the extensions installed for VS Code, VS Code Insiders, Cursor, Windsurf and VSCodium, plus the
dirs their remote servers install into, and signs a sha256 for every file. Pure Go: no tracing, no
privileges, same behaviour on macOS, Windows and Linux.
## Validated invocation
```bash
cilock attest --step editor-extensions --attestations editor-extensions \
--signer-file-key-path key.pem --outfile editor-extensions.json
```
Point it at another home directory (a fixture, a mounted image) with `CILOCK_EDITOR_EXTENSIONS_HOME`;
a relative value is resolved against `--workingdir`.
## What gets captured
- `roots[]`: one entry per editor dir it looks in, recorded home-relative (`~/.cursor/extensions`), whether
it is `present`, and the sha256 of each top-level file (`extensions.json`, `.obsolete`).
Dirs read, under the home directory (`%USERPROFILE%` on Windows): `.vscode`, `.vscode-insiders`,
`.cursor`, `.windsurf`, `.vscode-oss` (VSCodium), and `.vscode-server`, `.vscode-server-insiders`,
`.cursor-server`, `.windsurf-server`, `.vscodium-server`, each `/extensions`.
- `extensions[]`, one per directory under a root:
- `id` (lowercased `publisher.name`) and `version` from the extension's `package.json`;
- `target_platform` from `extensions.json` metadata, else `package.json` `__metadata`, else the
dir-name suffix (`-darwin-arm64`); universal installs record `""`;
- `source` (`gallery`, `vsix`, ...) and `listed` from the root's `extensions.json`;
- `files[]`: slash-separated path, `sha256`, `size`; a symlink is recorded with its `symlink` target and
never followed;
- `tree_sha256`: sha256 over `files` in path order, one compact JSON array per line:
`["f","",""]` for a file, `["l","",""]` for a symlink. JSON escaping
keeps it unambiguous whatever a path contains;
- `complete`: every file under the dir was hashed.
- `gaps[]`: every cap hit, unreadable path, symlinked extension dir, unparseable `extensions.json`
and extension without a usable `package.json`. Nothing is skipped without a gap.
- `limits`: the caps in force (files and bytes hashed, directory entries visited). Every byte read
counts against the byte cap, and every entry, directories included, against the entry cap.
Directories are read in batches, so a huge one is never listed whole first.
Subjects: `editor-extension::@[+]` (or `editor-extension::dir:`
without an identity), digest = `tree_sha256`.
## Why this shape
A file digest is what proves tampering: the Cursor 2.1.312 build differed from upstream 2.1.312 only in
`extension.js`. The per-file list lets a verifier name the file; the tree digest lets the fleet search
for one bad tree by subject digest. Identity comes from `package.json` because that is what the editor
loads, and it is parsed from the same bytes that were hashed.
## Validate it locally
```bash
make test MODULES="plugins/attestors/editor-extensions"
```
## How a verifier consumes this
A policy reads `extensions[]` and joins on `id`, `version`, `target_platform` and each file's `sha256`
against an upstream reference set; `complete` and `gaps` say whether the inventory may back a "not
affected" claim at all. An extension with `complete: false`, or any gap, cannot. The subject digest
(`tree_sha256`) finds every machine carrying one known-bad tree.
## Gotchas
- Opt-in. Its gate fires on `CILOCK_EDITOR_EXTENSIONS_HOME` or a wrapped `--install-extension` /
`--list-extensions`; otherwise name it with `--attestations editor-extensions`.
- The editor writes `.vsixmanifest` into the dir at install; a verifier comparing against the VSIX must ignore it.
Older VS Code builds also wrote `__metadata` into `package.json`, which makes that file differ from the
VSIX.
- Not read: portable installs (`data/extensions` beside the binary), `--extensions-dir`,
`VSCODE_EXTENSIONS`, `--extensionDevelopmentPath` dev extensions, and builtin extensions inside the
app bundle. Run it on each side of WSL or a remote host: it reads the running OS's home only.
- It proves what is on disk when it runs, not what the editor process loaded.
## See also
- [lockfiles](./lockfiles.mdx)
- [instruction-file](./instruction-file.mdx)
---
# environment
Source: https://www.testifysec.com/docs/cilock/attestors/environment/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/environment.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/environment.json';
# `environment` attestor
Captures the host OS, hostname, username, and the full process environment (with sensitive variables obfuscated by default) at attestation time.
## What it captures
Four json-tagged fields on the `Attestor` struct:
- **`os`** — `runtime.GOOS` (e.g. `linux`, `darwin`, `windows`). No kernel version, no architecture.
- **`hostname`** — `os.Hostname()`.
- **`username`** — `user.Current().Username`.
- **`variables`** — map of every `KEY=VAL` entry returned by `os.Environ()`, after the sensitive-variable filter has been applied. Keys are always preserved; only values are touched.
Sensitive-variable filter behavior (`attestation/sensitive_env_matcher.go`, called from `plugins/attestors/environment/filter.go`):
- The blocklist is split into two sets at runtime. Entries containing `*` are compiled as **gobwas/glob** patterns; entries without `*` become **case-insensitive exact-match** keys.
- Both the env-var key and the blocklist entry are upper-cased before comparison, so `aws_secret_access_key` matches `AWS_SECRET_ACCESS_KEY` and `*token*` matches `MyToken`.
- Default mode is **obfuscate**: matched values are replaced with the literal string `******`. The key still appears in `variables`.
- With `--env-filter-sensitive-vars`, matched entries are **dropped entirely** — neither key nor value appears in `variables`.
- `--env-allow-sensitive-key` excludes specific keys from the filter (exact-match only, no globs).
- **Credentials inside URL-shaped values are redacted whatever the key** (`url_credentials.go`, releases after 4.4.0). The userinfo of a URL in any value becomes `******` and the scheme, host, port and path stay, so `HTTP_PROXY=http://user:pass@proxy:3128` is recorded as `http://******@proxy:3128`. The username goes too, because a token can sit in either slot. A scheme-less `user:pass@proxy:3128`, which curl and Go read as `http://`, is redacted the same way. So is a scheme-relative `//user:pass@proxy:3128`, which Python's urllib reads as a proxy URL, to `//******@proxy:3128`. A colon-separated path list such as `PATH` or `PKG_CONFIG_PATH` is not a URL and is left alone, even when an entry holds an `@` (`/opt/homebrew/opt/python@3.11/bin`). This runs in both modes and neither `--env-disable-default-sensitive-vars` nor `--env-allow-sensitive-key` turns it off.
The default blocklist (`attestation/sensitive_env_vars.go::DefaultSensitiveEnvList`) ships 27 glob patterns: `*TOKEN*`, `*SECRET*`, `*API_KEY*`, `*APIKEY*`, `*KEY*`, `*PASSWORD*`, `*PASSWD*`, `*PWD*`, `*_PASS`, `*PASSPHRASE*`, `*passphrase*`, `*JWT*`, `*sshKey*`, `*PAT*`, `*CREDENTIAL*`, `*CRED*`, `*AUTH*`, `*OAUTH*`, `*BEARER*`, `*PRIVATE*`, `*SIGNING*`, `*ACCESS_KEY*`, `*SESSION_TOKEN*`, `*WEBHOOK*`, `*DSN*`, `*CONNECTION_STRING*`, `*DATABASE_URL*`. It also carries 88 explicit keys including `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AZURE_CLIENT_SECRET`, `GH_TOKEN`, `GOOGLE_APPLICATION_CREDENTIALS`, `CI_JOB_JWT`, `CI_JOB_JWT_V2`, `CI_JOB_TOKEN`, `VAULT_TOKEN`, `ACTIONS_RUNTIME_TOKEN`, `ACTIONS_ID_TOKEN_REQUEST_TOKEN`, `DOCKER_PASSWORD`, `NPM_AUTH_TOKEN`, `SLACK_TOKEN`, `SNYK_TOKEN`, `STRIPE_API_KEY`, cloud-provider keys for Heroku/DigitalOcean/Vultr/Sauce/Sentry/Percy/Twilio, the bare keys `TOKEN`, `PASS` and `SSHPASS`, and cilock-action's `INPUT_ACTION-INPUTS` / `INPUT_ACTION-ENV` (both the hyphen and the underscore spelling), whose values are user-supplied maps and env lines that routinely carry `${{ secrets.X }}`.
## When to use
Always. It is one of three default-on attestors (with `git` and `platform`) and provides the baseline host/identity context every downstream collection links back to. Disable it only if you are intentionally producing an environment-free predicate.
## Flags
| Flag | Default | Effect |
|---|---|---|
| `--env-filter-sensitive-vars` | `false` | Switch from obfuscation to outright removal — matched keys and values are dropped from `variables`. |
| `--env-disable-default-sensitive-vars` | `false` | Skip the built-in `DefaultSensitiveEnvList`; only `--env-add-sensitive-key` entries are sensitive. |
| `--env-add-sensitive-key` | `[]` | Repeatable. Adds keys or globs (e.g. `*INTERNAL*`) to the blocklist. |
| `--env-allow-sensitive-key` | `[]` | Repeatable. Allowlist that bypasses the filter for specific keys. No glob support. |
| `--env-capture-allowlist` | `[]` | Repeatable. Positive allowlist: when set, only keys matching one of the patterns (exact key such as `HOME`, or a glob such as `GITHUB_*`) are captured, and every other key is dropped. The sensitive-variable filter still runs on the keys it keeps. |
These five flags live on the `cilock run` command (in `cilock/internal/options/run.go`), not as `--attestor-environment-*` flags. The environment attestor registers no per-attestor flags of its own.
## Output shape
```json
{
"os": "linux",
"hostname": "runner-abc123",
"username": "runner",
"variables": {
"PATH": "******",
"HOME": "/home/runner",
"GH_TOKEN": "******",
"AWS_ACCESS_KEY_ID": "******",
"CI_JOB_JWT": "******"
}
}
```
## Gotchas
- **The key still leaks.** In the default obfuscate mode only the value becomes `******` — `GH_TOKEN`, `AWS_ACCESS_KEY_ID`, `CI_JOB_JWT_V2` etc. remain visible in the predicate. If even the presence of a key is sensitive, use `--env-filter-sensitive-vars`.
- **cilock 4.4.0 and earlier sign URL credentials verbatim.** A proxy password in `HTTP_PROXY`, `ALL_PROXY` and their siblings lands in the predicate, because those keys match nothing on the blocklist. On those versions pass `--env-add-sensitive-key '*PROXY*'`, plus the name of any other variable that holds a credential URL.
- **URL redaction never names a host the value does not dial, and errs toward naming none.** The marker keeps `@host` only when Go, Python, WHATWG and curl read one userinfo and the same host after it. Where they do not, the URL keeps only its scheme and `******@`, in which none of them finds a host: two `@` in the authority (`https://a@evil.example@github.com/x`), a password holding `/`, `?`, `#` or `\` (`https://alice:sec/ret@github.com/acme`), or an `@` after the authority. An `@` after a `?` or `#` with no `/` before it counts too: Python's proxy parser ends the authority only at a `/` after the userinfo's `@`, so `http://u:pass@proxy-a?tail@proxy-b:3128` sends `pass@proxy-a?tail` to `proxy-b` and becomes `http://******@`. An empty userinfo does not end that search: `http://@proxy-a?u:pass@proxy-b:3128` is an empty user at `proxy-a` to Go, curl and WHATWG, sends `pass` to `proxy-b` from Python, and becomes `http://******@`. A `/` first ends the authority for every parser, so `git+https://u:pass@host/o/r.git@v1` keeps its host and path. `https://evil.example/x@proxy.golang.org` dials `evil.example` in Go, WHATWG and curl, while Python's proxy parser sends `evil.example/x` as a userinfo to `proxy.golang.org`, so it becomes `https://******@`, and so does `https://registry.npmjs.org/@scope/pkg`. A scheme-less value is held to the same rule: `evil.example:8080/x@good.example` and `DOMAIN\user:pass@proxy:8080` (which a WHATWG parser dials at `domain`) become `******@`, and so does a compound scheme that carries a credential (`jdbc:postgresql://u:pass@db/app`). One pair of matching quotes around a value (`"u:pass@proxy:3128"`, as `docker --env-file` keeps them) is looked through, with or without a scheme, so a space in a quoted URL's password does not end it. A value that holds a credential only once tabs and newlines are removed, as WHATWG removes them (`http://u:pass@h`), becomes `******@`. A path list is told from a scheme-less credential by a `/` in its first entry, or a `/` or `\` that starts its second, so one without (`.:foo@1.2`) is read as `user:pass@host` and redacted. A `\` in the user does not count, because Python's urllib sends `DOMAIN\user:pass@proxy:8080` as a credential. A domain holding `;` (`dom;ain\u:\pass@proxy:8080`) is read as a Windows path list and kept; NetBIOS names cannot hold `;`. A value that opens with `//` is held to the rules of a URL with a scheme whatever its first entry looks like, so a path list that starts with a network path (`//server/share/bin:/opt/x@1/bin`) becomes `//******@`. A package URL (`pkg:npm/lodash@4.17.21`), a scoped npm alias (`npm:@scope/pkg@1.2.3`), a `mailto:` address and a full-length image digest (`docker://ghcr.io/o/img@sha256:<64 hex>`) are references, not userinfo, and are kept. Each shape is held tight: add a port, a list entry or a second `@` and the value is redacted. What shape leaves open is a proxy user literally named `mailto`, or `pkg` or `npm` with a password shaped like the rest of a reference, on a proxy with no port. A token in a query string is not userinfo, but a query parameter named for a credential (`?token=`, a presigned `X-Amz-Signature`, an Azure SAS `sig`) has its value replaced with `******` in every value, whatever the key (`redact.URLQueryCredentials`). Every value also has `-Dkey=value` and `--password x` secrets masked (`redact.SecretKeyedWords`), and the token of an Authorization header or a JWT (`redact.CredentialShapes`). A secret in a parameter with a neutral name is not redacted; name its variable with `--env-add-sensitive-key`.
- **The broad globs catch ordinary variables.** `*PAT*` matches `PATH`, `*PWD*` matches `PWD` and `OLDPWD`, and `*KEY*` and `*AUTH*` catch many non-secret names. Their values are recorded as `******`. To keep one, name it with `--env-allow-sensitive-key PATH`.
- **Glob vs exact is decided by `*`.** A blocklist entry like `MY_SECRET` is exact-match (case-insensitive); `MY_SECRET*` is a glob. Half-baked patterns like `MY_SECRET_` will only match that literal key. There is no regex support.
- **Glob patterns are normalised to uppercase.** Mixed-case patterns like `*sshKey*` and `*passphrase*` in the default list are upper-cased at compile time, then matched against upper-cased keys — so they catch any casing.
- **Panic-safe matching.** `safeGlobMatch` recovers from `gobwas/glob` panics on adversarial patterns and treats them as non-matches; an unmatched-due-to-panic value is **not** filtered. Audit custom patterns before trusting them.
- **No kernel, no arch.** Despite what older witness docs imply, this attestor records only `runtime.GOOS` — not kernel version, not `runtime.GOARCH`. Hardware/kernel context must come from a separate attestor.
- **Shared capturer.** `Attest` writes the capturer into `AttestationContext.SetEnvironmentCapturer` so other attestors (e.g. `command-run`) apply the same filter to any environment they record.
## CLI example
Default. Captures the process's environment variables; values of sensitive keys (TOKEN, KEY, SECRET, PASSWORD and the rest of the blocklist) are replaced with `******`.
```bash
cilock run --step my-step \
--signer-file-key-path key.pem --outfile attestation.json \
--attestations environment \
-- echo hi
```
Validated. Default attestor. See the full real-data example at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/04-environment](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/04-environment).
## See also
- [Catalog row](../reference/attestor-catalog.md)
- Upstream: [witness/environment.md](https://github.com/in-toto/witness/blob/main/docs/attestors/environment.md)
---
# fleet-change
Source: https://www.testifysec.com/docs/cilock/attestors/fleet-change/
# `fleet-change` attestor
Signs the record of one root change `jade fleet` made on one fleet host: the host (named by the SSH host key that answered), the action (named by the digest of its definition), the plan, and every step with its exit status and a redacted, capped output excerpt.
| | |
|---|---|
| Name | `fleet-change` |
| Predicate type | `https://aflock.ai/attestations/fleet-change/v0.1` |
| Lifecycle | `postproduct` |
| Default binary? | **Yes** |
## What it captures
The attestor reads `fleet-change.json` from the working directory, which the producer (`jade fleet`) writes. It decodes the file strictly (version `0.1`, no unknown fields, every size cap respected) and signs it as the predicate. A defective record is refused, not signed in part.
Predicate fields:
- `version`, `run_id`, `phase`: `phase` is `start` (the plan, written before the host is touched) or `final`.
- `start_gitoid`: on a `final`, the gitoid of the `start` envelope it closes. Empty on a start.
- `host`: `{ name, addr, ssh_host_key, node_spiffe_id }`. `ssh_host_key` is the SHA256 fingerprint of the host key the run's own connection verified. Empty only for a local run.
- `action`: `{ name, rollback, table_digest, definition_sha256 }`.
- `operator`: `{ user, machine, agent_session }`.
- `plan[]`: each planned command, with `argv` redacted and capped, plus `argv_sha256` over the raw argv.
- `steps[]`: each command that ran: `phase`, `argv_sha256`, start and end times, `exit` (`-1` when no status came back), and `output` (`sha256` and size of the raw bytes, plus a redacted, capped `text` excerpt).
- `started_at`, `ended_at`, `result`: `result` is one of `applied`, `rolled-back`, `already`, `ran`, `probe-failed`, `precondition-failed`, `command-failed`, `postcheck-failed`, `starting` (on a start) or `abandoned` (a reconciled final).
- `detail`: the action's own account, up to 32 KiB.
Caps: the whole record file is at most 256 KiB, plan and steps at most 512 entries each, and an output excerpt keeps the first and last 8 KiB.
Subjects emitted: `fleet-host:` (digest of the SSH host key, absent on a local run), `fleet-action:` (sha256 of the action definition, so two versions of one action differ), and `fleet-run:` (sha256 of the run id, so a start and its final pair up).
## When to use
You rarely run this by hand. `jade fleet` produces the record and selects the attestor. Use it as evidence that an infrastructure change was planned before the host was touched and what happened to it afterward.
## Flags
None. The detector attaches it when `fleet-change.json` exists in the working directory.
## Gotchas
- The attestor does not make the change or contact the host. It signs what the producer wrote.
- A start with no matching final means the run never reported. `jade fleet reconcile` signs a final with `result: abandoned`; the change may have run and its outcome is unknown.
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [`command-run`](./command-run.mdx), the attestor for an ordinary wrapped command
---
# gcp-iit
Source: https://www.testifysec.com/docs/cilock/attestors/gcp-iit/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/gcp-iit.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/gcp-iit.json';
# `gcp-iit` attestor
Captures the GCP Instance Identity Token (a signed JWT from the GCE metadata server) and verifies its signature against Google's published JWKS, producing a tamper-evident proof of "this ran on GCE project/instance X."
## What it captures
The verified [`jwt`](./jwt.mdx) attestor's predicate (`claims`, and `verifiedBy` with the JWKS URL and the key that verified the token; the raw token is not recorded) plus the following GCE claims extracted from the `google` claim of the IIT:
- `project_id` — GCP project (string)
- `project_number` — numeric project ID (string)
- `zone` — GCE zone
- `instance_id` — GCE instance ID
- `instance_hostname` — `instance_name` from the IIT
- `instance_creation_timestamp`
- `instance_confidentiality`
- `licence_id` — list of GCE license IDs
When the token has no `google` claim (Workload Identity on GKE), the attestor instead reads the GCE metadata server directly and fills in `cluster_name`, `cluster_uid`, `cluster_location` and the instance fields (`instance_hostname`, `instance_id`, `zone`) from it; only the project ID and number are parsed from the JWT `email` claim.
Subjects emitted: `instanceid:`, `instancename:`, `projectid:`, `projectnumber:`, `clusteruid:`.
## When to use
Builds running on GCE VMs, GKE nodes, or Cloud Build workers. The IIT is the GCP analog of the AWS instance identity document — a strong "this ran in our project, this zone, this instance" signal signed by Google.
## Flags
None. Configuration is via environment variable:
| Env var | Default | What it does |
|---|---|---|
| `WITNESS_GCP_JWKS_URL` | `https://www.googleapis.com/oauth2/v3/certs` | Override the JWKS endpoint used to verify the IIT signature. |
| `GCE_METADATA_HOST` | `metadata.google.internal` | Override the metadata-server host (`host[:port]`, or a URL whose host is used), as the Google Cloud SDK does. |
The identity token is always fetched with audience `witness-node-attestor` against the `default` service account.
## Output shape
```json
{
"jwt": { "claims": { ... }, "verifiedBy": { "jwksUrl": "https://www.googleapis.com/oauth2/v3/certs", "jwk": { ... } } },
"project_id": "my-project",
"project_number": "123456789012",
"zone": "projects/123/zones/us-central1-a",
"instance_id": "8675309",
"instance_hostname": "build-runner-01",
"instance_creation_timestamp": "1700000000",
"instance_confidentiality": "0",
"licence_id": ["1234"],
"cluster_name": "",
"cluster_uid": "",
"cluster_location": ""
}
```
## Gotchas
- **GCE-only.** The identity token is fetched from `http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/identity?audience=witness-node-attestor&format=full` with the `Metadata-Flavor: Google` header. On any non-GCE host the request fails (no DNS, no IMDS) and `Attest` returns `unable to retrieve valid identity token`.
- **Signature verification is delegated to the `jwt` attestor.** The IIT is verified against Google's JWKS at `https://www.googleapis.com/oauth2/v3/certs` (or `WITNESS_GCP_JWKS_URL`). If verification fails, the attestor fails — unverified tokens are never recorded.
- **Workload Identity fallback.** GKE pods using Workload Identity get a token without the `google` claim. The attestor detects this, falls back to direct metadata server lookups (`/computeMetadata/v1/instance/...` and `/computeMetadata/v1/project/...`), and parses project ID/number out of the JWT `email` claim domain. Cluster fields are only populated on this path.
- Metadata responses are capped at 1 MB to bound memory if the endpoint is compromised.
- The hardcoded audience is `witness-node-attestor` — verifiers asserting an audience should expect that exact string.
## CLI example
See the constraint summary + reproduction recipe at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/26-gcp-iit](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/26-gcp-iit). This attestor is currently blocked or doc-only — the linked example explains why and shows the recipe to validate once the constraint is removed.
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [`aws`](./aws.mdx) — AWS analog (EC2 instance identity document)
- [`jwt`](./jwt.mdx) — the underlying token verification
- Upstream: [witness/gcp-iit.md](https://github.com/in-toto/witness/blob/main/docs/attestors/gcp-iit.md)
---
# git-changes
Source: https://www.testifysec.com/docs/cilock/attestors/git-changes/
# `git-changes` attestor
Records which paths a commit changed, as a proof a verifier recomputes from the pushed commit and its trees. It is a sibling of the [`git`](./git.mdx) attestor, not a new version of it.
| | |
|---|---|
| Name | `git-changes` |
| Predicate type | `https://aflock.ai/attestations/git-changes/v0.1` |
| Lifecycle | `prematerial` |
| Default binary? | **Yes** (registered by the same plugin as `git`) |
## What it captures
- `version`, `hash`: the proof version and the object format; `sha1` is the only one supported.
- `status`: `complete` or `incomplete`. When `incomplete`, `reason` is one of `shallow`, `base_unresolved`, `target_unresolved`, `tree_unreadable`, `git_unavailable` or `no_commit`.
- `commit`, `tree`: the head commit and its tree.
- `base`, `base_tree`: the merge-base of `HEAD` and the target branch tip as the clone last fetched it, and its tree.
- `target`: `{ ref, tip }`, diagnostic only. A verifier never reads it for a decision.
- `changes[]`: `{ path, old_path, status }` for each changed path.
- `delta`, `head_trees`: the encoded proof data. `head_trees` is filled only with `--attestor-git-changes-embed-head-trees`.
Nothing here is trusted on its own. A verifier checks every field against the pushed commit, a base the forge picks, and the hashes of the trees. A wrong claim makes the observation incomplete, which applies every review class. The predicate is capped at 64 KiB.
## When to use
In the push-metadata step of a gated push, where a policy needs the set of changed paths to decide which reviews apply. Request it by name; detection never selects it.
## Flags
| Flag | Default | Purpose |
|---|---|---|
| `--attestor-git-changes-target-ref` | origin's default branch | Branch the push will land on, such as `main` or `origin/main`. |
| `--attestor-git-changes-embed-head-trees` | `false` | Carry every head tree the proof walks, so the attestation verifies without the pushed pack or a repository. About 44 KB at the median. |
## Gotchas
- There is no detector. Pass `-a git-changes`.
- A shallow clone cannot produce a complete proof; it signs `incomplete` with reason `shallow`.
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [`git`](./git.mdx)
---
# git
Source: https://www.testifysec.com/docs/cilock/attestors/git/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/git.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/git.json';
# `git` attestor
Captures the state of the git repository at the working directory — HEAD commit, author/committer identity, refs, remotes, tags pointing at HEAD, parent commits, tree hash, and worktree/staging dirtiness.
## What it captures
The attestor opens the repo with `go-git` (using `DetectDotGit`, so it walks up from `--workingdir` to find `.git`) and records:
- **`commithash`** — SHA-1 of HEAD commit. Also emitted as a `commitdigest` `DigestSet` (`sha1`).
- **`commithashverified`** — `true` when the commit hash was **recomputed from the canonical commit bytes with a collision-detecting hasher** and only that computed value was recorded — never the id storage merely claims. This signed capability marker is what the SHA-1 match exception in policy digest matching requires (`cryptoutil/digestset.go`); legacy evidence without the marker cannot use that exception.
- **`author` / `authoremail`** — `commit.Author.Name` / `.Email`.
- **`committername` / `committeremail`** — `commit.Committer.Name` / `.Email`.
- **`commitdate`** — author timestamp (`time.Time.String()` format).
- **`commitmessage`** — full commit message.
- **`signature`** — PGP signature on the commit, if present.
- **`parenthashes`** — SHA-1s of parent commits (multiple for merges).
- **`treehash`** — SHA-1 of the root tree.
- **`refs`** — every ref (branches, remote-tracking, tags) whose target equals HEAD.
- **`branch`** — short ref name of HEAD (json key is `branch`, struct field `RefNameShort`).
- **`remotes`** — the URLs of the remote named `origin` when one exists, otherwise every remote's URLs in remote-name order. A credential embedded in a URL is redacted; a URL whose credential cannot be located safely is omitted.
- **`remotesrefused`** — one `{reason, count}` entry per refusal reason when a remote URL was omitted. The reason is one of `ambiguous-authority`, `opaque-transport`, `path-bytes-not-redactable`. No byte of the refused URL is recorded.
- **`tags`** — annotated tag objects pointing at HEAD: `name`, `taggername`, `taggeremail`, `when` (RFC3339), `pgpsignature`, `message`.
- **`status`** — map of dirty files to `{staging, worktree}` codes: `unmodified`, `untracked`, `modified`, `added`, `deleted`, `renamed`, `copied`, `updated`.
- **`gittool`** — `"go-git+git-bin"` when the `git` binary is on `PATH`, else `"go-git"`.
- **`gitbinpath` / `gitbinhash`** — path and digest of the `git` binary (only when present). Hash uses the attestation context's configured hashes.
- **`workdirprefix`** — the working directory relative to the worktree root, with forward slashes. `""` means the run was at the root.
If HEAD cannot be resolved, the attestor fails closed — unless the repository is provably unborn (no refs and no objects: a brand-new repo with no commits), in which case it emits an empty predicate rather than failing the run.
## When to use
Almost every CI step that runs inside a git checkout. The captured `commithash` is the canonical SLSA source identifier most release policies pin against, and the `parenthash` subjects make the resulting collection traversable along the commit-graph during policy evaluation.
## Keyless commit and tag signing
The same `cilock` binary implements Git's standard X.509 signing protocol. Configure the current repository once:
```bash
cilock git configure
git commit -S -m "feat: signed by CI/lock"
git tag -s v1.2.3 -m "v1.2.3"
git verify-commit HEAD
git verify-tag v1.2.3
```
CI/lock defaults to the hosted TestifySec platform. It exchanges the current stored session or registered workflow identity for a short-lived Fulcio certificate, signs with an ephemeral in-memory key, and requires an RFC 3161 timestamp from the platform TSA. Private installations use the same protocol with the organization's TestifySec appliance. No signing flag, platform flag, separate `gitsign` executable, or credential-cache daemon is required.
This covers the everyday gitsign-compatible Git surface: signed commits, signed annotated tags, `git log --show-signature`, `git verify-commit`, and `git verify-tag`. CI/lock is designed for an organization's private trust infrastructure, so it uses platform discovery and pinned private trust instead of gitsign's public-community TUF/Rekor configuration. CI/lock's existing `run`, `attest`, and `verify` commands remain the attestation and policy interface; it does not duplicate gitsign's source-predicate subcommands.
## Flags
| Flag | Default | Description |
|---|---|---|
| `--attestor-git-allow-subdirectory` | `false` | Attest from a subdirectory of the worktree. Without it, a run whose working directory is below the worktree root fails, because the material attestor would cover only that subdirectory. The non-empty `workdirprefix` is still signed, and verifiers may refuse it. |
## Output shape
```json
{
"gittool": "go-git+git-bin",
"gitbinpath": "/usr/bin/git",
"gitbinhash": { "sha256": "..." },
"commithash": "9f1c...",
"commithashverified": true,
"author": "Jane Dev",
"authoremail": "jane@example.com",
"committername": "Jane Dev",
"committeremail": "jane@example.com",
"commitdate": "2026-05-20 12:34:56 +0000 UTC",
"commitmessage": "fix: ...",
"commitdigest": { "sha1": "9f1c..." },
"signature": "-----BEGIN PGP SIGNATURE-----\n...",
"parenthashes": ["abcd..."],
"treehash": "1234...",
"refs": ["refs/heads/main", "refs/remotes/origin/main"],
"remotes": ["https://github.com/org/repo"],
"remotesrefused": [{"reason": "opaque-transport", "count": 1}],
"tags": [{"name": "v1.2.3", "taggername": "...", "taggeremail": "...", "when": "2026-05-20T12:34:56Z", "pgpsignature": "...", "message": "..."}],
"branch": "main",
"status": {"path/to/file": {"staging": "modified", "worktree": "unmodified"}},
"workdirprefix": ""
}
```
Emitted subjects: `commithash:`, `authoremail:`, `committeremail:`, `parenthash:` (one per parent), `refnameshort:`, `remote:`. `BackRefs()` exposes `commithash:` and `parenthash:` with sha1 digests.
## Gotchas
- **Parent-hash chain semantics.** `parenthash:` subjects use the **raw SHA-1** of the parent commit — the same encoding used for `commithash:`. This is deliberate (issue #34, PR #37): a downstream collection's `parenthash` subject digest now matches the upstream collection's `commithash` subject digest for the same commit, so policy can traverse the parent chain across collections via subject-graph matching. Earlier builds hashed the string with sha256, which broke the join.
- **Status detection has two modes.** If the `git` binary is on `PATH`, status comes from `git status --porcelain`; otherwise it uses go-git's worktree status. The two implementations are not always byte-identical for edge cases (submodules, ignored files).
- **Shallow clones / missing refs.** `refs` only contains refs the local repo knows about. CI checkouts that fetch a single SHA may produce an empty `branch` and minimal `refs`. Tags must be fetched explicitly (`fetch-tags`) to appear in `tags`.
- **Submodules** are not traversed — only the outer repo's HEAD is recorded.
- **Remote URL scrubbing.** A URL with an embedded credential is recorded in redacted form. A URL whose authority cannot be established (for example git's `transport::address` helper syntax) is not recorded at all: it is counted in `remotesrefused`, a warning is logged, and no `remote:` subject is emitted for it.
- **Only `origin` is anchored.** When a remote named `origin` exists, the other remotes are not recorded, even when `origin` itself is refused.
- **Outside a checkout the run fails.** `git` is a default attestor (with `environment` and `platform`), so a plain `cilock run` or `cilock attest` in a directory with no repository exits 70 with `attestor git failed: repository does not exist`. Run inside a checkout, or name the attestors explicitly without `git` (`--attestations environment`); `--no-default-attestor` drops only `product` and `material`.
- **Run from the worktree root.** A run from a subdirectory fails unless you pass `--attestor-git-allow-subdirectory`.
- **Dirty trees still attest.** A non-empty `status` map does not fail the attestor; downstream policy must reject dirty builds explicitly if that is the requirement.
- **Signing and attesting are distinct.** The Git signature authenticates the proposed commit or tag. The `git` attestor records repository state inside signed in-toto evidence. Pushgate policy can require both without treating either as a substitute for the other.
## CLI example
Real `.git/` discovery. Reads HEAD commit, branch, tag, parent SHA, author, signature.
```bash
cilock run --step git-context \
--signer-file-key-path key.pem --outfile attestation.json --workingdir . \
--attestations git \
-- echo "captured git context"
```
Validated against a real git checkout (rookery). Captures real commit metadata. See the full real-data example at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/05-git](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/05-git).
## See also
- [Catalog row](../reference/attestor-catalog.md)
- Upstream: [witness/git.md](https://github.com/in-toto/witness/blob/main/docs/attestors/git.md)
---
# github-action
Source: https://www.testifysec.com/docs/cilock/attestors/github-action/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/github-action.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/github-action.json';
# `github-action` attestor
Captures metadata about a GitHub Action execution — the action reference, type, inputs/outputs, exit code, and a small slice of GitHub Actions runtime context.
## What it captures
The attestor records pre-set action metadata supplied by the action runner, plus a few `GITHUB_*` env vars sampled at `Attest()` time. Unlike `command-run`, it does not itself shell out — execution happens via a runner-provided `ExecuteFunc`.
Top-level fields:
- `actionref` — action reference such as `actions/checkout@v4`. Also emitted as a subject (`actionref:`).
- `actiontype` — `javascript`, `docker`, or `composite`.
- `actionname` — `name` field from the action's `action.yml`.
- `actioninputs` — the names of the user-provided inputs. Each non-empty value is recorded as `******`, never as the value: the attestor cannot tell which inputs carry `${{ secrets.X }}`. An empty value stays `""`.
- `actionoutputs` — the names of the captured outputs, values redacted the same way.
- `exitcode` — exit code returned by the execute function.
- `actiondir` — resolved local path of the action on disk.
- `refpinned` — true if `actionref` was pinned to a commit SHA.
- `docker` — nested `DockerContainerConfig` (populated only for docker actions): `image`, `network`, `workspace`, `entrypoint`, `envcount`, `args`.
- `actionyamldigest` — digest of the resolved `action.yml`, the file that decided what ran. (v0.2)
- `steps` — the composite `run:` steps in execution order, each with `index`, `name`, `action`, `shell`, `workingDirectory`, `digest` (of the exact bytes handed to the interpreter), `script` (only under content capture), `exitCode` and `skipped`. (v0.2)
- `childEnv` — whether the action ran with the CI OIDC credentials withheld (`ciOidcCredentials: "scrubbed"`, the default) or `"inherited"`, plus the `scrubbed` variable names (never values).
- `runid` — from `GITHUB_RUN_ID`.
- `workflowname` — from `GITHUB_WORKFLOW`.
- `jobname` — from `GITHUB_JOB`.
The only `GITHUB_*` env vars consumed are `GITHUB_RUN_ID`, `GITHUB_WORKFLOW`, and `GITHUB_JOB`. Anything else about the workflow (event, actor, ref, sha, runner OS, repository) is **not** in this attestor — see `github` for OIDC-derived identity.
## When to use
Inside GitHub Actions workflows when an action is being executed under cilock's action runner. `cilock-action` wires this attestor in by default; you generally don't add it manually.
## Flags
None. The attestor is configured by the in-process action runner via functional options (`WithActionRef`, `WithActionType`, `WithDockerConfig`, `WithExecuteFunc`, etc.), not by CLI flags.
## Output shape
```json
{
"actionref": "actions/checkout@v4",
"actiontype": "javascript",
"actionname": "Checkout",
"actioninputs": { "ref": "******", "token": "******" },
"actionoutputs": { "ref": "******" },
"exitcode": 0,
"actiondir": "/runner/_actions/actions/checkout/v4",
"refpinned": false,
"docker": {
"image": "ghcr.io/example/action:1.2.3",
"network": "none",
"workspace": "/github/workspace",
"entrypoint": "/entrypoint.sh",
"envcount": 12,
"args": ["--flag"]
},
"runid": "1234567890",
"workflowname": "release",
"jobname": "build"
}
```
## Gotchas
- The predicate type is `https://aflock.ai/attestations/github-action/v0.2` when `actionyamldigest`, `steps` or `childEnv` is populated, and `https://aflock.ai/attestations/github-action/v0.1` otherwise, so `cilock run --attestations github-action` (which records none of them) still emits v0.1. cilock-action records `childEnv` on every action it wraps, so a wrapped `docker://` action with no `action.yml` is v0.2. Both are cilock-native types, not upstream in-toto or witness predicates.
- `Attest()` runs the `ExecuteFunc` (if set) between material and product attestors, so file-system side effects of the action are visible to `product`. If execution fails, `exitcode` is still recorded and the error is returned.
- Only `actionref` becomes a subject; if it's empty, the attestation has no subjects.
- The three `GITHUB_*` env vars are only read at `Attest()` time. Outside Actions they will simply be empty strings.
## CLI example
Real GitHub Actions runtime context. Reads canonical `GITHUB_*` env vars exposed to every Actions job and records them in a predicate.
```bash
# Same workflow as the github attestor; both are run together:
cilock run --step github-validation \
--signer-file-key-path key.pem --outfile attestation.json --workingdir . \
--attestations environment,git,github,github-action \
-- echo "real GH Actions run"
```
Validated alongside `github` in the same workflow run. This attestor records `GITHUB_RUN_ID`, `GITHUB_WORKFLOW` and `GITHUB_JOB`; repository, runner and OIDC context come from `github`. See the full real-data example at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/20-github-action](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/20-github-action).
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [`github`](./github.mdx) for OIDC claims
- [GitHub Action reference](../reference/github-action.md)
---
# github-review
Source: https://www.testifysec.com/docs/cilock/attestors/github-review/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/github-review.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/github-review.json';
# `github-review` attestor
Reads the pull requests associated with a commit, or one named pull request, and every review on each, from the GitHub REST API, and records them as a point-in-time snapshot.
## What it captures
The attestor resolves the repository and commit, picks a token, then reads either `GET /repos/{repo}/commits/{sha}/pulls` (commit mode) or `GET /repos/{repo}/pulls/{pr}` (PR mode), and `GET /repos/{repo}/pulls/{n}/reviews` for each PR. Every list is followed through its `Link: rel="next"` pages at 100 per page.
Fields (the `json` tags on `Attestor`):
- `repo`: `owner/name`.
- `commit_sha`: the commit reviews were looked up for. In PR mode it is the PR's head SHA unless `--attestor-github-review-sha` is set.
- `fetched_at`: wall-clock time of the read, RFC 3339 UTC.
- `api_base_url`: the REST base that was read.
- `token_source`: which source supplied the token: `flag`, `gh-token-env`, `github-token-env`, `gh-auth-token` or `anonymous`. The token itself is never recorded.
- `prs[]`: `number`, `state` (`open`, `closed`, or `merged` when the response carries `merged: true`; the single-PR read used with `--attestor-github-review-pr` carries it, but the commit-to-PR lookup's list response has no `merged` field, so a merged PR found that way is recorded `closed`), `head_sha`, `base_sha`, `url`, and `reviews[]`.
- `reviews[]`: `state` (GitHub's value, for example `APPROVED`, `CHANGES_REQUESTED`, `COMMENTED`, `DISMISSED`), `user_login`, `submitted_at`, `commit_id`.
The attestor records reviews as GitHub returns them. It does not decide whether a PR is approved; write that rule in policy.
## When to use
To make code review part of the evidence for a release: run it with `cilock attest` (no wrapped command) after the PR exists, then require `APPROVED` reviews from the reviewers you trust in a policy. It also works inside `cilock run`. Auto-detection attaches it when `.git/HEAD` exists and `GITHUB_TOKEN`, `GH_TOKEN` or `GITHUB_ACTIONS` is set.
## Flags
| Flag | Default | Purpose |
|---|---|---|
| `--attestor-github-review-repo` | parsed from `git remote get-url origin` | `owner/name`. Required for a non-`github.com` remote. |
| `--attestor-github-review-sha` | `git rev-parse HEAD` | Commit to look up. |
| `--attestor-github-review-pr` | (none) | Attest this PR number directly, skipping the commit-to-PR lookup. |
| `--attestor-github-review-token` | (none) | Deprecated and hidden: a literal token is visible to `ps` and shell history, and cilock warns when it is used. Set `GH_TOKEN` or `GITHUB_TOKEN`, or sign in with `gh auth login`, instead. Still takes the highest precedence. |
| `--attestor-github-review-api-url` | `https://api.github.com` | REST base; for GitHub Enterprise Server use e.g. `https://ghe.example.com/api/v3`. |
Token precedence: the flag, then `GH_TOKEN`, then `GITHUB_TOKEN`, then `gh auth token` (3-second limit), then anonymous.
## Output shape
```json
{
"repo": "acme/payments",
"commit_sha": "3f2a9c1...",
"fetched_at": "2026-10-16T14:02:11Z",
"api_base_url": "https://api.github.com",
"token_source": "github-token-env",
"prs": [
{
"number": 42,
"state": "open",
"head_sha": "3f2a9c1...",
"base_sha": "a81d0e7...",
"url": "https://github.com/acme/payments/pull/42",
"reviews": [
{ "state": "APPROVED", "user_login": "alice", "submitted_at": "2026-10-16T13:40:02Z", "commit_id": "3f2a9c1..." }
]
}
]
}
```
Subjects: `commitsha:`, `repo:`, `pr:#` for each PR, and `reviewer:` for each reviewer.
## Gotchas
- **No attestation before the commit reaches GitHub.** If GitHub answers 422 "No commit found", the attestor fails and records nothing. An empty `prs` list would make "every PR is approved" true, so it is never signed for a commit GitHub has not seen.
- **A commit in no PR is recorded with `prs: []`.** Your policy must require at least one PR if that matters.
- **The snapshot is what the token could see.** A private repository read anonymously, or with a token that lacks access, fails with 401, 403 or 404. In GitHub Actions grant `pull-requests: read`; with a fine-grained PAT grant "Pull requests: Read".
- **Anonymous is public-only and limited to 60 requests an hour.** The attestor warns when it falls back to anonymous, and warns louder inside GitHub Actions.
- **The data is not signed by GitHub.** The attestor trusts the API; only cilock's own envelope makes the snapshot tamper-evident, as of `fetched_at`.
- **Each request has a 30-second timeout.**
## CLI example
```bash
# Review state for HEAD of the current checkout
cilock attest -a github-review -k key.pem -o review.bundle.json -s review-head
# One PR, from any directory
cilock attest -a github-review \
--attestor-github-review-repo aflock-ai/rookery --attestor-github-review-pr 153 \
-k key.pem -o review-pr153.bundle.json -s review-pr153
```
## See also
- [`github`](./github.mdx)
- [Catalog row](../reference/attestor-catalog.md)
---
# github
Source: https://www.testifysec.com/docs/cilock/attestors/github/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/github.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/github.json';
# `github` attestor
Fetches the GitHub Actions OIDC ID token, verifies its signature against the GitHub JWKS, and records the decoded claims alongside a small slice of `GITHUB_*` / `RUNNER_*` workflow context.
## What it captures
The attestor first fails fast with `ErrNotGitHub` unless `GITHUB_ACTIONS=true`. It validates the workflow URL components, fetches an ID token (audience `witness`), and delegates signature verification to the embedded [`jwt`](./jwt.mdx) attestor. The token's string `repository` and `run_id` claims must match the corresponding environment variables. Other workflow fields remain observed environment data, not authenticated claims.
Top-level fields (the `json` tags on `Attestor`):
- `jwt` — full nested `jwt` attestor record, including `claims` (the entire decoded OIDC payload: `sub`, `aud`, `iss`, `repository`, `ref`, `sha`, `workflow`, `event_name`, `actor`, `job_workflow_ref`, `run_id`, `runner_environment`, etc. — whatever GitHub put in the token) and `verifiedBy` (`jwksUrl` plus the JWK that validated the signature).
- `ciconfigpath` — `GITHUB_ACTION_PATH`.
- `pipelineid` — `GITHUB_RUN_ID`.
- `pipelinename` — `GITHUB_WORKFLOW`.
- `pipelineurl` — `//actions/runs/` (also emitted as a subject and the sole back-ref).
- `projecturl` — `/` (also emitted as a subject).
- `runnerid` — `RUNNER_NAME`.
- `cihost` — hostname parsed from `GITHUB_SERVER_URL`.
- `ciserverurl` — `GITHUB_SERVER_URL`.
- `runnerarch` — `RUNNER_ARCH`.
- `runneros` — `RUNNER_OS`.
The OIDC claims themselves live under `jwt.claims` — the attestor does not duplicate them at the top level.
## When to use
In any GitHub Actions workflow that grants `permissions: id-token: write`. The OIDC token is GitHub's signed assertion of *who is running, in what repo, at what ref, in what workflow*; capturing and verifying it gives downstream policy a CI-platform-rooted identity that is independent of the cilock binary and any signer it uses.
## Flags
None. Two undocumented env-var overrides exist for testing:
| Env var | Purpose |
|---|---|
| `WITNESS_GITHUB_JWKS_URL` | Override JWKS endpoint (default `https://token.actions.githubusercontent.com/.well-known/jwks`). |
| `ACTIONS_ID_TOKEN_REQUEST_URL` / `ACTIONS_ID_TOKEN_REQUEST_TOKEN` | Set by the GitHub runner; consumed to fetch the ID token. |
Audience is hard-coded to `witness`.
## Output shape
```json
{
"jwt": {
"claims": {
"sub": "repo:aflock-ai/rookery:ref:refs/heads/main",
"aud": "witness",
"iss": "https://token.actions.githubusercontent.com",
"repository": "aflock-ai/rookery",
"ref": "refs/heads/main",
"sha": "deadbeef...",
"workflow": "release",
"event_name": "push",
"actor": "octocat",
"job_workflow_ref": "aflock-ai/rookery/.github/workflows/release.yml@refs/heads/main",
"run_id": "1234567890",
"runner_environment": "github-hosted"
},
"verifiedBy": {
"jwksUrl": "https://token.actions.githubusercontent.com/.well-known/jwks",
"jwk": { "kty": "RSA", "kid": "...", "n": "...", "e": "AQAB" }
}
},
"pipelineid": "1234567890",
"pipelinename": "release",
"pipelineurl": "https://github.com/aflock-ai/rookery/actions/runs/1234567890",
"projecturl": "https://github.com/aflock-ai/rookery",
"ciserverurl": "https://github.com",
"runneros": "Linux"
}
```
## Gotchas
- **Hard-fails outside Actions.** If `GITHUB_ACTIONS != "true"` the attestor returns `ErrNotGitHub` and produces no record.
- **OIDC permission required.** Without `permissions: id-token: write` on the job, `ACTIONS_ID_TOKEN_REQUEST_URL` / `ACTIONS_ID_TOKEN_REQUEST_TOKEN` will be unset and `fetchToken` will fail.
- **Signature is verified, not just decoded.** The embedded `jwt` attestor fetches the JWKS (response capped at 1 MB), parses the signed JWT, validates the signature against the matching `kid`, and only then populates `claims`. A bad signature causes `Attest()` to fail.
- **Audience is fixed.** Token requests always pass `audience=witness`; this is also the value asserted in the `aud` claim. There is no flag to change it — only the `WITNESS_GITHUB_JWKS_URL` env var, intended for test stubs.
- **Token fetch is bounded.** Token requests have a 30-second timeout and do not follow redirects. Responses over 1 MiB are rejected rather than silently truncated. The JWKS response has its own size limit.
- **Token endpoint restriction.** Requests require HTTPS on a subdomain of `actions.githubusercontent.com`, with no user information, fragment, or nonstandard port. Other endpoints, including private Enterprise Server token hosts, are not supported. Redirects cannot expand this boundary.
- **Workflow URL validation.** The server must be an HTTPS origin. Repository paths must contain two bounded, non-traversal components; run IDs must be positive canonical unsigned integers.
- **Subjects + back-refs.** Nonempty `pipelineurl` and `projecturl` are subjects; only `pipelineurl` is a back-ref. Failed attempts clear previous output and do not publish empty URL subjects.
- **Verifier trust remains separate.** Claim matching does not authenticate the environment's server URL or its JWKS override. Consumers must independently pin the expected issuer, audience, and verification keys; a caller-selected JWKS is not proof of GitHub identity.
## CLI example
Real GitHub Actions OIDC token. The attestor calls `ACTIONS_ID_TOKEN_REQUEST_URL` with the `ACTIONS_ID_TOKEN_REQUEST_TOKEN` bearer and verifies the JWT against GitHub's public JWKS.
```bash
# In a workflow with `permissions: id-token: write`:
cilock run --step github-validation \
--signer-file-key-path key.pem --outfile attestation.json --workingdir . \
--attestations environment,git,github,github-action \
-- echo "real GH Actions run $GITHUB_RUN_ID"
```
Validated via `.github/workflows/cilock-ci-attestors.yml` in the linked repo. Captures the live OIDC token signed by `token.actions.githubusercontent.com`. See the full real-data example at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/19-github](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/19-github).
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [`github-action`](./github-action.mdx)
- [Concepts: signing & identity](../concepts/signing-and-identity.md)
- Upstream: [witness/github.md](https://github.com/in-toto/witness/blob/main/docs/attestors/github.md)
---
# githubwebhook
Source: https://www.testifysec.com/docs/cilock/attestors/githubwebhook/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/githubwebhook.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/githubwebhook.json';
# `githubwebhook` attestor
Verifies a GitHub webhook payload's HMAC-SHA256 signature against a configured shared secret and records the parsed payload plus event name so a verifier can prove which webhook delivery triggered the pipeline.
## What it captures
The attestor struct has two JSON-tagged fields written into the predicate:
- `payload` (`map[string]interface{}`) — the full webhook body parsed as JSON.
- `event` (`string`) — the GitHub event name (`push`, `pull_request`, `pull_request_review`, `workflow_job`, `check_suite`, or any other delivered event).
For known events, the attestor also derives subjects and back-references from the parsed payload:
- Always: `event:`, plus `reponame:` / `repourl:` (from `repository.name` / `repository.html_url`) and `sender:` (from `sender.login`) when present.
- `push`: one `commit:` subject per entry in `commits[]`, plus author username/email hashes.
- `pull_request` / `pull_request_review`: `pullrequest:`, `pullrequestheadref:`, `pullrequestheadsha:`, and (when set) `mergecommitsha:`. Head SHA and merge SHA are also emitted as back-refs so the webhook attestation can be chained to downstream git/build attestations.
- `workflow_job`: `workflowjob:`, `workflowrun:` (hashed) and `workflowjobheadsha:`. No back-refs.
- `check_suite`: `checksuite:` (hashed) and `checksuiteheadsha:`, only when the suite id is an exact integer and the head SHA a full lowercase hex object name. No back-refs.
Neither the raw body bytes nor the received HMAC signature are written into the predicate — they are consumed only to validate the delivery.
## When to use
For self-hosted CI (Jenkins, Tekton, custom runners) that receives GitHub webhook deliveries directly and needs to prove "this build was triggered by a webhook GitHub actually signed." Not needed inside GitHub Actions itself — use the [`github`](./github.mdx) and [`github-action`](./github-action.mdx) attestors there.
## Flags
None. The attestor has no CLI surface in cilock today; it is configured in-process via Go options (`WithBody`, `WithSecret`, `WithRecievedSignature`, `WithEvent`) by an embedding application that has already received the webhook.
## Output shape
```json
{
"payload": {
"repository": { "name": "rookery", "html_url": "https://github.com/aflock-ai/rookery" },
"sender": { "login": "octocat" },
"pull_request": {
"html_url": "https://github.com/aflock-ai/rookery/pull/42",
"merge_commit_sha": "deadbeef...",
"head": { "sha": "cafef00d...", "ref": "feature/x" }
}
},
"event": "pull_request"
}
```
## Gotchas
- **HMAC verification is mandatory and fail-closed.** `Attest()` returns an error if any of `body`, `secret`, or `receivedSig` is empty, and computes `HMAC-SHA256(body, secret)` and compares it (constant-time) against the hex value after stripping the `sha256=` prefix from the `X-Hub-Signature-256` header. A mismatch aborts attestation; no partial record is emitted.
- **Secret comes from the embedder, not a flag.** Because there is no CLI wiring, the shared secret must be supplied by whatever component invokes the attestor in-process. Do not pass it on the command line.
- **Payload bytes must be the exact bytes GitHub signed.** Any re-serialization (pretty-printing, key reordering) before passing to `WithBody` will fail HMAC verification.
- **Unknown event types still attest.** If `event` is not `push`, `pull_request`, `pull_request_review` or `workflow_job`, the payload and event are still recorded, but no event-specific subjects or back-refs are derived (a debug log is emitted).
- **cilock-native.** This attestor exists only in rookery/cilock; there is no upstream witness equivalent.
## CLI example
See the constraint summary + reproduction recipe at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/21-githubwebhook](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/21-githubwebhook). This attestor is currently blocked or doc-only — the linked example explains why and shows the recipe to validate once the constraint is removed.
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [`github`](./github.mdx)
- [`github-action`](./github-action.mdx)
---
# gitlab-review
Source: https://www.testifysec.com/docs/cilock/attestors/gitlab-review/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/gitlab-review.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/gitlab-review.json';
# `gitlab-review` attestor
Reads the merge requests that brought a commit in, or one named merge request, from the GitLab REST v4 API, and records each approval with the exact head sha it approved, plus the approval rules, pipelines, statuses and open threads.
## What it captures
The attestor reads `GET /version`, detects the GitLab tier, then lists the merge requests for the commit and keeps those where the commit is the merge commit, the squash commit or the head (`relation`). For each one it reads the diff versions, notes, approvals, approval state and settings (Premium), pipelines and commit statuses on the head (in the source project too for a fork), and discussions. It then reads the merge request, versions, approvals and approval policy again; if anything changed, it fails and records nothing. Every list is paginated to the end.
Top-level fields: `instance` (`api_url`, `host`, `version`, `revision`, `enterprise`), `tier` (`plan`: `free`, `premium` or `ultimate`, and `detected_by`), `project_id`, `commit_sha`, `fetched_at`, `token_source` (`env:`), `clock_skew_ms`, and `merge_requests[]`.
Each merge request records its ids, `state`, branches, `author_id`, `head_sha`, `base_sha`, merge and squash commit, `merged_at`, `merge_user`, `relation`, `versions[]`, `retargets[]`, `approvals[]`, `approved_flag`, `approval_state` and `approval_settings` (or `unavailable[]` with the reason), `pipelines[]`, `commit_statuses[]`, and `discussions` (`resolvable`, `resolved`, `unresolved[]`).
Each approval has `user_id`, `username`, `approved_at`, `bound_head_sha` and `binding`:
- `timeline`: bound to the head of the newest diff version created before the approval.
- `unbound`: `bound_head_sha` is null. The approval is within `clock_skew_ms` of a version, or no version precedes it.
- `before_retarget`: given at or before the last reset (a "changed target branch" note, or a version that repeats the previous head).
GitLab's own `approved` flag is recorded in `approved_flag` with its edition meaning and is never evaluated. Count bound approvals for the head in policy instead.
## When to use
In a GitLab CI job, to make merge request approval part of the evidence for a release. Auto-detection attaches it when `CI_API_V4_URL` and `GITLAB_REVIEW_TOKEN` are both set.
## Flags
| Flag | Default | Purpose |
|---|---|---|
| `--attestor-gitlab-review-api-url` | `$CI_API_V4_URL` | REST base. Must be `https` with the path `/api/v4`; no credentials, query or fragment. |
| `--attestor-gitlab-review-token-env` | `GITLAB_REVIEW_TOKEN` | Variable holding a `read_api` token (Maintainer to read approval settings). `CI_JOB_TOKEN` is refused. |
| `--attestor-gitlab-review-project` | `$CI_PROJECT_ID` | Numeric project id. |
| `--attestor-gitlab-review-sha` | `$CI_COMMIT_SHA`, then `git rev-parse HEAD` | Commit to attest. |
| `--attestor-gitlab-review-mr` | (none) | Attest this merge request iid directly. |
| `--attestor-gitlab-review-clock-skew-ms` | `60000` | Clock guard. Use `0` only for a GitLab with one clock. |
| `--attestor-gitlab-review-tier` | detected | Declare `free`, `premium` or `ultimate`. Reads above it are not attempted and are recorded unavailable. |
## Output shape
```json
{
"instance": { "api_url": "https://gitlab.com/api/v4", "host": "gitlab.com", "version": "18.5.0-ee", "revision": "...", "enterprise": true },
"tier": { "plan": "premium", "detected_by": "GET /projects/123/external_status_checks 404" },
"project_id": 123,
"commit_sha": "3f2a9c1...",
"token_source": "env:GITLAB_REVIEW_TOKEN",
"clock_skew_ms": 60000,
"merge_requests": [
{
"iid": 7,
"state": "merged",
"head_sha": "3f2a9c1...",
"relation": "head",
"approvals": [
{ "user_id": 42, "username": "alice", "approved_at": "2026-10-16T13:40:02Z", "bound_head_sha": "3f2a9c1...", "binding": "timeline" }
],
"approved_flag": { "value": true, "edition_semantics": "ee-rules-satisfied", "note": "recorded, never evaluated; count bound approvals" },
"discussions": { "resolvable": 2, "resolved": 2, "unresolved": [] }
}
]
}
```
Subjects use ids, never names: `commitsha:`, `project:/`, `mrhead:`, `mergerequest:/!`, and `approver:/`. `commitsha:` and `mrhead:` are also back-refs.
## Gotchas
- **Any failure to observe records nothing.** No merge request for the commit, a 401 or 403, a 5xx, a malformed body, or a change between the two reads fails the attestor.
- **A tier the instance lacks is not a failure.** A 404 on a read that needs a higher plan than the detected one becomes an `unavailable` entry with its reason. A 404 on a read the tier has fails.
- **Tier detection.** Community Edition is `free`. On Enterprise Edition, `GET /projects/:id/approvals` returning 200 means Premium or better, and `GET /projects/:id/external_status_checks` returning 200 means Ultimate.
- **Pin the host in policy.** The job chooses `CI_API_V4_URL`; `instance.host` is the value to check.
- **No anonymous reads.** The token must come from the named variable.
- **Requests** have a 30-second timeout, never follow a redirect, and read at most 32 MiB.
## CLI example
```bash
# In a GitLab CI job with GITLAB_REVIEW_TOKEN set as a masked variable
cilock attest -a gitlab-review -k key.pem -o review.bundle.json -s review
```
## See also
- [`gitlab`](./gitlab.mdx)
- [Catalog row](../reference/attestor-catalog.md)
---
# gitlab
Source: https://www.testifysec.com/docs/cilock/attestors/gitlab/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/gitlab.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/gitlab.json';
# `gitlab` attestor
Captures GitLab CI job context and the GitLab-issued OIDC JWT — the CI-side identity that proves "this attestation came from this pipeline, this job, this project."
## What it captures
CI/CD context read from GitLab's predefined `CI_*` environment variables, plus the decoded GitLab-issued JWT (claims + JWKS verification, recorded under the nested `jwt` field).
Struct fields (json tags):
- `jwt` — full embedded `jwt` attestor result (token claims + JWKS verification)
- `ciconfigpath` — `CI_CONFIG_PATH`
- `jobid` — `CI_JOB_ID`
- `jobimage` — `CI_JOB_IMAGE`
- `jobname` — `CI_JOB_NAME`
- `jobstage` — `CI_JOB_STAGE`
- `joburl` — `CI_JOB_URL` (also recorded as a subject)
- `pipelineid` — `CI_PIPELINE_ID`
- `pipelineurl` — `CI_PIPELINE_URL` (subject + back-reference)
- `projectid` — `CI_PROJECT_ID`
- `projecturl` — `CI_PROJECT_URL` (also recorded as a subject)
- `runnerid` — `CI_RUNNER_ID`
- `cihost` — `CI_SERVER_HOST`
- `ciserverurl` — `CI_SERVER_URL` (used to derive the JWKS URL)
`Attest()` first checks `GITLAB_CI=true` and returns `ErrNotGitlab` if unset.
## When to use
In any GitLab CI pipeline. The embedded JWT gives the verifier a GitLab-signed proof of pipeline/project/job identity that is independent of the cilock binary itself. Pair with the cilock-action GitLab template (or an equivalent `.gitlab-ci.yml` snippet) so the runner exposes a JWT env var to the attestor.
## Flags
- `--attestor-gitlab-token-env `: record the claims of the ID token in `$NAME` only. By default the attestor finds the job's own ID token by its claims: any variable holding a JWT issued by `CI_SERVER_URL` to `CI_JOB_ID`, preferring `SIGSTORE_ID_TOKEN`. A named variable that holds no token for this job is an error.
The JWKS endpoint is `${CI_SERVER_URL}/oauth/discovery/keys`, or `WITNESS_GITLAB_JWKS_URL` when set. Programmatic options (Go API): `WithToken(string)`, `WithTokenEnvVar(string)`.
The job declares its token in `.gitlab-ci.yml`; the audience does not matter to this attestor (it records claims and sends the token nowhere), so the token cilock already signs with serves:
```yaml
id_tokens:
SIGSTORE_ID_TOKEN:
aud: sigstore
```
## Output shape
```json
{
"jwt": {
"claims": { "iss": "https://gitlab.com", "sub": "project_path:group/repo:ref_type:branch:ref:main", "...": "..." },
"verifiedBy": { "jwksUrl": "https://gitlab.com/oauth/discovery/keys", "...": "..." }
},
"ciconfigpath": ".gitlab-ci.yml",
"jobid": "9876543210",
"jobimage": "alpine:3.20",
"jobname": "build",
"jobstage": "build",
"joburl": "https://gitlab.com/group/repo/-/jobs/9876543210",
"pipelineid": "1234567890",
"pipelineurl": "https://gitlab.com/group/repo/-/pipelines/1234567890",
"projectid": "42",
"projecturl": "https://gitlab.com/group/repo",
"runnerid": "12345",
"cihost": "gitlab.com",
"ciserverurl": "https://gitlab.com"
}
```
Subjects: `` `pipelineurl:` ``, `` `joburl:` ``, `` `projecturl:` `` (SHA-256). Back-reference: `` `pipelineurl:` ``.
## Gotchas
- **Not in GitLab CI**: if `GITLAB_CI` is unset or not `"true"`, the attestor returns `ErrNotGitlab` (`not in a gitlab ci job`), writes no `gitlab` predicate, and fails the run: the signed collection (`attestation-collection/v0.2`) lists `gitlab` under `failedattestors`, and cilock exits 70 with `attestor gitlab failed`.
- **No ID token**: a job that declares no `id_tokens:` has no signed identity on GitLab 17+ (GitLab removed `CI_JOB_JWT`). The attestor still records the `CI_*` fields and warns that no signed job claims were recorded.
- **Only this job's token**: a token whose `iss` is not `CI_SERVER_URL` or whose `job_id` is not `CI_JOB_ID` is never recorded, whatever variable holds it. On a GitLab older than 17 that still sets `CI_JOB_JWT`, that token is found the same way.
- **Self-hosted and air-gapped GitLab**: the JWKS is fetched from the job's own GitLab (`${CI_SERVER_URL}/oauth/discovery/keys`), which the runner can always reach, so capture needs no internet. Override with `WITNESS_GITLAB_JWKS_URL` for a non-standard install.
- **JWT verification failure is fatal**: if a token is present but JWKS verification fails, `Attest()` returns the underlying jwt-attestor error and no gitlab attestation is recorded.
## CLI example
See the constraint summary + reproduction recipe at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/22-gitlab](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/22-gitlab). This attestor is currently blocked or doc-only — the linked example explains why and shows the recipe to validate once the constraint is removed.
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [GitLab component reference](../reference/gitlab-component.md)
- Upstream: [witness/gitlab.md](https://github.com/in-toto/witness/blob/main/docs/attestors/gitlab.md)
---
# go-build
Source: https://www.testifysec.com/docs/cilock/attestors/go-build/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/go-build.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/go-build.json';
# `go-build` attestor
Reads the build information the Go toolchain embeds in every binary it compiles, for each Go binary among the step's products, and records it in the predicate and in a `.gobuild.json` file next to the binary.
## What it captures
The attestor runs after products are recorded. For each product it copies the file into a private temporary snapshot while digesting it, refuses the product if that digest no longer matches the one the product attestor recorded, and only then calls Go's `debug/buildinfo.Read` on the snapshot. A file that is not a Go binary, or whose build information was already stripped, goes to `skipped_non_go`. A product it cannot read, or one that changed since the product attestor recorded it, fails the attestation instead. For each Go binary it records the snapshot's digest as the `binary:` subject, writes `.gobuild.json` (temp file, then rename) and digests the sidecar.
Fields (the `json` tags on `Attestor` and `BinaryInfo`):
- `binaries[]`, sorted by `path`:
- `path`: the binary, relative to the working directory.
- `sidecar_path`: the sidecar written for it; empty if the write failed.
- `go_version`: the toolchain, e.g. `go1.26.3`.
- `main_path`: the main package path.
- `main_module`: `path`, `version`, `sum`, `replace` of the main module.
- `deps[]`: every dependency module the toolchain recorded, same shape.
- `settings`: the build settings as a map, e.g. `-trimpath`, `-ldflags`, `CGO_ENABLED`, `GOOS`, `GOARCH`, `vcs.revision`, `vcs.time`, `vcs.modified`.
- `skipped_non_go[]`: product paths that were read and are not Go binaries (or carry no build information).
## When to use
On any step that runs `go build` or `go install`. Release pipelines often `strip` binaries later, which removes the build information for good; this attestor captures it while the binary still has it. Auto-detection attaches it when the command starts with `go build` or `go install` (including `go -C build|install`). A `go.mod` alone does not attach it; a build wrapped by make or a script needs `-a go-build`.
## Flags
None.
## Output shape
```json
{
"binaries": [
{
"path": "bin/server",
"sidecar_path": "bin/server.gobuild.json",
"go_version": "go1.26.3",
"main_path": "example.com/acme/server",
"main_module": { "path": "example.com/acme/server", "version": "(devel)" },
"deps": [
{ "path": "golang.org/x/sys", "version": "v0.30.0", "sum": "h1:..." }
],
"settings": { "-trimpath": "true", "GOOS": "linux", "GOARCH": "amd64", "vcs.revision": "3f2a9c1...", "vcs.modified": "false" }
}
]
}
```
Subjects, per Go binary: `binary:` (digest of the binary, which `cilock verify --artifactfile ` matches) and `go-build-sidecar:` (digest of the sidecar JSON).
## Gotchas
- **It needs products.** With no products (for example under `cilock attest`, or when the build wrote nothing in the working directory) it records an empty predicate and no error.
- **No Go binary is not an error.** Non-Go products land in `skipped_non_go` and the run continues.
- **The sidecar is a new file.** `.gobuild.json` is written into your tree next to each binary. Ship it with the binary, or let a later step's product attestor hash it.
- **A failed sidecar write is a warning.** The build information is still in the predicate, but there is no `sidecar_path` and no `go-build-sidecar:` subject.
- **Stripped before the step ends is too late.** If the same step strips the binary, the build information is gone and the binary is listed in `skipped_non_go`.
## CLI example
```bash
cilock run --step build -a go-build -k key.pem -o build.bundle.json \
-- go build -trimpath -o bin/server ./cmd/server
```
## See also
- [`product`](./product.mdx)
- [Catalog row](../reference/attestor-catalog.md)
---
# haskell-build
Source: https://www.testifysec.com/docs/cilock/attestors/haskell-build/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/haskell-build.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/haskell-build.json';
# `haskell-build` attestor
Reads each of the step's products and records which Haskell units are linked into it, and the GHC version that compiled it.
## What it captures
The attestor runs after products are recorded. A cabal or stack build reads every library in its build plan, so a list of files the build opened says what was available, not what ended up in the program. GHC writes the unit id of each linked library into the executable in two places:
- constructor descriptions, `::`, which `strip` keeps;
- z-encoded symbol names such as `aesonzm2zi3zi2zi0zm_DataziAeson_...`, which `strip` removes.
This version reads the constructor descriptions only. Symbol-table evidence is planned.
Each product is read once and parsed as ELF; the same bytes are parsed and digested, so the unit list is bound to the subject digest. Constructor descriptions are read only from allocated, non-executable data sections, and the GHC version only from the `.ident` string GHC writes into `.comment`. A file that is not ELF is never evidence, whatever strings it holds.
Fields (the `json` tags on `Attestor`, `BinaryInfo` and `Unit`):
- `binaries[]`, sorted by `path`, one per product that carries at least one unit id:
- `path`: the product, relative to the working directory.
- `ghc_version`: from GHC's `.ident` string in `.comment`, e.g. `9.6.7`; empty when absent.
- `units[]`, sorted by `id`:
- `id`: the full unit id, e.g. `aeson-2.3.2.0-a931bef6…` (cabal store), `aeson-2.1.2.1-7OPvzW6QotrC573yNTjjB7` (stack), or `containers-0.6.7` (a GHC boot package).
- `name`, `version`: parsed from the id.
- `evidence`: `con_desc`, the only kind this version reads.
- `skipped_non_haskell[]`: products that are not ELF executables or shared objects, or ELF files with no unit id.
- `skipped_unsupported_format[]`: Mach-O and PE products, which this version does not parse.
- `skipped_unreadable[]`: products that could not be read.
- `skipped_too_large[]`: products over 2 GiB, not scanned.
Wired-in units that GHC records without a version (`base`, `ghc-prim`, `ghc-bignum`) are not listed.
## When to use
On any step that runs `cabal build`, `cabal install`, `stack build` or `ghc`. `strip` does not change what it reads. Auto-detection attaches it on those commands, or when the working directory has a `cabal.project` or `stack.yaml`.
## Flags
None.
## Output shape
```json
{
"binaries": [
{
"path": "dist/app",
"ghc_version": "9.6.7",
"units": [
{ "id": "aeson-2.3.2.0-a931bef6…", "name": "aeson", "version": "2.3.2.0", "evidence": ["con_desc"] },
{ "id": "containers-0.6.7", "name": "containers", "version": "0.6.7", "evidence": ["con_desc"] }
]
}
],
"skipped_non_haskell": ["dist/app.sha256"]
}
```
Subjects: `binary:` for each product listed in `binaries`.
## Gotchas
- **It needs products.** With no products (for example under `cilock attest`) it records an empty predicate and no error.
- **Products only.** A cabal store or Nix store outside the working directory is not a product, so a build that only populated a store records nothing here.
- **Linux binaries only.** macOS (Mach-O) and Windows (PE) products are listed in `skipped_unsupported_format`, not read.
- **A unit with no constructors is invisible.** A library that contributes only functions leaves no constructor description, so this version does not list it. In a measured aeson build, six of the store units (QuickCheck among them) appear only in symbol names.
---
# inclusion-proof
Source: https://www.testifysec.com/docs/cilock/attestors/inclusion-proof/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/inclusion-proof.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/inclusion-proof.json';
# `inclusion-proof` attestor
Defines the predicate schema for a signed inclusion proof binding a single file's digest to a Merkle tree's root. Since v0.3, the product and material attestors inline all per-file leaves directly in the signed envelope, so per-file verification flows through the product attestation itself — no separate inclusion-proof envelope is needed for the default path. Standalone inclusion-proof envelopes remain a recognized predicate type for interoperability with pre-v0.3 pipelines and for policies that consume them as `externalAttestations`.
## What it captures
The predicate carries the data a verifier needs to recompute the Merkle root from a single leaf via [RFC 6962 §2.1.1](https://datatracker.ietf.org/doc/html/rfc6962#section-2.1.1):
| JSON field | Type | Source |
|---|---|---|
| `treeRoot` | string (hex) | The Merkle root the proof terminates at. Must equal the product/material attestation's `tree:products` (or `tree:materials`) subject digest. |
| `leafIndex` | integer | Zero-based index of the file in the sorted leaf list. |
| `leafPath` | string | The file's portable (forward-slash) path within the working directory. It is not part of the leaf hash; only the DSSE signature over the predicate authenticates it. |
| `fileDigest` | string (hex) | Lowercase hex SHA-256 of the file content. |
| `auditPath` | array of hex strings | Ordered list of sibling hashes from the leaf up to the root. Length is `⌈log₂(treeSize)⌉`. |
| `hashAlgorithm` | string | Hash algorithm used to build the tree (always `sha256` for v0.1). |
| `construction` | string | Always `RFC6962` for v0.1. |
The verifier reconstructs the leaf hash by calling the canonical encoder `inclusionproof.LeafHash(leafPath, fileDigest)` (which produces `sha256(fileDigest-bytes-raw32)`; the path argument is ignored, so the root never binds the path); the RFC 6962 audit-path verifier applies the `0x00` leaf-domain prefix on top of that pre-hash. Carrying the path and digest in the predicate (instead of a pre-computed leaf hash) lets the verifier refuse a proof whose `fileDigest` does not match the subject the user asked to verify — closing off the CVE-2026-22703 class.
The DSSE statement's subject is the file digest itself (the file content's hash, not the leaf hash):
```json
"subject": [
{
"name": "file:dist/binary",
"digest": { "sha256": "" }
}
]
```
The subject being the file digest is what makes the inclusion-proof attestation discoverable via the existing subject-digest BFS. See [the spine of the graph](../concepts/the-spine-of-the-graph.md) for the structural reasoning.
## When to use
In the v0.3 inline-leaves model, per-file verification flows directly from the product or material attestation — no standalone inclusion-proof envelope is required. The inclusion-proof predicate type is recognized for backward compatibility with pre-v0.3 pipelines and for policies that wire standalone envelopes via `externalAttestations`.
## Flags
The `inclusion-proof` attestor does not register CLI flags via the standard attestor registry; it is not produced by a `cilock run` step. Standalone inclusion-proof envelopes are produced programmatically or by external tooling and consumed by `cilock verify` via the `externalAttestations` policy mechanism.
## Verification semantics
A verifier consuming an inclusion-proof attestation must, in order:
1. **Verify the DSSE signature.** Reject if the signer is not a trusted functionary per the active policy.
2. **Reconstruct the leaf and recompute the root.** Compute `leafPreHash = sha256(fileDigest-raw32)` via the canonical `inclusionproof.LeafHash` encoder (the path is not hashed), then fold the pre-hash through `auditPath` using RFC 6962's audit-path verifier (which applies the `0x00` leaf-domain prefix on top). The reconstructed value must equal the claimed `treeRoot`.
3. **Cross-check against the seed.** The predicate's `fileDigest` must equal the subject digest the verifier was asked to verify. Skipping this is the [CVE-2026-22703](https://nvd.nist.gov/vuln/detail/CVE-2026-22703) class of bug — a valid proof for the wrong artifact silently passes.
4. **Find the product/material attestation.** `treeRoot` is not a subject or back-ref of the inclusion-proof attestation: its only subject and back-ref is the file digest (`file:`), so a BFS from the proof does not reach the tree. Search for the product/material attestation whose `tree:products` or `tree:materials` subject digest equals `treeRoot`.
5. **Verify the product/material attestation's signature.** Same trust check as step 1.
All five checks are mandatory. See [verify a specific file](../guides/verify-a-specific-file.md) for the consumer-side flow with worked failure modes.
## Output shape
A full DSSE statement for an inclusion-proof attestation:
```json
{
"_type": "https://in-toto.io/Statement/v1",
"subject": [
{
"name": "file:dist/binary",
"digest": { "sha256": "9c6fb35e4d3a1c7b8e2f0a91d5c8b4f6e3a2b1c9d7e8f6a3b2c1d4e5f6a7b8c9d" }
}
],
"predicateType": "https://aflock.ai/attestations/inclusion-proof/v0.1",
"predicate": {
"treeRoot": "abc1234567890def1234567890abcdef1234567890abcdef1234567890abcdef",
"leafIndex": 1247,
"leafPath": "dist/binary",
"fileDigest": "9c6fb35e4d3a1c7b8e2f0a91d5c8b4f6e3a2b1c9d7e8f6a3b2c1d4e5f6a7b8c9d",
"auditPath": [
"1111111111111111111111111111111111111111111111111111111111111111",
"2222222222222222222222222222222222222222222222222222222222222222",
"3333333333333333333333333333333333333333333333333333333333333333"
],
"hashAlgorithm": "sha256",
"construction": "RFC6962"
}
}
```
(Digests above are synthetic placeholders. A real proof's `auditPath` length is `⌈log₂(treeSize)⌉` — three hashes here would correspond to a tree of size 5–8. All hex values are unprefixed lowercase — the `treeRoot` and `auditPath` entries are raw hex, not `sha256:`-prefixed.)
## Gotchas
- **One attestation per file.** v0.1 does not cluster proofs. Five files needing per-file claims = five inclusion-proof attestations. Storage cost is bounded by `O(log(treeSize))` per proof — small enough that one-per-file is fine for typical release sets.
- **Algorithm pinning.** The verifier must reject any proof whose `hashAlgorithm` does not match the product attestation's `hashAlgorithm`. A proof tagged `sha-1` against a tree built with `sha256` is invalid even if the audit path happens to compute. Hash-algorithm confusion is a known CVE class.
- **The leaf hash does not include the path.** Two files with identical content at different paths have the same leaf hash, and the Merkle proof says nothing about where the file sat. `leafPath` is authenticated only by the DSSE signature over the predicate. The predicate carries both `leafPath` and `fileDigest`, so a verifier can still refuse a proof whose signed path or digest does not match the file the consumer is asking about.
- **The proof is meaningless without a signed root.** Always verify the product/material attestation's signature before trusting its claimed root as the proof's terminator. ([GHSA-jp26-88mw-89qr](https://github.com/sigstore/sigstore-java/security/advisories/GHSA-jp26-88mw-89qr) is the canonical example of skipping this step.)
- **The sidecar tree is not evidence.** `` `.product.tree.json` `` / `` `.material.tree.json` `` are unsigned and producer-only. A consumer who somehow obtained one has no signed claim to verify against — only the producer's signature on the inclusion-proof attestation makes the proof trustworthy.
## Usage note
With v0.3 inline leaves, `cilock verify` resolves per-file claims directly from the product or material attestation — no standalone inclusion-proof envelope is needed. If you have a pre-existing standalone inclusion-proof envelope (from a pre-v0.3 pipeline), reference it via `externalAttestations` in the policy; the predicate schema and verification semantics above remain valid.
## Wiring into a policy
Unlike other cilock predicates, an inclusion-proof envelope is a **bare DSSE predicate, not a `Collection`**. That means it cannot be referenced as one of a step's `attestations[].type` entries — the policy engine's Collection-walking code path won't unmarshal it (it tries to decode the bare predicate as a `Collection` body and silently produces an empty struct).
The correct wiring uses `Policy.externalAttestations` + `Step.externalFrom`:
```json
{
"externalAttestations": {
"binaryInclusionProof": {
"name": "binaryInclusionProof",
"predicateType": "https://aflock.ai/attestations/inclusion-proof/v0.1",
"functionaries": [ /* ... */ ],
"required": true
}
},
"steps": {
"release": {
"name": "release",
"functionaries": [ /* ... */ ],
"attestationsFrom": ["build"],
"externalFrom": ["binaryInclusionProof"],
"attestations": [
{ "type": "...", "regopolicies": [ /* ... */ ] }
]
}
}
}
```
An external attestation is described by `name`, `predicateType`, `functionaries` and `required` (default `true`), with optional `regopolicies` and `aipolicies` evaluated against the bare predicate. Rego policies sit on each entry of the step's `attestations[]`; a step has no `regopolicies` of its own. Under the v0.2 policy type an unknown member, such as `type` inside an external attestation, is a decode error; under v0.1 it is silently dropped, which leaves `predicateType` empty.
That lifts the inclusion-proof predicate into the Rego module's `input.external.binaryInclusionProof`, where the release-gate rule can compare `treeRoot` against the `merkleRoot` of the build's `https://aflock.ai/attestations/product/v0.3` attestation in `input.steps.build.collections[_].attestations` to verify the proof is bound to the artifact the build produced.
See [`multi-step-attestationsFrom`](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/multi-step-attestationsFrom) for a worked policy that uses this pattern end-to-end.
## See also
- [Product attestor v0.3](./product.mdx) — inline-leaves model, primary per-file verification path
- [Inclusion proofs](../concepts/inclusion-proofs.md) — the underlying algorithm
- [The spine of the graph](../concepts/the-spine-of-the-graph.md) — why the subject is the file digest
- [Verify a specific file](../guides/verify-a-specific-file.md) — consumer-side workflow
- [Issue #135](https://github.com/aflock-ai/rookery/issues/135) — design rationale
---
# Attestors overview
Source: https://www.testifysec.com/docs/cilock/attestors/
# Attestors
Each CI/lock attestor captures one slice of build/run state and emits it as an in-toto predicate inside the DSSE envelope. A single `cilock run` invocation can chain many attestors together, so the resulting collection is the union of every signal you asked for.
This section has **one page per attestor** — what it captures, when to use it, available flags, output shape, and common gotchas.
For a comparative overview (predicate type, lifecycle phase, which ones ship by default), see the [Attestor catalog](../reference/attestor-catalog.md).
## Lifecycle phases (when an attestor fires)
| Phase | Fires | Examples |
|---|---|---|
| `prematerial` | Before materials are recorded | `git`, `environment`, `github`, `aws` |
| `material` | Snapshot of inputs before the wrapped command runs | `material` (always run) |
| `execute` | The wrapped command itself | `command-run` (always run), `github-action` |
| `product` | Snapshot of outputs after the command runs | `product` (always run) |
| `postproduct` | After products are recorded | `sbom`, `sarif`, `cred-leak`, `slsa`, `vex`, `oci` |
| `verify` | Only inside `cilock verify` | `policyverify` |
The `material → execute → product` core fires on every `cilock run`. Everything else comes from the default set, from auto-detection, or from `--attestations`.
## Always run
Three attestors fire on every `cilock run` that wraps a command. They're the spine of the in-toto link statement CI/lock emits:
- **[material](./material.mdx)** — digests of the working directory before the command
- **[command-run](./command-run.mdx)** — the wrapped command, exit code, optional ptrace
- **[product](./product.mdx)** — digests of files changed or created after the command
`--no-default-attestor material` or `--no-default-attestor product` drops one of the two snapshot attestors. Dropping both is refused, because the collection would carry no material or product evidence.
## Default-on
When `--attestations` (`-a`) is not specified, CI/lock additionally enables:
- **[environment](./environment.mdx)** — OS, hostname, username, environment variables (sensitive ones masked)
- **[git](./git.mdx)** — commit, branch, dirty status, parents, refs, remotes
- **platform**: binds the run to your logged-in TestifySec platform tenant. It is dropped from the default set when there is no platform session (`--offline`, or not logged in) and when the binary does not include it. See [platform](./platform.mdx).
To override, pass `--attestations ""`. An explicit list is used exactly as given: the defaults above are replaced, not extended.
## Auto-detection
When you do not pass `-a`, `cilock run` also inspects the wrapped command, its environment and the working directory, and attaches every attestor whose detection rule matches. The rules live in each attestor's `detector.yaml` (`argv_prefix`, `file_exists`, `env_set`), or in `attestation/detection/catalog/.yaml` for catalog tools; a catalog entry takes precedence over a plugin `detector.yaml` of the same name. `cilock tools show ` prints the rule in effect. A `.git/HEAD` attaches `git`, a `go build` or `go install` in the wrapped command, or a `go.mod` in the working directory, attaches `go-build`, and a scanner attestor attaches only when that scanner is the wrapped command.
- Pass `-a` and detection is off: your list is the exact set.
- `--workload auto` forces detection even alongside `-a`; `--workload manual` turns it off.
- `cilock run --validate-only ...` prints the planned attestor set without running the command.
- An attestor that auto-detection attached and that then fails does not fail the run. Name it with `-a` to make a failure fatal.
## Default vs. builder opt-in
Every attestor below ships in the default `cilock` binary unless its page says "**builder opt-in only**" or that it is not compiled into the default binary (the AWS attestors need `-tags aws_attestors`). Those exist in rookery but aren't blank-imported in the default. To add one, [build a custom CI/lock](../guides/build-a-custom-cilock.md).
## Naming gotcha
The directory name in `plugins/attestors/` is not always the attestor name you pass to `--attestations`. Use the canonical name (see each attestor's page, or the [catalog](../reference/attestor-catalog.md)).
| Directory | Name to use |
|---|---|
| `commandrun/` | `command-run` |
| `githubaction/` | `github-action` |
| `aws-iid/` | `aws` |
| `secretscan/` | `cred-leak` (`secretscan` is a deprecated alias, removed in cilock 6.0) |
---
# Chef InSpec
Source: https://www.testifysec.com/docs/cilock/attestors/inspec/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/inspec.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/inspec.json';
# `inspec` attestor
[Chef InSpec](https://github.com/inspec/inspec) (originally Chef Software, now maintained by [Progress Software](https://www.chef.io/products/chef-inspec) after the 2020 acquisition) is a compliance-as-code framework. You write profiles as Ruby DSL files — `describe` blocks asserting facts about the target — and `inspec exec` runs them against any host reachable over SSH, WinRM, Docker, Kubernetes, or the local filesystem. Under cilock, every `inspec exec` becomes a **signed v0.1 InSpec attestation** carrying the profile name, target platform, per-control pass/fail/skip counts and the failing controls, plus the report file's path and digest. The raw JSON report itself is not embedded.
## Validated invocation
```bash
cilock run --step inspec-scan \
--signer-file-key-path key.pem \
--outfile attestation.json \
--attestations inspec,environment,git \
--enable-archivista=false \
-- inspec exec dev-sec/linux-baseline \
--reporter json:inspec-results.json \
--no-distinct-exit \
--chef-license=accept-silent
```
Three InSpec-specific quirks are baked into that command — each matters for clean attestations:
- **`--reporter json:inspec-results.json`** — InSpec writes the machine-readable JSON to a file in cwd. The `inspec` attestor (a `postproduct` lifecycle attestor) reads that file out of cilock's product set, integrity-checks it against the recorded digest, and parses the profile / platform / per-control results into the predicate.
- **`--no-distinct-exit`** — InSpec normally exits `100` when controls fail and `101` when only skipped controls remain. Without this flag, the very fact that you ran the scan to surface a finding makes `command-run/v0.2` record a non-zero exit code. `--no-distinct-exit` folds both into a clean `0` while the failed control IDs stay in the JSON (and in the signed `inspec/v0.1` predicate).
- **`--chef-license=accept-silent`** — InSpec 5+ refuses to run interactively until the license is accepted. Passing the flag silently accepts the community license on the same invocation; without it, the run blocks on a TTY prompt that doesn't exist inside cilock.
## What gets captured
Each cilock run emits an in-toto envelope whose predicate carries the following attestor types:
| Attestor type | Captures |
| ------------------------------------------------------ | --------------------------------------------------------------------- |
| `https://aflock.ai/attestations/command-run/v0.2` | Real `inspec exec ...` argv, env, exit code, stdout/stderr |
| `https://aflock.ai/attestations/material/v0.3` | Merkle tree of inputs (profile sources, custom Ruby controls, fixtures) |
| `https://aflock.ai/attestations/product/v0.3` | Merkle tree of outputs, including `inspec-results.json` |
| `https://aflock.ai/attestations/inspec/v0.1` | Profile name, platform `-`, pass/fail/skip counts, failed control IDs |
| `https://aflock.ai/attestations/environment/v0.1` | OS, arch, user, env vars (PII-filtered) |
| `https://aflock.ai/attestations/git/v0.1` | Commit SHA, branch, remotes |
The `inspec/v0.1` predicate's `reportDigestSet.sha256` exactly matches the digest of the `inspec-results.json` leaf in the `product/v0.3` tree. That chain is what makes the compliance findings verifiable — you can't swap in a clean JSON without invalidating the product tree. Each failed control ID also becomes a subject (`inspec:control:`) so a downstream Rego policy can gate on specific rule failures.
## Why this shape
| Antipattern | This page |
| ---------------------------------------------------------------- | ---------------------------------------------------------------- |
| `cilock run ... -- bash -c "cp inspec-out.json product.json"` | `cilock run ... -- inspec exec --reporter json:...` |
| `command-run` records `bash -c "cp ..."` — useless | `command-run` records the real `inspec exec` argv |
| Product attestor digests the `cp` destination | Product attestor digests InSpec's actual output file |
| Tool execution happens outside the attestation | InSpec runs inside cilock; with `--trace`, the tracer sees its syscalls and target connections |
cilock invokes `inspec exec` **directly** — no `bash -c` wrapper. That preserves the real argv in `command-run` (including the profile reference and target backend), and, with `--trace`, lets the tracer observe every file InSpec opened. The `product` attestor digests every report it wrote. The `inspec` attestor then picks the JSON file out of the products map, re-hashes it, and parses it.
## Validate it locally
```bash
# Generate a signing key (one-time).
openssl genpkey -algorithm ed25519 -out key.pem
# Run cilock + inspec exec against a profile (dev-sec/linux-baseline shown here;
# substitute any local path, git URL, or Automate-hosted profile reference).
cilock run --step inspec-scan \
--signer-file-key-path key.pem \
--outfile attestation.json \
--attestations inspec,environment,git \
--enable-archivista=false \
-- inspec exec dev-sec/linux-baseline \
--reporter json:inspec-results.json \
--no-distinct-exit \
--chef-license=accept-silent
# Confirm the predicate carries the expected attestor types.
jq -r '.payload' attestation.json | base64 -d \
| jq '.predicate.attestations | map(.type)'
```
Expected output:
```json
[
"https://aflock.ai/attestations/environment/v0.1",
"https://aflock.ai/attestations/git/v0.1",
"https://aflock.ai/attestations/material/v0.3",
"https://aflock.ai/attestations/command-run/v0.2",
"https://aflock.ai/attestations/product/v0.3",
"https://aflock.ai/attestations/inspec/v0.1"
]
```
```bash
# Confirm InSpec's real argv ended up in command-run.
jq -r '.payload' attestation.json | base64 -d \
| jq '.predicate.attestations[]
| select(.type=="https://aflock.ai/attestations/command-run/v0.2")
| .attestation.cmd'
```
Expected output (literal InSpec argv — proof the `cp` antipattern is gone):
```json
[
"inspec",
"exec",
"dev-sec/linux-baseline",
"--reporter",
"json:inspec-results.json",
"--no-distinct-exit",
"--chef-license=accept-silent"
]
```
```bash
# Pull the compliance roll-up out of the inspec attestor.
jq -r '.payload' attestation.json | base64 -d \
| jq '.predicate.attestations[]
| select(.type=="https://aflock.ai/attestations/inspec/v0.1")
| .attestation
| {reportFile,
digest: .reportDigestSet.sha256,
profile: .scanSummary.profileName,
platform: .scanSummary.platform,
total: .scanSummary.totalControls,
failed: .scanSummary.failedControls,
failedIds: [.scanSummary.failedDetails[].id]}'
```
Against the [`30-inspec`](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/30-inspec) example (real `dev-sec/linux-baseline` scan on an AL2023 EC2 host) this surfaces the profile name (`linux-baseline`), the platform (`amazon-2023`), the total / failed control counts, and the IDs of every failed control — feeding directly into a `cilock verify` Rego gate.
## How a verifier consumes this
The `inspec` attestor is a `postproduct` lifecycle attestor with predicate type `https://aflock.ai/attestations/inspec/v0.1`. It does not shell out to `inspec`; it reads a pre-existing JSON report from the step's products. It populates three top-level fields:
- `reportFile` — path of the InSpec JSON file picked up from products.
- `reportDigestSet` — digest set of that file, integrity-checked against the product entry before parsing.
- `scanSummary` — structured roll-up of the report:
- `profileName` — name of the first profile in the report.
- `platform` — `-` from the InSpec `platform` block (just `` if release is empty).
- `totalControls`, `passedControls`, `failedControls`, `skippedControls` — aggregate counts.
- `failedDetails[]` — `{ id, title, profile }` for every control with at least one failing result.
Subjects published:
- `platform:-`
- `profile:` for each profile in the report.
- `inspec:control:` for each control with a failing result.
Pair this attestor with [`policyverify`](./policyverify.mdx) to gate promotion on `failedControls == 0`.
### Output shape
```json
{
"reportFile": "results/inspec.json",
"reportDigestSet": { "sha256": "..." },
"scanSummary": {
"profileName": "cis-ubuntu-22.04",
"platform": "ubuntu-22.04",
"totalControls": 142,
"passedControls": 130,
"failedControls": 4,
"skippedControls": 8,
"failedDetails": [
{ "id": "xccdf_org.cisecurity.benchmarks_rule_1.1.1.1", "title": "Disable cramfs", "profile": "cis-ubuntu-22.04" }
]
}
}
```
## Notes
- **Profile selection.** InSpec accepts a profile as a local path (`./my-profile`), a git URL (`https://github.com/dev-sec/linux-baseline`), a [Chef Supermarket](https://supermarket.chef.io) shortname (`dev-sec/linux-baseline`, `dev-sec/ssh-baseline`), an Automate-hosted reference, or a `.tar.gz` archive. The community CIS profiles maintained by the [dev-sec.io](https://dev-sec.io) project are the most common starting point — they cover Linux baseline, SSH, NGINX, Apache, MySQL, PostgreSQL, and Windows. The same cilock invocation works for any of them; only the profile argument changes.
- **Target backends.** InSpec scans whatever target `-t` points at: `-t ssh://user@host` (SSH, key-auth recommended), `-t winrm://user@host` (Windows), `-t docker://` (running container), `-t podman://`, `-t k8s://`, `-t aws://` / `-t azure://` / `-t gcp://` (cloud-resource scanning), or omitted (local target). cilock is target-agnostic — it captures whatever the InSpec backend produces. The `--no-distinct-exit` and `--reporter json:...` flags apply uniformly.
- **Reporter formats.** InSpec supports `cli` (human), `json`, `json-min`, `junit`, `html`, `progress`, `documentation`, `yaml`, and `automate` reporters; multiples can stack (`--reporter cli json:results.json junit:results.xml`). Only the `json` reporter is parsed by the `inspec` attestor (`json-min` output has no top-level `profiles` array, so it is rejected as not an InSpec report) — the others ride along in the product Merkle tree as opaque files for human review.
- **Custom Ruby profiles.** Profile sources are inputs, so anything in your local profile directory (Ruby `controls/*.rb` files, custom resources, libraries, attribute files) gets digested into `material/v0.3`. Findings produced by custom controls flow into the same `inspec/v0.1` predicate as findings from upstream rules — your in-house compliance rules are attested alongside the dev-sec.io / CIS ones.
- **License model.** The InSpec engine itself is Apache-2.0, but newer releases ship under Progress's commercial agreement; the `--chef-license=accept-silent` flag covers the community use case. If you're running under a Progress commercial license, the same flag still works — the license is consumed locally and does not appear in the captured attestation.
- **Chef → Progress rename.** The tool is still binary-named `inspec` and the GitHub org is still `inspec/inspec`; only the corporate ownership changed. Documentation and marketing copy increasingly say "Progress Chef InSpec," but the CLI surface this page documents is stable.
## Gotchas
- **Does not shell out to `inspec`.** The attestor reads the JSON report from the products of the same step; run `inspec exec --reporter json:` as the command cilock wraps (as in the validated invocation above) so the report is a product of that step. With no products, or no product that is an accepted InSpec report, the attestor fails (`no products to attest` / `no InSpec JSON report found in products`) rather than being skipped.
- **MIME filter.** Only products with MIME type `text/plain` or `application/json` are considered; reports written with other types are skipped.
- **Shape detection.** A candidate must parse as JSON and contain a non-empty `profiles` array, otherwise it is rejected as "not an InSpec report".
- **Digest integrity.** The file is re-hashed and compared against the product digest before parsing; a mismatch causes that candidate to be skipped.
- **First match wins.** Products are walked in sorted path order; if multiple files look like InSpec reports, only the first accepted one is attested.
- **Control outcome.** A control is `failed` if any result has status `failed`; `skipped` if it has no results or every result is `skipped`; otherwise `passed`. Only failing control IDs become subjects.
- **`profileName` in the summary** is taken from the first profile only, even when the report contains multiple.
## FAQ
### Does cilock support Chef InSpec?
Yes. Cilock invokes the upstream `inspec` binary unchanged and captures its JSON reporter output via the native `inspec` attestor, which emits a `https://aflock.ai/attestations/inspec/v0.1` predicate. No InSpec fork, no plugin install — InSpec is treated as a normal tool that happens to write a documented JSON schema cilock knows how to parse.
### Which targets can InSpec scan under cilock?
All of them — local (`-t local://`, the default), SSH (`-t ssh://`), WinRM (`-t winrm://`), Docker / Podman containers (`-t docker://`, `-t podman://`), Kubernetes (`-t k8s://`), and the major cloud providers (`-t aws://`, `-t azure://`, `-t gcp://`). cilock is target-agnostic: it captures whatever the InSpec backend produces. The same flags (`--reporter json:...`, `--no-distinct-exit`) apply uniformly.
### Can I write custom Ruby controls?
Yes — custom controls work exactly as they do without cilock. Drop your `controls/*.rb` files into a profile directory, point `inspec exec` at it, and the findings flow into the same `inspec/v0.1` predicate alongside any upstream rules. The custom control sources themselves get digested into `material/v0.3`, so a verifier can prove which version of which control produced each finding.
### Why `--no-distinct-exit`?
InSpec exits `100` when any control fails and `101` when only skipped controls remain. Without `--no-distinct-exit`, `command-run/v0.2` records a non-zero exit code on every scan that surfaces a real finding — which makes downstream tooling treat the scan itself as broken. The flag folds 100/101 back to 0; the failed control IDs still ride in the signed `inspec/v0.1` attestation, and the gate belongs at `cilock verify` time (a Rego policy over `failedControls`), not at scan time.
### How does InSpec compare to OpenSCAP / `oscap`?
Both are compliance scanners; the differences are the rule language, the ecosystem, and the target shape. OpenSCAP consumes [SCAP](https://csrc.nist.gov/projects/security-content-automation-protocol) content (XCCDF / OVAL XML, mostly Red Hat / SCAP-Security-Guide profiles) and is best for Linux baseline scans. InSpec consumes Ruby DSL profiles, ships a much larger community library (dev-sec.io, CIS, vendor-specific), and natively scans remote SSH / WinRM / cloud-API targets that OpenSCAP can't reach. Cilock has [a native attestor for each](../attestors/oscap.mdx) — pick the tool that matches your existing compliance content, not the attestor.
## See also
- [`oscap` tool integration](../attestors/oscap.mdx) — sibling compliance scanner with the same `cilock verify` gating pattern
- [Validated example: `30-inspec`](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/30-inspec) — real `dev-sec/linux-baseline` scan against an AL2023 EC2 host
- [Chef InSpec upstream](https://github.com/inspec/inspec) — the tool itself, maintained by Progress Software
- [dev-sec.io community profiles](https://dev-sec.io) — Linux, SSH, NGINX, Apache, MySQL, PostgreSQL, Windows hardening baselines
- [`kube-bench`](./kube-bench.mdx), [`oscap`](./oscap.mdx), [`prowler`](./prowler.mdx)
- [Tools index](../tools/index.md)
---
# instruction-file
Source: https://www.testifysec.com/docs/cilock/attestors/instruction-file/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/instruction-file.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/instruction-file.json';
# `instruction-file` attestor
Captures the SHA-256 digest of every recognized agent instruction file in the workspace, so a verifier can pin exactly which standing instructions an autonomous agent was operating under when it produced an artifact — and records, as a machine-checkable field, whether the credential about to sign that claim belongs to a workload or to a human's interactive session.
## Validated invocation
The attestor takes no tool invocation. It runs at `prematerial` time against the working directory:
```bash
cilock run --step build -a instruction-file -o build.json -- make build
```
## What gets captured
A `files` array, sorted by path, with one entry per recognized instruction file:
- `path` — relative to the search root, always slash-separated so a predicate produced on Windows is byte-identical to one produced on Unix.
- `digest` — a `DigestSet` holding the SHA-256 of the file's bytes.
- `sizeBytes` — the file's size on disk.
- `convention` — the agent product or ecosystem the file belongs to (`claude-code`, `agents-md`, `github-copilot`, …).
- `scope` — `repository` for a root-level file, `directory` for a nested one.
- `skipReason` — present only when the file was found but not digested.
Plus `signer` (see below), `status`, `warnings`, and `caveat`.
**File content is deliberately NOT captured.** Instruction files routinely carry internal hostnames, ticket numbers and occasionally credentials, and a signed attestation is a durable, widely readable artifact. The subject digest pins the bytes exactly; a verifier who legitimately holds the file can confirm the match, and one who does not learns nothing.
Recognized conventions:
| Pattern | Match | Convention |
| --- | --- | --- |
| `CLAUDE.md` | base name | `claude-code` |
| `AGENTS.md` | base name | `agents-md` |
| `SKILLS.md` | base name | `skills-md` |
| `GEMINI.md` | base name | `gemini-cli` |
| `.cursorrules` | base name | `cursor` |
| `.windsurfrules` | base name | `windsurf` |
| `.aider.conf.yml` | base name | `aider` |
| `.github/copilot-instructions.md` | declared path | `github-copilot` |
| `.cursor/rules` | declared path | `cursor` |
This is an allowlist, not a heuristic. A file it does not recognize is not attested — silently digesting every Markdown file in a tree would produce a predicate nobody could reason about.
**A declared path matches the file at that path, or every file beneath it when the path is a directory.** Cursor ships both shapes — `.cursor/rules` was a single file and is now a `.cursor/rules/` directory of `.mdc` rule files — and the directory form is not optional to support. Auto-detection stats the declared path, and a stat succeeds on a directory, so a directory there *activates* the attestor. If matching then found nothing, the run would emit `status: complete` with no subjects while live instructions sat inside it.
**Base names are recognized outside hidden directories only.** `docs/CLAUDE.md` is captured, `.hidden/CLAUDE.md` is not. This is a scope boundary, not an oversight: auto-detection's recursive glob does not descend hidden directories, so recognizing base names there would mean the same file became evidence or did not depending on whether something *else* in the tree happened to trip the pre-gate. Declared paths under `.github` and `.cursor` are unaffected — the pre-gate reaches those by exact path rather than by glob — and so is everything *beneath* a declared directory convention: `.cursor/rules/.private/rule.mdc` is captured, because the boundary being drawn here is about the glob's reach and that subtree was never found through the glob.
Each digested file is emitted as an in-toto subject named `` `instructionfile:` `` keyed by the **file's own** digest, so the subject joins by content: an approved instruction file can be pinned by digest across repositories.
## Why this shape
### The signer axis that matters is not keyed-versus-keyless
The closest prior art is [`nono`](https://github.com/nolabs-ai/nono), whose `signer.kind` is exactly `"keyed"` or `"keyless"` — a closed set, with any other value a hard parse error (`crates/nono/src/trust/dsse.rs:286-336`). That axis grades **key material**, not principal.
Read carefully, nono's `keyless` arm is workload-*shaped*: it hard-requires `issuer`, `repository`, `workflow_ref`, `subject` and `build_signer_uri` (`dsse.rs:299-331`), which a browser-OIDC session could not satisfy. So the problem is **not** that nono lets humans in through the keyless door. It is that the vocabulary cannot *name* a principal, and two things follow:
- A human's interactive session is unrepresentable. Signing locally lands in `keyed`, which conflates "a static keystore key" with "a person signed this".
- "Is this a workload?" can only be approximated as "is this keyless?" — which couples the check to GitHub-Actions-shaped fields, cannot express a workload on another platform, and cannot say "not a human session" at all.
The case that matters is the ALPS 0.1 gap: an agent launched from a signed-in human's shell inherits that human's platform session and signs with it — no ceremony, no human in the loop at the moment of signing. In cilock's own keyless browser-OIDC flow that credential is *keyless and human* and carries no `workflow_ref`, so a keyed/keyless axis cannot classify it at all.
So this predicate carries two independent fields:
- `signer.keyMaterial` — `keyed` | `keyless` | `unknown`. nono's axis, kept for interop. **This attestor always emits `unknown`**, because key material is chosen at *signing* time, after this predicate exists — a runner with a complete OIDC token environment can still sign with a long-lived static key from a secret.
- `signer.kind` — the **observed principal class**.
### The whole signer block is observational, and says so
`signer.policyUse` is pinned by the schema to the constant `observational-only`. A predicate that omits it or claims anything else is schema-invalid.
That field exists because the alternative is not reachable. Binding these values to the credential that actually signs would mean reading the signing certificate, and this attestor is `prematerial` — it runs **before any signing has happened**, so there is no certificate to read. Everything in the block is an observation of environment variables and process state, and any ancestor process can set an environment variable.
Two concrete defeats, both real:
- Two `export` lines (`GITHUB_ACTIONS=true`, `GITHUB_REPOSITORY=…`) in any shell.
- A genuine CI job, with every runner variable legitimately present, that signs with a static key from a secret. Nothing observable here distinguishes it from a keyless workload signature.
So **do not gate on this block.** Gate on the DSSE signing certificate — its SAN, its issuer, and the Fulcio extensions carrying repository and workflow — through the policy's functionary constraint. Use `signer` as the defense-in-depth cross-check that catches a *mismatch* between what the environment claimed and what the certificate proves. The `signer.kind != "workload-identity"` rule below is written as that cross-check, not as the gate.
### `signer.kind` is a closed enum, and `unknown` is a member
| `kind` | Meaning |
| --- | --- |
| `workload-identity` | Federated, non-interactive machine identity minted for a single run. No natural person's session in the chain. |
| `interactive-human-session` | The credential derives from a person's interactive login — browser OIDC, device grant, stored platform session — regardless of whether a person or an agent is driving it right now. |
| `long-lived-key` | A static private key with neither an interactive session nor a federated identity. |
| `unknown` | Not established. **Deny.** |
`unknown` is an explicit member rather than an empty string so that absence is representable and a policy can name it. It is the common case on a developer machine, and it is *not* a synonym for "no human involved": an ALPS-style agent inheriting a human session runs with no TTY and no CI variables, and lands here.
**This attestor emits only three of the four.** `long-lived-key` is part of the predicate's vocabulary — the type is a shared contract, and other producers (and later cilock versions, which will see the signing configuration) need to express it — but nothing observable at prematerial time distinguishes "a static key is about to be used" from "we could not tell", so this attestor reports `unknown` instead of guessing. A policy allowlisting `workload-identity` denies both regardless. The gap is pinned by a test, so teaching the detector to emit it is a deliberate change rather than a silent one.
### The strong claim cannot travel without its evidence
`workload-identity` is the only kind that earns anything, so the JSON Schema makes it structurally inseparable from the evidence that would substantiate it:
```json
"allOf": [
{ "if": { "properties": { "kind": { "const": "workload-identity" } }, "required": ["kind"] },
"then": { "required": ["federated"] } }
]
```
A predicate claiming `workload-identity` with no `federated` block is **schema-invalid**, not merely policy-denied. The conditional is generated by iterating the attestor's own signer-kind table, so a future kind marked as requiring federated evidence acquires the constraint automatically.
`kind`, `keyMaterial` and `assurance` are all **required** — none carries `omitempty`. An omitted field reads to a policy as an absent constraint, so a signer-less predicate would sail straight past a `signer.kind != "interactive-human-session"` check. Requiring them makes a signer-less predicate malformed rather than permissive.
## How a verifier consumes this
`cilock verify` hands the policy this attestor's JSON as `input`, unwrapped: `input.signer`, `input.status` and `input.files` are top-level fields, and there is no `input.predicate`. The module needs `import rego.v1` for the `contains`, `if` and `in` keywords, because cilock parses Rego v0 by default.
**That flat shape holds only while the step asks for no cross-step context.** The moment a step declares `attestationsFrom` or `externalFrom`, `buildRegoInput` (`attestation/policy/rego.go`) re-shapes the input to `{attestation, steps, external}` and this attestor's fields move under `input.attestation`. The flat module below then reads undefined paths and every `deny` body fails. That used to admit everything the module was written to refuse, silently; the verifier now refuses the step with an error naming the missing path, so it fails loudly, but it still never evaluates the rules you wrote. Write for the shape your step actually produces, and check `attestationsFrom`/`externalFrom` before copying either example.
Write the gate as an **allowlist**, never a denylist. A denylist silently admits any kind added later:
```rego
package instructionfile
import rego.v1
# The signer must be a workload. `unknown` and every future kind deny by default.
deny contains msg if {
input.signer.kind != "workload-identity"
msg := sprintf("instruction attestation signed by principal class %v; workload identity required", [input.signer.kind])
}
# A partial scan makes no claim about what it did not read.
deny contains msg if {
input.status != "complete"
msg := sprintf("instruction-file scan status %v; nothing is claimed about the unexamined remainder", [input.status])
}
# Pin the reviewed instruction files by digest.
approved := {"9f2b...c1", "44ae...07"}
deny contains msg if {
some f in input.files
not f.digest.sha256 in approved
msg := sprintf("unapproved instruction file %v (sha256 %v)", [f.path, f.digest.sha256])
}
```
This module is extracted from this page and run against real attestor output by `plugins/attestors/instruction-file/rego_input_test.go`, so it cannot drift from the shape the attestor emits.
**The same gate for a step that declares `attestationsFrom` or `externalFrom`.** Identical rules, one level deeper. Nothing else changes:
```rego
package instructionfile
import rego.v1
deny contains msg if {
input.attestation.signer.kind != "workload-identity"
msg := sprintf("instruction attestation signed by principal class %v; workload identity required", [input.attestation.signer.kind])
}
deny contains msg if {
input.attestation.status != "complete"
msg := sprintf("instruction-file scan status %v; nothing is claimed about the unexamined remainder", [input.attestation.status])
}
approved := {"9f2b...c1", "44ae...07"}
deny contains msg if {
some f in input.attestation.files
not f.digest.sha256 in approved
msg := sprintf("unapproved instruction file %v (sha256 %v)", [f.path, f.digest.sha256])
}
```
Both modules are extracted from this page and evaluated against real attestor output, the flat one without step context and the wrapped one with it, so neither can drift from the shape the attestor emits. The same test also pins the failure this section warns about: the flat module, given step context, denies nothing.
**Gate on the certificate too.** The `signer` block is derived from environment variables and process state at prematerial time, *before* any signing has happened, and any ancestor process can set an environment variable. It is corroborating context, not proof: a policy that gates on `signer.kind` alone can be defeated by setting `GITHUB_ACTIONS=true`. The authoritative check is the DSSE signing certificate — its SAN, its issuer, and the Fulcio extensions carrying the workload's repository and workflow — enforced by the policy's **functionary constraint**. Use `signer.kind` as the defense-in-depth cross-check that catches a mismatch between what the environment claimed and what the certificate proves.
## Notes
- **Run type is `prematerial`.** Instruction files are inputs that shape the run, so they are captured before anything acts on them.
- **`status` is fail-closed.** `complete` means the whole tree under the search root was examined *and every recognized file in it was digested*, so an empty `files` list is a positive claim ("this workspace has no recognized instruction files"). `incomplete` means either that part of the tree could not be read, or that a recognized file was found and refused — in both cases *nothing* is claimed about what was not examined. `unavailable` means the walk could not be performed. A policy requiring "no unreviewed instruction files" must treat `incomplete` the way it treats `unavailable`.
- **A file found but not digested is recorded**, with a `skipReason`, rather than dropped. Present-but-refused and never-there are different facts, and collapsing them is how a policy comes to believe a file it never saw was clean. Such a file contributes no subject, because a subject with no digest anchors to nothing — **which is exactly why it also forces `status: incomplete`.** Otherwise the two behaviours compose into the worst available predicate: a workspace whose only `CLAUDE.md` is a symlink would report `complete` with an empty subject list, asserting the tree was fully examined and held nothing. The `status != "complete"` rule above is what catches it, so a policy that omits that rule and inspects only `files` will still miss the case.
- **Vendored trees are skipped** (`node_modules`, `vendor`, `.git`, `target`, `dist`, …). A dependency's instruction file is not this workspace's evidence. **The exception is a declared convention subtree**: everything under a declared path such as `.cursor/rules` is walked in full, ignore list and hidden-directory rule included, so `.cursor/rules/vendor/rule.mdc` and `.cursor/rules/.private/rule.mdc` are both captured. Those two rules exist to keep the walk in agreement with auto-detection's recursive glob — a statement about where the scan goes *looking* — and a subtree the pre-gate named by exact path was never reached through that glob. Pruning it anyway produced `status: complete` for a workspace whose rule files had been silently skipped.
- **Symlinks are not followed at any path component.** A symlinked instruction file is recorded with a skip reason, and so is one reached through a symlinked *parent* directory: every component is opened with no-follow semantics against the descriptor of the component before it. Containment is not the property under test — a link that stays inside the workspace still means the bytes published under a path are not that path's bytes — so an in-workspace link is refused exactly like an escaping one.
- **On platforms without an atomic no-follow open, nothing is digested.** The traversal above needs `openat(O_NOFOLLOW)`; where that is unavailable the attestor refuses the file with a skip reason and the scan reports `incomplete`, rather than publishing a path-to-digest binding it cannot guarantee. A missing subject is visible; a wrong one is not.
- **Files over 4 MiB are recorded but not digested.**
## Gotchas
- **`assurance` never exceeds `environment-observed`.** This attestor runs before signing, so it cannot observe a verified OIDC token. The vocabulary deliberately has no stronger grade — inventing one would be the exact failure it exists to prevent.
- **CI variables without the token-minting machinery are what spoofed CI looks like.** `federated.tokenEndpointPresent` reports whether the ambient workload-OIDC endpoint was actually reachable. `false` alongside a full set of CI variables is a signal worth denying on.
- **A self-hosted runner can be a developer machine.** When the platform publishes it, `federated.runnerEnvironment` carries `self-hosted`, which weakens the workload claim considerably.
- **`unknown` is the default on a laptop.** That is intended. If a local `cilock run` is being denied by an ALPS-style policy, the policy is working.
## FAQ
**Why a first-class aflock predicate rather than adopting nono's type or using in-toto SCAI?**
There is no ratified in-toto predicate for prompts, instructions or agent inputs — the spec's predicates directory holds provenance, VSA, SCAI, runtime-trace, test-result, release, reference, link, SPDX, CycloneDX, vuln and SVR, and nothing covering this. No standard is being ignored. Adopting nono's vendor type would have meant inheriting an axis (`keyed`/`keyless`) that cannot express the distinction this predicate exists for. The Statement envelope stays in-toto v1 either way.
**Can cilock verify nono's own attestations?**
The code path exists and needs no change, though this has not been demonstrated end-to-end against a real `.nono-trust.bundle`. An envelope whose `predicateType` has no registered attestor factory is wrapped as a `RawAttestation` holding the exact decoded predicate bytes (`attestation/source/memory.go:256-261`, `attestation/source/archivista.go:457-462`), and rego `input` is built by marshalling that attestor directly (`attestation/policy/rego.go:97`) — so a third-party predicate's JSON reaches a policy verbatim. Policies also carry an `ExternalAttestations` map for evidence produced outside the run. Emitting our predicate and consuming theirs are separable, and only the emitting half is implemented here.
**Is nono's instruction-file attestation multi-subject?**
No. `new_instruction_statement` builds a statement with exactly one subject (`dsse.rs:388-419`). Multi-subject signing is a *separate* predicate type, `https://nono.sh/attestation/multi-file/v1` (`dsse.rs:34`, `new_multi_subject_statement`). Our predicate is multi-subject in a single statement, one subject per discovered file.
**Does this attestor decide whether an instruction file is acceptable?**
No. It records facts; policy renders the verdict. That separation is why the raw digests are reusable ground truth that any policy can evaluate.
## See also
- [`alps-evidence`](./alps-evidence.mdx) — observes which coding agent invoked cilock, as forgeable attribution data.
- [`lockfiles`](./lockfiles.mdx) — the same capture shape for dependency lockfiles.
- [`policyverify`](./policyverify.mdx) — renders the verdict over this evidence.
---
# jenkins
Source: https://www.testifysec.com/docs/cilock/attestors/jenkins/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/jenkins.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/jenkins.json';
# `jenkins` attestor
Captures Jenkins build metadata from `JENKINS_*`, `BUILD_*`, and related environment variables exported into the build's shell, binding the artifact to the pipeline run that produced it.
## What it captures
The attestor first checks for `JENKINS_URL`. If unset, it returns `ErrNotJenkins` ("not in a jenkins ci job"), the attestor fails, and `cilock run` exits 70 with `jenkins` listed in the collection's `failedattestors`. Otherwise it reads the following environment variables and writes them to the json-tagged fields below:
| Field (JSON) | Env var |
|---|---|
| `buildid` | `BUILD_ID` |
| `buildnumber` | `BUILD_NUMBER` |
| `buildtag` | `BUILD_TAG` |
| `pipelineurl` | `BUILD_URL` (userinfo redacted) |
| `executornumber` | `EXECUTOR_NUMBER` |
| `javahome` | `JAVA_HOME` |
| `jenkinsurl` | `JENKINS_URL` (userinfo redacted) |
| `jobname` | `JOB_NAME` |
| `nodename` | `NODE_NAME` |
| `workspace` | `WORKSPACE` |
Two subjects are recorded as SHA-256 digests of the URL strings: `` `pipelineurl:` `` and `` `jenkinsurl:` ``. Any `user:password@` in either URL is replaced with `******@` before it is stored or digested (`redact.URLCredentials`), so a policy must match the redacted form. Only `pipelineurl:` is exposed as a back-reference for chaining.
## When to use
Use this attestor on any Jenkins-driven CI job where you want the resulting attestation to record which pipeline, job, build number, and agent node produced an artifact. Jenkins does not ship a native OIDC identity for build jobs, so this attestor only records self-reported environment variables. The [`jwt`](./jwt.mdx) attestor cannot fill that gap today: it takes its token only from an embedding attestor, and `-a jwt` on its own fails, so a token issued by a Jenkins OIDC plugin cannot be recorded.
## Flags
None. The attestor consumes environment variables only; there are no `--attestor-jenkins-*` flags.
## Output shape
```json
{
"buildid": "42",
"buildnumber": "42",
"buildtag": "jenkins-my-job-42",
"pipelineurl": "https://jenkins.example.com/job/my-job/42/",
"executornumber": "0",
"javahome": "/opt/java/openjdk",
"jenkinsurl": "https://jenkins.example.com/",
"jobname": "my-job",
"nodename": "built-in",
"workspace": "/var/jenkins_home/workspace/my-job"
}
```
## Gotchas
- All fields are unverified, self-reported strings from the build environment. Anything with write access to the shell — a `sh` step, an upstream pipeline, a malicious dependency — can overwrite them before `cilock` runs. Treat this attestor as build-context metadata, not as proof of provenance.
- Detection hinges on `JENKINS_URL` being present. If a shell step unsets or shadows it (`env -i`, container with a scrubbed environment), `Attest` returns `ErrNotJenkins{}`, the attestor fails, and cilock exits 70 with the failure recorded in the collection's `failedattestors`. Keep `-a jenkins` out of templates shared with non-Jenkins runners.
- On modern Jenkins, `BUILD_ID` is identical to `BUILD_NUMBER`; both fields are populated for backward compatibility and will usually match.
- Subjects are digests of the URL *strings*, not of their contents. They identify the pipeline run but do not attest that the URL resolves to anything.
- `JAVA_HOME` is recorded if present in the environment regardless of whether the job uses Java; it reflects the controller/agent JDK, not the build toolchain.
- Despite the upstream witness doc mentioning a `BUILD_USER` field, this implementation does **not** read `BUILD_USER` — the actor field is absent from the predicate.
## CLI example
Real Jenkins runtime context. Reads canonical Jenkins env vars (`BUILD_ID`, `BUILD_URL`, `JOB_NAME`, `JENKINS_URL`) exposed by the agent.
```bash
# In a Jenkins pipeline / freestyle job:
cilock run --step jenkins-validation \
--signer-file-key-path key.pem --outfile attestation.json --workingdir . \
--attestations jenkins,environment \
-- echo "captured Jenkins context"
```
Validated by setting the canonical Jenkins env vars in shell. The attestor reads from env, no other inputs. See the full real-data example at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/23-jenkins](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/23-jenkins).
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [`jwt`](./jwt.mdx), the token verifier the `github`, `gitlab` and `gcp-iit` attestors embed
- Upstream: [witness/jenkins.md](https://github.com/in-toto/witness/blob/main/docs/attestors/jenkins.md)
---
# jwt
Source: https://www.testifysec.com/docs/cilock/attestors/jwt/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/jwt.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/jwt.json';
# `jwt` attestor
Parses a JWT, fetches a JWKS, verifies the token's signature, and records the decoded claims plus the JWK that verified it.
## What it captures
The struct exposes two top-level JSON-tagged fields:
- `claims` — the full set of decoded JWT claims, populated by `go-jose`'s `parsed.Claims(jwks, &a.Claims)` after signature verification. Stored as `map[string]interface{}`, so every claim in the token (standard registered claims plus any custom issuer-specific claims) lands here verbatim.
- `verifiedBy` (omitempty) — the JWKS coordinates that verified the signature:
- `jwksUrl` — the URL the JWKS was fetched from, with any userinfo in it recorded as `******` (the rule the environment attestor applies to its values). The fetch itself uses the URL as configured, so an endpoint behind basic auth still verifies.
- `jwk` — the `jose.JSONWebKey` (kid, kty, alg, public key material, etc.) whose `kid` matched the token header.
The token itself and the configured JWKS URL are kept as unexported fields (`token`, `jwksUrl`) and are deliberately not serialized.
This attestor is also embedded inside the [`github`](./github.mdx), [`gitlab`](./gitlab.mdx), and [`gcp-iit`](./gcp-iit.mdx) attestors, which construct it via `jwt.New(jwt.WithToken(...), jwt.WithJWKSUrl(...))` to share JWT parsing, JWKS fetch, and signature-verification logic.
## When to use
Through the dedicated attestors that embed it: GitHub Actions (`github`), GitLab CI (`gitlab`) and GCP (`gcp-iit`). `-a jwt` on its own always fails with `invalid token: ""`, because no CLI flag or environment variable supplies the token; only an embedding attestor can set it. It is a generic "I held this signed token and verified it against this JWKS" attestation.
## Flags
None. The attestor is configured programmatically through functional options (`WithToken`, `WithJWKSUrl`) by its embedders; it does not register CLI flags, so there is no way to hand it a token from the command line.
## Output shape
```json
{
"claims": {
"iss": "https://token.actions.githubusercontent.com",
"sub": "repo:example/repo:ref:refs/heads/main",
"aud": "witness",
"exp": 1700000000,
"iat": 1699996400
},
"verifiedBy": {
"jwksUrl": "https://token.actions.githubusercontent.com/.well-known/jwks",
"jwk": {
"use": "sig",
"kty": "RSA",
"kid": "...",
"alg": "RS256",
"n": "...",
"e": "AQAB"
}
}
}
```
## Gotchas
- **Empty token fails fast.** `Attest()` returns `ErrInvalidToken("")` if no token was supplied via `WithToken`; no network call is made.
- **JWKS fetch is hard-capped.** The fetch uses a `*http.Client` with a 30 s timeout, requires HTTP 200 (anything else errors with `unexpected status code from JWKS endpoint ...`), and the response body is wrapped in `io.LimitReader(resp.Body, 1<<20)` — a malicious or misconfigured JWKS endpoint cannot OOM the attestor; oversized responses fail at JSON decode.
- **Fetch errors do not quote a credential.** An error names the endpoint with its userinfo as `******`. The error net/http wraps is text taken from the endpoint and from any redirect, so it is kept only when the request was not redirected, the text holds no `@`, and the URL holds no credential or Go dials the host the redacted endpoint still names; otherwise the error says only what kind of failure it was (`the URL does not parse`, `the request timed out`, `the request failed`). `https://ci:secret/part@host/keys`, whose password holds a `/`, fails to parse with `invalid port ":secret"`, and a redirect to `http://ci:secret@host:bad/keys` fails with that Location quoted whole; both are withheld.
- **Bad signature fails the attestation.** Signature verification is performed by `parsed.Claims(jwks, &a.Claims)`. If the token's signature does not validate against any key in the fetched JWKS, `Attest()` returns `error parsing claims: ...` and the attestation does not run. The `claims` field is only populated on successful verification.
- **Missing `kid` is tolerated for `verifiedBy` only.** After successful claims verification, the attestor walks the token headers for the first non-empty `kid` and looks it up in the JWKS. If no key matches, `Attest()` returns `nil` with `verifiedBy` left zero-valued — claims are still captured, but the recorded JWK is absent. (Signature verification itself has already succeeded by this point; this lookup is purely to record which JWK matched.)
- **No revocation, no expiration check, no audience check.** This attestor records what the token says; it does not enforce `exp`, `nbf`, `aud`, or issuer constraints. Policy evaluation is responsible for asserting on `claims.*`.
## CLI example
See the constraint summary + reproduction recipe at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/27-jwt](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/27-jwt). This attestor is currently blocked or doc-only — the linked example explains why and shows the recipe to validate once the constraint is removed.
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [`github`](./github.mdx), [`gitlab`](./gitlab.mdx), [`gcp-iit`](./gcp-iit.mdx) — all embed this attestor
- Upstream: [witness/jwt.md](https://github.com/in-toto/witness/blob/main/docs/attestors/jwt.md)
---
# k8smanifest
Source: https://www.testifysec.com/docs/cilock/attestors/k8smanifest/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/k8smanifest.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/k8smanifest.json';
# `k8smanifest` attestor
Walks YAML/JSON products as Kubernetes manifests, strips ephemeral fields, optionally normalizes via `kubectl --dry-run=server`, and records per-document digests plus extracted container image references.
## What it captures
For every `.yaml`, `.yml`, or `.json` product the attestor decodes each document, removes ephemeral fields, and appends a `RecordedObject` with these JSON-tagged fields: `filepath`, `kind`, `name`, `data` (ephemeral-cleaned JSON), `subjectkey`, and `recordedimages`. Each `recordedimage` carries a `reference` and a `digest` map populated by resolving the OCI reference against the registry's `/v2` manifest endpoint.
Container images are extracted by a path-walker (`internal/k8sparse`) that knows these kinds: `Pod` (`spec`), `Deployment`/`ReplicaSet`/`StatefulSet`/`DaemonSet`/`Job` (`spec.template.spec`), and `CronJob` (`spec.jobTemplate.spec.template.spec`). Both `containers[]` and `initContainers[]` are scanned. Top-level `kind: List` documents are unwrapped and each item is processed individually. Other kinds (CRDs, ConfigMaps, etc.) produce a `RecordedObject` with an empty `recordedimages` slice.
When `record-cluster-information` is on, the attestor also fills `clusterinfo.server` from the active kubeconfig context and, for any `Node` documents in the products, adds an entry to `clusterinfo.nodes` keyed by `nodeInfo.machineID`. The recorded `NodeSystemInfo` carries `machineID`, `systemUUID`, `bootID`, `kernelVersion`, `osImage`, `containerRuntimeVersion`, `kubeletVersion`, `kubeProxyVersion`, `operatingSystem`, and `architecture` — wire-compatible with the upstream `corev1.NodeSystemInfo` JSON shape but parsed locally.
## When to use
In the manifest-generation step of a GitOps or CD pipeline. A downstream `cilock verify` step on the apply side checks that the deployed manifest's ephemeral-cleaned digest matches the attested digest, blocking drift between rendered and applied state.
## Server-side dry-run
With `server-side-dry-run` enabled, each document is marshalled back to YAML and piped to `kubectl apply --dry-run=server -o json -f -`; the JSON output replaces the local document before ephemeral stripping. This forces admission controllers and defaulting to run, so the recorded digest reflects the form the API server would persist. If the kubectl invocation fails, the attestor logs a debug message and falls back to the un-normalized document.
## Flags
| Flag | Default | What it does |
|---|---|---|
| `--attestor-k8smanifest-server-side-dry-run` | `false` | Normalize each doc via `kubectl apply --dry-run=server` before hashing. |
| `--attestor-k8smanifest-kubeconfig` | `$HOME/.kube/config` | Kubeconfig path. Used both for dry-run and cluster-info recording. |
| `--attestor-k8smanifest-context` | (kubeconfig's `current-context`) | Override the active kubeconfig context. |
| `--attestor-k8smanifest-record-cluster-information` | `true` | Resolve the active context's cluster server URL into `clusterinfo.server`. Fails the attestor (and the run) when the kubeconfig is missing or has no usable context; pass `=false` on a runner without one. |
| `--attestor-k8smanifest-ignore-fields` | (none) | Extra dot-paths to strip in addition to the defaults below. |
| `--attestor-k8smanifest-ignore-annotations` | (none) | Extra `metadata.annotations` keys to strip beyond the defaults. |
Default stripped fields: `metadata.resourceVersion`, `metadata.uid`, `metadata.creationTimestamp`, `metadata.managedFields`, `metadata.generation`, `status`.
Default stripped annotations: `kubectl.kubernetes.io/last-applied-configuration`, `deployment.kubernetes.io/revision`, `aflock.ai/content-hash`, `cosign.sigstore.dev/message`, `cosign.sigstore.dev/signature`, `cosign.sigstore.dev/bundle`.
## Output shape
```json
{
"serversidedryrun": false,
"recordclusterinfo": true,
"kubeconfig": "/home/user/.kube/config",
"kubecontext": "staging",
"recordeddocs": [
{
"filepath": "dist/manifest.yaml",
"kind": "Deployment",
"name": "api",
"data": { "apiVersion": "apps/v1", "kind": "Deployment", "...": "..." },
"subjectkey": "k8smanifest:dist/manifest.yaml:Deployment:api",
"recordedimages": [
{ "reference": "ghcr.io/example/api:1.2.3", "digest": { "sha256": "abc..." } }
]
}
],
"clusterinfo": {
"server": "https://k8s.example.com",
"nodes": {}
}
}
```
Subject keys collide-resolve by appending `#2`, `#3`, ... when the same `file:kind:name` triple appears more than once in a single attestor run.
## Gotchas
- The kubeconfig parser (`internal/k8sparse/kubeconfig.go`) only reads `current-context`, `contexts[]`, and `clusters[]` (server URL). Auth fields — `users`, `auth-provider`, `exec` credential plugins — are ignored. That is fine for cluster-info recording, but `server-side-dry-run` shells out to real `kubectl`, which does honor those auth fields.
- `server-side-dry-run` requires `kubectl` on `PATH` and network reachability to the API server. CI runners need a kubeconfig with apply permission on a cluster matching your prod's Kubernetes version, or admission-controller defaults will diverge.
- The path-walker covers seven workload kinds. CRDs, `ConfigMap`, `Secret`, `Service`, etc. are still recorded (with cleaned digest and subject), but their `recordedimages` will be empty.
- Files without a `.json`, `.yaml`, or `.yml` extension are skipped. Multi-doc YAML and JSON arrays are both supported; each document becomes its own `RecordedObject`.
- Image digest resolution hits the registry directly. Private registries that require auth will log a debug message and record an empty `digest` map; the `reference` is still preserved.
## CLI example
Real Kubernetes manifest. Records `kind`, `metadata.name`, and the cleaned document; each subject is `k8smanifest:::`, so `apiVersion` and `metadata.namespace` do not enter it.
```bash
# Static manifest: cilock invokes kubectl directly so the manifest is
# rendered by kubectl (which materializes any kustomization), captured
# as a real product, then parsed by the k8smanifest attestor. No cluster
# is needed, so cluster-info recording is turned off.
cilock run --step k8s-deploy-manifest \
--signer-file-key-path key.pem --outfile attestation.json \
--attestations k8smanifest,environment,git \
--attestor-k8smanifest-record-cluster-information=false \
-- sh -c 'kubectl kustomize ./manifests > deploy.yaml'
# Live cluster: pull the running deployment manifest from the API server.
cilock run --step k8smanifest-live \
--signer-file-key-path key.pem --outfile attestation.json \
--attestations k8smanifest,environment,git \
-- sh -c 'kubectl get deployment my-app -n production -o yaml > deploy.yaml'
```
The `sh -c` redirect is a tool-output limitation (kubectl writes YAML to stdout, not a file path) — `command-run` records the literal `sh -c` argv including kubectl, so the attestation pipeline is intact.
Validated against a real Deployment manifest. See the full real-data example at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/13-k8smanifest](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/13-k8smanifest).
## See also
- [Catalog row](../reference/attestor-catalog.md)
- Upstream: [witness/k8smanifest.md](https://github.com/in-toto/witness/blob/main/docs/attestors/k8smanifest.md)
---
# kube-bench
Source: https://www.testifysec.com/docs/cilock/attestors/kube-bench/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/kube-bench.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/kube-bench.json';
# `kube-bench` attestor
Captures Aqua Security `kube-bench` CIS Kubernetes Benchmark results by scanning the step's products for a JSON report and recording a per-check pass / fail / warn summary.
It is in the default `cilock` binary: select it with `--attestations kube-bench` (or `-a kube-bench`).
## What it captures
The attestor does **not** execute `kube-bench` itself. It runs in the `postproduct` phase: you run `kube-bench --json > report.json` (or equivalent) earlier in the step so the file lands in the attestation context's products map, and this attestor picks it up.
Each product is filtered first by MIME type (only `text/plain` or `application/json` are considered), the file digest is recomputed and compared against the product's recorded digest, and the bytes are decoded into `KubeBenchReport`. The first file that decodes successfully **and** has a non-empty `Controls` array wins.
Top-level attestor fields:
- `report_file` — path of the kube-bench JSON file inside the attestation context.
- `report_digest_set` — digest of that file (taken from the product entry).
- `cluster_name` — populated from the `KUBE_BENCH_CLUSTER_NAME` environment variable at `New()` time.
- `version` — derived from the first control section's `ID` (e.g. section `"1"` → version `"1"`); this is the major section identifier, not a full CIS version string.
- `node_hostname` — captured from `os.Hostname()` when the attestor is constructed.
- `summary` — see below.
`summary` rolls up:
- `total_pass`, `total_fail`, `total_warn` — copied from the report's `Totals`.
- `failed_checks` — every result with `status == "FAIL"`, recorded as `{id, text}` from the result's `test_number` and `test_desc`.
- `warned_checks` — same shape, every result with `status == "WARN"`.
The full nested report (`Controls` → `Tests` → `Results` with `test_number`, `test_desc`, `status`, `scored`, `actual_value`, `expected_result`) is parsed during ingest but only the rolled-up summary is persisted in the attestation.
## Subjects
`Subjects()` emits up to three synthetic identity subjects so the report ties into the supply-chain graph:
- `benchmark:cis-kubernetes-` (falls back to `benchmark:cis-kubernetes` if no version was derived).
- `cluster:` — only when `KUBE_BENCH_CLUSTER_NAME` was set.
- `node:` — only when the hostname was resolvable.
Each subject's digest is computed over the literal subject key string.
## When to use
Run as a dedicated step in a Kubernetes cluster hardening pipeline. Pair the actual `kube-bench` invocation with this attestor in `postproduct`, then verify the resulting attestation against a policy that gates on `summary.total_fail` or specific `failed_checks[*].id` values.
## Flags
None. Configuration is environment-driven: set `KUBE_BENCH_CLUSTER_NAME` before invoking `cilock` to label the run.
## Output shape
```json
{
"report_file": "kube-bench.json",
"report_digest_set": { "sha256": "..." },
"cluster_name": "prod-eks",
"version": "1",
"node_hostname": "ip-10-0-1-23",
"summary": {
"total_pass": 42,
"total_fail": 3,
"total_warn": 5,
"failed_checks": [
{ "id": "1.2.6", "text": "Ensure that the --kubelet-certificate-authority argument is set as appropriate" }
],
"warned_checks": [
{ "id": "1.2.10", "text": "Ensure that the admission control plugin EventRateLimit is set" }
]
}
}
```
## Gotchas
- **No exec.** If you forget to produce a `kube-bench` JSON file in the step, `Attest` returns `no kube-bench report found in products`.
- **Products must declare a compatible MIME type.** Files with a MIME type other than `text/plain` or `application/json` are skipped; products with an empty MIME type are still considered.
- **Digest must match.** If the file on disk no longer matches the product's recorded digest, the file is skipped silently (debug log only).
- **`version` is just the first section ID.** It is not a parsed CIS benchmark version — downstream policies should treat it as an opaque tag.
- **Node role is not captured.** Despite the CIS benchmark distinguishing master / node / etcd / controlplane profiles, this attestor does not record which profile was scanned; encode that into the `KUBE_BENCH_CLUSTER_NAME` value or a separate attestor if you need it.
## CLI example
See the constraint summary + reproduction recipe at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/18-kube-bench](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/18-kube-bench). This attestor is currently blocked or doc-only — the linked example explains why and shows the recipe to validate once the constraint is removed.
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [Build from source](../getting-started/installation.md#5-build-from-source)
- [`docker-bench`](./docker-bench.md), [`inspec`](./inspec.mdx)
---
# link
Source: https://www.testifysec.com/docs/cilock/attestors/link/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/link.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/link.json';
# `link` attestor
Emits an [in-toto Link v0.3](https://github.com/in-toto/attestation/blob/main/spec/predicates/link.md) predicate synthesized from the step's `command-run`, `material`, `product`, and `environment` attestors — for compatibility with legacy in-toto verifiers.
## What it captures
This attestor does **not** produce its own predicate type — it produces the upstream in-toto Link predicate. The serialized JSON shape (`attestation/intoto/link.Link`) has these fields:
- `name` — the cilock step name (from `AttestationContext.StepName()`)
- `command` — `argv` of the executed command, copied from the `command-run` attestor's `cmd` field
- `materials` — list of [in-toto v1 `ResourceDescriptor`](https://github.com/in-toto/attestation/blob/main/spec/v1/resource_descriptor.md) entries (`name`, `digest`) built from the `material` attestor's pre-execution file digests
- `environment` — map of environment-variable name → value, copied from the `environment` attestor's filtered `variables`
- `byproducts` — reserved field in the upstream schema; not populated by the current `Attest()` implementation
Subjects are derived from the `product` attestor: each product path is emitted as `` `file:` `` with its digest set.
## When to use
Enable `link` when a downstream consumer expects raw in-toto Link statements rather than cilock-native predicates — for example, a legacy in-toto verifier, or interop with another supply-chain tool that already knows how to consume `https://in-toto.io/attestation/link/v0.3`. For new pipelines, prefer the dedicated `command-run`, `material`, `product`, and `environment` attestors directly.
## Flags
| Flag | Type | Default | Effect |
|---|---|---|---|
| `--attestor-link-export` | bool | `false` | Emit the Link predicate as its own standalone DSSE envelope instead of nesting it inside the cilock collection envelope. |
## Output shape
```json
{
"name": "build",
"command": ["go", "build", "./..."],
"materials": [
{
"name": "main.go",
"digest": {"sha256": "…"}
}
],
"environment": {
"PATH": "/usr/local/bin:/usr/bin:/bin",
"GOOS": "linux"
}
}
```
## Gotchas
- **Requires sibling attestors.** `link` runs at `postproduct` and only populates fields it can read off `CompletedAttestors()`. If `command-run`, `material`, `product`, or `environment` did not run, the corresponding `command` / `materials` / subjects / `environment` fields are simply empty — no error is raised.
- **Standalone vs wrapped.** Without `--attestor-link-export`, the Link predicate is wrapped inside the cilock collection alongside the source attestors. With `--attestor-link-export=true`, `Export()` returns true and cilock emits the Link in its own DSSE envelope — useful when feeding it directly to an in-toto verifier.
- **Duplication.** The Link data is a re-projection of `command-run` + `material` + `product` + `environment`. Enabling `link` does not replace those attestors; it adds a second view of the same evidence.
- **`byproducts` is not populated** by this implementation even though the upstream schema defines it.
## CLI example
Real in-toto Link statement v0.3 derived from material + product + command-run. The `materials` array is built by ranging over a Go map, so its order can change between identical runs and two runs over the same tree are not byte-identical.
```bash
cilock run --step link-emit \
--signer-file-key-path key.pem --outfile attestation.json --workingdir . \
--attestations link \
-- make build
```
Validated against a real build producing an in-toto Link statement. See the full real-data example at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/08-link](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/08-link).
## See also
- [Catalog row](../reference/attestor-catalog.md)
- Upstream: [witness/link.md](https://github.com/in-toto/witness/blob/main/docs/attestors/link.md)
---
# Linkerd
Source: https://www.testifysec.com/docs/cilock/attestors/linkerd-check/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/linkerd-check.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/linkerd-check.json';
# `linkerd-check` attestor
[Linkerd](https://linkerd.io) is the CNCF-graduated Kubernetes service mesh — a sidecar-based mTLS, retries, and traffic-routing layer that's auto-injected into meshed workloads. Under cilock, the rookery **native `linkerd-check` attestor** ingests two of Linkerd's JSON outputs and produces a single signed in-toto attestation linked to the host environment, the git commit, and the literal capture argv:
- `linkerd check -o json` — control-plane + extension health (kubernetes-api, linkerd-existence, linkerd-identity, linkerd-control-plane-proxy, linkerd-viz, etc.) with per-check pass/warn/error results.
- `linkerd viz edges deploy -A -o json` — the meshed service graph with `client_id` / `server_id` peer identities and a `no_tls_reason` per src→dst pair. An edge is mTLS-secured iff both IDs are present AND `no_tls_reason` is empty.
The headline use case: a release-gate Rego that **denies any deploy where any meshed edge is non-mTLS**. The full positive + negative case is exercised end-to-end against the `dropbox-clone-dev` EKS cluster with the emojivoto demo in [`tool-linkerd-check`](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/tool-linkerd-check).
## Validated invocation
```bash
# Pre-reqs: linkerd CLI + kubeconfig pointed at a cluster with Linkerd
# control plane installed. Viz extension required for the edges capture.
LINKERD_CLUSTER_NAME= cilock run --step linkerd-mesh-check \
--signer-file-key-path key.pem \
--outfile attestation.json \
--attestations linkerd-check,environment,git \
--enable-archivista=false \
-- sh -c 'linkerd check -o json > linkerd-check.json; \
linkerd viz edges deploy -A -o json > linkerd-edges.json'
```
This is the exact command exercised in [`tool-linkerd-check`](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/tool-linkerd-check). The single `sh -c` wrapper writes both JSON files into the working directory in one shot: cilock's product attestor hashes both, the linkerd-check attestor parses both. The `command-run/v0.2` predicate records the full `sh -c` argv.
`LINKERD_CLUSTER_NAME` is read by the attestor and stamped into the predicate's `cluster_name` field so cluster-aware Rego can branch on it. Optional; if unset the field is empty but the attestation still signs.
## What gets captured
| Predicate type | Source |
|---|---|
| `https://aflock.ai/attestations/environment/v0.1` | host OS, kernel, env vars (sensitive ones obfuscated) |
| `https://aflock.ai/attestations/git/v0.1` | commit hash, branch, dirty status |
| `https://aflock.ai/attestations/material/v0.3` | Merkle root over the working tree before the capture |
| `https://aflock.ai/attestations/command-run/v0.2` | literal `sh -c 'linkerd check ...; linkerd viz edges ...'` argv |
| `https://aflock.ai/attestations/product/v0.3` | Merkle root over `linkerd-check.json` + `linkerd-edges.json` |
| `https://aflock.ai/attestations/linkerd-check/v0.1` | parsed reports with per-category pass/warn/error counts, edges summary with secured/insecure counts, cluster name |
The `linkerd-check/v0.1` predicate body has this shape:
```json
{
"cluster_name": "dropbox-clone-dev",
"check_summary": {
"pass": 50, "warn": 4, "error": 0,
"overall_success": true, "distinct_categories": 10,
"categories": [
{ "category": "kubernetes-api", "pass": 2, "warn": 0, "error": 0 },
...
]
},
"check_report": { /* full parsed check JSON */ },
"edges_summary": {
"total_edges": 15, "secured": 15, "insecure": 0,
"distinct_src_namespaces": ["emojivoto", "linkerd-viz"],
"distinct_dst_namespaces": ["emojivoto", "linkerd", "linkerd-viz"]
},
"edge_report": [ /* full parsed edges array */ ]
}
```
## Why this shape
| Antipattern | Correct shape (this example) |
|---|---|
| `cilock run ... -- bash -c "linkerd check ... > check.json && cp check.json out.json"` | `cilock run ... -- sh -c 'linkerd check -o json > linkerd-check.json; linkerd viz edges deploy -A -o json > linkerd-edges.json'` |
| `command-run.cmd` records `["bash","-c","... && cp ..."]` | `command-run.cmd` records the literal `sh -c` argv invoking the two linkerd subcommands |
| The product is a copy of a file written outside cilock's view | The product is the JSON file as `linkerd` wrote it during the wrapped step |
Three properties matter: (1) `command-run/v0.2.cmd` records the real argv (the `sh -c` invoking the two linkerd subcommands), not a chained shell with a separate cp. (2) The ptrace spy traces the shell + linkerd child processes because cilock is `sh`'s direct parent. (3) `product/v0.3` captures `linkerd-check.json` and `linkerd-edges.json` as written via the single redirects inside the wrapped step, and the linkerd-check attestor parses those exact files.
The single `sh -c` wrapper is the same pattern as [hadolint](../tools/hadolint.mdx), [govulncheck](../tools/govulncheck.mdx), and [falco](../tools/falco.md) — tools that need stdout-to-file conversion to be hashed by the product attestor. The shell redirect is a one-shot conversion, not the cp antipattern.
## The mTLS-required policy (the value cilock adds)
Without policy, you have a signed envelope but no enforcement. The canonical service-mesh release gate is "**any insecure edge → block deploy**." A minimal Rego:
```rego
package linkerd_mtls
deny[msg] {
input.edges_summary.insecure > 0
msg := sprintf(
"linkerd viz edges reports %d insecure (non-mTLS) edge(s) of %d total — refusing to deploy through unmeshed traffic",
[input.edges_summary.insecure, input.edges_summary.total_edges]
)
}
deny[msg] {
input.check_summary.error > 0
msg := sprintf("linkerd reports %d error-level check(s)", [input.check_summary.error])
}
deny[msg] {
not input.edges_summary
msg := "edges report not captured — mTLS contract cannot be enforced"
}
```
Full Rego with five deny rules + the positive/negative end-to-end runner is in [`tool-linkerd-check/policy/`](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/tool-linkerd-check/policy).
## Validate it locally
List the predicate types in the captured envelope:
```bash
jq -r '.payload' attestation.json | base64 -d | jq '.predicate.attestations | map(.type)'
```
Expected output:
```json
[
"https://aflock.ai/attestations/environment/v0.1",
"https://aflock.ai/attestations/git/v0.1",
"https://aflock.ai/attestations/material/v0.3",
"https://aflock.ai/attestations/command-run/v0.2",
"https://aflock.ai/attestations/product/v0.3",
"https://aflock.ai/attestations/linkerd-check/v0.1"
]
```
Confirm `command-run.cmd` carries the literal `sh -c` argv:
```bash
jq -r '.payload' attestation.json | base64 -d \
| jq '.predicate.attestations[] | select(.type=="https://aflock.ai/attestations/command-run/v0.2") | .attestation.cmd'
# ["sh","-c","linkerd check -o json > linkerd-check.json; linkerd viz edges deploy -A -o json > linkerd-edges.json"]
```
Pull the mesh summary from the signed envelope:
```bash
jq -r '.payload' attestation.json | base64 -d \
| jq '.predicate.attestations[] | select(.type=="https://aflock.ai/attestations/linkerd-check/v0.1") | .attestation | {
cluster: .cluster_name,
check: .check_summary | {pass, warn, error, overall_success},
edges: .edges_summary | {total_edges, secured, insecure}
}'
# {
# "cluster": "dropbox-clone-dev",
# "check": { "pass": 50, "warn": 4, "error": 0, "overall_success": true },
# "edges": { "total_edges": 15, "secured": 15, "insecure": 0 }
# }
```
## Notes
- **Extension JSON concatenation.** `linkerd check -o json` emits the core report and one report per installed extension (viz, jaeger, multicluster) with **no delimiter** between objects ([linkerd/linkerd2#5837](https://github.com/linkerd/linkerd2/issues/5837)). The attestor uses a streaming JSON decoder to read every object and merges their categories; the merged report's `overall_success` is the logical AND of all sub-reports. This is transparent to the operator — you just run `linkerd check -o json > file` and the attestor handles the quirk.
- **Viz extension required for mTLS gating.** `linkerd check` alone doesn't surface per-edge mTLS state — that's a viz-extension feature. Install with `linkerd viz install | kubectl apply -f -` (or via the official Helm chart). Without viz, the linkerd-check predicate still produces, but `edges_summary` is absent and policies that require it fail-closed (which is the right default).
- **`-A` namespace scope.** The validated example uses `linkerd viz edges deploy -A -o json` to scope across all namespaces. For a tighter release gate, scan only the namespaces your release touches — `linkerd viz edges deploy -n -n `. Either way the predicate captures `distinct_src_namespaces` and `distinct_dst_namespaces` so policies can branch on scope.
- **Cluster name stamping.** Set `LINKERD_CLUSTER_NAME` in CI so policies can branch on cluster (e.g. allow warnings on `dev`, deny them on `prod`). If unset, the field is empty.
- **Stable-channel warnings.** Linkerd's `linkerd check` flags warnings for any non-edge channel version mismatch — running stable-2.14.10 against the current `linkerd version` check produces 4 warnings. The attestor records warnings and errors but fails on neither, so nothing blocks by default. Gate on errors (or warnings) with an explicit deny rule.
## FAQ
### Does cilock support Linkerd?
Yes. Wrap `sh -c 'linkerd check -o json > check.json; linkerd viz edges deploy -A -o json > edges.json'` with `cilock run --attestations linkerd-check,environment,git`. The native `linkerd-check` attestor parses both files into a `https://aflock.ai/attestations/linkerd-check/v0.1` predicate with per-category check rollup and per-edge mTLS booleans, alongside the standard collection (environment, git, material, command-run, product).
### How do I gate a release on every edge being mTLS-secured?
Write a Rego that denies on `input.edges_summary.insecure > 0`. The Rego runs against the `linkerd-check/v0.1` predicate's `attestation` field, so it sees the same `edges_summary` block. A 3-line policy with one deny rule is enough for the headline case; the [`tool-linkerd-check/policy/decoded-rego-linkerd-mtls.txt`](https://github.com/aflock-ai/attestor-compliance-examples/blob/main/tool-linkerd-check/policy/decoded-rego-linkerd-mtls.txt) shows the production-ready 5-rule version.
### Why parse `linkerd check` JSON into a custom predicate instead of using k8smanifest?
`linkerd check` validates dynamic cluster state (control plane pods are healthy, identity certs are valid, viz proxies are running the right version) — none of that lives in a static Kubernetes manifest. `k8smanifest` would snapshot the policy CRDs (Server, ServerAuthorization, HTTPRoute) but couldn't capture whether the linkerd-identity Deployment is actually ready or whether the trust anchor is about to expire. The two attestors are complementary: capture CRDs with `k8smanifest` for the desired state, capture `linkerd check` for the actual state.
### Does this require the viz extension?
For the mTLS gate, yes — `linkerd viz edges` is what provides per-edge mTLS booleans. The plain `linkerd check` capture works without viz but only surfaces control-plane health, not data-plane integrity. Install viz with `linkerd viz install | kubectl apply -f -`.
### How does this differ from running Linkerd standalone?
Standalone `linkerd check` and `linkerd viz edges` give you JSON outputs with no provenance — nothing binds them to a release, a cluster (modulo the kubeconfig that ran the command), or a policy. cilock adds five predicates around the same JSON: `git/v0.1` (the commit that defined the policy), `environment/v0.1` (the host running the capture), `material/v0.3` (the working tree), `command-run/v0.2` (the exact `sh -c` argv + exit code), and `product/v0.3` (the JSON files' content hashes). The linkerd JSON is unchanged — same bytes, same downstream pipeline — but the surrounding evidence is now signed and policy-checkable.
## See also
- [Validated example: tool-linkerd-check](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/tool-linkerd-check) — real EKS-cluster capture + raw envelopes + mTLS-required Rego (positive + negative)
- [Linkerd project](https://linkerd.io) — upstream
- [`linkerd check` CLI reference](https://linkerd.io/2-edge/reference/cli/check/)
- [`linkerd viz` CLI reference](https://linkerd.io/2-edge/reference/cli/viz/)
- [Tools index](./index.md)
---
# lockfiles
Source: https://www.testifysec.com/docs/cilock/attestors/lockfiles/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/lockfiles.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/lockfiles.json';
# `lockfiles` attestor
Captures the contents and SHA-256 digest of common package-manager lockfiles found in the working tree, providing a cheap, deterministic fingerprint of the project's pinned dependency set.
## What it captures
The attestor records a list of `lockfiles`. Each entry has three fields:
- `filename` — the path at which the lockfile was found, relative to the working directory (an absolute search path is recorded as given).
- `content` — the raw file contents as a string.
- `digest` — a `DigestSet` containing the SHA-256 of the file bytes.
Each lockfile is also emitted as an in-toto subject named `` `file:` `` keyed by its digest.
The following lockfile filenames are matched exactly (no globbing of the basename):
- `Gemfile.lock` — Ruby (Bundler)
- `package-lock.json` — Node.js (npm)
- `yarn.lock` — Node.js (Yarn)
- `Cargo.lock` — Rust
- `poetry.lock` — Python (Poetry)
- `Pipfile.lock` — Python (Pipenv)
- `uv.lock` — Python (uv)
- `requirements.txt` — Python (pip)
- `composer.lock` — PHP
- `go.sum` — Go
- `Podfile.lock` — iOS/macOS (CocoaPods)
- `gradle.lockfile` — Gradle
- `pnpm-lock.yaml` — Node.js (pnpm)
- `cabal.project.freeze` — Haskell (cabal-install)
- `stack.yaml.lock` — Haskell (Stack)
- `dist-newstyle/cache/plan.json` — Haskell (cabal-install's solver plan: every unit with the sdist sha256 Hackage's signed index pins). The default and path-list modes match it at this relative path under each searched directory; `recursive` mode matches it as a path suffix, so a nested `/dist-newstyle/cache/plan.json` is captured too. A `plan.json` anywhere else is not captured. It exists before the build only when `dist-newstyle/` is restored or kept between builds.
Search behavior is controlled by the `WITNESS_LOCKFILES_SEARCH_PATHS` environment variable, read at attestor construction:
- Unset / empty (default): searches the working directory (`--workingdir`, else the current directory) only.
- `recursive`: walks the working tree, skipping `node_modules`, `vendor`, `.git`, `.svn`, `.hg`, `__pycache__`, `venv`, `.venv`, `target`, `build`, `dist`, and any directory whose name begins with `.`.
- A list using the OS path-list separator (colon on Unix): searches each listed directory non-recursively. Relative directories are resolved against the working directory.
## When to use
When you need a tamper-evident snapshot of pinned dependencies without paying for a full SBOM scan. Useful as a pre-build attestation to prove the dependency graph that fed into a subsequent build step, or as an input to policies that gate on lockfile drift.
## Flags
None. Configuration is via the `WITNESS_LOCKFILES_SEARCH_PATHS` environment variable.
## Output shape
```json
{
"lockfiles": [
{
"filename": "go.sum",
"content": "github.com/example/mod v1.2.3 h1:...\ngithub.com/example/mod v1.2.3/go.mod h1:...\n",
"digest": {
"sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
}
}
]
}
```
## Gotchas
- The digest is over the lockfile **bytes**, not the parsed dependency set — reformatting or reordering changes the hash even when the resolved versions do not. For semantic dependency inventory, use [`sbom`](./sbom.mdx).
- Basenames are matched exactly via `filepath.Glob(dir/)`; non-standard names (e.g. `dev-requirements.txt`) are not detected.
- Recursive mode skips a fixed ignore list and every dotted directory; lockfiles inside those trees are invisible to the attestor.
- The full file content is embedded in the attestation. Lockfiles that contain sensitive index URLs or credentials will be captured verbatim.
- A lockfile that is a symlink is followed only while it stays inside the working directory (or, for a search directory outside it, inside that lockfile's own directory). One that resolves elsewhere, or is not a regular file, fails the attestation rather than copying the target's content into it. A symlink with an absolute target is refused even when the target is inside the tree; use a relative target.
## CLI example
Real lockfile capture from a multi-language repo: `go.sum`, `package-lock.json`, `Cargo.lock`, `poetry.lock`, etc.
```bash
cilock run --step lockfiles-capture \
--signer-file-key-path key.pem --outfile attestation.json --workingdir . \
--attestations lockfiles \
-- echo "captured lockfiles"
```
Validated against a real multi-language repo with several lockfiles. See the full real-data example at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/07-lockfiles](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/07-lockfiles).
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [`sbom`](./sbom.mdx)
- Upstream: [witness/lockfiles.md](https://github.com/in-toto/witness/blob/main/docs/attestors/lockfiles.md)
---
# material
Source: https://www.testifysec.com/docs/cilock/attestors/material/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/material.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import VersionedDoc, {VersionPane} from '@site/src/components/Catalog/VersionedDoc';
import meta_v0_3 from '@catalog/material.json';
import meta_v0_1 from '@catalog/material-v0.1.json';
# `material` attestor
Snapshots the working directory **before** the step's command runs, computes a Merkle root over every input file's digest, and emits a single in-toto subject (`tree:materials`) whose digest is the root.
The attestor name remains `material`. Its predicate type remains `https://aflock.ai/attestations/material/v0.3`. The content-root construction does not change with inventory retention.
- Generic library constructors retain the existing inline leaves and legacy manifest fields.
- The compact profile omits material details by default. The signed `inventory.state` is `omitted`, not empty.
- With complete retention, the compact profile emits a `detached` inventory reference and a full inventory companion.
The signed reference describes capture and retention, not upload success. Capture and the in-memory material baseline remain unchanged.
## What it captures
Every representation carries these commitment fields:
| JSON field | Type | Source |
|---|---|---|
| `merkleRoot` | string (hex) | The Merkle root over the sorted material list, computed via [RFC 6962 §2.1](https://datatracker.ietf.org/doc/html/rfc6962#section-2.1). |
| `treeSize` | integer | Number of distinct content digests that contributed to the root, not the full path count. |
| `hashAlgorithm` | string | Always `sha256` for v0.3. |
| `construction` | string | Always `RFC6962` for v0.3. |
The DSSE statement's subject array carries one entry:
```json
"subject": [
{
"name": "tree:materials",
"digest": { "sha256": "" }
}
]
```
The predicate also carries either the legacy fields or a compact `inventory` reference. A new reference cannot coexist with `leaves`, `manifest`, or `manifestUploaded`.
## Why v0.3 looks like this
v0.1 emitted a flat `map[path]DigestSet` directly as the predicate body, with one `file:` subject per material. For source trees the cardinality was fine — a Go module produces a few dozen materials. For container builds (`COPY . /app` over a JS project's `node_modules`) the per-file subject count blew through Archivista's placeholder budget and inflated the signed envelope to multi-megabyte territory.
v0.3 publishes a single subject. Inline leaves or an exact-byte inventory binding authenticate paths. The content root alone does not authenticate paths.
## How the material set is captured
This attestor commits a Merkle root over a set of input files — but *which* files, and where their digests come from, is decided by the active **capture mode**, not by the attestor itself:
- **Directory walk** (default, and the only mode without `--trace`): every regular file under `--workingdir` at step start is hashed. A portable before-snapshot of the inputs.
- **Syscall trace** (`--trace`, Linux): cilock observes the process's `openat` calls so materials reflect the inputs actually read — including files outside the working directory. The trace backend is `ptrace+seccomp` (always available) or `eBPF` where the kernel supports it; `CILOCK_TRACE_MODE=auto` probes eBPF and falls back to ptrace.
- **fanotify** (`--hardening standard`/`strict`): supplies the content hash at `FAN_OPEN_PERM` time (each inode hashed once), race-tight against an input that's modified later in the same build.
`--capture-mode auto` (the default) uses trace events when `--trace` is on and the directory walk otherwise. See [how cilock captures files](../concepts/capture-modes.md) for the full comparison and a selection guide.
## When to use
It always fires. Its output is the canonical "what existed on disk when the step started" record — consumed by policy to verify that a step's inputs match a known prior product (chained materials → products across steps), and used as `subjectOf` evidence for SLSA provenance.
## Flags
The `material` attestor registers one flag of its own, `--attestor-material-bind`. The rest of its behavior is controlled by the global `run` flags it reads from `AttestationContext`:
| Flag | Effect on `material` |
|---|---|
| `--workingdir` / `-d` | Root of the walk |
| `--hashes` | Hash algorithms applied to every file (default `sha256`) — v0.3 commits only the sha256 leaf to the tree |
| `--attestor-material-bind RECORDED_PATH=FILE` | Repeatable. Hashes `FILE` before the command runs and records it as a material under `RECORDED_PATH`, in both walk and trace mode. Policy `artifactsFrom` compares by path, so this lets a step consume an upstream product under the path the upstream step recorded it at, e.g. a release sign step recording the unsigned binary as `/tmp/build/cilock`. The digest is always of the file's bytes before the command; only the key is chosen. A missing file, a malformed spec, or a capture that recorded the same path with a different digest fails the attestor. |
| `--dirhash-glob` | Glob patterns of directories to collapse into a single `dirhash` digest (excluded from the v0.3 leaf set because the dirhash key isn't a raw file content sha256) |
## Subject behavior
`Subjects()` returns exactly one entry, `tree:materials`. The digest is the Merkle root computed via:
```
Walk the working directory per attestation/file.RecordArtifacts (regular files only,
symlinks bounded to the workingdir, dirhash globs honoured).
Filter to entries that have a raw sha256 digest (dirhash/gitoid entries are skipped).
Deduplicate by content digest and sort by digest bytes.
For each distinct file digest:
leafPreHash = sha256(file-digest-bytes-raw32)
Pass the leafPreHash list into a merkle tree built per RFC 6962 §2.1.
The wrapper applies its own 0x00 leaf-domain prefix and 0x01 interior prefix,
so the actual leaf the tree commits to is:
H(0x00 || leafPreHash) = H(0x00 || sha256(file-digest))
```
The leaf encoder is `inclusionproof.LeafHash` — the same canonical function the product attestor uses. Any drift between the two would mean a file recorded as a product in one step could not be matched against the same file recorded as a material in the next step. There is exactly one implementation; both attestors call it.
A captured empty set retains the existing `"leaves": []` encoding and the RFC 6962 empty-root subject. It emits no new inventory reference. Empty trees emit no back-reference.
## Output shape
Commitment fields in a v0.3 material statement (representation fields omitted from this illustration):
```json
{
"_type": "https://in-toto.io/Statement/v1",
"subject": [
{
"name": "tree:materials",
"digest": { "sha256": "4f1e...aa72" }
}
],
"predicateType": "https://aflock.ai/attestations/material/v0.3",
"predicate": {
"merkleRoot": "4f1e...aa72",
"treeSize": 218,
"hashAlgorithm": "sha256",
"construction": "RFC6962"
}
}
```
The compact parent grows with its counters, not with its leaf list. A retained inventory has a separate byte budget.
## Inline leaves
Generic library constructors retain inline `(path, fileDigest, leafHash)` triples. The legacy tree deduplicates equal content, so these leaves do not preserve every captured path.
An empty-but-present `"leaves": []` describes an empty captured set. An absent key does not mean empty. A walk does not prove actual command reads, isolation, or hermeticity.
## Compact inventories
`material.WithCompactInventory(retain)` changes representation, not capture. Nonempty captures omit inline leaves and both legacy manifest fields.
The reference schema is `https://aflock.ai/attestations/file-inventory/v0.1`. Its `kind` is `material`, and `fileCount` counts all captured paths.
| Reference field | Meaning |
|---|---|
| `state: omitted` | Details were not retained. The reference has no `digest` or `bytes`. |
| `state: detached` | Complete retained details have an exact raw SHA-256 `digest` and a `bytes` count. |
| `captureMode: walk` | Scope is `working-directory`. |
| `captureMode: trace` | Scope is `trace-provider`. |
| `captureMode: unknown` | Scope is `unspecified`. |
A retained payload has `schema`, `kind`, and path-sorted `entries`. Each entry contains an opaque `path` and a lowercase SHA-256 `fileDigest`. Distinct paths remain distinct even when their content matches. Paths are metadata, never filesystem instructions.
The limits are 64 MiB of predicate bytes and one million entries. Consumers reject invalid digests, invalid paths, duplicate paths, unknown fields, duplicate keys, and case aliases.
A consumer verifies exact bytes, the reference count, the reconstructed content root, and `treeSize` before it uses the entries. A matching root alone cannot authenticate paths or metadata. Hydration preserves the compact serialized parent shape.
The companion uses the inventory predicate type and the subject `inventory:material`. Its subject digest is the raw SHA-256 of its predicate bytes. It does not inherit a commit subject. The signed parent reference supplies the integrity binding, not the storage location or companion signer.
Retention does not authorize upload. The CLI controls local storage and explicit inventory-upload consent separately. Missing or corrupt required details are not an empty input set.
## Detached leaf manifest
This section describes the legacy profile only. `cilock run --material-manifest` retains its existing companion behavior. Legacy producers keep inline leaves as well as the legacy manifest reference:
- the leaves are published as a **companion DSSE envelope** with predicate type `https://aflock.ai/attestations/material-manifest/v0.1`, written next to `--outfile` as `-material-manifest.json` and, when Archivista upload is on, stored *before* the collection that references it;
- the manifest's predicate is the [inclusion-proof sidecar](./inclusion-proof.mdx) shape verbatim, so it needs no new schema and no server change;
- its only subject is `tree:materials`, so it is reachable from the collection by one subject-graph hop but never appears in a commit-keyed lookup.
Two legacy fields describe this arrangement. Compact nonempty predicates do not emit or reinterpret either field:
| Field | Meaning |
|---|---|
| `manifestUploaded: true` | The producer published the leaves. A verifier that cannot resolve the manifest has a **finding**, not a benign absence. |
| `manifestUploaded: false` | A signed statement that the producer chose **not** to publish the leaves. Expected and benign; chain verification fails closed with an actionable message. |
| key absent | The predicate predates the feature, or the field was stripped. Treated as "legacy shape — decide from `leaves`", **never** as `false`. |
| `manifest.digest.sha256` | Content digest of the manifest predicate bytes. Emitted **unconditionally**, even when `manifestUploaded` is false, so a manifest arriving later by any route can still be bound to this exact envelope. |
The reference is a digest, never a URL: Archivista may serve the object from any path, so the envelope names the content. A consumer binds a manifest by hashing its compact predicate bytes and comparing to `manifest.digest.sha256`, then **rebuilds the tree** from the manifest's leaves and compares the recomputed root to the signed `merkleRoot`. Comparing two stored root strings would prove nothing.
**Size limit.** A manifest's compact JSON encoding is bounded by `inclusionproof.MaxManifestBytes` (512 MiB), and that one constant binds both ends: `cilock run --material-manifest` refuses to publish a manifest above it — the run fails with an error naming the limit and nothing is signed — and a verifier refuses to read a predicate above it before parsing a byte of it. The limit is stated in *compact predicate bytes*; a verifier's ceiling for the companion **file** is that same limit carried through the encoding a manifest passes on its way to disk (statement framing, base64, the DSSE envelope with its signatures), so every manifest a conforming producer emits is readable and nothing larger is. `MaxLeaves` bounds the leaf *count*; this bounds the *bytes*, which the count cannot (paths are unbounded). A producer that is not publishing (`manifestUploaded: false`) is not size-checked, since its digest reference is a binding, not a publication. The store's own upload cap applies separately, at upload time.
Nothing about the flag changes the claim — only where the proof material lives.
## Per-file verification
When the `leaves` array is available (inline, or hydrated from a resolved manifest), per-file input claims are verified directly:
1. Find the leaf whose `fileDigest` equals the file digest being verified.
2. Confirm the leaf's `leafHash` equals `sha256(fileDigest-bytes-raw32)`. **v0.3 binds file CONTENT only — the path is not part of the leaf hash.** Path authentication comes from the signature over the leaf list, not from the Merkle commitment. (Because the leaf binds content alone, two paths sharing a digest are deduplicated to a single leaf, so `treeSize` can be smaller than the file count.)
3. Fold the leaf hash through the tree's RFC 6962 structure and confirm the result equals the `tree:materials` subject digest.
See [verify a specific file](../guides/verify-a-specific-file.md) for the full check sequence.
## Gotchas
- **The leaf set excludes dirhash and gitoid entries.** `--dirhash-glob` directories still appear in the in-memory `Materials()` map (so downstream attestors that walk `ctx.Materials()` continue to see them), but they do not contribute to the Merkle root because the dirhash isn't a raw file sha256.
- **Symlinks pointing outside `--workingdir` are silently dropped, not errored.** If you depend on a linked tree being recorded, place it inside the working directory.
- **`material` runs before the command.** Files created by the step appear only in `product`, never here.
- **Empty material sets still have a subject.** Only the empty tree's graph back-reference is absent.
- **Omitted details do not change the product baseline.** The in-memory captured material map remains available to the product attestor.
## CLI example
Builtin. cilock always runs this — hashes files present in workingdir BEFORE the wrapped command runs.
```bash
cilock run --step my-step \
--signer-file-key-path key.pem --outfile attestation.json --workingdir src/ \
-- make build
```
The signed parent carries the Merkle root and the representation selected by the distribution profile. Generic library constructors remain legacy-inline.
## See also
- [Inclusion-proof attestor](./inclusion-proof.mdx) — the standalone proof primitive
- [Product attestor](./product.mdx) — companion attestor for outputs
- [Merkle trees](../concepts/merkle-trees.md) — the underlying construction
- [Verify a specific file](../guides/verify-a-specific-file.md) — consumer-side flow
> **Status:** this documents the **historical** v0.1 wire format. It is not emitted by any current cilock build — new attestations always use the latest version (select it from the version dropdown above). The v0.1 decoder remains registered so `cilock verify` can read pre-cutover attestations.
Records a digest of every regular file under the working directory **before** the step's command runs, establishing the input baseline for the in-toto attestation.
## What it captures
The attestor walks `--workingdir` and produces a flat map keyed by the path of each file relative to the working directory. The value is a `DigestSet` — a map of `{hash-algorithm} -> {hex digest}` computed per file with the algorithms selected by the global `--hashes` flag (default `sha256`).
Walk semantics, from `attestation/file.RecordArtifacts`:
- Only **regular files** are hashed. Directories, FIFOs, device files, sockets, and other special files are skipped (FIFO skipping is an explicit DoS hardening).
- **Symlinks** are followed only when their resolved target stays within the working directory boundary (resolved via `filepath.EvalSymlinks` on both sides so `/var` ↔ `/private/var` style aliases match). Targets outside the boundary are skipped; broken symlinks are skipped; visited targets are de-duplicated.
- When a directory matches any `--dirhash-glob` pattern, the entire subtree is collapsed into a single Go-module `dirhash` entry (key gets a trailing path separator) and the walk does not descend further into it.
- Hashing is parallelized across `GOMAXPROCS` workers.
## Flags
The `material` attestor itself registers no flags. Its behavior is controlled by the global `run` flags it reads from `AttestationContext`:
| Flag | Effect on `material` |
|---|---|
| `--workingdir` / `-d` | Root of the walk |
| `--hashes` | Hash algorithms applied to every file (repeatable; default `sha256`) |
| `--dirhash-glob` | Glob patterns of directories to collapse into a single `dirhash` digest |
## Output shape
`Attestor.MarshalJSON` emits the materials map directly — there is **no wrapping object**, so the predicate body is a flat map of path → digest set:
```json
{
"cmd/main.go": {
"sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
},
"go.mod": {
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
"vendor/": {
"dirHash": "h1:abc123..."
}
}
```
The `Schema()` method reflects `map[string]cryptoutil.DigestSet{}` for exactly this reason — a struct wrapper would misrepresent the wire format.
## Gotchas
- Symlinks pointing outside `--workingdir` are silently dropped, not errored. If you depend on a linked tree being recorded, place it inside the working directory.
- `--dirhash-glob` matches **directory** paths only and short-circuits descent (`filepath.SkipDir`); individual files inside a matched directory will not appear as separate entries.
- `material` runs before the command, so files created by the step appear only in `product`, never here.
## See also
- [Inclusion-proof attestor](./inclusion-proof.mdx) — the per-file claim primitive
- Upstream: [witness/material.md](https://github.com/in-toto/witness/blob/main/docs/attestors/material.md)
---
# maven
Source: https://www.testifysec.com/docs/cilock/attestors/maven/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/maven.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/maven.json';
# `maven` attestor
Parses a Maven `pom.xml` and records the project coordinates plus its declared dependencies as an attestation.
## What it captures
Fields are read directly out of the POM XML and emitted under these JSON keys:
- `groupid` — from ``.
- `artifactid` — from ``.
- `version` — from ``.
- `projectname` — from ``.
- `dependencies` — array of objects from ``. Each entry exposes:
- `groupid` (``)
- `artifactid` (``)
- `version` (``)
- `scope` (``)
The attestor also emits subjects: one `` `project:/@` `` entry for the project and one `` `dependency:/@` `` entry per declared dependency. Each subject's digest is the SHA-256 of that subject string.
## When to use
Run during the `prematerial` phase of a Maven build to lock in the declared coordinates and dependency set before compile/fetch. Pair with a `material` attestor if you also need to bind the resolved artifact bytes.
## Flags
| Flag | Default | Description |
|---|---|---|
| `--attestor-maven-pom-path` | `pom.xml` | Path to the Project Object Model (POM) XML file used for the task being attested. |
## Output shape
```json
{
"groupid": "com.example",
"artifactid": "my-service",
"version": "1.2.3",
"projectname": "My Service",
"dependencies": [
{
"groupid": "org.springframework",
"artifactid": "spring-core",
"version": "6.1.0",
"scope": "compile"
}
]
}
```
## Gotchas
- **Direct dependencies only.** Only entries under `` are captured. ``, ``, profile-scoped dependencies, and parent-inherited dependencies are not parsed. No transitive resolution is performed — the attestor never invokes Maven.
- **No POM digest is recorded.** The attestor does not hash the `pom.xml` file itself; only the parsed coordinates and dependency list end up in the predicate. Capture the POM with a material attestor if you need to bind its bytes.
- **No property/variable interpolation.** Values like `${project.version}` or `${revision}` are emitted verbatim as they appear in the XML; Maven's effective-POM substitution is not applied.
- **Single POM only.** The flag accepts one path. Multi-module reactor builds need one attestation per module POM.
- **Subjects are coordinate-string digests, not artifact digests.** Each `project:` / `dependency:` subject's SHA-256 is computed over the coordinate string itself, not over a resolved JAR.
## CLI example
Real `pom.xml` resolution: groupId, artifactId, version, declared dependencies extracted statically.
```bash
# In a directory containing pom.xml:
cilock run --step maven-build \
--signer-file-key-path key.pem --outfile attestation.json --workingdir . \
--attestations maven \
-- mvn -q package
```
Validated against a real `pom.xml` with declared dependencies. The attestor reads the pom statically; no Maven invocation needed. See the full real-data example at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/10-maven](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/10-maven).
## See also
- [Catalog row](../reference/attestor-catalog.md)
- Upstream: [witness/maven.md](https://github.com/in-toto/witness/blob/main/docs/attestors/maven.md)
---
# network-flows
Source: https://www.testifysec.com/docs/cilock/attestors/network-flows/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/network-flows.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/network-flows.json';
# `network-flows` attestor
Reads an AWS VPC flow log (plain-text delivery) and signs raw rows: what each capturing interface (instance and interface) logged for one packet source, packet destination, destination port and protocol, with the log's own direction, service and traffic path, and the flows, packets, bytes and rejected count in the window. It also signs the sha256 of the pod list the operator supplied, and never reads it. Which pod a row belongs to is decided in policy, where the cluster is known. Slice 1 signs observations only and no verdict: there is no `status`, `ok` or `complete` field. What it cannot classify is counted in `unattributed` or named in `blindSpots`. The rule is in `docs/design/planned/network-flows-fail-closed.md`.
## What it captures
Predicate `https://aflock.ai/attestations/network-flows/v0.2`:
- `window`: `start`, `end` (a record counts when it started inside) and the delivery lag the window ends before now.
- `source`: `provider` (`aws-vpc-flow-logs`), `logId`, `destination`, the `fieldSet` of the log, `objects` read, `objectsSha256`, `recordsRead`, `skipData`, `accountIds` and `vpcIds`, `files[]` (name, sha256, log id, record count), `unidentifiedFiles[]` (files whose names carry no flow log id: name and sha256, or `unreadable: true` with no digest when the file could not be read; never parsed) and `duplicateObjects[]` (files whose names match as one S3 object, each group with `identicalBytes`; every file is read and counted, so the group explains doubled counts).
- `addressFields`: the packet address columns the rows were built from.
- `podSnapshot`: `sha256` of the pod list file's bytes, `takenAt` and `takenAtSource` (`operator-flag`), `clusterVpcIds` and `clusterVpcIdsSource`. The file is hashed and never parsed.
- `rows[]`: `instanceId`, `interfaceId`, `direction`, `src`, `dst`, `port`, `protocol`, `service`, `trafficPath`, `flows`, `packets`, `bytes`, `rejected`, `firstSeen`, `lastSeen`. A row never merges across instances, interfaces or directions, and the list is never trimmed: the 200001st distinct row is an error.
- `unattributed`: every record read lands in exactly one bucket (`counted`, `outsideWindow`, `skipData`, `noData`, `noPacketAddresses`) and the buckets sum to `source.recordsRead`.
- `observed`: `coverage` (600s slices of the window, how many have a record of any status, the start of each empty one), `recordsWithoutVpcId`, `skipDataInWindow`, `windowEndsInsideDeliveryLag` and `podSnapshotBeforeWindowEnd`.
- `blindSpots[]`: `{id, text}`, fixed text per id, including `pod-attribution-in-policy`, `direction-not-classified`, `peer-not-classified`, `aws-service-traffic-not-logged`, `duplicate-capture` and `snapshot-unread`.
Subject: `network-flows://///`, digest = sha256 of the JSON of `rows` exactly as the predicate carries it. A window boundary with a fraction of a second is refused; the default end is cut to the second.
## Why this shape
Under the AWS VPC CNI, a flow log's `srcaddr` and `dstaddr` are the logging interface's addresses and name no pod; the pod is `pkt-srcaddr` on egress. An earlier shape joined those addresses to a pod list inside the attestor, and eighteen review rounds ended on a case no input can settle: a pod whose node is gone but still reads `Running`, whose released address a new instance acquired. The attestor now signs the instance and interface that logged each row and the digest of the pod list, and the policy that knows the cluster does the join, with its own rules for readiness time, departed nodes and shared addresses.
- A row does not say who opened a connection. `direction` is the log's value verbatim (`egress`, `ingress` or `-`) and part of the row's key.
- A destination is an address. `service` and `trafficPath` are the log's own values and part of the key, so a policy can tell traffic path 7 (a gateway endpoint) from 8 (an internet gateway).
- The pod list carries no read time and names no network, so `--attestor-network-flows-pods-taken-at` and `--attestor-network-flows-cluster-vpc-id` are required and recorded as the operator's assertions.
- A flow log file whose name carries no flow log id is listed and never read. A log without `pkt-srcaddr`, `pkt-dstaddr` and `flow-direction` signs no rows and `unattributed.noPacketAddresses`.
Nothing in the predicate says the window is complete. A policy decides from `observed.coverage`, `source.duplicateObjects`, `observed.skipDataInWindow`, `unattributed` and the blind spots.
## Validated invocation
```sh
cilock attest --step network-flows -a network-flows \
--attestor-network-flows-flow-log-dir ./flow-logs \
--attestor-network-flows-flow-log-id fl-0123456789abcdef0 \
--attestor-network-flows-pods-file pods.json \
--attestor-network-flows-pods-taken-at 2026-11-15T15:01:00Z \
--attestor-network-flows-cluster-vpc-id vpc-0123456789abcdef0 \
--attestor-network-flows-window 1h \
--attestor-network-flows-window-end 2026-11-15T15:00:00Z
```
`pods.json` is `kubectl get pods --all-namespaces -o json`, read at the end of the window, and is the list the policy joins against. Relative paths resolve against the attestation working directory. This version reads files; reading S3 and the cluster directly follows.
## Flags
| Flag | Default | What it does |
|---|---|---|
| `--attestor-network-flows-flow-log-dir` | (required) | Directory of downloaded flow log files (`.log`, `.log.gz`, plain-text delivery). |
| `--attestor-network-flows-flow-log-id` | (only one allowed) | Flow log id (`fl-...`) to read. Required when the directory holds more than one flow log. |
| `--attestor-network-flows-pods-file` | (required) | The pod list the policy will join against. Hashed, never read. |
| `--attestor-network-flows-pods-taken-at` | (required) | When the pod list was read, RFC 3339. A file time is not used. |
| `--attestor-network-flows-cluster-vpc-id` | (required) | The one VPC id the cluster runs in (`podSnapshot.clusterVpcIds`, `clusterVpcIdsSource: operator-flag`). Every record of the log that carries a vpc-id must carry this one or the run fails; an OK record with none fails too; NODATA and SKIPDATA records with none are counted in `observed.recordsWithoutVpcId`. |
| `--attestor-network-flows-window` | `1h` | How much traffic the attestation covers. |
| `--attestor-network-flows-window-end` | now minus delivery-lag | End of the window, RFC 3339. |
| `--attestor-network-flows-delivery-lag` | `10m` | How long before now the window ends, so the log has finished writing. |
## Needs from the flow log
Required fields: `srcaddr dstaddr srcport dstport protocol packets bytes start end action log-status vpc-id interface-id`. `interface-id` is part of every row's identity, so an OK record with `-` there is refused. For rows: `pkt-srcaddr pkt-dstaddr flow-direction`. Preferred: `instance-id` (the policy join needs it) and `traffic-path`. Optional: `pkt-dst-aws-service`. Parquet delivery is refused with an error.
## How a verifier consumes this
Policy reads `rows[]` and joins them to pods using the snapshot whose digest is `podSnapshot.sha256` and the cluster's own node and instance data. It owns the completeness verdict: for example require `observed.coverage.emptySlices` empty, `source.duplicateObjects` empty, `observed.skipDataInWindow` zero and the blind spots acceptable. Absence of a row does not prove no connection was opened.
## Gotchas
- Not seen by design: traffic between pods on one node (never leaves the host), traffic to the Amazon DNS resolver and the instance metadata service, and traffic source-NATed before the capture point. `blindSpots` says so in every attestation.
- `flows` counts flow log records, not connections. Rows from two interfaces that logged one packet are two rows.
- Every column of every record is checked against a closed grammar whatever its status (a truncated `action`, `log-status` or direction, an address or number that does not parse, a record of a VPC other than the cluster's, a file whose last line has no newline, a header field AWS does not define or repeats): a violation is an error, never a default.
- A failure to read (no cluster VPC, no file names a flow log id, no files, a pod snapshot that is missing or not a regular file, no snapshot time, a window whose start is not before its end) is an error and signs nothing. A window with no record signs the empty coverage.
## Later slices
The policy-side join, connection direction, peer classification, S3 and live cluster reads. See `docs/design/planned/network-flows-fail-closed.md`.
## See also
`docs/design/planned/network-flows-fail-closed.md` in the judge repository; the `k8smanifest` attestor for cluster state.
---
# nix
Source: https://www.testifysec.com/docs/cilock/attestors/nix/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/nix.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/nix.json';
# `nix` attestor
Records which Nix environment a step ran in, as facts a policy can compare with what was approved: the profile and the store object it resolves to, the closure behind it, the hash of the working directory's `flake.lock`, and the settings in `nix.conf` that decide whose binaries the store accepts.
The one thing it does that Nix's own tools do not is hash. For every path in the closure it serializes the path as a NAR and takes the sha256 itself, then records that value (`narHashRecomputed`) beside the value Nix's database holds (`narHash`). The attestor does not trust the database and does not judge it: a difference is a recorded fact (`narHashMismatch: true`), not an error.
## Validated invocation
```bash
cilock run --step build --attestations git,nix -o build.att.json -- make
cilock run --step build --attestations git,nix --attestor-nix-profile /nix/var/nix/profiles/default -o build.att.json -- make
```
The attestor lists the closure with the runner's own `nix-store`, found at fixed locations (`/nix/var/nix/profiles/default/bin/nix-store`, then `/run/current-system/sw/bin/nix-store`) and never on `PATH`: a project's dev shell controls `PATH` and can put a wrapper first that leaves dependencies out of its answer. The binary must resolve to a regular file under `/nix/store`, owned by root and not writable by group or other. Nix installs one program, `nix`, and links `nix-store` to it, so the verified target is started under the name `nix-store`. It runs with a minimal environment of its own (`PATH` is its directory, `HOME` an empty private directory), so a dev shell's `LD_PRELOAD`, library paths and `NIX_CONFIG`, `NIX_CONF_DIR` or `plugin-files` overrides do not reach it. It opens the host's store read-only, directly (`--store local?read-only=true`), not through the daemon: a daemon's `allowed-users` can refuse the user running the step, while the database and the store are readable. Without one that qualifies (a single-user install whose store belongs to the user does not), the attestation is still signed, with a `gaps` entry that says so and no closure.
## What gets captured
- `profile` and `profiles[]`: each profile the attestor resolved, with the profile as named (`path`), where it came from (`source`: `flag` or `NIX_PROFILES`) and the store object it resolves to (`storePath`). The walk follows the profile's links to the first object directly under the store directory and stops there: a store object that is itself a link is the profile's object and is not followed. `..` in a name is applied by the filesystem after the links before it, never by the text. `profiles` lists every profile that resolved, in the order named; `profile` is the last. No generation number, no home profile, no system default and no `PATH` search is recorded: a profile that is not named is not guessed.
- `missingProfiles`: the `NIX_PROFILES` entries that do not exist or are not in the store, always present (an empty list when none is missing).
- `roots`: the store objects the closure was computed from, one per profile that resolved. With `--attestor-nix-profile` it is the named profile's object; without it, the profile of each `NIX_PROFILES` entry that resolves. A profile that exists and does not lead to a store object under the store directory is a gap and leaves the record with no `closureDigest`; no other profile takes its place.
- `closure[]`, one per path, sorted by path: `path`, `narHash` (the database's claim), `narHashRecomputed`, `narHashMismatch`, `narSize` (bytes of the NAR), and `error` when the path could not be read. Hashes are lowercase hex sha256 of the NAR, not Nix's base-32 text.
- `closureDigest`: sha256 of one `\n` line per closure path in path order. It is left out, with a `gaps` entry, when the closure cannot be taken as whole: any path could not be hashed, `nix-store` listed an entry that is not a store path, a root is missing from its own closure, or nothing came back. A digest over part of a closure would read as the whole one. The paths that were read are still listed in `closure`. `closureCount`, `narHashMismatches` and `narBytes` summarize.
- `flakeLock`: `path`, `sha256` and `size` of its exact bytes, read once through one handle. The lock is not parsed: there is no inputs list, so a policy that needs an input recomputes it from the file the digest names. The file is the one in the step's working directory (or the one `--attestor-nix-flake-lock` names): a default or checkout-relative lock is opened inside the checkout and a link at its name is never followed, so it can be the working tree's file with uncommitted changes, not necessarily the committed blob.
- `nixConf`: the Nix configuration the attestor read, as written. It does not say what the effective settings are: that depends on how a daemon was started, how Nix merges files and its version, which a client cannot see, and a policy interprets it. `sources[]` lists, in the order Nix applies them (later overrides earlier), the system file (`NIX_CONF_DIR`, default `/etc/nix/nix.conf`), the user files, every file one of them includes, and `NIX_CONFIG` as a pseudo-source. Each has its `path`, `sha256`, `scope` (system, user or env) and `size` in bytes. `lines[]` is one list for all sources, in the order Nix applied them: each entry is a trust-relevant assignment as written with the `source` index it was written in, so an included file's lines are where its include is and the last line for a key is the one that won, whichever file it was in. Duplicates are kept, and `name` is as written (`substituters`, `extra-substituters`, `trusted-substituters`, `trusted-public-keys`, `extra-trusted-public-keys`, `require-sigs`, `trusted-users`, `store`, `extra-store`, `plugin-files`, and the other `extra-` forms) and `value`. An empty assignment (`substituters =`) is a line with an empty value. `redirects[]` lists the variables that change which configuration is read, `NIX_CONF_DIR`, `NIX_USER_CONF_FILES`, `NIX_CONFIG` (presence only, its text is a source), `NIX_REMOTE`, `NIX_DAEMON_SOCKET_PATH`, `NIX_STORE_DIR` and `NIX_STATE_DIR`, each with whether it is set and its value (a URL without credentials). A variable set to nothing is set: `NIX_USER_CONF_FILES=` switches user configuration off, and the record says it was set. `redactions` lists what was removed from URLs (see below).
- `nixVersion` and `nixStore` (path and sha256 of the `nix-store` that answered), `storeDir` (present only when `NIX_STORE_DIR` declared it or the verified `nix-store`'s own location established it), and `gaps`.
Subjects: `nix:closure`, digested by `closureDigest`, and `nix:flake-lock`, digested by the sha256 of the lock file. The first is absent when the closure is incomplete, the second when there is no `flake.lock`.
Flags: `--attestor-nix-profile ` names the profile; without it the attestor reads the `NIX_PROFILES` entries. Nothing else is searched for. `--attestor-nix-flake-lock ` names the lock, default `flake.lock` in the working directory.
## Why this shape
A store path such as `/nix/store/<32 characters>-nodejs-24.22.2` is a hash of the derivation, meaning the inputs and the build recipe, not of the bytes in the directory. Two builds of one derivation can produce different bytes, and a modified path keeps its name. So "the path name matches" proves nothing about content. What names content is the narHash, the sha256 of the NAR serialization, and the copy of it in Nix's local database is a root-writable claim.
So the attestor reads the bytes. A verifier gets both numbers and decides. A narHash backed by a signature from a cache the policy trusts, or by an attested build step, is evidence; a database value that merely equals the recomputed one on this host is evidence that the database agrees with the disk.
It records no verdict. Whether a closure is the approved one, whether `require-sigs` may be `false`, whether a mismatch matters: those are policy.
## How the narHash is checked
The attestor serializes each path in the NAR format and hashes the stream without holding it in memory. The format, from the Nix manual and Dolstra's thesis (chapter 5):
```
str(s) = len(s) as 8 bytes little-endian, s, zero padding up to a multiple of 8
nar = str("nix-archive-1") node
node = str("(") body str(")")
regular = str("type") str("regular") [str("executable") str("")] str("contents") str(data)
symlink = str("type") str("symlink") str("target") str(target)
dir = str("type") str("directory") { str("entry") str("(") str("name") str(n) str("node") node str(")") }
```
Entries are in bytewise order of name. A file is executable when its owner-execute bit is set; nothing else about it (owner, other mode bits, times) is in the archive. A device, socket or fifo is an error. On macOS, where Nix writes `~nix~case~hack~N` suffixes on a case-insensitive store, the suffix is stripped from names before sorting, as Nix does.
The code is checked against an archive derived by hand, `testdata/handmade.nar.hex` in the plugin: a directory holding `a` (the two bytes `hi`), `b` (an executable empty file), `link` (a symlink to `a`) and `sub` (an empty directory). The file lays out each `str()` as 8 length bytes, the bytes and the padding, one per line, with the grammar rule beside it. It is 864 bytes and its sha256 is `a4edc4a61142d133fa329190d9c2b722b9e0404c1656dba4009f17f70d209f46`. Three computations that share no code agree on that digest: `xxd -r -p` into `shasum -a 256`, a short Python encoder written from the grammar, and the Go code walking a real directory of that shape. The test also fails when any byte differs, so a bug cannot hide in a matching hash. Further tests change one content byte, the executable bit, a symlink target, an entry name or an entry count and require the hash to change, and stream a file past nine mebibytes.
Nix's own base-32 text for a hash is decoded and encoded with the algorithm from Nix, tested against the digest of the empty string (`sha256:0mdqa9w1p6cmli6976v4wi0sw9r4p5prkj7lzfd1877wk11c9c73` in nixpkgs).
## Validate it locally
On a host with Nix:
```bash
cilock run --step env --attestations nix -o nix.att.json -- true
jq '.payload | @base64d | fromjson | .predicate.attestations[] | select(.type | contains("/nix/")) | .attestation | {profile, closureCount, narHashMismatches, closureDigest, gaps}' nix.att.json
```
Compare one entry with Nix: `nix path-info --json ` gives the database's `narHash` in SRI form, and `nix hash convert --hash-algo sha256 --to base16 ` (`nix hash to-base16` on older Nix) turns it into the hex this attestor records. `narHashRecomputed` should equal it on a healthy store.
## How a verifier consumes this
- Join on the digests: the build's `nix:closure` against the closure of the host-apply step, and `nix:flake-lock` against the `flake.lock` at the commit under build.
- Treat a record with `gaps` as incomplete: a policy that requires a closure refuses it. A record with `narHashMismatches` above zero names, per path, which one differs.
- To use a closure as evidence of content, require `narHash` and `narHashRecomputed` to agree, then require the hash itself to be one the policy trusts (a cache signature, or an attested build).
## Notes
- Run type is pre-material: the record is of the environment before the command runs.
- Cost: one read of every file in the closure. Hashing runs in parallel, up to 8 paths at once, and streams. The time scales with the closure's size on disk.
- The closure comes from `nix-store --query --requisites` and the claimed hashes from `nix-store --query --hash`, not from reading `/nix/var/nix/db/db.sqlite`. The database is Nix's private schema, would need a SQLite engine linked into cilock, and is root-writable, so it is no trust root either way. The command follows the same store and daemon Nix does.
- URLs are not copied verbatim. In `substituters`, `trusted-substituters`, `store` and the other URL settings in `sources[].lines`, `redirects[].value`, and a flake input's `url`, the user name and password before the `@` are removed and so is the whole query string (`?token=`, `?ssh-key=`, `?priority=`), because a query is where secrets are put and no list of names is safe. `redactions` records that this happened, by key. An authenticated substituter does not put its password in Archivista; the cost is that a `?priority=` is lost.
- With a remote or relocated store selected (`NIX_REMOTE`, or the `store` setting, anything but plain `local`, `auto` or `daemon`), `nix-store` would answer about that store while the paths are hashed from this host's disk. The selector is judged as written, before URL cleaning, so `local?root=/alt` (or any parameter such as `store=` or `state=`) is untied too. The attestor then reads no closure, records a gap, and emits no `nix:closure` subject.
- Every path that comes from the step's environment or flags is placed by one rule: a relative path is a path in the step's working directory, not in the directory cilock was started from. That covers `NIX_PROFILES`, `--attestor-nix-profile`, `HOME` and `XDG_*`, `NIX_CONF_DIR`, `NIX_USER_CONF_FILES`, `include` and `!include` (in a file or in `NIX_CONFIG`), the `flake.lock` flag and the entries of `PATH`. Sources and the profile are recorded at the resolved path. If a relative path cannot be placed because the working directory is not known, there is a gap and no closure; the launch directory is never guessed.
- The whole configuration read has a budget: 64 include directives and 4 MiB in total, besides the per-file cap of 1 MiB and the include depth of 8. Reaching it records a gap and the closure is withheld, so a small file that includes a large one many times cannot exhaust a runner.
- `NIX_DAEMON_SOCKET_PATH`, `NIX_STORE_DIR` or `NIX_STATE_DIR` set to anything, by any value, withholds the closure with a gap naming the variable: they point Nix at a daemon or store tree, and no selector is interpreted. The query itself always opens the host's own store read-only, whatever the step's environment says.
- The store directory is the one `NIX_STORE_DIR` declares, else `/nix/store`, resolved once per attestation as the filesystem has it. `storeDir` in the record is present only when the declaration or an object found under it established it.
- The effective store selector follows configuration precedence (system, then user, then `NIX_CONFIG`; the last assignment wins; `store` is a single value, so `extra-store` is a line Nix refuses and leaves the read incomplete) over every source before it is judged. Only an empty or absent selector, or a plain `local`, `daemon` or `auto`, permits the query, so an overridden `store = local?root=/alt` does not withhold the closure and a later one does. `NIX_REMOTE` is judged the same way.
- On a real multi-user host the closure of a 2.1 GiB profile (190 paths) hashed from a warm page cache in under half a second with no mismatch against the database. A cold disk will take longer; no cold-cache figure has been measured.
- `nix.conf` is read the way Nix layers it, with `include` and `!include` followed. If any input that Nix would read cannot be read in full, the record has no closure: a file that exists but is unreadable or larger than 1 MiB, a line that is not a setting, an include that cannot be followed or nests deeper than 8, or a `NIX_CONF_DIR` set to nothing, a `NIX_USER_CONF_FILES` of only whitespace, or an `XDG_CONFIG_HOME` set to nothing (what Nix does with it is not guessed at). The gap names the input and says the configuration was not read completely. A file that is absent is normal, as Nix ignores it. The reason for refusing: what a file says can change the effective store selector, and an unread tail may say `store = ssh://...`.
## Gotchas
- The path name is not evidence. Do not write a policy that compares store path names alone.
- On a host where the database is wrong, every mismatch is reported but the step is not failed: the attestor never fails a build for what it finds.
- A closure path that cannot be read (permissions, a path garbage-collected mid-run) gets an `error` and a `gaps` line, and `closureDigest` is left out.
- A closure query that lists something outside the store directory is not opened or hashed; the entry count is in `gaps`.
- `NIX_PROFILES` lists the default profile and the user's. Each one that resolves is a root, so the closure is their union; pass `--attestor-nix-profile` to record one profile alone.
- A profile named with `--attestor-nix-profile` that is not there is a gap, and the record has no `closureDigest` or `nix:closure` subject. The entries of `NIX_PROFILES` are candidates instead. Nix's own shell setup (`nix-daemon.sh`) sets it to the system profile and `$HOME/.nix-profile`, and the second is absent on a healthy host, so a missing entry is listed in `missingProfiles` (a signed list, so a verifier sees which named profile was absent) and the closure is read from the profiles that resolve. A profile that exists and fails to resolve is not missing: it is a gap, and the profiles that did resolve are not a stand-in for it. If none resolve there is no closure and no other profile is substituted. The profile generation and a closure root for the tools on `PATH` are not recorded (nix-fleet.md D-21).
## FAQ
**Does it need root?** No, but the `nix-store` it asks must be root's. It reads the store and runs `nix-store --query`, which a normal user can do with a running daemon.
**Does it check signatures?** No. `trusted-public-keys` and `require-sigs` lines are recorded as written; per-path signatures are not read.
**Why hex and not Nix's base-32?** Policies and digests everywhere else in cilock are hex sha256; the conversion is one command (see above).
## See also
- [`system-packages`](./system-packages.mdx)
- [`command-run`](./command-run.mdx)
- [`product`](./product.mdx)
- [Catalog row](../reference/attestor-catalog.md)
---
# oci
Source: https://www.testifysec.com/docs/cilock/attestors/oci/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/oci.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/oci.json';
# `oci` attestor
Ingests an OCI/Docker image saved as a tarball product and records the manifest, image ID, layer diffIDs, and repo tags.
## What it captures
The attestor finds a `.tar` product, reads its `manifest.json`, and computes digests over the config blob and each referenced layer. The predicate carries these json-tagged fields:
- `tardigest` — `DigestSet` of the tar file itself (taken from the product digest after re-verification).
- `manifest` — array of `Manifest` entries parsed from `manifest.json`. Each entry has:
- `Config` — tar-relative path to the image config JSON.
- `RepoTags` — repo tags recorded by `docker save` / `nerdctl save`.
- `Layers` — tar-relative paths of the layer blobs in order.
- `imagetags` — `RepoTags` copied from the first manifest entry.
- `diffids` — array of `DigestSet`s, one per layer. Gzipped layers are decompressed first so the digest matches OCI "diffID" semantics (digest of the uncompressed tar stream); non-gzipped layers are hashed as-is.
- `imageid` — `DigestSet` over the bytes of the config blob (matches Docker's image ID).
- `manifestraw` — raw bytes of `manifest.json` as read from the tar.
- `manifestdigest` — `DigestSet` over `manifestraw`.
- `registrydigests` — present only when the run pushed: one `{reference, digest}` entry per registry-assigned manifest digest reported in the output of a successful `docker push`, `docker image push`, `crane push` or `crane copy`/`cp` wrapped by this run, or written to `--digestfile` by a successful `buildah push`. The digest is taken verbatim from that output, not recomputed. A push-only run with no tar product attests these alone.
- `imagemanifests` — one `{path, mediatype, digest, bytes}` entry per product file whose bytes are a registry image manifest or index, kept verbatim (at most 16, in sorted path order). `imagemanifeststruncated` counts any past that cap. A run with no tar product but at least one such manifest also succeeds.
`Subjects()` exposes: `manifestdigest:`, `tardigest:`, `imageid:`, one `imagetag:` per repo tag (digest is the SHA256 of the tag string), `layerdiffidNN:` for each layer (zero-padded index), one `registrydigest:@sha256:` per registry digest, and one lookup-only `imagemanifest:sha256:` per recorded image manifest.
## When to use
Pipelines that produce image tarballs via `docker save`, `nerdctl save`, `podman save`, or `skopeo copy ... docker-archive:`. Run the attestor in `postproduct` after the tar has been written and recorded as a product. For buildx metadata-file workflows, use the [`docker`](./docker.mdx) attestor instead.
## Flags
None. The attestor takes no configuration.
## Output shape
```json
{
"tardigest": { "sha256": "..." },
"manifest": [
{
"Config": "blobs/sha256/abc123...",
"RepoTags": ["registry.example.com/app:1.2.3"],
"Layers": ["blobs/sha256/def456...", "blobs/sha256/789aaa..."]
}
],
"imagetags": ["registry.example.com/app:1.2.3"],
"diffids": [
{ "sha256": "..." },
{ "sha256": "..." }
],
"imageid": { "sha256": "..." },
"manifestraw": "",
"manifestdigest": { "sha256": "..." },
"registrydigests": [
{ "reference": "registry.example.com/app:1.2.3", "digest": { "sha256": "..." } }
]
}
```
## Gotchas
- **Tarball detection is MIME-based.** The candidate selector iterates `ctx.Products()` and picks the first product whose `MimeType == "application/x-tar"`. Filename and extension are ignored. If a product is not classified as `application/x-tar` upstream (e.g. it was gzipped to `image.tar.gz` and detected as `application/gzip`), it will be skipped.
- **Integrity re-check.** The on-disk file is re-hashed and compared against the recorded product digest. A mismatch skips that candidate; if no tar survives, attestation fails with `integrity error for candidate : product digest does not match`. Only when there was no tar product at all does it fail with `no tar file found` (or, when the run pushed or produced an image manifest, succeed with `registrydigests` and `imagemanifests` alone).
- **`docker save` layout assumed.** The parser looks for a top-level `manifest.json` and treats it as the legacy Docker tar layout (a JSON array of `{Config, RepoTags, Layers}` entries with tar-relative paths). It does not parse the OCI image-layout `index.json` / `oci-layout` form. `docker save` writes both `manifest.json` and OCI-style blobs since recent Docker versions, so output from `docker save` and `nerdctl save` works; pure `oci-layout` archives (no top-level `manifest.json`) do not.
- **Only the first manifest entry is used.** `ImageID`, `LayerDiffIDs`, and `ImageTags` are taken from `Manifest[0]`. Multi-image tarballs (saving more than one image into one archive) record only the first image's derived fields, though all manifest entries are preserved in `manifest`.
- **Size caps.** `manifest.json` and the config blob must each be under 256 MiB. Each layer may decompress to at most 8 GiB, all layers of one image together to at most 24 GiB, and a manifest may name at most 512 layers. Larger inputs fail attestation.
## CLI example
Real `docker save` OCI tarball. The attestor reads the tar, parses `manifest.json` for repo tags + layer digests, computes the image-id digest.
```bash
docker pull alpine:3.20
# cilock invokes docker save directly. command-run records the real argv;
# product/v0.3 captures alpine-3.20.tar as a Merkle leaf; the oci attestor
# parses the saved tarball from the product set.
cilock run --step oci-save \
--signer-file-key-path key.pem --outfile attestation.json \
--attestations oci,environment,git \
-- docker save alpine:3.20 -o alpine-3.20.tar
```
Validated against the real `alpine:3.20` image. Manifest, layer diff-ids, and image-id all match independent verification. See the full real-data example at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/15-oci](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/15-oci).
## See also
- [Catalog row](../reference/attestor-catalog.md)
- [`docker`](./docker.mdx) — buildx metadata file approach
- Upstream: [witness/oci.md](https://github.com/in-toto/witness/blob/main/docs/attestors/oci.md)
---
# omnitrail
Source: https://www.testifysec.com/docs/cilock/attestors/omnitrail/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/omnitrail.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/omnitrail.json';
# `omnitrail` attestor
Captures a content-addressed trail of every file and directory under the working directory, with POSIX metadata, suitable for cross-tool provenance correlation.
## What it captures
The attestor wraps the upstream [`omnitrail-go`](https://github.com/fkautz/omnitrail-go) factory, which walks `ctx.WorkingDir()` and produces a single `Envelope` with three default plugins active: file, directory, and POSIX.
The attestor struct itself has exactly one json-tagged field:
| Field | Type | Description |
|---|---|---|
| `Envelope` | `*omnitrail.Envelope` | Trail envelope — header + per-path mapping |
`Envelope.Header.Features` is keyed by plugin: `file` (algorithms `gitoid:sha1`, `gitoid:sha256`, `sha1`, `sha256`), `directory` (`gitoid:sha1`, `gitoid:sha256`) and, on Unix, `posix` (no algorithms). `Envelope.Mapping` is a `map[string]*Element` keyed by **absolute** path. Each `Element` records:
- `type` — `file` or `directory`
- `sha1`, `sha256` — content hashes (files only; both are always computed)
- `gitoid:sha1`, `gitoid:sha256` — OmniBOR artifact dependency graph identifiers (files and directories)
- `posix` — atime, ctime, mtime, creation_time, file_inode, file_device_id, file_system_id, file_type, file_flags, hard_link_count, owner_uid, owner_gid, permissions, size, extended_attributes, metadata_ctime
> **Note:** Despite the name, omnitrail does **not** auto-detect toolchains (go, cargo, node, pip, gcc, etc.). It is a filesystem trail, not a tool inventory. For toolchain provenance, layer in `command-run` or language-specific attestors.
## When to use
Use omnitrail when downstream verifiers need a stable, content-addressed reference for every input file in the workspace — particularly for OmniBOR/ADG-based correlation across pipeline stages or between independent reproducible builds. Because it runs in the `prematerial` phase, it sees the workspace before any user command mutates it.
## Flags
None. The attestor exposes no CLI flags; the upstream library is constructed with defaults (SHA1 enabled, no allow-list, all three plugins active).
## Output shape
```json
{
"Envelope": {
"header": {
"features": {
"file": { "algorithms": ["gitoid:sha1", "gitoid:sha256", "sha1", "sha256"] },
"directory": { "algorithms": ["gitoid:sha1", "gitoid:sha256"] },
"posix": {}
}
},
"mapping": {
"/workspace/src/main.go": {
"type": "file",
"sha1": "…",
"sha256": "…",
"gitoid:sha1": "gitoid:blob:sha1:…",
"gitoid:sha256": "gitoid:blob:sha256:…",
"posix": {
"mtime": "2026-05-21T12:00:00Z",
"owner_uid": "501",
"permissions": "0644",
"size": "4096"
}
},
"/workspace/src": {
"type": "directory",
"gitoid:sha1": "gitoid:tree:sha1:…",
"gitoid:sha256": "gitoid:tree:sha256:…"
}
}
}
}
```
## Gotchas
- **Windows exclusion.** `omnitrail.go` carries `//go:build !windows`, and the Windows build is a stub that registers nothing. Any `cilock` built for Windows, the release binary or a custom one from [`rookery-builder`](../guides/build-a-custom-cilock.md), silently omits this attestor; policies that require it will fail on Windows runners.
- **POSIX plugin is Unix-only.** Upstream `posix_plugin_unix.go` is gated on Unix; even on macOS/Linux the POSIX fields depend on filesystem support for the relevant syscalls.
- **No allow-list wiring.** The upstream `SetAllowList` hook exists but the cilock adapter never calls it — every file under the working directory is walked. Large workspaces produce large envelopes.
- **No tool detection.** This attestor records files, not toolchain binaries. Documentation that claims otherwise (including any prior version of this page) was wrong.
- **Absolute paths.** Mapping keys are absolute paths on the producing host, so the same tree attested from two checkout directories yields different keys. A policy should match on digests, not on path keys.
## CLI example
Real omnitrail SBOM emission tied to a real material set.
```bash
cilock run --step omnitrail-emit \
--signer-file-key-path key.pem --outfile attestation.json --workingdir . \
--attestations omnitrail \
-- echo "captured omnitrail bom"
```
Validated against a real material set. See the full real-data example at [https://github.com/aflock-ai/attestor-compliance-examples/tree/main/12-omnitrail](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/12-omnitrail).
## See also
- [Catalog row](../reference/attestor-catalog.md)
- Upstream: [witness/omnitrail.md](https://github.com/in-toto/witness/blob/main/docs/attestors/omnitrail.md)
- Library: [fkautz/omnitrail-go](https://github.com/fkautz/omnitrail-go)
---
# OpenSCAP
Source: https://www.testifysec.com/docs/cilock/attestors/oscap/
{/* GENERATED — do not edit. Source: rookery attestation/detection/docs/oscap.doc.md. Regenerate: npm run gen */}
import AttestorMeta from '@site/src/components/Catalog/AttestorMeta';
import GeneratedFooter from '@site/src/components/Catalog/GeneratedFooter';
import meta from '@catalog/oscap.json';
# `oscap` attestor
[OpenSCAP](https://www.open-scap.org/) is the Red Hat-maintained reference implementation of the SCAP (Security Content Automation Protocol) stack — it evaluates a host against XCCDF benchmarks (CIS, DoD STIG, PCI-DSS, ANSSI, CUI, etc.) using OVAL probes and writes an XCCDF results XML report. Under cilock, every `oscap xccdf eval` run becomes a **signed `oscap/v0.1` attestation** carrying the parsed pass/fail/notapplicable counts, the failed-rule list, and a digest of the raw XCCDF XML alongside the file itself in `product/v0.3`.
## Validated invocation
```bash
cilock run --step oscap-scan \
--signer-file-key-path key.pem \
--outfile attestation.json \
--attestations oscap,environment,git \
--ignore-command-exit-code \
-- oscap xccdf eval \
--profile xccdf_org.ssgproject.content_profile_standard \
--results oscap-results.xml \
/usr/share/xml/scap/ssg/content/ssg-amzn2023-ds.xml
```
This is the [`29-oscap`](https://github.com/aflock-ai/attestor-compliance-examples/tree/main/29-oscap) example with `--ignore-command-exit-code` added, validated end-to-end against a fresh Amazon Linux 2023 EC2 host using the SCAP Security Guide (SSG) `standard` profile from `ssg-amzn2023-ds.xml`. The scan produced **11 pass, 3 fail, 64 N/A** — real findings, not synthetic fixtures. The three failed rules (`rpm_verify_permissions`, `file_permissions_library_dirs`, `grub2_nousb_argument`) reflect actual gaps on the host.
A few things to know about this invocation:
- **`--ignore-command-exit-code` is needed.** `oscap xccdf eval` exits 2 when any rule fails (the repo's own fixture recorder, `plugins/attestors/oscap/testdata/fixtures/almalinux9-standard/record.sh`, notes this), so without the flag `cilock run` exits non-zero on a scan with findings. The envelope and the `oscap/v0.1` predicate are written either way, and `command-run/v0.2` records the real exit code. The gate belongs at `cilock verify` time over the parsed `oscap/v0.1` predicate, not at scan time.
- **`--results ` is required.** Without it `oscap` only prints to stdout and there is no XML file for cilock's `product/v0.3` and `oscap` attestors to ingest.
- **Datastream path is distribution-specific.** AL2023 ships SSG content at `/usr/share/xml/scap/ssg/content/ssg-amzn2023-ds.xml`; RHEL 9 uses `ssg-rhel9-ds.xml`, Ubuntu 22.04 uses `ssg-ubuntu2204-ds.xml`, etc. The `scap-security-guide` package (RHEL/Fedora) or `ssg-base` (Debian/Ubuntu) installs them.
## What gets captured
Each cilock run emits an in-toto envelope whose predicate carries the following attestor types:
| Attestor type | Captures |
| ------------------------------------------------------ | ------------------------------------------------------------------------- |
| `https://aflock.ai/attestations/command-run/v0.2` | Real `oscap xccdf eval ...` argv, exit code, stdout/stderr |
| `https://aflock.ai/attestations/material/v0.3` | Merkle tree of the files under `--workingdir` before the scan (the SSG datastream XML is outside it and not recorded) |
| `https://aflock.ai/attestations/product/v0.3` | Merkle tree of outputs, including `oscap-results.xml` |
| `https://aflock.ai/attestations/oscap/v0.1` | Parsed XCCDF: profile, benchmark, target host, per-result counts, failed-rule list, `reportDigestSet.sha256` |
| `https://aflock.ai/attestations/environment/v0.1` | OS, hostname, user, env vars (PII-filtered) |
| `https://aflock.ai/attestations/git/v0.1` | Commit SHA, branch, remotes |
The `oscap/v0.1` predicate's `reportDigestSet.sha256` exactly matches the digest of the `oscap-results.xml` leaf in the `product/v0.3` tree. That is the chain that makes the findings verifiable — you can't swap in a different XCCDF report without invalidating the product tree. The `oscap` attestor also publishes three SHA-256 subjects on the envelope: `profile:`, `host:`, and `benchmark:`, so a policy can pin "this attestation is the STIG scan for *this* host."
## Why this shape
| Antipattern | This page |
| --------------------------------------------------------------- | ---------------------------------------------------------------------- |
| `cilock run ... -- bash -c "cp scan.xml results.xml"` | `cilock run ... -- oscap xccdf eval --results oscap-results.xml ...` |
| `command-run` records `bash -c "cp ..."` — useless | `command-run` records the real `oscap xccdf eval` argv |
| Product attestor digests a copy of a file written outside cilock | Product attestor digests the XCCDF XML `oscap` actually wrote |
| Tool execution happens outside cilock's syscall view | `oscap` runs as cilock's direct child; with `--trace`, the spy traces its syscalls |
| `oscap` predicate parses a file of unknown provenance | `oscap` predicate parses the same file cilock just hashed into product |
cilock invokes `oscap` **directly** — no `bash -c` wrapper, no `cp` of a pre-existing report, no `echo scan-done` placeholder. This page was promoted from the `29-oscap` validated example precisely because earlier internal docs used those antipatterns; the antipattern sweep cleaned the attestor reference page, and this user-facing page inherits the corrected shape. The guarantees (real argv in `command-run`, product digest matching the parsed report, and ptrace coverage of the scan when `--trace` is on) only hold when cilock is the tool's direct parent.
## Validate it locally
```bash
# Generate a signing key (one-time).
openssl genpkey -algorithm ed25519 -out key.pem
# Run cilock + oscap against the host.
cilock run --step oscap-scan \
--signer-file-key-path key.pem \
--outfile attestation.json \
--attestations oscap,environment,git \
--ignore-command-exit-code \
-- oscap xccdf eval \
--profile xccdf_org.ssgproject.content_profile_standard \
--results oscap-results.xml \
/usr/share/xml/scap/ssg/content/ssg-amzn2023-ds.xml
# Confirm the predicate carries the expected attestor types.
jq -r '.payload' attestation.json | base64 -d \
| jq '.predicate.attestations | map(.type)'
```
Expected output:
```json
[
"https://aflock.ai/attestations/environment/v0.1",
"https://aflock.ai/attestations/git/v0.1",
"https://aflock.ai/attestations/material/v0.3",
"https://aflock.ai/attestations/command-run/v0.2",
"https://aflock.ai/attestations/product/v0.3",
"https://aflock.ai/attestations/oscap/v0.1"
]
```
Confirm `oscap`'s real argv ended up in `command-run`:
```bash
jq -r '.payload' attestation.json | base64 -d \
| jq '.predicate.attestations[]
| select(.type=="https://aflock.ai/attestations/command-run/v0.2")
| .attestation.cmd'
```
Expected output (no `bash`, no `cp` — the literal `oscap` argv):
```json
[
"oscap",
"xccdf",
"eval",
"--profile",
"xccdf_org.ssgproject.content_profile_standard",
"--results",
"oscap-results.xml",
"/usr/share/xml/scap/ssg/content/ssg-amzn2023-ds.xml"
]
```
Extract the pass/fail/N/A counts and the failed-rule list from the `oscap/v0.1` predicate:
```bash
jq -r '.payload' attestation.json | base64 -d \
| jq '.predicate.attestations[]
| select(.type=="https://aflock.ai/attestations/oscap/v0.1")
| .attestation.scanSummary
| {profile, benchmarkId, targetSystem,
passCount, failCount, notApplicableCount, errorCount,
failedRules: [.failedRules[] | {idref, severity}]}'
```
Against the `29-oscap` AL2023 host you should see `passCount: 11, failCount: 3, notApplicableCount: 64` and the three failed rules listed above.
## How a verifier consumes this
The `oscap` attestor is a `postproduct` lifecycle attestor with predicate type `https://aflock.ai/attestations/oscap/v0.1`. It does not shell out to `oscap`; it reads a pre-existing XCCDF/ARF XML report from the step's products. It populates three top-level fields:
- `reportFile` — path of the XCCDF/ARF XML file picked up from products.
- `reportDigestSet` — digest set of that file, integrity-checked against the product entry before parsing.
- `scanSummary` — structured roll-up of the first `` `` `` in the document:
- `profile` — the `idref` from the `` `` `` child of `` `` ``.
- `benchmarkId` — the `id` attribute of the XCCDF `` `` `` element.
- `targetSystem` — the trimmed contents of the `` `` `` element.
- `passCount`, `failCount`, `notApplicableCount`, `errorCount` — aggregate counts derived from `` `` `` outcomes.
- `failedRules[]` — `{ idref, severity, result }` for every rule whose `` `` `` is `fail`.
Subjects published (each value hashed with SHA-256):
- `profile:` — the XCCDF profile that was evaluated.
- `host:` — the system that was scanned.
- `benchmark:` — the XCCDF benchmark document.
Pair this attestor with [`policyverify`](./policyverify.mdx) to gate promotion on `failCount == 0`.
### Output shape
```json
{
"reportFile": "results/oscap-results.xml",
"reportDigestSet": { "sha256": "..." },
"scanSummary": {
"profile": "xccdf_org.ssgproject.content_profile_stig",
"benchmarkId": "xccdf_org.ssgproject.content_benchmark_RHEL-9",
"targetSystem": "host.example.com",
"passCount": 312,
"failCount": 4,
"notApplicableCount": 27,
"errorCount": 0,
"failedRules": [
{
"idref": "xccdf_org.ssgproject.content_rule_package_telnet_removed",
"severity": "high",
"result": "fail"
}
]
}
}
```
## Notes
- **Profile selection.** SSG ships a dozen profiles per OS — the canonical ones are `xccdf_org.ssgproject.content_profile_standard` (baseline), `xccdf_org.ssgproject.content_profile_cis` / `_cis_server_l1` / `_cis_workstation_l1` (CIS), `xccdf_org.ssgproject.content_profile_stig` (DISA STIG), `xccdf_org.ssgproject.content_profile_pci-dss` (PCI), `xccdf_org.ssgproject.content_profile_cui` (NIST 800-171), and `xccdf_org.ssgproject.content_profile_anssi_bp28_high`. `oscap info ` lists every profile id available in a given DS.
- **Datastream paths by distro.** RHEL/CentOS/Rocky/Alma: `/usr/share/xml/scap/ssg/content/ssg-rhel{8,9,10}-ds.xml`. Fedora: `ssg-fedora-ds.xml`. AL2023: `ssg-amzn2023-ds.xml`. Ubuntu: `ssg-ubuntu{2004,2204,2404}-ds.xml`. Install via `dnf install scap-security-guide` (RHEL/Fedora) or `apt install ssg-base ssg-debderived` (Debian/Ubuntu).
- **SCAP spec triad.** SCAP is an umbrella for several XML grammars: **XCCDF** (the human-authored benchmark with rule descriptions, profiles, and remediation text), **OVAL** (the machine-checkable probes XCCDF rules delegate to), and **CPE** (the platform identifiers that gate which rules apply). `oscap xccdf eval` walks all three and writes a single XCCDF results XML — that file is what cilock attests.
- **ARF wrappers.** `oscap` can also emit an Asset Reporting Format (`--results-arf arf.xml`) that wraps XCCDF in a richer envelope. The rookery `oscap` attestor handles both: it walks XML tokens looking for the first `` `` `` element regardless of nesting depth.
- **Result strings.** The attestor buckets rule outcomes by exact match on `pass`, `fail`, `notapplicable` (and `not applicable`), and `error`. Other XCCDF result values — `notchecked`, `informational`, `fixed`, `unknown` — are present in the raw XML but not counted in the predicate's roll-up.
## Gotchas
- **Does not shell out to `oscap`.** The attestor reads a pre-existing XCCDF/ARF XML report from products; the wrapped command of the same `cilock run` step must write it (`oscap xccdf eval --results ` or equivalent) so it is a product of that step. A report written by an earlier step is not a product here and is not read.
- **File-suffix filter.** Only products whose path ends in `.xml` are considered; reports written with other extensions are skipped.
- **XCCDF namespace check.** A candidate file must contain the literal string `http://checklists.nist.gov/xccdf/1.2` as a fast pre-filter before structural parse; non-XCCDF XML is rejected.
- **Digest integrity.** The file is re-hashed and compared against the product digest before parsing; a mismatch causes that candidate to be skipped.
- **First match wins.** Products are walked in sorted path order; if multiple files look like XCCDF reports, only the first accepted one is attested.
- **ARF wrappers.** The decoder walks tokens looking for the first `` `