validate

v0.2.4 tool

Validates evidence packs against compliance profiles

Install

epack install tool validate

Adds to epack.yaml, resolves dependencies, downloads binary.

Usage

Run the tool on an evidence pack:

epack tool validate --pack ./evidence.pack

Pass tool-specific arguments after --

Configuration

Or add manually to epack.yaml:

tools:
  validate:
    source: https://github.com/locktivity/epack-tool-validate

Then run epack install to lock and sync.

Overview

epack-tool-validate is an epack tool that validates evidence packs against compliance profile YAML files. It evaluates whether the artifacts in a pack satisfy the requirements defined in a profile.

How It Works

The tool performs validation in several stages:

  1. Profile Resolution: Determines which profile to use from tool configuration
  2. Profile Loading: Loads the base profile and any overlay files
  3. Overlay Application: Merges overlays into the base profile (modify, skip, add)
  4. Profile Compilation: Validates and compiles the profile into an executable form
  5. Pack Indexing: Indexes artifacts by their schema for efficient lookup
  6. Validation: Evaluates each requirement against the indexed artifacts

Run without a pack, the tool stops after compilation and lints the profile instead. See Linting a Profile.

Profile Structure

Profiles are YAML files that define compliance requirements:

id: my-compliance-profile
name: My Compliance Profile
version: "1.0.0"
description: A compliance profile for validation

requirements:
  - id: REQ-001
    name: MFA Required
    control: CC6.2
    category: Access Control
    satisfied_by:
      any_of:
        - type: evidencepack/idp-posture@v1
          metadata_conditions:
            all:
              - path: $.policy.mfa_required
                op: eq
                value: true

Requirement Modes

Requirements can use two clause modes:

  • any_of: Requirement passes if ANY clause passes. Without a pass, an unknown clause leaves the requirement unknown, then the first clause that matched with a severity sets the failure's severity, and otherwise the requirement fails at high
  • all_of: Requirement passes if ALL clauses match

Conditions

Conditions use JSONPath expressions to evaluate artifact metadata:

Operator Description
eq Equals
neq Not equals
gt Greater than
gte Greater than or equal
lt Less than
lte Less than or equal
exists Value exists (not null)
not_exists Value does not exist (null)
max_age_days ISO date or RFC3339 timestamp is no older than value days (date-only values may be up to one day in the future to absorb timezone differences)

Cardinality for Multi-Value Paths

When using JSONPath expressions that return multiple values (e.g., $.accounts[*].logging.audit_log_enabled), you must specify how to evaluate them:

metadata_conditions:
  all:
    - path: $.accounts[*].logging.audit_log_enabled
      op: eq
      value: true
      cardinality: all  # ALL values must satisfy the condition
Cardinality Description
(empty) Default. Path must return exactly one value
all Every value must satisfy the condition
any At least one value must satisfy the condition
none No value should satisfy the condition

Graduated Severity

Clauses can specify a severity level for graded compliance:

satisfied_by:
  any_of:
    # No severity = full pass
    - type: evidencepack/idp-posture@v1
      metadata_conditions:
        all:
          - path: $.user_security.mfa_coverage_pct
            op: gte
            value: 100

    # Severity = graded failure
    - type: evidencepack/idp-posture@v1
      severity: low
      metadata_conditions:
        all:
          - path: $.user_security.mfa_coverage_pct
            op: gte
            value: 90

Freshness Checks

Clauses can require artifacts to be recent:

- type: evidencepack/vuln-scan@v1
  freshness:
    max_age_days: 30
  metadata_conditions:
    all:
      - path: $.critical_count
        op: eq
        value: 0

Use max_age_days when the date to check is inside the artifact body rather than the artifact's manifest timestamp:

- type: evidencepack/pentest-report@v1
  metadata_conditions:
    all:
      - path: $.metadata.test_date
        op: max_age_days
        value: 365

Every Artifact of a Type

A pack can hold several artifacts of one type, such as idp-posture files from two identity providers. A clause is satisfied when one of them satisfies it, so a strong result in one file hides a weak result in another. A clause with artifacts: all needs every file it reads to satisfy it instead:

- type: evidencepack/idp-posture@v1
  artifacts: all  # every identity provider must reach 90%
  metadata_conditions:
    all:
      - path: $.user_security.mfa_coverage_pct
        op: gte
        value: 90

With all, one file whose conditions do not hold fails the clause, even when another file lacks the value. See Configuration for the full order and the counts each check reports.

Applies When

A clause can say when it applies with applicable_when. Its conditions take the same path, op, value, and cardinality as metadata_conditions:

- type: evidencepack/cloud-posture@v1
  applicable_when:
    all:
      - path: $.provider
        op: eq
        value: aws
  metadata_conditions:
    all:
      - path: $.accounts[*].logging.audit_log_enabled
        op: eq
        value: true
        cardinality: all

When the conditions are false for an artifact, the clause doesn't apply to it and the artifact is set aside. A clause that applies to none of its type's artifacts reads not_applicable. When a value the conditions need is absent, the clause reads unknown instead, so missing evidence never makes a clause not applicable. Artifacts too old for the clause's freshness are skipped before applicable_when is decided.

A clause with applicable_when and no metadata_conditions passes whenever it applies.

Each element of a list. A condition with cardinality: each is decided for each element of the list before its [*]. Elements it rules out are skipped, and the clause's conditions on that list grade only the elements left:

