Expand description
§taudit-api — stable wire types for JSON / SARIF / CloudEvents
This crate owns every Rust type that appears in taudit’s emitted
output (JSON taudit-report.schema.json, JSON authority-graph.v1.json,
SARIF result.message.text and result.ruleId, CloudEvents
tauditruleid / tauditfindingfingerprint extension attributes).
§Stability promise (0.x)
While at 0.x:
- Additive changes (new variants, new fields) MAY ship in any minor
bump. Consumers should pin a minor (
taudit-api = "0.1") and review on each upgrade. - Breaking changes (renamed fields, removed variants, changed serde
representations) trigger a
0.{N+1}minor bump and a CHANGELOG migration note.
At 1.0, the promise lifts: only 2.0 permits breaking changes; all
1.x minor bumps are additive.
§Use in downstream tooling
Downstream consumers (tsign, axiom, custom SIEM integrations,
Backstage plugins) should depend on taudit-api directly rather than
taudit-core. taudit-core is workspace-internal and may break
between minors; taudit-api is the public contract.
See ADR 0001 (graph as product) and ADR 0004 (prereleases publish to crates.io).
Structs§
- Authority
Edge Summary - Abbreviated authority context for
HasAccessTo→ identity edges in JSON exports (ADR 0002 Phase 2). Copied from the target identity’s trust zone and selectedmetadatakeys so consumers need not reverse-engineer rawMETA_*strings for common questions. Omitted on edges where absent. - Edge
- A directed edge in the authority graph.
- Finding
- A finding is a concrete, actionable authority issue.
- Finding
Extras - Optional finding metadata. Lives on every
Findingvia#[serde(flatten)]so consumers see the fields at the top of the finding object — same place they’d appear if declared inline onFinding. Default-constructed extras serialize to nothing (allOption::Noneand emptyVecs skip-serialize), so existing snapshots remain byte-stable until a rule populates a field. - Node
- A node in the authority graph.
- Param
Spec - Pipeline-level parameter declaration captured from a top-level
parameters:block. Used by rules that need to reason about whether caller-supplied parameter values are constrained (values:allowlist) or free-form (no allowlist on a string parameter — shell-injection risk). - Pipeline
Source - Where the pipeline definition came from.
- Propagation
Path - A path that authority took through the graph. The path is the product — it’s what makes findings persuasive.
Enums§
- Authority
Completeness - How complete is this authority graph? Parsers set this based on whether they could fully resolve all authority relationships in the pipeline YAML.
- Edge
Kind - Edge semantics model authority/data flow — not syntactic YAML relations. Design test: “Can authority propagate along this edge?”
- Finding
Category - MVP categories (1-5) are derivable from pipeline YAML alone. Stretch categories (6-9) need heuristics or metadata enrichment.
- Finding
Source - Provenance of a finding — distinguishes findings emitted by built-in
taudit rules from findings emitted by user-loaded custom invariant YAML
(
--invariants-dir). Custom rules can emit arbitrarily-worded findings at any severity, so an operator piping output into a JIRA workflow or SARIF upload needs a non-spoofable signal of which file the rule came from. Serializes as"built-in"(string) for built-in findings and{"custom": "<path>"}for custom-rule findings — seedocs/finding-fingerprint.mdfor the contract. - FixEffort
- Coarse-grained remediation effort. Surfaces in JSON
time_to_fixand SARIFproperties.timeToFixso triage dashboards can sort byseverity * effort. - GapKind
- The category of reason why a graph is partial.
- Identity
Scope - How broad is an identity’s scope? Classifies the risk surface of tokens, service principals, and OIDC identities.
- Node
Kind - Semantic kind of a graph node.
- Recommendation
- Routing: scope findings -> TsafeRemediation; isolation findings -> CellosRemediation.
- Severity
- Severity of a finding. Ordered by
rank()(Critical = most severe). - Trust
Zone - Trust classification. Explicit on every node — not inferred from kind.
Constants§
- AUTHORITY_
EDGE_ SUMMARY_ FIELD_ MAX - Maximum characters per summary string field on
AuthorityEdgeSummary. - META_
ADD_ SPN_ TO_ ENV - Marks a Step task that runs with
addSpnToEnvironment: true, exposing the federated SPN (idToken / servicePrincipalKey / servicePrincipalId / tenantId) to the inline script body via environment variables. - META_
ATTESTS - Marks a Step that performs cryptographic provenance attestation (e.g.
actions/attest-build-provenance). - META_
CACHE_ KEY - Marks a Step that calls
actions/cache(oractions/cache/save/actions/cache/restore). The cell value is the rawkey:input from the step’swith:block. Consumed bypr_specific_cache_key_in_default_branch_consumerto detect PR-derived cache keys (head_ref, head.ref, actor) that a default-branch run can later restore — classic cache poisoning. - META_
CHECKOUT_ REF - Step-level metadata: the value passed to
actions/checkout’swith.refinput (verbatim, including any${{ … }}expressions). Stamped only onactions/checkoutsteps that supply aref:. Consumed bymanual_dispatch_input_to_url_or_command. - META_
CHECKOUT_ SELF - Marks a Step that performs a
checkout: self(ADO) or defaultactions/checkouton a PR context. - META_
CLI_ FLAG_ EXPOSED - Marks a Secret node whose value is interpolated into a CLI flag argument (e.g.
-var "key=$(SECRET)"). CLI flag values appear in pipeline log output even when ADO secret masking is active, because the command string is logged before masking runs and Terraform itself logs-varvalues. - META_
CONDITION - Step-level metadata: the AND-joined chain of
condition:expressions that gate this step’s runtime execution (stage condition, then job condition, then step condition, joined withAND). Stamped by parsers that surface runtime gating expressions — currently the ADO parser (stage / job / stepcondition:). Presence of this key means the step is NOT unconditionally reachable on every trigger; the runtime evaluator decides via expression (e.g.eq(variables['Build.SourceBranch'], 'refs/heads/main')). Consumed byapply_compensating_controlsto downgrade severity on findings whose firing step is gated behind a conditional. - META_
CONTAINER - Marks an Image node as a job container (not a
uses:action). - META_
DEPENDS_ ON - Step-level metadata: comma-joined list of upstream stage / job names this
step’s container declared via a non-default
dependsOn:value. Default ADO behaviour (“depends on the previous job/stage”) is NOT stamped — only explicit overrides. Currently a parser-side hook for future cross-job taint rules; no consumer rule exists yet. - META_
DIGEST - Records the digest of a pinned action / image reference.
- META_
DISPATCH_ INPUTS - Graph-level metadata: comma-joined list of
workflow_dispatch.inputs.*names declared by the workflow. Empty / absent if the workflow has noworkflow_dispatchtrigger. Consumed bymanual_dispatch_input_to_url_or_commandto taint-track input flow into command lines, URLs, andactions/checkoutrefs. - META_
DOTENV_ FILE - Records the GitLab
artifacts.reports.dotenv:file path for a Step. When set, the file’sKEY=valuelines are silently exported as pipeline variables for every downstream job that consumes this job vianeeds:ordependencies:. Consumed bydotenv_artifact_flows_to_privileged_deployment. - META_
DOWNLOADS_ ARTIFACT - Marks a Step that downloads a workflow artifact (typically
actions/download-artifactordawidd6/action-download-artifact). Inworkflow_run-triggered consumers, the originating run’s artifacts were produced from PR context — the consumer must treat their content as untrusted input even when the consumer itself runs with elevated perms. - META_
ENVIRONMENT_ NAME - Records the deployment environment name on a Step
(e.g. GitLab
environment.name:/ GHAenvironment:). Used by rules that gate on production-like environment names. - META_
ENVIRONMENT_ URL - Records a Step’s
environment:url:value verbatim. Stamped by the GitLab parser when the job declares anenvironment:mapping with aurl:field. Consumed byuntrusted_ci_var_in_shell_interpolationbecauseenvironment:url:is rendered by the GitLab UI and any predefined-CI-var interpolated into it is a stored-XSS / open-redirect sink. - META_
ENV_ APPROVAL - Marks a Step that belongs to an ADO deployment job whose
environment:is configured with required approvals — a manual gate that breaks automatic authority propagation. Findings whose path crosses such a node have their severity reduced by one step (Critical → High → Medium → Low). - META_
ENV_ GATE_ WRITES_ SECRET_ VALUE - Marks a Step that writes a
$(secretRef)value to the env gate. Co-set with META_WRITES_ENV_GATE when the written VALUE contains an ADO$(VAR)expression, distinguishing secret-exfiltration from plain-integer or literal env-gate writes. - META_
FORK_ CHECK - Marks a Step in a GHA workflow as carrying an
if:condition that references the standard fork-check pattern (github.event.pull_request.head.repo.fork == falseor the equivalenthead.repo.full_name == github.repository). Stamped by the GHA parser so rules can credit the step with the compensating control without re-parsing the YAML expression. Bool stored as"true". - META_
GHA_ ACTION - Step-level metadata: normalized GitHub Actions
uses:action name without its@refsuffix, for exampledocker/login-action. Set only by the GHA parser onuses:steps. - META_
GHA_ CONTAINER_ OPTIONS - Image-node metadata: raw
jobs.<id>.container.optionsvalue, when present. Kept separate from the image name because container options can carry runtime privilege flags even when the image is pinned. - META_
GHA_ ENV_ ASSIGNMENTS - Step-level metadata: sorted effective GitHub Actions
env:assignments after workflow ⊕ job ⊕ step merge, encoded as newline-delimitedkey=valuerecords. Values are the literal YAML/template strings, not secret values. Consumed by env-config and runtime-startup-injection rules. - META_
GHA_ RUNS_ ON - Step-level metadata: raw
jobs.<id>.runs-onvalue rendered into a compact deterministic string. Set on every step in the job and on synthetic reusable-workflow caller steps. - META_
GHA_ WITH_ INPUTS - Step-level metadata: sorted scalar
with:inputs for a GHAuses:step, encoded as newline-delimitedkey=valuerecords. Non-scalar inputs are omitted. Consumed by action-specific rules that need precision controls such asmask-password: falseorskip_install: true. - META_
GHA_ WORKFLOW_ CALL_ INPUTS - Graph-level metadata: comma-joined list of
workflow_call.inputs.*names declared by a reusable workflow. Empty / absent for ordinary workflows. - META_
GITLAB_ ALLOW_ FAILURE - Marks a Step (GitLab job) declared with
allow_failure: true. Used bysecurity_job_silently_skippedto detect scanner jobs that pass silently. - META_
GITLAB_ CACHE_ KEY - Records the literal
cache.key:value declared on a GitLab job (or the empty string if no cache is declared). Consumed bycache_key_crosses_trust_boundaryto detect cross-trust cache keys. - META_
GITLAB_ CACHE_ POLICY - Records the
cache.policy:value declared on a GitLab job (pull/push/pull-push/pull_push). When absent, the GitLab runtime default ispull-push. Consumed bycache_key_crosses_trust_boundary. - META_
GITLAB_ DIND_ SERVICE - Marks a Step (GitLab job) that declares one or more
services:entries matchingdocker:*-dindordocker:dind. Combined with secret-bearing HasAccessTo edges it indicates a runtime sandbox-escape primitive — any inline build step candocker run -v /:/hostfrom inside dind. - META_
GITLAB_ EXTENDS - Records the comma-joined list of
extends:template names a GitLab job inherits from. Used by scanner-name pattern matching insecurity_job_silently_skippedbecause GitLab security templates are usually consumed viaextends:rather than by job-name match. - META_
GITLAB_ INCLUDES - Graph-level metadata: JSON-encoded array of
include:entries declared by a GitLab CI pipeline. Each entry is an object with fields: - META_
GITLAB_ TRIGGER_ KIND - Marks a Step (GitLab job) that defines a
trigger:block (downstream / child pipeline). Value is"static"for a fixed downstreamproject:orinclude:of in-tree YAML, and"dynamic"when the include source is anartifact:(dynamic child pipelines — code-injection sink). - META_
IDENTITY_ SCOPE - Records the inferred breadth of an identity’s scope (
broad/constrained/unknown). - META_
IMPLICIT - Marks an Identity node as implicitly injected by the platform (e.g. ADO System.AccessToken). Implicit tokens are structurally accessible to all tasks by platform design — exposure to untrusted steps is Info-level (structural) rather than Critical (misconfiguration).
- META_
INFERRED - Marks a metadata value that the parser inferred rather than read literally.
- META_
INTERACTIVE_ DEBUG - Marks a Step that uses an interactive debug action (mxschmitt/action-tmate,
lhotari/action-upterm, actions/tmate, etc.). The cell value is the action
reference (e.g.
mxschmitt/action-tmate@v3). A successful debug session gives the operator an external SSH endpoint with the runner’s full environment loaded — every secret in scope, the checked-out HEAD, and write access to whatever the GITHUB_TOKEN holds. - META_
INTERPRETS_ ARTIFACT - Marks a Step whose body interprets artifact (or other untrusted file)
content into a privileged sink —
unzip/tar -x,cat/jqpiping into>> $GITHUB_ENV/>> $GITHUB_OUTPUT,eval, posting to a PR comment viaactions/github-scriptbody:/issue_body:, or evaluating extracted text. Combined withMETA_DOWNLOADS_ARTIFACTupstream in the same job and aworkflow_run/pull_request_targettrigger this is the classic mypy_primer / coverage-comment artifact-RCE pattern. - META_
JOB_ NAME - Records the parent job name on every Step node, enabling per-job subgraph
filtering (e.g.
taudit map --job build) and downstream consumers that need to attribute steps back to their containing job. Set by both the GHA and ADO parsers on every Step they create within a job’s scope. - META_
JOB_ OUTPUTS - Graph-level metadata: pipe-delimited list of
<job>\t<name>\t<source>records, one perjobs.<id>.outputs.<name>. Records are joined with|, fields within a record with\t.sourceis one ofsecret(value readssecrets.*),oidc(value referencessteps.*.outputs.*from a step that holds an OIDC identity),step_output(any othersteps.*.outputs.*), orliteral. Plain-text rather than JSON to keep the parser crate free ofserde_json. Consumed bysensitive_value_in_job_output. - META_
NEEDS - Records, on a Step, the upstream job names this step consumes via
GitLab
needs:ordependencies:. Comma-separated job names. Used to build dotenv-flow dependency chains across stages. - META_
NO_ WORKFLOW_ PERMISSIONS - Graph-level metadata: marks a GitHub Actions workflow as having NO
top-level
permissions:block declared. Set by the GHA parser whenworkflow.permissionsis absent so rules can detect the negative-space “no permissions block at all” pattern (which leavesGITHUB_TOKENat its broad platform default —contents: write,packages: write, etc.). - META_
OIDC - Marks an Identity node as OIDC-capable (
permissions: id-token: write). - META_
OIDC_ AUDIENCE - Records the OIDC audience (
aud:) value of anid_tokens:entry on an Identity node. GitLab CI emits one Identity perid_tokens:key; the audience is what trades for downstream cloud creds (Vault path, AWS role, etc), so audience reuse across MR-context and protected-context jobs is the precise privilege-overscope signal. Set by the GitLab parser. - META_
OIDC_ AUDIENCES - Records the comma-joined list of
id_tokens.aud:values when GitLab CI declares the audience as a YAML sequence (multi-cloud broker — strongest over-scoping signal). When set, the legacyMETA_OIDC_AUDIENCEfield holds the same comma-joined string for backward compatibility, and this field is the explicit “this was a list” marker. Set by the GitLab parser only on the multi-aud path; absent for scalaraud:values. - META_
PERMISSIONS - Records the
permissions:block scoped to an Identity / Step node. - META_
PLATFORM - Graph-level metadata: identifies the source platform of the parsed
pipeline. Set by every parser to its
platform()value ("github-actions","azure-devops","gitlab"). Allows platform-scoped rules to gate their detection without parsing the source file path. - META_
READS_ ENV - Marks a Step that reads from the runner-managed environment via an
env.<NAME>template reference —${{ env.X }}in awith:value, inline script body, or stepenv:mapping. Distinct fromsecrets.Xreferences (which produce a HasAccessTo edge to a Secret node) —env.Xreferences can be sourced from the ambient runner environment, including values laundered through$GITHUB_ENVby an earlier step. Stamped by the GHA parser sosecret_via_env_gate_to_untrusted_consumercan find the gate-laundering chain that the explicit-secret rules miss. - META_
REPOSITORIES - Graph-level metadata: JSON-encoded array of
resources.repositories[]entries declared by the pipeline. Each entry is an object with fieldsalias,repo_type,name, optionalref, andused(true when the alias is referenced viatemplate: x@alias,extends: x@alias, orcheckout: aliassomewhere in the same pipeline file). Set by the ADO parser; consumed bytemplate_extends_unpinned_branch. - META_
RULES_ PROTECTED_ ONLY - Marks a GitLab CI job (Step node) whose
rules:oronly:clause restricts execution to protected branches — either via an explicitif: $CI_COMMIT_REF_PROTECTED == "true"rule, anif: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCHrule, or anonly: [main, ...]allowlist of platform-protected refs. Set by the GitLab parser. Absence on a deployment job is a control gap. - META_
SCRIPT_ BODY - Records the raw inline script body of a Step (the text from
script:/bash:/powershell:/pwsh:/run:/ taskinputs.script/inputs.Inline/inputs.inlineScript). Stamped by parsers when the step has an inline script. Consumed by script-aware rules:vm_remote_exec_via_pipeline_secret,short_lived_sas_in_command_line,secret_to_inline_script_env_export,secret_materialised_to_workspace_file,keyvault_secret_to_plaintext,add_spn_with_inline_script,parameter_interpolation_into_shell. Stored verbatim — rules apply their own pattern matching. - META_
SECRETS_ INHERIT - Marks the synthetic Step node created for a job that delegates to a
reusable workflow with
secrets: inherit. The whole secret bag forwards to the callee regardless of what the callee actually consumes — when the caller is fired by an attacker-controllable trigger this is a wide-open exfiltration path. Set on the synthetic step node by the GHA parser. - META_
SELF_ HOSTED - Marks an Image node as a self-hosted agent pool (pool.name on ADO; runs-on: self-hosted on GHA).
- META_
SERVICE_ CONNECTION - Marks an Identity node as an ADO service connection.
- META_
SERVICE_ CONNECTION_ NAME - Records the name of the ADO service connection a step uses (the value of
inputs.azureSubscription/inputs.connectedServiceName*). Set on the Step node itself (in addition to the Identity node it links to) so rules can pattern-match on the connection name without traversing edges. - META_
SETVARIABLE_ ADO - Marks a Step that came from an ADO
##vso[task.setvariable]call (as opposed to a GHA>> $GITHUB_ENVredirect). Used to distinguish the two env-gate write patterns so BUG-4 suppression only applies to ADO plain-value writes. - META_
TERRAFORM_ AUTO_ APPROVE - Marks a Step as performing
terraform apply ... -auto-approve(either via an inline script or via aTerraformCLI/TerraformTasktask withcommand: applyandcommandOptionscontainingauto-approve). - META_
TRIGGER - Graph-level metadata: identifies the trigger type (e.g.
pull_request_target,pr). - META_
TRIGGERS - Graph-level metadata: comma-joined list of every entry under
on:(e.g.pull_request_target,issue_comment,workflow_run). Distinct fromMETA_TRIGGER(singular) which is set only forpull_request_target/ ADOprto preserve the existingtrigger_context_mismatchcontract. Consumers of this list (e.g.risky_trigger_with_authority) must split on,and treat each token as a trigger name. - META_
VARIABLE_ GROUP - Marks a Secret node sourced from an ADO variable group (vs inline pipeline variable).
- META_
WORKSPACE_ CLEAN - Marks an Image node (self-hosted agent pool) as having workspace isolation
configured (
workspace: { clean: all }orworkspace: { clean: true }in ADO). When present, the agent workspace is wiped between runs, mitigating workspace poisoning attacks where a PR build leaves malicious files for the next privileged pipeline run. Absence of this key on a self-hosted Image node is the signal forshared_self_hosted_pool_no_isolation. - META_
WRITES_ ENV_ GATE - Marks a Step that writes to the environment gate (
$GITHUB_ENV, ADO##vso[task.setvariable]).