Skip to main content

File Attestation

The File Attestation Plugin verifies that a given file exists and that its attestation is present and valid, then exposes this information as evidence to the Continuous Compliance Framework.

Typical use cases:

  • Ensure a critical artifact (e.g. SBOM, manifest, binary) is present.
  • Verify that the artifact is covered by a signed Sigstore-style attestation.
  • Enforce that the signer of an attestation is on an approved list.
  • Ensure a given standard-based report is compliant (SARIF, CTRF)

This plugin is intended to be run as part of an aggregate agent and will execute your policy suite for the configured file and its attestation.


This page is for operators who run the plugin-file-attestation plugin with the CCF Agent, and for developers who write policies for it. It documents v0.2.3 and is generated from the plugin's README at v0.2.3.

Requirements​

Authentication​

The plugin can fetch both the file and its attestation from different locations:

  • Local filesystem (/path/to/file or file:///path/to/file)
  • HTTP / HTTPS endpoints
  • OCI-style endpoints (treated as HTTP(S) by this plugin)

Depending on where the file and attestation live, you may need authentication:

  • Basic Auth
    • basic_auth_username
    • basic_auth_password
  • Bearer Token
    • bearer_token

These credentials are automatically applied to http, https, and oci URIs.

Note: There is no GitHub-specific authentication in this plugin. Any GitHub access should be provided via standard HTTP(S) endpoints secured with the mechanisms above.


Configuration​

This plugin is configured via the agent YAML under plugins:

plugins:
file_attestation:
# Required: path to the file whose existence should be checked.
# Can be:
# - Relative path (treated as local filesystem)
# - file:///absolute/path
# - http(s)://... or oci://...
file_path: "file:///etc/myapp/config.yaml"

# Optional: path to the attestation associated with the file.
# Same URI formats as `file_path`.
attestation_path: "https://attest.example.com/config.yaml.att.json"

# Optional: comma-separated list of authorized signers for the attestation.
# Example: emails, identities, or URIs depending on your trust model.
authorized_signers: "alice@example.com,bob@example.com"

# Optional: credentials for HTTP/HTTPS/OCI endpoints.
basic_auth_username: ""
basic_auth_password: ""
bearer_token: ""

Path rules​

  • file_path is required.
  • file_path and attestation_path may be:
    • Relative filesystem paths (no URI scheme).
    • file:// URIs (local filesystem).
    • http://, https://, or oci:// URIs.
  • Any other schemes (including git://) are rejected during validation.

Absolute filesystem paths are normalized to file:// internally. Relative filesystem paths are kept as relative paths.

Subject labeling​

When the plugin emits evidence, it labels tracked files differently depending on where the file is sourced from:

  • Local filesystem paths and file:// URIs are labeled with:
    • provider=file
    • type=attestation
    • source=local
    • host=<current host>
    • file=<absolute local file path>
  • Remote http://, https://, and oci:// targets are labeled with:
    • provider=file
    • type=attestation
    • source=remote
    • host=<remote domain>
    • file=<remote path excluding the domain>

This allows the framework to resolve separate subject templates for:

  • Local host-backed files
  • Remote files and artifacts

HTTP example​

Example agent configuration using an HTTP-hosted file:

plugins:
file_attestation:
file_path: "https://raw.githubusercontent.com/compliance-framework/plugin-local-ssh/main/README.md"
authorized_signers: ""

Policy input​

One run tracks one file, the file_path setting, and its attestation, and evaluates every policy package against one document that a policy receives as input. The document is the same whether the file is local or remote. When the file doesn't exist, the document still reaches the policies, with exists false and attestation left out as null, so a policy can record the missing file as evidence. When the file exists but its attestation can't be fetched, attestation is set with exists false and the reason in error. Fields are listed by their name in the document; the ones under attestation have the prefix attestation.. Your own policy data from the agent configuration is in data.<key>, not in input.

FieldTypeDescription
pathstringThe file_path setting after normalisation: an absolute filesystem path becomes a file:// URI, a relative path and any URI stay as written.
contentstringThe file's content as text. Empty when the file doesn't exist.
existsbooleanTrue when the file was found. A file that returns HTTP 404, or is missing on disk, counts as not existing, and so does one that could not be read.
shastringSHA-256 of the file's content, in lower-case hexadecimal. Left out when the file doesn't exist.
sha512stringSHA-512 of the file's content, in lower-case hexadecimal. Left out when the file doesn't exist.
attestationobject or nullThe attestation found for the file. null when the file doesn't exist, so test for it before reading the fields below. The object is present even when no attestation_path is set, with exists false.
attestation.pathstringThe attestation_path setting after the same normalisation as path.
attestation.existsbooleanTrue when the attestation was found and could be read.
attestation.verifiedbooleanTrue when the attestation is a Sigstore bundle the plugin could parse (it has a mediaType or transparency log entries), or a DSSE envelope with at least one signature. The plugin doesn't check the signature itself: use signer_identity and signer_issuer to decide who you trust.
attestation.signer_identitystringWho signed: the first email address, URI or DNS name in the signing certificate's subject alternative names for a Sigstore bundle, the first signature's keyid for a DSSE envelope. Empty when none could be read.
attestation.signer_issuerstringWho issued the signing identity: the Fulcio issuer extension of the certificate, or the certificate issuer's common name when there is none. Empty for a DSSE envelope.
attestation.subject_digest_algstringAlgorithm of the first subject digest in the attestation's in-toto statement: sha256 or sha512 when present, otherwise the first one listed. Left out when there is no digest.
attestation.subject_digeststringThe digest value for subject_digest_alg. Compare it with sha or sha512. Left out when there is no digest.
attestation.timestampstringThe integratedTime of the first transparency log entry, as the bundle writes it (seconds since the epoch, as text). Empty when there is none.
attestation.errorstringWhy the attestation couldn't be fetched or understood, such as unrecognized attestation format. Left out when there was no problem.
authorized_signersarray of stringsThe authorized_signers setting split on commas, with spaces trimmed. null when the setting is empty. Match it against attestation.signer_identity.

An example input:

{
"path": "file:///etc/myapp/config.yaml",
"content": "listen: 0.0.0.0:8080\n",
"exists": true,
"sha": "3b1c8f0f6c1b6f0e0b7d3a1f9e6c2d4a5b8e7f90a1c2d3e4f5a6b7c8d9e0f1a2",
"sha512": "9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d",
"attestation": {
"path": "https://attest.example.com/config.yaml.att.json",
"exists": true,
"verified": true,
"signer_identity": "alice@example.com",
"signer_issuer": "https://accounts.google.com",
"subject_digest_alg": "sha256",
"subject_digest": "3b1c8f0f6c1b6f0e0b7d3a1f9e6c2d4a5b8e7f90a1c2d3e4f5a6b7c8d9e0f1a2",
"timestamp": "1767225600"
},
"authorized_signers": [
"alice@example.com",
"bob@example.com"
]
}

Subject templates​

The subject templates this plugin registers. Each example is built from sample data.

Tracked Local Host File Attestation​

One subject per local file and host, registered when the agent calls Init. It applies to evidence whose source label is local: a relative path, an absolute path or a file:// URI. Title: Tracked local file attestation target: '{{.file}}' on host '{{.host}}'. The evidence also carries the provider (file) and type (attestation) labels, and any labels from the policy_labels setting.

Identity keyDescription
hostThe hostname of the machine the plugin runs on.
fileThe absolute path of the tracked file. A relative file_path is resolved against the agent's working directory.
_pluginThe name the plugin has in the agent configuration, set by the agent (file_attestation in the sample configuration).

Example:

{
"name": "Tracked Local Host File Attestation",
"type": "component",
"title": "Tracked local file attestation target: '/etc/myapp/config.yaml' on host 'web-01'",
"description": "Tracked local file '/etc/myapp/config.yaml' on host 'web-01' and its associated attestation evidence",
"purpose": "Represents a host-backed local file artifact being monitored for existence, attestation availability, signer authorization, and digest integrity",
"selectorLabels": {
"source": "local"
},
"identityLabels": {
"host": "web-01",
"file": "/etc/myapp/config.yaml",
"_plugin": "file_attestation"
}
}

Tracked Remote File Attestation​

One subject per remote file and host, registered when the agent calls Init. It applies to evidence whose source label is remote: an http://, https:// or oci:// URI. Title: Tracked remote file attestation target: '{{.file}}' from host '{{.host}}'. The evidence also carries the provider (file) and type (attestation) labels, and any labels from the policy_labels setting.

Identity keyDescription
hostThe domain of the URI, without a port.
fileThe path of the URI without the domain and the leading /, as written (percent-encoding kept).
_pluginThe name the plugin has in the agent configuration, set by the agent (file_attestation in the sample configuration).

Example:

{
"name": "Tracked Remote File Attestation",
"type": "component",
"title": "Tracked remote file attestation target: 'releases/app/config.yaml' from host 'artifacts.example.com'",
"description": "Tracked remote file or artifact 'releases/app/config.yaml' from host 'artifacts.example.com' and its associated attestation evidence",
"purpose": "Represents a remote file artifact being monitored for existence, attestation availability, signer authorization, and digest integrity",
"selectorLabels": {
"source": "remote"
},
"identityLabels": {
"host": "artifacts.example.com",
"file": "releases/app/config.yaml",
"_plugin": "file_attestation"
}
}

Policies​

The policy bundles that work with this plugin, at their newest releases. The controls are the ones the bundle's policies list in their metadata.

BundleLatest versionControls coveredCompatible plugin lines
plugin-file-attestation-ctrf-policiesv0.2.1none listedlatest
plugin-file-attestation-policiesv0.2.1none listedlatest
plugin-file-attestation-sarif-policiesv0.2.1none listedlatest

Policies are written in OPA/Rego and must live under the compliance_framework package namespace.

Example:

# deny_unsigned_file.rego
# package compliance_framework.[YOUR_RULE_PATH]
package compliance_framework.deny_unsigned_file

deny[msg] {
input.attestation.exists == false
msg := "critical file is missing an attestation"
}

The plugin exposes information about:

  • File path and existence
  • Attestation presence and verification status
  • Attestation signer identity and issuer (where available)
  • Configured authorized signers

You can use these fields to write policies such as:

  • Deny when the file does not exist.
  • Deny when the attestation is missing or invalid.
  • Deny when the signer is not one of the authorized_signers.

Policy data​

Any policy_data set on this plugin's block in the agent configuration is passed to every policy evaluation and is available to Rego as data.<key>:

plugins:
file_attestation:
# ...plugin settings as above...
policy_data:
allowed_issuers:
- https://token.actions.githubusercontent.com