- type: evidencepack/cloud-posture@v1
  applicable_when:
    all:
      - path: $.accounts[*].storage.storage_resources_present
        op: eq
        value: true
        cardinality: each
  metadata_conditions:
    all:
      - path: $.accounts[*].storage.encryption_pct
        op: gte
        value: 100
        cardinality: all

Here an account with no storage is skipped. An account whose storage_resources_present is absent is graded anyway, so it passes only if its own percentage does. When every account is skipped, the clause is not applicable. When the list is absent or empty, the clause is unknown.

Another artifact type. With type, the conditions read a different artifact type than the clause:

- type: evidencepack/mfa-settings-capture@v1
  applicable_when:
    type: evidencepack/cloud-posture@v1
    all:
      - path: $.workforce_sign_in.in_use
        op: eq
        value: true
  metadata_conditions:
    all:
      - path: $.metadata.captured_on
        op: max_age_days
        value: 365

The clause applies when the conditions hold on any artifact of that type. It is unknown when they hold on none and are unknown on one, and it doesn't apply when they are false on all of them. A pack with no artifact of that type makes the clause missing. The clause's freshness doesn't apply to those artifacts.

Combining. Clauses that don't apply are set aside before a requirement combines the rest. A requirement where no clause applies reads not_applicable. Like a manual requirement, it counts under its own summary.not_applicable, never changes the overall status, and is never in key_failures.

See Configuration for the rules a profile has to follow and the applicable_when details each check reports.

Unknown Outcomes

Evaluation is three-valued. A value that is absent from an artifact (a missing
field, an explicit null, an array element without the field, or an empty
result set) cannot pass or fail a comparison: the condition, its clause, and
the requirement score as unknown with failure_kind:
"insufficient_evidence"
, never as a pass or a graded failure. The presence
operators (exists, not_exists) stay two-valued, since absence is exactly
what they test.

Combination follows the evidence: in any_of, a definite pass wins and any
unknown clause otherwise blocks a verdict; in all_of, a definite miss fails
the requirement even when other clauses are unknown. In all_of, a failed
condition, a stale artifact, or a missing timestamp decides before an artifact
type the pack doesn't have, so missing evidence never hides a failed
comparison. The overall status rolls up as fail over unknown over pass, and
summary.unknown counts the requirements that could not be scored. Unknown
requirements never appear in key_failures.

Deprecated Fields

A field the bundled schemas mark deprecated can name a field that holds the
same value, in its x-epack-replaced-by with same. When an artifact has no
value at all at such a field, the condition reads the new field instead. A
field renamed in its own schema is read in the same artifact. A field that
moved to another schema is read in that schema's artifact from the same
collector run, which is the artifact at artifacts/<run>.<kind>.json with
the same <run>. Another run's artifact is never read, so a check on GitHub
never takes Okta's value. The result reports the path the profile names.

A profile written before epack v0.10.0 keeps working after a later release
stops writing the old fields. Applies-when conditions fall back the same way,
on the clause's own type or the type the gate names. A condition with
cardinality each, and a condition that reads the list it picks from, read
only the fields they name.

Manual Requirements and Asserted Support

Not every requirement is machine-checkable. A written policy or a signed
agreement has no artifact field to compare, so a requirement can declare
manual: true instead of satisfied_by. Manual requirements report status:
"manual"
, count under summary.manual, and never affect the overall status;
they are answered by asserted support and human review.

Asserted support comes from control mapping artifacts
(evidencepack/control-mapping@v1) sealed into the pack by its publisher.
Each entry maps a requirement to a piece of evidence: an artifact (optionally
a JSON pointer into it) or an indexed document (optionally a quoted passage in
its extracted text). The tool joins entries to the profile's requirements,
resolves each reference against the pack, and reports the results in the
asserted_support output section. Any requirement can receive entries, so a
machine-checked requirement shows its computed result and its mapped evidence
side by side.

Mappings are assertions, not verification results. A broken or stale mapping
produces warnings (MAPPING_UNRESOLVED, MAPPING_PROFILE_MISMATCH,
INVALID_MAPPING_ENTRY, MANUAL_UNSUPPORTED), never a failure. See
Configuration for the join rules,
resolution states, and output shape.

Output

The tool outputs a validation.json file containing:

{
  "status": "pass",
  "profile": {
    "id": "my-compliance-profile",
    "name": "My Compliance Profile",
    "version": "1.0.0",
    "digest": "sha256:abc123..."
  },
  "validated_at": "2024-06-15T12:00:00Z",
  "validated_at_label": "just now",
  "pack_digest": "sha256:def456...",
  "summary": {
    "total": 5,
    "passed": 5,
    "failed": 0,
    "missing": 0,
    "warnings": 0
  },
  "requirements": [
    {
      "id": "REQ-001",
      "name": "MFA Required",
      "control": "CC6.2",
      "category": "Access Control",
      "status": "pass",
      "artifact": "artifacts/idp-posture.json",
      "path": "$.enabled",
      "expected": {"op": "eq", "value": true},
      "actual": true,
      "checks": [
        {
          "clause_index": 0,
          "schema": "evidencepack/idp-posture@v1",
          "status": "pass",
          "artifact": "artifacts/idp-posture.json",
          "conditions": [
            {
              "path": "$.enabled",
              "expected": {"op": "eq", "value": true},
              "actual": true,
              "passed": true
            }
          ]
        }
      ]
    }
  ],
  "by_category": {
    "Access Control": {"passed": 3, "failed": 0, "missing": 0},
    "System Operations": {"passed": 2, "failed": 0, "missing": 0}
  }
}

Overlays

Overlays allow customizing profiles without modifying the original:

id: my-overlay
name: Production Overlay

# Modify existing requirements
modify:
  - id: REQ-001
    name: Stricter MFA Requirement
    satisfied_by:
      any_of:
        - type: evidencepack/idp-posture@v1
          metadata_conditions:
            all:
              - path: $.user_security.mfa_coverage_pct
                op: gte
                value: 100

# Skip requirements
skip:
  - REQ-003
  - REQ-004

# Add new requirements
add:
  - id: REQ-NEW
    name: New Requirement
    satisfied_by:
      any_of:
        - type: evidencepack/custom@v1

Overlays are applied in order, with last-write-wins semantics.

Limitations

  • Single Profile (MVP): Currently supports one profile per validation run
  • Local Profiles Only: Profiles must be local files (no remote fetch)

Configuration

epack-tool-validate requires a compliance profile to validate against. The profile path is specified in the tool configuration.

Tool Requirements

Requirement Value
Requires Pack No. With a pack it validates; without one it lints the profile
Network Access No

Configuration Options

Option Type Required Description
profile string Yes* Path to a single profile YAML file
profiles []string Yes* List of profile paths (MVP: only one supported)
overlays []string No List of overlay YAML files to apply
schemas map No Artifact type to JSON Schema path, used by lint. Adds types the tool does not bundle and replaces bundled schemas for the types it names

*Either profile or profiles must be specified. If both are provided, profiles takes precedence.

Usage

Via epack Build

Add to your build configuration:

# epack.yaml
tools:
  validate:
    source: locktivity/epack-tool-validate@v1
    config:
      profile: profiles/security-policy.yaml

With Overlays

Apply environment-specific customizations:

# epack.yaml
tools:
  validate:
    source: locktivity/epack-tool-validate@v1
    config:
      profile: profiles/security-policy.yaml
      overlays:
        - profiles/overlays/production.yaml
        - profiles/overlays/us-region.yaml

Linting a Profile

Run the tool without a pack to lint a profile before it ever meets evidence:

epack tool validate profiles/security-policy.yaml

With no arguments, lint reads profile, overlays and schemas from the tool configuration. Arguments replace them:

epack tool validate profiles/draft.yaml --overlay profiles/overlays/production.yaml --schema acme/thing@v1=schemas/thing.json

Lint reports every problem it finds, not just the first. Findings print to stderr and are written to lint.json. Errors mean the profile will not evaluate as written. Warnings mean it will, but probably not as intended.

Code Severity Meaning
UNKNOWN_PATH error The path names a field the artifact's schema does not declare. Includes the declared fields at that level and the closest declared paths
MOVED_PATH warning The path reads a deprecated field, such as one in cloud-posture's iam, which epack v0.10.0 moved to access-posture. A later release stops writing it. Names the new field. When the schema marks the new field as holding the same value, the validator reads it once the old one is gone, and the condition needs no change. Otherwise a profile keeps the old condition beside one on the new field until then
PATH_SHAPE error The path indexes something that is not an array, or reads a field of something that is not an object
OPERATOR_TYPE_MISMATCH error A numeric operator on a non-numeric field, or max_age_days on a field that is not a date string
NEVER_MATCHES error eq against a value the field can never hold: the wrong type, a value outside its allowed values, or a whole object. Also a numeric operator given a non-numeric value
MISSING_VALUE error A comparison with no value
MISSING_FIELD error The profile has no version, or a requirement has no id or name
ALWAYS_MATCHES warning neq against a value the field can never hold
VACUOUS_PASS warning A condition that passes when there is nothing to test: cardinality: none over an empty list, exists with none, not_exists with all, or a single not_exists, which also passes when the field was never collected
FRESHNESS_IGNORED warning freshness.max_age_days below 1, which is ignored
TYPE_UNCHECKED warning No schema is known for the clause's type, so its paths were not checked. Pass one under schemas
PATH_UNCHECKED warning The path uses recursive descent, a filter or a union, which cannot be checked statically

Compiler errors such as INVALID_OPERATOR, INVALID_CARDINALITY, and INVALID_GATE are reported too, every one of them in a single run. Paths in applicable_when are checked against the schema of the type its conditions read, at locations such as any_of[0].applicable_when.all[1].

The tool bundles schemas for evidencepack/idp-posture@v1, cloud-posture@v1, vcs-posture@v1, email-dns@v1 and tls@v1. Any other type needs a schema under schemas before its paths are checked.

Profile File Format

Profiles are YAML files with the following structure:

id: my-security-profile           # Unique identifier
name: My Security Profile         # Human-readable name
version: "1.0.0"                  # Semantic version
description: Example profile      # Optional description

requirements:
  - id: REQ-001                   # Unique requirement ID
    name: MFA is enforced for every user  # The statement a reviewer reads
    control: CC6.1                # Optional control reference
    category: Access Control      # Optional category for grouping
    description: >                # Optional prose: what satisfies this
      Every active user is enrolled in multi-factor authentication.
    satisfied_by:
      any_of:                     # OR: any clause can satisfy
        - type: evidencepack/idp-posture@v1
          metadata_conditions:
            all:                  # AND: all conditions must match
              - path: $.user_security.mfa_coverage_pct
                op: gte
                value: 100

Editor and Agent Support

schema/profile.schema.json and schema/overlay.schema.json describe the profile and overlay grammar as JSON Schema. Point an editor at them from the top of the file for completion and inline errors:

# yaml-language-server: $schema=https://raw.githubusercontent.com/locktivity/epack-tool-validate/main/schema/profile.schema.json
id: my-security-profile

The JSON Schema checks the grammar. Lint goes further: it checks each path against the schema of the artifact it reads.

Clause Options

Field Type Description
type string Required. Artifact schema to match (e.g., evidencepack/idp-posture@v1)
severity string Optional. Failure severity: critical, high, medium, low
artifacts string Optional. any (the default) or all. Whether one artifact of the type or every one must satisfy the clause. See Every Artifact of a Type
freshness.max_age_days int Optional. Maximum age of artifact in days
applicable_when object Optional. When the clause applies. See Applies When
metadata_conditions.all []Condition Optional. Conditions that must all be true. Required when applicable_when has a cardinality: each condition

Condition Options

Field Type Description
path string JSONPath expression (e.g., $.user_security.mfa_coverage_pct)
op string Operator: eq, neq, gt, gte, lt, lte, exists, not_exists, max_age_days
value any Expected value (not required for exists/not_exists)
cardinality string For multi-value paths: all, any, none (empty = single value required). In applicable_when only, each

max_age_days expects value to be a non-negative number of days (validated at profile compile time) and the JSONPath value to be an ISO date (YYYY-MM-DD) or RFC3339 timestamp. It passes when the date is no older than the configured number of days and not in the future. Date-only values carry no timezone, so they are allowed up to one day in the future; RFC3339 timestamps must not be in the future at all.

Supported JSONPath Syntax

The following JSONPath patterns are supported:

Pattern Example Description
Root field $.field Access top-level field
Nested field $.nested.field Access nested field
Array index $.array[0] Access specific array element
Last element $.array[-1] Access last array element
Wildcard $.array[*].field Access field in all array elements (requires cardinality)
Recursive descent $..field Access field at any depth (requires cardinality)

Note: Multi-value patterns (wildcards, recursive descent) require a cardinality field to specify how multiple results are evaluated. See Cardinality.

Cardinality for Multi-Value Paths

When a JSONPath expression can return multiple values, you must specify how to evaluate them:

metadata_conditions:
  all:
    - path: $.accounts[*].logging.audit_log_enabled
      op: eq
      value: true
      cardinality: all  # ALL accounts must have audit logging on
Cardinality Description
(empty) Default. Path must return exactly one value
all Every value must satisfy the condition
any At least one value must satisfy the condition
none No value should satisfy the condition

Examples:

# All accounts must have audit logging on
- path: $.accounts[*].logging.audit_log_enabled
  op: eq
  value: true
  cardinality: all

# At least one environment must be production
- path: $.deployments[*].environment
  op: eq
  value: production
  cardinality: any

# No user should have admin role
- path: $.users[*].role
  op: eq
  value: admin
  cardinality: none

Partial presence detection: For cardinality: all, the validator checks that ALL array elements have the field. If some elements are missing the field entirely, the condition is unknown rather than passing. For example, $.accounts[*].logging.audit_log_enabled with op: eq, value: true, and cardinality: all is unknown if 2 out of 3 accounts have audit_log_enabled: true but the third account has no audit_log_enabled field. The result shows "2 of 3 elements evaluated". With op: exists, the same accounts fail the condition, and the result shows "2 of 3 elements have field".

Note: Partial presence detection requires a simple wildcard path (e.g., $.accounts[*].field). Recursive descent paths ($..field) cannot detect partial presence since there's no single base array to count.

Every Artifact of a Type

A pack can hold several artifacts of one type, such as an idp-posture file from Okta and another from Google Workspace, or one access-posture file for each system. By default a clause is satisfied when one of them satisfies it. Set artifacts: all to require every one:

- type: evidencepack/access-posture@v1
  artifacts: all  # every system must require SSO
  metadata_conditions:
    all:
      - path: $.sign_in.sso_required
        op: eq
        value: true
Artifacts Description
any Default. One artifact satisfying the clause is enough
all Every artifact the clause reads must satisfy it

With all, an artifact whose conditions do not hold fails the clause, even when another artifact lacks a value the clause reads. Without such a failure, a missing value makes the clause unknown. A stale artifact comes next, then one with no timestamp when the clause sets freshness. Artifacts that applicable_when sets aside are not read, and the clause does not apply when it sets aside every one. A pack with no artifact of the type makes the clause missing, as it does with any. Any other value fails to compile with INVALID_ARTIFACTS.

Each check for a clause with artifacts: all reports how it went across the artifacts:

"artifacts": {
  "mode": "all",
  "evaluated": 7,
  "passed": 5,
  "failed": [
    "artifacts/clickhouse.access-posture.json",
    "artifacts/modal.access-posture.json"
  ]
}

evaluated counts the artifacts whose conditions were checked, and passed the ones that satisfied them. failed lists the ones whose conditions did not hold. skipped counts the ones applicable_when set aside and appears only when there are any. A stale artifact, or one with no timestamp, is in none of these. When more than one artifact satisfied the clause, a passing check has no artifact.

Applies When

applicable_when on a clause says when the clause applies. Applies When in the overview explains how it evaluates.

- type: evidencepack/cloud-posture@v1
  applicable_when:
    type: evidencepack/cloud-posture@v1   # optional, defaults to the clause's type
    all:
      - path: $.accounts[*].storage.storage_resources_present
        op: eq
        value: true
        cardinality: each
  metadata_conditions:
    all:
      - path: $.accounts[*].storage.encryption_pct
        op: gte
        value: 100
        cardinality: all
Field Type Description
type string Optional. Artifact type the conditions read. Defaults to the clause's own type
all []Condition Required. Conditions that must all hold for the clause to apply

Rules:

  • applicable_when needs at least one condition.
  • cardinality: each is allowed only in applicable_when, only on a path with exactly one [*] and no other multi-value syntax, and only when the conditions read the clause's own type.
  • Every each condition in a clause ranges over the same list, the path before its [*]. Every condition in that clause's metadata_conditions with a [*] must read that list too, with one [*].
  • A clause with an each condition needs metadata_conditions. Without them the clause passes whenever it applies, so it would pass as soon as one element qualified and say nothing about the rest.
  • Otherwise metadata_conditions is optional. A clause with applicable_when and no metadata_conditions passes whenever it applies.

A profile that breaks one of these rules fails to compile with INVALID_GATE, except for each outside applicable_when, which fails with INVALID_CARDINALITY.

A check reports status: "not_applicable" when applicable_when set aside every artifact the clause could read, and a requirement reports it when every one of its checks does. Each check for a clause with applicable_when also reports how it was decided, on the artifact that decided the check:

"applicable_when": {
  "type": "evidencepack/cloud-posture@v1",
  "conditions": [
    {
      "path": "$.accounts[*].storage.storage_resources_present",
      "expected": {"op": "eq", "value": true},
      "actual": "1 of 3 elements match",
      "passed": true
    }
  ],
  "skipped": 2,
  "evaluated": 1
}

conditions lists every condition in profile order, in the same shape as the check's own conditions. For an each condition, actual counts the elements it held for, and passed is true when it held for at least one. skipped and evaluated count the list's elements and appear only when applicable_when has an each condition. When the check's artifact was never evaluated, applicable_when carries only type.

Manual Requirements

A requirement with manual: true declares that no machine check answers it. It is answered by asserted support (control mapping entries, see Control Mappings) and human review.

requirements:
  - id: REQ-POLICY
    name: Information Security Policy
    control: PL-01
    category: Governance
    description: Current version, stating review cadence of at least annually.
    manual: true

The optional description carries what would satisfy the requirement, in prose. It is echoed on each requirement in validation.json, so a reviewer sees the acceptance criteria beside the outcome and any asserted support.

Rules:

  • A requirement must have exactly one of any_of, all_of, or manual: true.
  • A manual requirement must carry id or control; without either it could never receive asserted support.
  • Manual requirements are never scored. They report status: "manual", count under summary.manual, and never affect the overall status. Requirements no clause applies to are handled the same way under summary.not_applicable, so summary.total minus summary.manual and summary.not_applicable is the machine-checked denominator.
  • A manual requirement with no asserted support entries produces a MANUAL_UNSUPPORTED warning.

Overlay File Format

Overlays customize profiles without modifying the original:

id: production-overlay            # Optional identifier
name: Production Overlay          # Optional name

# Modify existing requirements (replaces entire requirement)
modify:
  - id: REQ-001
    name: MFA is enforced and phishing-resistant
    satisfied_by:
      any_of:
        - type: evidencepack/idp-posture@v1
          metadata_conditions:
            all:
              - path: $.user_security.mfa_coverage_pct
                op: gte
                value: 100
              - path: $.user_security.mfa_phishing_resistant_pct
                op: gte
                value: 90

# Skip requirements entirely
skip:
  - REQ-003
  - REQ-004

# Add new requirements
add:
  - id: REQ-PROD-001
    name: Production-Specific Check
    category: Production
    satisfied_by:
      any_of:
        - type: evidencepack/deploy-info@v1
          metadata_conditions:
            all:
              - path: $.environment
                op: eq
                value: production

Overlay Application Order

  1. Overlays are applied in the order specified
  2. modify replaces the entire requirement (last-write-wins)
  3. skip removes requirements from evaluation
  4. add appends new requirements (ID must be unique)

Configuration Examples

Basic Single Profile

tools:
  validate:
    source: locktivity/epack-tool-validate@v1
    config:
      profile: profiles/compliance.yaml

Profile with Multiple Overlays

tools:
  validate:
    source: locktivity/epack-tool-validate@v1
    config:
      profile: profiles/security-policy.yaml
      overlays:
        - profiles/overlays/skip-manual.yaml
        - profiles/overlays/environment-prod.yaml

Environment-Specific Configuration

Use environment variables in overlay paths:

tools:
  validate:
    source: locktivity/epack-tool-validate@v1
    config:
      profile: profiles/security-baseline.yaml
      overlays:
        - profiles/overlays/${ENVIRONMENT}.yaml

Shared Configuration with YAML Anchors

Use YAML anchors to share configuration between multiple tool instances:

tools:
  validate:
    source: locktivity/epack-tool-validate@v1
    config: &base-validate
      profile: profiles/security-baseline.yaml

  validate-strict:
    source: locktivity/epack-tool-validate@v1
    config:
      <<: *base-validate
      overlays:
        - profiles/overlays/strict.yaml

Control Mappings

When the pack contains control mapping artifacts (schema evidencepack/control-mapping@v1), the tool reports their entries as asserted support beside its computed results. Mappings are publisher assertions: they never change any requirement outcome or the overall status. No configuration is needed; mapping support is automatic.

Each mapping entry references one requirement of the validated profile and one piece of evidence in the pack. The tool joins entries to requirements:

Entry field Joins to
requirement The requirement with that id
control The first requirement with that control value
type The single requirement whose clauses use that artifact schema (ambiguous types match nothing)

Mappings whose profile.id names a different profile are ignored. A mapping whose profile.digest differs from the validated profile's digest is still reported, with each entry marked "stale": true and a MAPPING_PROFILE_MISMATCH warning.

Evidence references resolve best-effort against the pack:

  • artifact resolves against the pack's artifact paths. An RFC 6901 pointer resolves into the artifact's JSON content; when it names a scalar, the entry carries the cited value in value.
  • document_id resolves through a document index artifact (schema evidencepack/document-index@v1). A quote anchor is searched in the document's extracted text; a table anchor resolves at document level, since packs carry no tabular extraction yet.

Each reported entry carries a resolution state:

State Meaning
resolved Target (and anchor, where an extraction exists) found
document_only Document found, but the anchor's extraction is absent
unresolved Target or anchor not found in the pack

The asserted_support output section is keyed by profile ID:

"asserted_support": {
  "my-security-profile": [
    {
      "requirement": "REQ-001",
      "requirement_id": "REQ-001",
      "evidence": {"artifact": "artifacts/idp-posture.json", "pointer": "/user_security/mfa_coverage_pct"},
      "label": "MFA coverage from the IdP export",
      "resolution": "resolved",
      "value": 100,
      "source": "artifacts/control-mappings.json"
    }
  ]
}

requirement, control, or type echoes the join the entry claimed; requirement_id is the joined requirement's id in this profile and is absent when the claim matched nothing.

Mapping issues surface as warnings, in the warnings array of validation.json and in the run's result.json. They are never errors and never affect status:

Code Meaning
INVALID_MAPPING_ENTRY Entry violates the mapping schema's constraints; the entry is reported in the warning and skipped
MAPPING_UNRESOLVED Entry cites an artifact, document, pointer, or quote not found in the pack, or references a requirement not present in the profile
MAPPING_PROFILE_MISMATCH Mapping's profile digest differs from the profile validated
MANUAL_UNSUPPORTED A manual: true requirement has no asserted support entries

Output Files

File Description
validation.json Validation results, written when the tool runs with a pack
lint.json Lint findings, written when the tool runs without a pack. status is pass when there are no errors

Exit Codes

Exit Code Meaning
0 Validation completed (check validation.json for pass/fail)
1 Operational error (profile not found, invalid YAML, etc.)

Note: A failing validation (requirements not met) still exits with code 0. Check the status field in validation.json: pass, fail, or unknown (evidence absent for at least one requirement, none failing). Manual and not applicable requirements never change it.

Examples

Basic Usage

Run validation on an evidence pack:

epack tool validate --pack ./my-evidence.epack

Interpreting Results

Passing Validation

{
  "status": "pass",
  "profile": {
    "id": "security-baseline",
    "name": "Security Baseline",
    "version": "1.0.0"
  },
  "validated_at": "2024-06-15T12:00:00Z",
  "pack_digest": "sha256:abc123...",
  "summary": {
    "total": 5,
    "passed": 5,
    "failed": 0,
    "warnings": 0
  },
  "requirements": [
    {
      "id": "REQ-001",
      "name": "MFA Enabled",
      "status": "pass",
      "artifact": "artifacts/idp-posture.json"
    }
  ]
}

All requirements are satisfied.

Failing Validation

{
  "status": "fail",
  "profile": {
    "id": "security-baseline",
    "name": "Security Baseline",
    "version": "1.0.0"
  },
  "summary": {
    "total": 5,
    "passed": 3,
    "failed": 1,
    "missing": 1,
    "warnings": 0
  },
  "requirements": [
    {
      "id": "REQ-001",
      "name": "MFA Coverage",
      "status": "fail",
      "severity": "high",
      "expected": {
        "op": "gte",
        "value": 100
      },
      "actual": 85,
      "delta": -15,
      "message": "conditions not satisfied",
      "artifact": "artifacts/idp-posture.json",
      "path": "$.user_security.mfa_coverage_pct",
      "failure_kind": "condition",
      "checks": [
        {
          "clause_index": 0,
          "schema": "evidencepack/idp-posture@v1",
          "status": "fail",
          "artifact": "artifacts/idp-posture.json",
          "message": "conditions not satisfied",
          "conditions": [
            {
              "path": "$.user_security.mfa_coverage_pct",
              "expected": {"op": "gte", "value": 100},
              "actual": 85,
              "delta": -15,
              "passed": false
            }
          ]
        }
      ]
    },
    {
      "id": "REQ-002",
      "name": "Vulnerability Scan",
      "status": "fail",
      "severity": "high",
      "failure_kind": "missing",
      "message": "no artifact with schema evidencepack/vuln-scan@v1",
      "checks": [
        {
          "clause_index": 0,
          "schema": "evidencepack/vuln-scan@v1",
          "status": "missing",
          "message": "no artifact with schema evidencepack/vuln-scan@v1"
        }
      ]
    }
  ],
  "key_failures": [
    {"id": "REQ-001", "name": "MFA Coverage", "severity": "high"},
    {"id": "REQ-002", "name": "Vulnerability Scan", "severity": "high"}
  ]
}

The key_failures array highlights critical and high severity failures.

Output fields for failed requirements:

Field Description
expected The condition that needed to be satisfied (op and value)
actual The actual value found in the artifact
delta Numeric difference from expected (for numeric comparisons)
path JSONPath that was evaluated
artifact Path to the artifact that was checked
failure_kind Structured failure classification such as missing or condition
checks Per-clause evaluation details, including missing or passing checks

Example Profiles

Basic Access Control Profile

id: access-control-basic
name: Basic Access Control Profile
version: "1.0.0"

requirements:
  - id: AC-001
    name: MFA Enabled
    control: AC-1
    category: Access Control
    satisfied_by:
      any_of:
        - type: evidencepack/idp-posture@v1
          metadata_conditions:
            all:
              - path: $.policy.mfa_required
                op: eq
                value: true

  - id: AC-002
    name: Password Policy
    control: AC-2
    category: Access Control
    satisfied_by:
      any_of:
        - type: evidencepack/idp-posture@v1
          metadata_conditions:
            all:
              - path: $.user_security.password_policy_noncompliant_pct
                op: lte
                value: 0
              - path: $.user_security.weak_password_pct
                op: lte
                value: 0

Graduated Compliance Profile

This profile uses graduated severity for MFA coverage thresholds:

id: mfa-graduated
name: MFA Coverage with Graduated Compliance
version: "1.0.0"

requirements:
  - id: MFA-001
    name: MFA Coverage
    control: CC6.2
    category: Access Control
    satisfied_by:
      any_of:
        # Full compliance (100%) - no severity = PASS
        - type: evidencepack/idp-posture@v1
          metadata_conditions:
            all:
              - path: $.user_security.mfa_coverage_pct
                op: gte
                value: 100

        # 90%+ coverage - low severity
        - type: evidencepack/idp-posture@v1
          severity: low
          metadata_conditions:
            all:
              - path: $.user_security.mfa_coverage_pct
                op: gte
                value: 90

        # 75%+ coverage - medium severity
        - type: evidencepack/idp-posture@v1
          severity: medium
          metadata_conditions:
            all:
              - path: $.user_security.mfa_coverage_pct
                op: gte
                value: 75

        # Anything less - high severity
        - type: evidencepack/idp-posture@v1
          severity: high
          metadata_conditions:
            all:
              - path: $.user_security.mfa_coverage_pct
                op: gte
                value: 0
MFA Coverage Result Severity
100% Pass -
95% Fail low
80% Fail medium
50% Fail high

Profile with Freshness Requirements

id: vuln-scan-fresh
name: Vulnerability Scanning Profile
version: "1.0.0"

requirements:
  - id: VS-001
    name: Recent Vulnerability Scan
    control: CC7.1
    category: System Operations
    satisfied_by:
      any_of:
        - type: evidencepack/vuln-scan@v1
          freshness:
            max_age_days: 7
          metadata_conditions:
            all:
              - path: $.critical_count
                op: eq
                value: 0

  - id: VS-002
    name: No High Vulnerabilities
    control: CC7.2
    category: System Operations
    satisfied_by:
      any_of:
        - type: evidencepack/vuln-scan@v1
          freshness:
            max_age_days: 30
          metadata_conditions:
            all:
              - path: $.high_count
                op: lte
                value: 5

All-Of Mode Example

This requirement needs ALL clauses to be satisfied:

requirements:
  - id: DEPLOY-001
    name: Production Deployment Checks
    category: Deployment
    satisfied_by:
      all_of:
        - type: evidencepack/deploy-info@v1
          metadata_conditions:
            all:
              - path: $.environment
                op: eq
                value: production

        - type: evidencepack/approval@v1
          metadata_conditions:
            all:
              - path: $.approved
                op: eq
                value: true

        - type: evidencepack/test-results@v1
          metadata_conditions:
            all:
              - path: $.all_passed
                op: eq
                value: true

Multi-Value JSONPath with Cardinality

Use cardinality when checking conditions across arrays:

requirements:
  - id: CLOUD-001
    name: Audit Logging On (All Accounts)
    category: Logging
    satisfied_by:
      any_of:
        - type: evidencepack/cloud-posture@v1
          metadata_conditions:
            all:
              # Check ALL accounts have audit logging on
              - path: $.accounts[*].logging.audit_log_enabled
                op: eq
                value: true
                cardinality: all

  - id: CLOUD-002
    name: At Least One High-Availability Region
    category: Infrastructure
    satisfied_by:
      any_of:
        - type: evidencepack/cloud-posture@v1
          metadata_conditions:
            all:
              # At least one region has HA enabled
              - path: $.regions[*].high_availability
                op: eq
                value: true
                cardinality: any

  - id: CLOUD-003
    name: No Public S3 Buckets
    category: Data Protection
    satisfied_by:
      any_of:
        - type: evidencepack/cloud-posture@v1
          metadata_conditions:
            all:
              # NO bucket should be public
              - path: $.s3_buckets[*].public_access
                op: eq
                value: true
                cardinality: none
Cardinality Use Case
all Every item must satisfy (e.g., all accounts have MFA)
any At least one item must satisfy (e.g., one region has HA)
none No item should satisfy (e.g., no public buckets)

Manual Requirements with Mapped Evidence

A requirement no machine check answers declares manual: true. It is
answered by control mapping entries sealed into the pack and by human review:

requirements:
  - id: GOV-001
    name: Information Security Policy
    control: PL-01
    category: Governance
    manual: true

When the pack carries a control mapping artifact
(evidencepack/control-mapping@v1), its entries appear in the
asserted_support section of validation.json:

"asserted_support": {
  "my-compliance-profile": [
    {
      "control": "PL-01",
      "requirement_id": "GOV-001",
      "evidence": {
        "document_id": "doc-8f2c1a9e",
        "quote": {"exact": "reviewed at least annually and approved by the CISO"}
      },
      "label": "Information Security Policy.pdf",
      "resolution": "resolved",
      "source": "artifacts/control-mappings.json"
    }
  ]
}

The manual requirement reports status: "manual" and never affects the
overall status. See Configuration for
the join rules, resolution states, and warning codes.

Example Overlays

Skip Manual Requirements

id: skip-manual
name: Skip Manual Review Requirements

skip:
  - MANUAL-001
  - MANUAL-002
  - MANUAL-003

Environment-Specific Overlay

id: production-overlay
name: Production Environment Overlay

modify:
  - id: VS-001
    name: Strict Vulnerability Scan (Production)
    satisfied_by:
      any_of:
        - type: evidencepack/vuln-scan@v1
          freshness:
            max_age_days: 1  # Daily scans in production
          metadata_conditions:
            all:
              - path: $.critical_count
                op: eq
                value: 0
              - path: $.high_count
                op: eq
                value: 0

add:
  - id: PROD-001
    name: Production Monitoring Active
    category: Production
    satisfied_by:
      any_of:
        - type: evidencepack/monitoring@v1
          metadata_conditions:
            all:
              - path: $.active
                op: eq
                value: true

Integration with CI/CD

GitHub Actions Example

name: Compliance Check

on:
  push:
    branches: [main]

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install epack
        run: |
          go install github.com/locktivity/epack/cmd/epack@latest

      - name: Build evidence pack
        run: epack collect -o evidence.epack

      - name: Validate compliance
        run: |
          epack tool validate --pack evidence.epack

          # Check validation result
          STATUS=$(jq -r '.status' validation.json)
          if [ "$STATUS" != "pass" ]; then
            echo "Compliance check failed"
            jq '.key_failures' validation.json
            exit 1
          fi

          echo "Compliance check passed"

GitLab CI Example

compliance:
  stage: test
  script:
    - epack collect -o evidence.epack
    - epack tool validate --pack evidence.epack
    - |
      if [ "$(jq -r '.status' validation.json)" != "pass" ]; then
        echo "Compliance failures:"
        jq '.requirements[] | select(.status == "fail")' validation.json
        exit 1
      fi
  artifacts:
    paths:
      - validation.json
    when: always

Debugging Validation Failures

Check Artifact Schema

Ensure your artifacts have the expected schema:

# List artifact schemas in pack
epack inspect --pack evidence.epack | jq '.artifacts[].schema'

Verify JSONPath

Lint the profile to check every path against the artifact's schema (see Linting a Profile), then look at the value in a real pack:

epack tool validate profiles/security.yaml
unzip -p evidence.epack artifacts/idp-posture.json | jq '.user_security.mfa_coverage_pct'

Profile Compilation Errors

If profile compilation fails, check:

  1. All requirement IDs are unique
  2. Each requirement has either any_of or all_of (not both)
  3. Each clause has a type field
  4. Severity values are valid: critical, high, medium, low
  5. Multi-value JSONPath expressions (wildcards, ..) have a cardinality field
  6. Cardinality values are valid: all, any, none
v0.2.4 Latest
2026-11-06

What's Changed

Full Changelog: https://github.com/locktivity/epack-tool-validate/compare/v0.2.3...v0.2.4

darwin/amd64 darwin/arm64 linux/amd64 linux/arm64
v0.2.3
2026-11-06

What's Changed

Full Changelog: https://github.com/locktivity/epack-tool-validate/compare/v0.2.2...v0.2.3

darwin/amd64 darwin/arm64 linux/amd64 linux/arm64
v0.2.2
2026-11-06

What's Changed

New Contributors

Full Changelog: https://github.com/locktivity/epack-tool-validate/compare/v0.2.1...v0.2.2

darwin/amd64 darwin/arm64 linux/amd64 linux/arm64
v0.2.1
2026-11-06
darwin/amd64 darwin/arm64 linux/amd64 linux/arm64
v0.2.0
2026-11-05
darwin/amd64 darwin/arm64 linux/amd64 linux/arm64
v0.1.13
2026-10-23
darwin/amd64 darwin/arm64 linux/amd64 linux/arm64
v0.1.12
2026-10-22
darwin/amd64 darwin/arm64 linux/amd64 linux/arm64
v0.1.11
2026-10-19
darwin/amd64 darwin/arm64 linux/amd64 linux/arm64
v0.1.10
2026-10-19
darwin/amd64 darwin/arm64 linux/amd64 linux/arm64
v0.1.9
2026-10-12
darwin/amd64 darwin/arm64 linux/amd64 linux/arm64
v0.1.8
2026-09-17
darwin/amd64 darwin/arm64 linux/amd64 linux/arm64
v0.1.7
2026-09-03
darwin/amd64 darwin/arm64 linux/amd64 linux/arm64
v0.1.6
2026-07-22
darwin/amd64 darwin/arm64 linux/amd64 linux/arm64
v0.1.5
2026-07-14
darwin/amd64 darwin/arm64 linux/amd64 linux/arm64
v0.1.4
2026-04-08
darwin/amd64 darwin/arm64 linux/amd64 linux/arm64
v0.1.3
2026-04-08
darwin/amd64 darwin/arm64 linux/amd64 linux/arm64
v0.1.2
2026-03-19
darwin/amd64 darwin/arm64 linux/amd64 linux/arm64

Details

Publisher
locktivity
Latest
v0.2.4
Protocol
v1

Platforms

darwin/amd64 darwin/arm64 linux/amd64 linux/arm64

Links