Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Theorem Catalog

93 proved · 0 sorry · 93 total

Condition Key Evaluation (IamExplainer.Condition)

StatusNameDescription
🟢 provedevalCond_noContext_T_imp
🟢 provedevalCond_noContext_tu

IamExplainer.Ghost.XAGhost

StatusNameDescription
🟢 provedcritical_is_top
🟢 provedxaTrust_ghost_conservative

SCPs, Permission Boundaries, and RCPs (IamExplainer.Layers)

StatusNameDescription
🟢 provedevalLayers_blocked_noContext_empty
🟢 provedevalLayers_noLayers_blocked

End-to-End IAM Authorization Proofs (IamExplainer.Proofs)

StatusNameDescription
🟢 provedallows_nocontext_conservative
🟢 provedallows_replaceAllow_mono
🟢 provedallows_replace_stmt_monoGeneralized statement replacement mono
🟢 provedemitFixed_narrows
🟢 provedgrants_completeGrants completeness and no-context conservatism
🟢 provedlayer_add_monotone
🟢 provedlayered_nocontext_conservative
🟢 provedlayers_narrowLayer theorems: layered evaluation only narrows access.
🟢 provedmatchPattern_ci_congr
🟢 provednarrowActions_narrows
🟢 provednarrowResources_narrowsNEW: narrowResources_narrows (T3)
🟢 provedremoveAllow_narrows
🟢 provedstmtGrantsAction_ci_congr
🟢 provedstmtGrantsAction_narrow

Seclib.Compose.Coverage

StatusNameDescription
🟢 provedallPass_no_fireCoverage claims: if all controls pass, chains cannot fire. Go source: chain_engi
🟢 provedcoverage_soundness
🟢 provedempty_failing_no_fire

Seclib.Compose.Dependencies

StatusNameDescription
🟢 provedfailClosed_diagnoses_notRunGo source: chain_engine.go:494-500 — fail_closed diagnoses on notRun.
🟢 provedfailClosed_diagnoses_unknownGo source: chain_engine.go:494-500 — fail_closed diagnoses on unknown.
🟢 provedfailOpen_never_diagnosesGo source: chain_engine.go:505-506 — fail_open never annotates.
🟢 provedranOK_never_diagnosesGo source: chain_engine.go:494-506 — ranOK never triggers any fallback.

Seclib.Compose.Distance

StatusNameDescription
🟢 provedchainDistance_mono
🟢 provedclassify_exploitable_of_fires
🟢 provedclassify_mono_via_distanceAdding failures can only move exploitability toward exploitable (never away from
🟢 provedfires_of_classify_exploitable
🟢 provedno_nearMiss_threshold_one

Seclib.Compose.Monotonicity

StatusNameDescription
🟢 provedchainFires_add_one
🟢 provedchainFires_mono
🟢 provedfailingCount_le_lengthfailingCount is bounded by the chain’s control count.
🟢 provedfailingCount_mono
🟢 provedfiringSet_monoSet-level monotonicity: the set of firing chains never shrinks when the failing

Seclib.CrossAccount.Monotonicity

StatusNameDescription
🟢 provedchain_step_necessaryRemoving a failing step from a chain at threshold breaks it.
🟢 provedcondition_blocks_wildcard
🟢 provedcoverage_monotoneMonotonicity and soundness proofs for cross-account trust model.
🟢 provedexternalId_blocks_wildcard
🟢 provedorgCondition_blocks_wildcard
🟢 provedpartition_complete
🟢 provedwildcard_complete

Policy Evaluation Semantics (Seclib.Domain.PolicySem)

StatusNameDescription
🟢 provedfilterMap_narrows
🟢 provedgrants_completegrants_complete: if allowed, an Allow statement exists that matches
🟢 provednarrow_narrowsnarrow_narrows: replacing a statement with one that matches fewer requests narro
🟢 provednocontext_conservativenocontext_conservative: if allowed under any context, allowed under noCtx
🟢 provedremoveAllowremoveAllow: removing an Allow statement narrows access

Seclib.Ghost

StatusNameDescription
🟢 provedghost_compositionWhen scope B resolves a ghost from scope A, the conservative finding from A is s
🟢 provedghost_contradiction_detectedTwo controls with incompatible ghost assumptions on the same reference cannot co

Seclib.IAM.Monotonicity

StatusNameDescription
🟢 provedbarrier_demotesA blocked escalation path is not distance-0 (not exploitable). Barriers demote e
🟢 provediam_exploitable_matches_composeAn exploitable IAM escalation maps to Compose’s .exploitable classification. Go
🟢 provediam_oneaway_matches_composeA one-away IAM escalation maps to Compose’s .oneAway classification.
🟢 provedperm_boundary_monotoneAdding a permission boundary action to a graph that has no escalation path canno
🟢 provedpriv_transitiveIf A can reach B and B can reach C, then A can reach C. Soufflé source: rules.dl
🟢 provedscp_deny_monotoneAdding an SCP deny statement to a graph that has no escalation path cannot creat

Seclib.Network.Monotonicity

StatusNameDescription
🟢 provedList.any_of_any_append_leftIf any holds on a list, it holds on a superset (append). Go source: reachabili
🟢 provedcanReach_mono_abstractIf membership is preserved, any is preserved. Go source: reachability.go:36-51
🟢 provedgated_not_unsatIf a gated egress path exists and no sink path exists, transitiveEgressVerdict r
🟢 provedisolation_soundIf a host is tagged isolated and no host in the graph can reach it on any port (
🟢 provedrule_check_monoAbstract monotonicity: if a predicate holds when checking any over a set of ru
🟢 provedtransitiveEgress_decompositionTransitive egress decomposes into two reachability queries: (1) isolated → servi
🟢 provedunsat_no_gatedContrapositive: if verdict is UNSAT, no gated path exists. Go source: proof.go:4

Action and Resource Pattern Matching (Seclib.Prim.Glob)

StatusNameDescription
🟢 provedciEq_toLowerStr
🟢 provedmatchPatternGo_literal_eq
🟢 provedmatchPattern_cs_literal_eq
🟢 provedmatchPattern_literal_mp
🟢 provedtoLower_eq_question
🟢 provedtoLower_eq_star

Statement Combining — Deny Overrides (Seclib.Prim.Rule)

StatusNameDescription
🟢 provedappliesOf_unknown_conservativeLemma 4: Unknown applicability is conservative
🟢 provedconj_narrowsLemma 3: Conjunction of evaluation gates never widens access
🟢 proveddenyOverrides_add_deny_narrowsLemma 2: Adding a deny narrows
🟢 proveddenyOverrides_remove_allow_narrowsLemma 1: Removing an allow rule narrows access

Seclib.Schema.Capability

StatusNameDescription
🟢 provedbuiltinCapabilities_length

Seclib.Schema.Properties

StatusNameDescription
🟢 provedappliesToAssetType_contains
🟢 provedappliesToAssetType_empty_means_all### Theorem 3: Catalog-schema coupling For every control in a catalog, if it dec
🟢 provedbuiltin_nonempty### Theorem 5: Capability liveness Every capability in the builtin set is a stri
🟢 provedcapability_membership
🟢 provedcel_validation_types### CEL validation type coverage requiresCELValidation is true exactly for unsaf
🟢 provedcontains_requires_value
🟢 provedembed_set_equality### Theorem 4: Embed invariant If two sorted lists of control IDs are equal, the
🟢 provedempty_predicate_no_fields### Predicate emptiness An empty predicate yields no field paths.
🟢 provedeq_requires_value
🟢 provedfieldPath_strip_properties_cons### Theorem 1: Schema-predicate consistency Every field path in a predicate that
🟢 provedlist_empty_no_value
🟢 provedmissing_no_value### Theorem 2: Null safety Operators missing, present, and list_empty do n
🟢 provedne_requires_value
🟢 provednull_safety_complete
🟢 provedoperator_count
🟢 provedoperator_exhaustive
🟢 provedpresent_no_value
🟢 provedseverity_total_order### Severity ordering is total

Dependency Graph

Nodes: 🟢 proved, 🟡 sorry, ⚪ definition.

Seclib.Compose.Basic

ChainDef — ⚪ definition

structure · source

A chain definition: controls that co-fail to create compound risk. Go source: internal/core/controldef/chain.go:14-65

structure ChainDef where

FailingControl — ⚪ definition

structure · source

A (control, asset) pair with an active violation. Go source: internal/core/evaluation/risk/chain_engine.go:18-21

structure FailingControl where

failingSet — ⚪ definition

def · source

The set of failing control IDs, ignoring asset grouping for now. The Go engine groups by scope/asset; the core composition predicate only needs the set of failing control IDs within one scope bucket.

def failingSet (failures : List FailingControl) : List ControlId

Seclib.Compose.Bridge

BridgeRecord — ⚪ definition

structure · source

Contract test bridge: parse JSONL from the Go engine export, run chainFires / chainDistance on the same inputs, compare verdicts. Go source: bridge_gen.py produces the JSONL; this module consumes it.

structure BridgeRecord where

— ⚪ definition

instance · source

instance : FromJson BridgeRecord where

mkChainDef — ⚪ definition

def · source

Build a ChainDef from a bridge record. Returns none if structural invariants don’t hold (< 2 controls or threshold out of range).

def mkChainDef (r : BridgeRecord) : Option ChainDef

CheckResult — ⚪ definition

structure · source

structure CheckResult where

checkRecord — ⚪ definition

def · source

Check one bridge record against the Lean composition model.

def checkRecord (r : BridgeRecord) : Option String

checkAll — ⚪ definition

def · source

Run the bridge checker on parsed records.

def checkAll (records : List BridgeRecord) : CheckResult

parseJsonl — ⚪ definition

def · source

Parse a JSONL string into bridge records.

def parseJsonl (content : String) : List BridgeRecord

bridgeCheck — ⚪ definition

def · source

Main bridge checker entry point.

def bridgeCheck (path : System.FilePath) : IO UInt32

Seclib.Compose.BridgeMain

main — ⚪ definition

def · source

CLI wrapper for the bridge checker. Go source: bridge_gen.py produces the JSONL consumed here.

def main (args : List String) : IO UInt32

Seclib.Compose.Compose

failingCount — ⚪ definition

def · source

Count how many of the chain’s controls appear in the failing set. Go source: chain_engine.go:166-172 (failing/holding partition)

def failingCount (chain : ChainDef) (failing : List ControlId) : Nat

chainFires — ⚪ definition

def · source

A chain fires when enough member controls fail. Go source: chain_engine.go:174 — len(failing) < chain.EscalationThreshold is the skip condition; negating it gives the firing predicate.

def chainFires (chain : ChainDef) (failing : List ControlId) : Prop

— ⚪ definition

instance · source

instance (chain : ChainDef) (failing : List ControlId) :

chainFiresB — ⚪ definition

def · source

Boolean version for computation.

def chainFiresB (chain : ChainDef) (failing : List ControlId) : Bool

controlsFailing — ⚪ definition

def · source

The controls in the chain that are failing.

def controlsFailing (chain : ChainDef) (failing : List ControlId) : List ControlId

missingSafeguards — ⚪ definition

def · source

The controls in the chain that are holding (not failing).

def missingSafeguards (chain : ChainDef) (failing : List ControlId) : List ControlId

Seclib.Compose.Coverage

allPass_no_fire — 🟢 proved

theorem · source

Coverage claims: if all controls pass, chains cannot fire. Go source: chain_engine.go:64-147 (DetectChains).

theorem allPass_no_fire (chain : ChainDef) (failing : List ControlId)
    (h : ∀ c, c ∈ chain.controls → c ∉ failing) :
    ¬ chainFires chain failing

empty_failing_no_fire — 🟢 proved

theorem · source

theorem empty_failing_no_fire (chain : ChainDef) :
    ¬ chainFires chain []

coverage_soundness — 🟢 proved

theorem · source

theorem coverage_soundness (chains : List ChainDef) (failing : List ControlId)
    (h : ∀ chain, chain ∈ chains →

Seclib.Compose.Dependencies

ImplicitDep — ⚪ definition

structure · source

Go source: internal/core/controldef/chain.go:153-167

structure ImplicitDep where

shouldDiagnose — ⚪ definition

def · source

Go source: internal/core/evaluation/risk/chain_engine.go:492-506 (AnnotateDependencies switch)

def shouldDiagnose (fallback : DependencyFallback) (status : DependencyStatus) : Bool

failClosed_diagnoses_notRun — 🟢 proved

theorem · source

Go source: chain_engine.go:494-500 — fail_closed diagnoses on notRun.

theorem failClosed_diagnoses_notRun :

failClosed_diagnoses_unknown — 🟢 proved

theorem · source

Go source: chain_engine.go:494-500 — fail_closed diagnoses on unknown.

theorem failClosed_diagnoses_unknown :

failOpen_never_diagnoses — 🟢 proved

theorem · source

Go source: chain_engine.go:505-506 — fail_open never annotates.

theorem failOpen_never_diagnoses (status : DependencyStatus) :
    shouldDiagnose .failOpen status = false

ranOK_never_diagnoses — 🟢 proved

theorem · source

Go source: chain_engine.go:494-506 — ranOK never triggers any fallback.

theorem ranOK_never_diagnoses (fb : DependencyFallback) :
    shouldDiagnose fb .ranOK = false

Seclib.Compose.Distance

chainDistance — ⚪ definition

def · source

Distance metric: how far is a chain from firing? Go source: finding_risk.go:11-24, chain_engine.go:432

def chainDistance (chain : ChainDef) (failing : List ControlId) : Nat

classify — ⚪ definition

def · source

def classify (chain : ChainDef) (failing : List ControlId) : Exploitability

classify_exploitable_of_fires — 🟢 proved

theorem · source

theorem classify_exploitable_of_fires (chain : ChainDef) (failing : List ControlId)
    (h : chainFires chain failing) :
    classify chain failing = .exploitable

fires_of_classify_exploitable — 🟢 proved

theorem · source

theorem fires_of_classify_exploitable (chain : ChainDef) (failing : List ControlId)
    (h : classify chain failing = .exploitable) :
    chainFires chain failing

isNearMiss — ⚪ definition

def · source

def isNearMiss (chain : ChainDef) (failing : List ControlId) : Prop

— ⚪ definition

instance · source

instance (chain : ChainDef) (failing : List ControlId) :

no_nearMiss_threshold_one — 🟢 proved

theorem · source

theorem no_nearMiss_threshold_one (chain : ChainDef) (failing : List ControlId)
    (hT : chain.threshold = 1) :
    ¬ isNearMiss chain failing

chainDistance_mono — 🟢 proved

theorem · source

theorem chainDistance_mono (chain : ChainDef) (s t : List ControlId) :
    chainDistance chain (s ++ t) ≤ chainDistance chain s

Exploitability.rank — ⚪ definition

def · source

Exploitability order: exploitable < oneAway < reachable. “Closer to firing” = lower value.

def Exploitability.rank : Exploitability → Nat
  | .exploitable => 0
  | .oneAway => 1
  | .reachable => 2

classify_mono_via_distance — 🟢 proved

theorem · source

Adding failures can only move exploitability toward exploitable (never away from it). Proved via the underlying distance metric.

theorem classify_mono_via_distance (chain : ChainDef) (s t : List ControlId)
    (h : classify chain s = .exploitable) :
    classify chain (s ++ t) = .exploitable

Seclib.Compose.Monotonicity

failingCount_mono — 🟢 proved

theorem · source

theorem failingCount_mono (chain : ChainDef) (s t : List ControlId) :
    failingCount chain s ≤ failingCount chain (s ++ t)

chainFires_mono — 🟢 proved

theorem · source

theorem chainFires_mono (chain : ChainDef) (s t : List ControlId)
    (h : chainFires chain s) : chainFires chain (s ++ t)

chainFires_add_one — 🟢 proved

theorem · source

theorem chainFires_add_one (chain : ChainDef) (s : List ControlId) (f : ControlId)
    (h : chainFires chain s) : chainFires chain (s ++ [f])

firingSet_mono — 🟢 proved

theorem · source

Set-level monotonicity: the set of firing chains never shrinks when the failing set grows. Every chain that fires on s also fires on s ++ t. This is the deliverable-4 property from the LEAN4-COMPOSE spec.

theorem firingSet_mono (chains : List ChainDef) (s t : List ControlId) :

failingCount_le_length — 🟢 proved

theorem · source

failingCount is bounded by the chain’s control count.

theorem failingCount_le_length (chain : ChainDef) (failing : List ControlId) :
    failingCount chain failing ≤ chain.controls.length

Seclib.CrossAccount.Boundary

oosPairs — ⚪ definition

def · source

The 13 OOS pairs — services with negligible enterprise prevalence. Go source: ca-triage-table.md (13 OOS).

def oosPairs : List TrustPair

coveredPairs — ⚪ definition

def · source

The 51 covered pairs — services with active controls.

def coveredPairs : List TrustPair

CrossAccountDisclosure — ⚪ definition

structure · source

Disclosure: when Stave reports no cross-account findings, it means “no finding in the covered 51 pairs.” The 13 OOS pairs are not evaluated.

structure CrossAccountDisclosure where

Seclib.CrossAccount.Bridge

GrantRecord — ⚪ definition

structure · source

Contract test bridge for cross-account trust model. Parses JSONL records, evaluates Lean predicates, compares results. Two record types: Grant record: tests wildcardGrant, conditionedGrant, scopedGrant Coverage record: tests pairCoverage verdict

structure GrantRecord where

CoverageRecord — ⚪ definition

structure · source

structure CoverageRecord where

parseMechanism — ⚪ definition

def · source

def parseMechanism : String → Option Mechanism
  | "resourcePolicy" => some .resourcePolicy
  | "trustPolicy" => some .trustPolicy
  | "grant" => some .grant
  | "accessPoint" => some .accessPoint
  | "sharingAPI" => some .sharingAPI
  | "replicationConfig" => some .replicationConfig
  | "accessEntry" => some .accessEntry
  | "podIdentity" => some .podIdentity
  | "oidcFederation" => some .oidcFederation
  | "invitationDelegation" => some .invitationDelegation
  | "attributeShare" => some .attributeShare
  | "association" => some .association
  | "ramShare" => some .ramShare
  | _ => none

parseDirection — ⚪ definition

def · source

def parseDirection : String → Option Direction
  | "inboundGrant" => some .inboundGrant
  | "outboundFlow" => some .outboundFlow
  | "both" => some .both
  | _ => none

verdictToString — ⚪ definition

def · source

def verdictToString : CoverageVerdict → String
  | .covered => "covered"
  | .uncovered => "uncovered"
  | .oos => "oos"
  | .schemaBlocked => "schemaBlocked"
  | .evidenceGated => "evidenceGated"

parseGrantRecord — ⚪ definition

def · source

def parseGrantRecord (j : Json) : Except String GrantRecord

parseCoverageRecord — ⚪ definition

def · source

def parseCoverageRecord (j : Json) : Except String CoverageRecord

checkGrantRecord — ⚪ definition

def · source

def checkGrantRecord (r : GrantRecord) : Bool × String

checkCoverageRecord — ⚪ definition

def · source

def checkCoverageRecord (r : CoverageRecord) : Bool × String

parseAndCheckLine — ⚪ definition

def · source

def parseAndCheckLine (line : String) : Option (Bool × String)

bridgeCheck — ⚪ definition

def · source

def bridgeCheck (path : System.FilePath) : IO UInt32

Seclib.CrossAccount.BridgeMain

main — ⚪ definition

def · source

def main (args : List String) : IO UInt32

Seclib.CrossAccount.Coverage

pairCoverage — ⚪ definition

def · source

The 64-pair taxonomy as a decidable coverage function. Go source: cross-account-v1.yaml (55 services, 64 pairs). Encodes the terminal ledger: 51 COVERED, 13 OOS.

def pairCoverage : TrustPair → CoverageVerdict

allPairs — ⚪ definition

def · source

The set of all 64 pairs in the taxonomy.

def allPairs : List TrustPair

catalogCovers — ⚪ definition

def · source

Whether a set of pairs is fully covered by the catalog.

def catalogCovers (pairs : List TrustPair) : Prop

— ⚪ definition

instance · source

instance (pairs : List TrustPair) : Decidable (catalogCovers pairs)

Seclib.CrossAccount.Grant

GrantConditions — ⚪ definition

structure · source

Conditions that constrain a cross-account trust grant. Go source: CTL.IAM.TRUST.EXTERNALID.001, CTL.IAM.POLICY.CONDITION.ORGID.001.

structure GrantConditions where

TrustGrant — ⚪ definition

structure · source

A concrete trust grant with conditions. Go source: individual control YAML unsafe_predicate fields.

structure TrustGrant where

wildcardGrant — ⚪ definition

def · source

Target is wildcard (* or broad). Any principal from any account. Go source: CTL.IAM.TRUST.EXTERNAL.CLOUD.001, CTL.OPENSEARCH.POLICY.CROSSACCOUNT.WILDCARD.001.

def wildcardGrant (g : TrustGrant) : Bool

conditionedGrant — ⚪ definition

def · source

Grant has conditions that meaningfully constrain access. Go source: CTL.IAM.TRUST.EXTERNALID.001 + CTL.IAM.POLICY.CONDITION.ORGID.001.

def conditionedGrant (g : TrustGrant) : Bool

scopedGrant — ⚪ definition

def · source

Grant target is a specific account (not wildcard). Go source: non-wildcard principal patterns in control predicates.

def scopedGrant (g : TrustGrant) : Bool

Seclib.CrossAccount.Invariants

noWildcardTrust — ⚪ definition

def · source

No wildcard trust grant exists for a service. Go source: CTL..POLICY.CROSSACCOUNT.WILDCARD., CTL.IAM.TRUST.EXTERNAL.CLOUD.001. Topology-level: no edge from any account grants access to * for the service.

def noWildcardTrust (t : Topology) (svc : Service) : Prop

orgBounded — ⚪ definition

def · source

All trust grants for a service stay within an org boundary. Go source: CTL.IAM.TRUST.ORGBOUNDARY.001, CTL.IAM.POLICY.CONDITION.ORGID.001. Simplified: all target accounts share a prefix with the source.

def orgBounded (t : Topology) (orgPrefix : String) : Prop

externalIdEnforced — ⚪ definition

def · source

Every cross-account AssumeRole trust policy requires ExternalId. Go source: CTL.IAM.TRUST.EXTERNALID.001, CTL.IAM.TRUST.EXTERNALID.SCOPED.001.

def externalIdEnforced (grants : List TrustGrant) : Prop

noExfiltration — ⚪ definition

def · source

No outbound-flow grant exists for a service (no data exfiltration path). Go source: CTL.EC2.EBS.CROSSACCOUNT.SNAPSHOT.* (attribute-share outbound controls).

def noExfiltration (t : Topology) (svc : Service) : Prop

Seclib.CrossAccount.Monotonicity

coverage_monotone — 🟢 proved

theorem · source

Monotonicity and soundness proofs for cross-account trust model.

theorem coverage_monotone (p : TrustPair)
    (h : pairCoverage p = .covered) :

wildcard_complete — 🟢 proved

theorem · source

theorem wildcard_complete (g : TrustGrant)
    (hTarget : g.target = "*")
    (hNoExtId : g.conditions.hasExternalId = false)
    (hNoOrg : g.conditions.hasOrgCondition = false) :
    wildcardGrant g = true

externalId_blocks_wildcard — 🟢 proved

theorem · source

theorem externalId_blocks_wildcard (g : TrustGrant)
    (h : g.conditions.hasExternalId = true) :
    wildcardGrant g = false

orgCondition_blocks_wildcard — 🟢 proved

theorem · source

theorem orgCondition_blocks_wildcard (g : TrustGrant)
    (h : g.conditions.hasOrgCondition = true) :
    wildcardGrant g = false

condition_blocks_wildcard — 🟢 proved

theorem · source

theorem condition_blocks_wildcard (g : TrustGrant)
    (hExtId : g.conditions.hasExternalId = true)
    (_hOrg : g.conditions.hasOrgCondition = true) :
    wildcardGrant g = false

chain_step_necessary — 🟢 proved

theorem · source

Removing a failing step from a chain at threshold breaks it.

theorem chain_step_necessary (chain : ChainDef) (failing : List ControlId)
    (step : ControlId)
    (hMember : step ∈ chain.controls)
    (hFailing : step ∈ failing)
    (hAtThreshold : failingCount chain failing = chain.threshold) :
    ¬ chainFires chain (failing.filter (· ≠ step))

partition_complete — 🟢 proved

theorem · source

theorem partition_complete :

Seclib.CrossAccount.Topology

TrustPair — ⚪ definition

structure · source

A service × mechanism × direction triple — one row in the taxonomy. Go source: cross-account-v1.yaml check id.

structure TrustPair where

TrustEdge — ⚪ definition

structure · source

A directed trust edge between two accounts for a specific service. Go source: individual control YAML predicates.

structure TrustEdge where

Topology — ⚪ definition

structure · source

Cross-account trust topology: the graph of inter-account trust grants.

structure Topology where

Topology.hasEdge — ⚪ definition

def · source

Whether a direct trust edge exists between accounts for a service.

def Topology.hasEdge (t : Topology) (src dst : AccountId) (svc : Service) : Bool

Topology.servicesFrom — ⚪ definition

def · source

All services with edges from a given account.

def Topology.servicesFrom (t : Topology) (acct : AccountId) : List Service

Topology.targetsFor — ⚪ definition

def · source

All accounts a service grants access to from a given account.

def Topology.targetsFor (t : Topology) (acct : AccountId) (svc : Service) : List AccountId

Seclib.CrossAccount.Vertical

kmsGrantChain — ⚪ definition

def · source

KMS grant chain: external-account grantee + no constraint = exploitable. Go source: CTL.KMS.GRANT.EXTERNAL.001. Fixture: internal/fixtures/labs/xa-kms-grants/.

def kmsGrantChain : ChainDef where

s3APChain — ⚪ definition

def · source

S3 access point chain: AP policy grants external + bucket allows AP. Go source: CTL.S3.AP.POLICY.EXTERNAL.001, CTL.S3.AP.CROSSACCOUNT.BUCKET.001. Fixture: internal/fixtures/labs/xa-s3-access-points/.

def s3APChain : ChainDef where

eksAccessChain — ⚪ definition

def · source

EKS access entry chain: external admin + pod identity external. Go source: CTL.EKS.ACCESSENTRY.EXTERNAL.ADMIN.001, CTL.EKS.PODIDENTITY.EXTERNAL.001. Fixture: internal/fixtures/labs/xa-eks-access-entries/.

def eksAccessChain : ChainDef where

oidcClaimChain — ⚪ definition

def · source

OIDC claim scoping chain: unscoped or org-wildcard claim. Go source: CTL.IAM.TRUST.OIDC.001 + CTL.IAM.TRUST.OIDC.ORGWILDCARD.001. Fixture: internal/fixtures/labs/xa-oidc-claim-scoping/. Uses supply_chain_ingress chain shape.

def oidcClaimChain : ChainDef where

stepNecessary — ⚪ definition

def · source

Step-level decomposition: fixing any one step of a chain breaks it. This is the abstract property — proved in Monotonicity.

def stepNecessary (chain : ChainDef) (failing : List ControlId) (step : ControlId) : Prop

Seclib.Domain.PolicySem

PolicySem — ⚪ definition

structure · source

Vendor-neutral policy evaluation: deny-overrides semantics. All definitions and theorems are parameterized over a PolicySem instance. No cloud provider, ARN, IAM, or vendor-specific concept appears in this module.

structure PolicySem (S R Ctx : Type) where

denyOverrides — ⚪ definition

def · source

def denyOverrides (sem : PolicySem S R Ctx) (stmts : List S) (req : R) (ctx : Ctx) : Bool

removeAllow — 🟢 proved

theorem · source

removeAllow: removing an Allow statement narrows access

theorem removeAllow (sem : PolicySem S R Ctx) (stmts : List S) (i : Nat)
    (hi : i < stmts.length) (heff : sem.effect (stmts[i]'hi) = .allow)
    (req : R) (ctx : Ctx)
    (h : denyOverrides sem (stmts.eraseIdx i) req ctx = true) :
    denyOverrides sem stmts req ctx = true

narrow_narrows — 🟢 proved

theorem · source

narrow_narrows: replacing a statement with one that matches fewer requests narrows access. Unifies narrowActions and narrowResources.

theorem narrow_narrows (sem : PolicySem S R Ctx)
    (stmts : List S) (i : Nat) (hi : i < stmts.length)
    (heff : sem.effect (stmts[i]) = .allow)
    (new_s : S) (hnew_eff : sem.effect new_s = .allow)
    (hnew_cond : ∀ c, sem.condEval c new_s = sem.condEval c (stmts[i]))
    (hmono : ∀ req, sem.sat new_s req = true → sem.sat (stmts[i]) req = true)
    (req : R) (ctx : Ctx)
    (h : denyOverrides sem (stmts.set i new_s) req ctx = true) :
    denyOverrides sem stmts req ctx = true

filterMap_narrows — 🟢 proved

theorem · source

theorem filterMap_narrows (sem : PolicySem S R Ctx)
    (stmts : List S) (f : S → Option S) (req : R) (ctx : Ctx)
    (h_deny : ∀ s ∈ stmts, sem.effect s = .deny → f s = some s)
    (h_mono : ∀ s s', s ∈ stmts → f s = some s' → sem.effect s = .allow →

nocontext_conservative — 🟢 proved

theorem · source

nocontext_conservative: if allowed under any context, allowed under noCtx

theorem nocontext_conservative (sem : PolicySem S R Ctx)
    (stmts : List S) (req : R) (ctx : Ctx)
    (h : denyOverrides sem stmts req ctx = true) :
    denyOverrides sem stmts req sem.noCtx = true

grants_complete — 🟢 proved

theorem · source

grants_complete: if allowed, an Allow statement exists that matches

theorem grants_complete (sem : PolicySem S R Ctx)
    (stmts : List S) (req : R) (ctx : Ctx)
    (h : denyOverrides sem stmts req ctx = true) :

Seclib.Ghost

GhostProperty — ⚪ definition

structure · source

structure GhostProperty where

[BEq — ⚪ definition

instance · source

instance [BEq α] : BEq (RefStatus α) where

FindingSeverity.toNat — ⚪ definition

def · source

def FindingSeverity.toNat : FindingSeverity → Nat
  | .safe => 0
  | .low => 1
  | .medium => 2
  | .high => 3
  | .critical => 4

— ⚪ definition

instance · source

instance : LE FindingSeverity where

— ⚪ definition

instance · source

instance (a b : FindingSeverity) : Decidable (a ≤ b)

— ⚪ definition

instance · source

instance : Ord FindingSeverity where

ghostConservative — ⚪ definition

def · source

Conservativeness — the central proof obligation A ghost finding is conservative when for every possible concrete instantiation of the ghost referent, the finding under the ghost assumption is at least as severe as the finding with full information. Any control that produces a finding about a ghost must prove this.

def ghostConservative
    (control : α → FindingSeverity)
    (_assume : GhostAssumption)
    (ghostFinding : FindingSeverity) : Prop

ghostAssumptionsCompatible — ⚪ definition

def · source

def ghostAssumptionsCompatible (a b : GhostAssumption) : Bool

RefStatus.isResolved — ⚪ definition

def · source

Helpers

def RefStatus.isResolved : RefStatus α → Bool
  | .resolved _ => true
  | .ghost _ _ => false

RefStatus.isGhost — ⚪ definition

def · source

def RefStatus.isGhost : RefStatus α → Bool
  | .resolved _ => false
  | .ghost _ _ => true

ObsScope — ⚪ definition

structure · source

Observation scope tracking ghost references and their assumptions. Consistency: no contradictory assumptions on the same reference.

structure ObsScope where

ObsScope.empty — ⚪ definition

def · source

def ObsScope.empty : ObsScope

DischargesGhosts — ⚪ definition

structure · source

Scope B discharges A’s ghost assumptions by providing resolved data.

structure DischargesGhosts (resolving : ObsScope) (assumptions : List (String × GhostAssumption)) : Prop where

ghost_contradiction_detected — 🟢 proved

theorem · source

Two controls with incompatible ghost assumptions on the same reference cannot coexist in a consistent scope.

theorem ghost_contradiction_detected
    {scope : ObsScope} {refId : String} {G₁ G₂ : GhostAssumption}
    (h1 : (refId, G₁) ∈ scope.ghostRefs)
    (h2 : (refId, G₂) ∈ scope.ghostRefs)
    (hContra : ghostAssumptionsCompatible G₁ G₂ = false) :
    False

ghost_composition — 🟢 proved

theorem · source

When scope B resolves a ghost from scope A, the conservative finding from A is still valid: for any concrete instantiation, the ghost finding is at least as severe.

theorem ghost_composition
    {α : Type} {scopeA scopeB : ObsScope}
    {control : α → FindingSeverity}
    {ga : GhostAssumption} {ghostFinding : FindingSeverity}
    {refId : String}
    (_hGhostInA : (refId, ga) ∈ scopeA.ghostRefs)
    (_hConservative : ghostConservative control ga ghostFinding)
    (_hDischarge : DischargesGhosts scopeB [(refId, ga)]) :

Seclib.Ghost.Datalog

ghostPropertyToDatalog — ⚪ definition

def · source

def ghostPropertyToDatalog (id : String) (p : GhostProperty) : String

ghostAssumptionToDatalog — ⚪ definition

def · source

def ghostAssumptionToDatalog (id : String) (assume : GhostAssumption) : String

refStatusToDatalog — ⚪ definition

def · source

def refStatusToDatalog [ToString α] (id : String) (ref : RefStatus α) : String

Seclib.Ghost.SMT

ghostPropertyToSMT — ⚪ definition

def · source

def ghostPropertyToSMT (id : String) (p : GhostProperty) : String

ghostAssumptionToSMT — ⚪ definition

def · source

def ghostAssumptionToSMT (id : String) (assume : GhostAssumption) : String

refStatusToSMT — ⚪ definition

def · source

def refStatusToSMT [ToString α] (id : String) (ref : RefStatus α) : String

Seclib.IAM.Barrier

barrierBlocks — ⚪ definition

def · source

Whether a barrier blocks the escalation path from principal to target action. Go source: fixture partial semantics.

def barrierBlocks (g : IAMGraph) (principalId targetAction : String) : Barrier → Bool
  | .mfa =>

pathBlocked — ⚪ definition

def · source

An escalation path is blocked if any barrier applies. Go source: partial fixture semantics — partial fires atomic but not chain.

def pathBlocked (g : IAMGraph) (principalId targetAction : String) (barrier : Barrier) : Prop

partialFinding — ⚪ definition

def · source

A partial finding: the escalation path exists but a barrier blocks it. Distance is ≥ 1 (one-away, not exploitable). Go source: fixture partial scenarios.

def partialFinding (g : IAMGraph) (principalId targetAction : String) (barrier : Barrier) : Prop

Seclib.IAM.Bridge

BridgeRecord — ⚪ definition

structure · source

A bridge test record.

structure BridgeRecord where

— ⚪ definition

instance · source

instance : FromJson BridgeRecord where

parseScenario — ⚪ definition

def · source

Parse an escalation scenario name to the enum.

def parseScenario : String → Option EscalationScenario
  | "addUserToGroup" => some .addUserToGroup
  | "attachRolePolicy" => some .attachRolePolicy
  | "attachGroupPolicy" => some .attachGroupPolicy
  | "attachUserPolicy" => some .attachUserPolicy
  | "putGroupPolicy" => some .putGroupPolicy
  | "putRolePolicy" => some .putRolePolicy
  | "putUserPolicy" => some .putUserPolicy
  | "createLoginProfile" => some .createLoginProfile
  | "updateLoginProfile" => some .updateLoginProfile
  | "createPolicyVersion" => some .createPolicyVersion
  | _ => none

BridgeRecord.toGraph — ⚪ definition

def · source

Build an IAMGraph from a bridge record’s edges, actions, and conditions.

def BridgeRecord.toGraph (r : BridgeRecord) : IAMGraph where

checkRecord — ⚪ definition

def · source

Check one bridge record: compare actual vs expected distance.

def checkRecord (r : BridgeRecord) : Bool × String

parseJsonl — ⚪ definition

def · source

Parse JSONL into bridge records.

def parseJsonl (content : String) : List BridgeRecord

bridgeCheck — ⚪ definition

def · source

Check all records via IO, printing results.

def bridgeCheck (path : System.FilePath) : IO UInt32

Seclib.IAM.BridgeMain

main — ⚪ definition

def · source

def main (args : List String) : IO UInt32

Seclib.IAM.Disclosure

allExcludedIAMLayers — ⚪ definition

def · source

All excluded layers.

def allExcludedIAMLayers : List ExcludedIAMLayer

AbstractReachabilityOnly — ⚪ definition

structure · source

The formalization is sound over the abstract reachability model. Type-level marker — proofs about IAM reachability carry these assumptions.

structure AbstractReachabilityOnly where

Seclib.IAM.Distance

EscalationScenario.primaryAction — ⚪ definition

def · source

The primary IAM action for each escalation scenario. Go source: escalation control YAML (unsafe_predicate fields).

def EscalationScenario.primaryAction : EscalationScenario → String
  | .addUserToGroup => "iam:AddUserToGroup"
  | .attachRolePolicy => "iam:AttachRolePolicy"
  | .attachGroupPolicy => "iam:AttachGroupPolicy"
  | .attachUserPolicy => "iam:AttachUserPolicy"
  | .putGroupPolicy => "iam:PutGroupPolicy"
  | .putRolePolicy => "iam:PutRolePolicy"
  | .putUserPolicy => "iam:PutUserPolicy"
  | .createLoginProfile => "iam:CreateLoginProfile"
  | .updateLoginProfile => "iam:UpdateLoginProfile"
  | .createPolicyVersion => "iam:CreatePolicyVersion"

escalationDistance — ⚪ definition

def · source

Escalation distance: 0 = exploitable, ≥ 1 = one or more barriers. Reuses Compose’s chainDistance concept. Go source: finding_risk.go:11-24.

def escalationDistance (g : IAMGraph) (principalId : String) (scenario : EscalationScenario) : Nat

classifyEscalation — ⚪ definition

def · source

Classify escalation exploitability using Compose’s Exploitability type. Go source: finding_risk.go:11-24.

def classifyEscalation (g : IAMGraph) (principalId : String) (scenario : EscalationScenario) : Exploitability

Seclib.IAM.Graph

TrustCondition — ⚪ definition

structure · source

A trust condition on a role’s trust policy that gates assumption. Soufflé source: schema.dl:138 (has_trust_condition).

structure TrustCondition where

ExternalTrust — ⚪ definition

structure · source

An external trust edge from a federation source to an IAM role. Soufflé source: federation.dl:59-65 (external_reach).

structure ExternalTrust where

IAMGraph — ⚪ definition

structure · source

The IAM privilege graph. Fields correspond to Soufflé input relations. Soufflé source: schema.dl (input relations), rules.dl (join structure).

structure IAMGraph where

IAMGraph.hasEdge — ⚪ definition

def · source

Whether a direct assumption edge exists. Soufflé source: rules.dl:64 (base case of transitive_assume).

def IAMGraph.hasEdge (g : IAMGraph) (src dst : String) : Bool

IAMGraph.hasCondition — ⚪ definition

def · source

Whether a role has a trust condition gate. Soufflé source: schema.dl:138 / rules.dl:81.

def IAMGraph.hasCondition (g : IAMGraph) (roleId : String) : Bool

IAMGraph.directActions — ⚪ definition

def · source

Actions directly held by a principal. Soufflé source: schema.dl:67 (has_action).

def IAMGraph.directActions (g : IAMGraph) (principalId : String) : List String

IAMGraph.directResources — ⚪ definition

def · source

Resources directly held by a principal. Soufflé source: schema.dl:69 (has_resource).

def IAMGraph.directResources (g : IAMGraph) (principalId : String) : List String

IAMGraph.directDenyActions — ⚪ definition

def · source

Deny actions directly held by a principal. Soufflé source: schema.dl:72 (has_deny_action).

def IAMGraph.directDenyActions (g : IAMGraph) (principalId : String) : List String

IAMGraph.permBoundary — ⚪ definition

def · source

Permission boundary actions for a principal. Soufflé source: schema.dl:78 (has_permission_action).

def IAMGraph.permBoundary (g : IAMGraph) (principalId : String) : List String

IAMGraph.hasPermBoundary — ⚪ definition

def · source

Whether a principal has any permission boundary. Go source: CTL.IAM.BOUNDARY.MISSING.001 semantics.

def IAMGraph.hasPermBoundary (g : IAMGraph) (principalId : String) : Bool

IAMGraph.scpDenies — ⚪ definition

def · source

Whether a principal has an SCP deny for an action. Boolean SCP model — known limitation (see Disclosure).

def IAMGraph.scpDenies (g : IAMGraph) (principalId : String) (action : String) : Bool

Seclib.IAM.Monotonicity

priv_transitive — 🟢 proved

theorem · source

If A can reach B and B can reach C, then A can reach C. Soufflé source: rules.dl:61-65 (transitive_assume recursive rule).

theorem priv_transitive (g : IAMGraph) (a b c : String)
    (hab : PrivReachable g a b) (hbc : PrivReachable g b c) :
    PrivReachable g a c

barrier_demotes — 🟢 proved

theorem · source

A blocked escalation path is not distance-0 (not exploitable). Barriers demote exploitable → one-away. Go source: fixture partial semantics.

theorem barrier_demotes (g : IAMGraph) (principalId : String)
    (scenario : EscalationScenario)
    (hPath : g.escalationPath principalId scenario.primaryAction = true)
    (barrier : Barrier)
    (hBlocked : barrierBlocks g principalId scenario.primaryAction barrier = true) :
    escalationDistance g principalId scenario ≥ 1

scp_deny_monotone — 🟢 proved

theorem · source

Adding an SCP deny statement to a graph that has no escalation path cannot create one. SCPs only restrict, never grant. Soufflé source: rules.dl:190-192 (effective_permission = allow AND NOT deny).

theorem scp_deny_monotone (g : IAMGraph) (principalId action : String)
    (stmt : String × String)
    (hNo : g.escalationPath principalId action = false) :

perm_boundary_monotone — 🟢 proved

theorem · source

Adding a permission boundary action to a graph that has no escalation path cannot create one. Go source: CTL.IAM.BOUNDARY controls.

theorem perm_boundary_monotone (g : IAMGraph) (principalId action : String)
    (entry : String × String)
    (hNo : g.escalationPath principalId action = false) :

iam_exploitable_matches_compose — 🟢 proved

theorem · source

An exploitable IAM escalation maps to Compose’s .exploitable classification. Go source: finding_risk.go:11-24 (Exploitability).

theorem iam_exploitable_matches_compose (g : IAMGraph) (principalId : String)
    (scenario : EscalationScenario)
    (h : escalationDistance g principalId scenario = 0) :
    classifyEscalation g principalId scenario = .exploitable

iam_oneaway_matches_compose — 🟢 proved

theorem · source

A one-away IAM escalation maps to Compose’s .oneAway classification.

theorem iam_oneaway_matches_compose (g : IAMGraph) (principalId : String)
    (scenario : EscalationScenario)
    (h : escalationDistance g principalId scenario = 1) :
    classifyEscalation g principalId scenario = .oneAway

Seclib.IAM.Principal

Principal — ⚪ definition

structure · source

An IAM principal. Soufflé source: schema.dl:57 (has_type → principal_type).

structure Principal where

Seclib.IAM.Reachability

IAMGraph.transitiveAssume — ⚪ definition

def · source

Bounded transitive assumption closure. Computes the fixpoint of can_assume up to fuel steps (prevents nontermination in Lean). Soufflé source: rules.dl:61-65.

def IAMGraph.transitiveAssume (g : IAMGraph) (principalId : String) (fuel : Nat

IAMGraph.unconditionalAssume — ⚪ definition

def · source

Bounded unconditional assumption closure: only edges where the target role has no trust condition gate (MFA, ExternalId, etc.). Soufflé source: rules.dl:78-82.

def IAMGraph.unconditionalAssume (g : IAMGraph) (principalId : String) (fuel : Nat

IAMGraph.reachableActions — ⚪ definition

def · source

Actions reachable by a principal (direct + via assumption chains). Soufflé source: rules.dl:93-97 (reachable_action).

def IAMGraph.reachableActions (g : IAMGraph) (principalId : String) : List String

IAMGraph.reachableResources — ⚪ definition

def · source

Resources reachable by a principal. Soufflé source: rules.dl:99-103 (reachable_resource).

def IAMGraph.reachableResources (g : IAMGraph) (principalId : String) : List String

IAMGraph.reachableDenyActions — ⚪ definition

def · source

Deny actions reachable by a principal. Soufflé source: rules.dl:109-113 (reachable_deny_action).

def IAMGraph.reachableDenyActions (g : IAMGraph) (principalId : String) : List String

IAMGraph.effectivePermission — ⚪ definition

def · source

Effective permission: allow minus deny. Soufflé source: rules.dl:190-192 (effective_permission). Simplified: omits scope-aware joins (those eliminate cross-account Cartesian false positives but don’t affect the formal properties).

def IAMGraph.effectivePermission (g : IAMGraph) (principalId : String) (action resource : String) : Bool

IAMGraph.effectiveAccess — ⚪ definition

def · source

Whether principal can perform action on resource (abstract ARN matching). Soufflé source: rules.dl:245-250 (effective_access). Uses exact string match — real Soufflé uses arn_matches with wildcards.

def IAMGraph.effectiveAccess (g : IAMGraph) (principalId resource action : String) : Bool

IAMGraph.escalationPath — ⚪ definition

def · source

Escalation path: principal can reach actions it doesn’t directly hold, via assumption chains. This is the core IAM privilege escalation concept. Soufflé source: transitive_assume + reachable_action composition.

def IAMGraph.escalationPath (g : IAMGraph) (principalId : String) (targetAction : String) : Bool

EscalationPath — ⚪ definition

def · source

Escalation path as a Prop. “Principal can reach an action it doesn’t directly hold.”

def EscalationPath (g : IAMGraph) (principalId targetAction : String) : Prop

Seclib.IAM.TrustBoundary

IAMGraph.crossAccountTrust — ⚪ definition

def · source

Cross-account trust: principal in one account can assume a role in another account. Soufflé source: schema.dl:98 (cross_account_assumes).

def IAMGraph.crossAccountTrust (g : IAMGraph) (principalId roleId : String) : Prop

IAMGraph.wildcardPrincipal — ⚪ definition

def · source

Whether a trust policy has a wildcard principal (*). Go source: CTL.IAM.TRUST.WILDCARD.001 semantics.

def IAMGraph.wildcardPrincipal (g : IAMGraph) (roleId : String) : Bool

IAMGraph.externalIdRequired — ⚪ definition

def · source

Whether a role requires ExternalId in its trust policy. Soufflé source: schema.dl:138 (has_trust_condition, condition_key contains “external”). Go source: CTL.IAM.TRUST.CONFUSEDDEPUTY.001 semantics.

def IAMGraph.externalIdRequired (g : IAMGraph) (roleId : String) : Bool

IAMGraph.orgBoundaryRespected — ⚪ definition

def · source

Whether a role’s trust policy respects organization boundary. Go source: CTL.IAM.TRUST.ORGBOUNDARY.001 semantics. True if all trusting principals are in the same org (modeled as account prefix match — simplified from real aws:PrincipalOrgID).

def IAMGraph.orgBoundaryRespected (g : IAMGraph) (roleId orgPrefix : String) : Bool

IAMGraph.externalReaches — ⚪ definition

def · source

External reachability: can an external source reach a resource through the IAM graph? Soufflé source: federation.dl:90-110 (external_transitive_reach).

def IAMGraph.externalReaches (g : IAMGraph) (source : String) (resource : String) : Bool

IAMGraph.unrestrictedExternalReach — ⚪ definition

def · source

Unrestricted external reach: external source reaches resource via at least one unrestricted hop. Soufflé source: federation.dl:120-129 (unrestricted_external_reach).

def IAMGraph.unrestrictedExternalReach (g : IAMGraph) (source resource : String) : Bool

Seclib.Network.Bridge

BridgeRecord — ⚪ definition

structure · source

A bridge record from the Go test suite.

structure BridgeRecord where

— ⚪ definition

instance · source

instance : FromJson BridgeRecord where

parseVerdict — ⚪ definition

def · source

Parse a verdict string to our Verdict type.

def parseVerdict (s : String) : Option Verdict

checkRecord — ⚪ definition

def · source

Check structural consistency of a bridge record.

def checkRecord (r : BridgeRecord) : Option String

checkAll — ⚪ definition

def · source

Check all bridge records.

def checkAll (records : List BridgeRecord) : IO UInt32

parseJsonl — ⚪ definition

def · source

Parse JSONL into bridge records.

def parseJsonl (content : String) : List BridgeRecord

bridgeCheck — ⚪ definition

def · source

Main entry point.

def bridgeCheck (path : System.FilePath) : IO UInt32

Seclib.Network.BridgeMain

main — ⚪ definition

def · source

CLI wrapper for the network bridge checker. Go source: bridge.jsonl produced from Go test expectations.

def main (args : List String) : IO UInt32

Seclib.Network.Disclosure

allExcludedLayers — ⚪ definition

def · source

All excluded layers. Go source: proof.go:468-472

def allExcludedLayers : List ExcludedLayer

SgIngressOnly — ⚪ definition

structure · source

UNSAT is sound over the SG-ingress-only model. Type-level marker. Go source: proof.go:468-472 (sound-over-SG-ingress disclaimer)

structure SgIngressOnly where

Seclib.Network.Graph

Host — ⚪ definition

structure · source

Host classification tags. Go source: graph.go:10-24

structure Host where

Host.isProduction — ⚪ definition

def · source

Go source: graph.go:20

def Host.isProduction (h : Host) : Bool

Host.isBastion — ⚪ definition

def · source

Go source: graph.go:21

def Host.isBastion (h : Host) : Bool

Host.isDevelopment — ⚪ definition

def · source

Go source: graph.go:22

def Host.isDevelopment (h : Host) : Bool

Host.isDatabaseTier — ⚪ definition

def · source

Go source: graph.go:23

def Host.isDatabaseTier (h : Host) : Bool

Host.isIsolated — ⚪ definition

def · source

Go source: graph.go:24

def Host.isIsolated (h : Host) : Bool

SGRule — ⚪ definition

structure · source

Go source: graph.go:27-33

structure SGRule where

VPCPeering — ⚪ definition

structure · source

Go source: graph.go:36-40

structure VPCPeering where

Subnet — ⚪ definition

structure · source

Go source: graph.go:43-48

structure Subnet where

Subnet.isPrivate — ⚪ definition

def · source

Go source: graph.go:51

def Subnet.isPrivate (s : Subnet) : Bool

Route — ⚪ definition

structure · source

Go source: graph.go:54-58

structure Route where

classifyRoute — ⚪ definition

def · source

Go source: proof.go:439-456

def classifyRoute (targetType : String) : RouteClass

broadCIDRs — ⚪ definition

def · source

RFC1918 + internet CIDRs treated as broad. Go source: reachability.go:17-23

def broadCIDRs : List String

NetGraph — ⚪ definition

structure · source

Go source: graph.go:68-76

structure NetGraph where

NetGraph.productionHosts — ⚪ definition

def · source

Go source: graph.go:198-206

def NetGraph.productionHosts (g : NetGraph) : List Host

NetGraph.bastionHosts — ⚪ definition

def · source

Go source: graph.go:209-217

def NetGraph.bastionHosts (g : NetGraph) : List Host

NetGraph.developmentHosts — ⚪ definition

def · source

Go source: graph.go:220-228

def NetGraph.developmentHosts (g : NetGraph) : List Host

NetGraph.databaseHosts — ⚪ definition

def · source

Go source: graph.go:231-239

def NetGraph.databaseHosts (g : NetGraph) : List Host

NetGraph.isolatedHosts — ⚪ definition

def · source

Go source: graph.go:242-250

def NetGraph.isolatedHosts (g : NetGraph) : List Host

NetGraph.privateSubnets — ⚪ definition

def · source

Go source: graph.go:253-261

def NetGraph.privateSubnets (g : NetGraph) : List Subnet

NetGraph.rulesFor — ⚪ definition

def · source

Look up SG rules by SG ID. Go source: graph.go:68-76 (Graph.SGRules map access)

def NetGraph.rulesFor (g : NetGraph) (sgId : String) : List SGRule

NetGraph.routesFor — ⚪ definition

def · source

Look up routes by route table ID. Go source: graph.go:68-76 (Graph.Routes map access)

def NetGraph.routesFor (g : NetGraph) (rtId : String) : List Route

NetGraph.findSubnet — ⚪ definition

def · source

Find subnet by ID. Go source: graph.go:68-76 (Graph.Subnets map access)

def NetGraph.findSubnet (g : NetGraph) (subnetId : String) : Option Subnet

Seclib.Network.Monotonicity

List.any_of_any_append_left — 🟢 proved

theorem · source

If any holds on a list, it holds on a superset (append). Go source: reachability.go — CanReach uses List.any; this is the abstract monotonicity principle underlying edge_monotone.

theorem List.any_of_any_append_left {l₁ l₂ : List α} {p : α → Bool}
    (h : l₁.any p = true) : (l₁ ++ l₂).any p = true

rule_check_mono — 🟢 proved

theorem · source

Abstract monotonicity: if a predicate holds when checking any over a set of rules, it still holds over a superset. Go source: reachability.go:36-51 — core of edge_monotone.

theorem rule_check_mono {rules extra : List SGRule}
    {check : SGRule → Bool}
    (h : rules.any check = true) :
    (rules ++ extra).any check = true

canReach_mono_abstract — 🟢 proved

theorem · source

If membership is preserved, any is preserved. Go source: reachability.go:36-51 The key invariant: adding an SG rule to a graph that already allows reachability cannot remove that reachability.

theorem canReach_mono_abstract
    (sgRules₁ sgRules₂ : String → List SGRule)
    (h_super : ∀ sg, ∀ r, r ∈ sgRules₁ sg → r ∈ sgRules₂ sg)
    (sgIds : List String) (check : SGRule → Bool)
    (h : sgIds.any (fun sg => (sgRules₁ sg).any check) = true) :
    sgIds.any (fun sg => (sgRules₂ sg).any check) = true

isolation_sound — 🟢 proved

theorem · source

If a host is tagged isolated and no host in the graph can reach it on any port (UNSAT), then canReachAny is false for all sources. Go source: graph.go:24 (IsIsolated), proof.go:588 (UNSAT)

theorem isolation_sound (g : NetGraph) (dst : Host)
    (_hIso : dst.isIsolated = true)
    (hUnsat : ∀ src, src ∈ g.hosts → g.canReachAny src dst = false) :
    ∀ src, src ∈ g.hosts → ¬ ReachableAny g src dst

hasGatedEgressPath — ⚪ definition

def · source

A graph has a gated egress path if an isolated host can reach a host whose subnet routes to a gated target. Go source: proof.go:560-584 (EVIDENCE_GATED condition)

def hasGatedEgressPath (g : NetGraph) : Prop

gated_not_unsat — 🟢 proved

theorem · source

If a gated egress path exists and no sink path exists, transitiveEgressVerdict returns evidenceGated, never unsat. Go source: proof.go:465 verdict precedence.

theorem gated_not_unsat (g : NetGraph)
    (hGated : g.isolatedHosts.any (fun iso =>

unsat_no_gated — 🟢 proved

theorem · source

Contrapositive: if verdict is UNSAT, no gated path exists. Go source: proof.go:465 (verdict precedence).

theorem unsat_no_gated (g : NetGraph)
    (h : transitiveEgressVerdict g = .unsat) :

transitiveEgress_decomposition — 🟢 proved

theorem · source

Transitive egress decomposes into two reachability queries: (1) isolated → service, (2) service has egress route. This is definitionally true from transitiveEgressSat. Go source: proof.go:532-557 (SAT check: canReachAnyPort then route classification).

theorem transitiveEgress_decomposition (g : NetGraph) :

Seclib.Network.Property

bastionSsh — ⚪ definition

def · source

All SSH paths to production traverse a bastion host. Go source: proof.go:53-118

def bastionSsh (g : NetGraph) (port : Nat) : Prop

prodDevIsolation — ⚪ definition

def · source

No network path between production and development environments. Go source: proof.go:167-217

def prodDevIsolation (g : NetGraph) : Prop

databaseIsolation — ⚪ definition

def · source

No host outside the database VPC can reach a database host. Go source: proof.go:222-290

def databaseIsolation (g : NetGraph) : Prop

transitiveSsh — ⚪ definition

def · source

No non-bastion relay can bridge SSH to production (two-hop). Go source: proof.go:295-374

def transitiveSsh (g : NetGraph) (port : Nat) : Prop

firewallMandatory — ⚪ definition

def · source

All private subnets route internet traffic through a firewall endpoint. Go source: proof.go:379-425

def firewallMandatory (g : NetGraph) : Prop

hostEgressClass — ⚪ definition

def · source

Egress classification for a host: whether its subnet has a default route to a sink, gated target, or neither. Go source: proof.go:490-522 (egress candidate classification)

def hostEgressClass (g : NetGraph) (h : Host) : Option RouteClass

transitiveEgressSat — ⚪ definition

def · source

Transitive egress SAT condition: isolated host reaches a sink. Go source: proof.go:532-557

def transitiveEgressSat (g : NetGraph) : Prop

transitiveEgressGated — ⚪ definition

def · source

Transitive egress EVIDENCE_GATED condition: isolated host reaches a gated target. Go source: proof.go:560-584

def transitiveEgressGated (g : NetGraph) : Prop

transitiveEgressVerdict — ⚪ definition

def · source

Full transitive-egress verdict with precedence: SAT > GATED > UNSAT. Go source: proof.go:465

def transitiveEgressVerdict (g : NetGraph) : Verdict

Seclib.Network.Reachability

NetGraph.vpcsConnected — ⚪ definition

def · source

Whether two VPCs are connected via peering or transit gateway. Go source: reachability.go:80-88, graph.go:323-343

def NetGraph.vpcsConnected (g : NetGraph) (vpc1 vpc2 : String) : Bool

cidrCovers — ⚪ definition

def · source

Whether a CIDR covers a host (same-VPC + broad CIDR). Go source: reachability.go:73-78

def cidrCovers (cidr : String) (src dst : Host) : Bool

ruleAllows — ⚪ definition

def · source

Check if a single ingress rule allows src to reach dst on a given port. Go source: reachability.go:37-50 (inner loop)

def ruleAllows (rule : SGRule) (src dst : Host) (port : Nat) : Bool

NetGraph.canReachSameVpc — ⚪ definition

def · source

Same-VPC reachability via SG ingress rules on a specific port. Go source: reachability.go:36-51

def NetGraph.canReachSameVpc (g : NetGraph) (src dst : Host) (port : Nat) : Bool

NetGraph.canReachCrossVpc — ⚪ definition

def · source

Cross-VPC reachability: peered/TGW-connected VPCs with broad CIDR ingress. Go source: reachability.go:54-68

def NetGraph.canReachCrossVpc (g : NetGraph) (src dst : Host) (port : Nat) : Bool

NetGraph.canReach — ⚪ definition

def · source

Full reachability: same-VPC or cross-VPC. Go source: reachability.go:26-71

def NetGraph.canReach (g : NetGraph) (src dst : Host) (port : Nat) : Bool

NetGraph.canReachAny — ⚪ definition

def · source

Any-port reachability: returns whether src can reach dst on any port. Go source: reachability.go:138-182

def NetGraph.canReachAny (g : NetGraph) (src dst : Host) : Bool

NetGraph.hasExternalIngress — ⚪ definition

def · source

Whether dst has external SSH ingress (0.0.0.0/0 or ::/0). Go source: proof.go:120-142

def NetGraph.hasExternalIngress (g : NetGraph) (dst : Host) (port : Nat) : Bool

Reachable — ⚪ definition

def · source

Reachability as a Prop (for proofs). Go source: reachability.go:26-71 (CanReach, lifted to Prop)

def Reachable (g : NetGraph) (src dst : Host) (port : Nat) : Prop

— ⚪ definition

instance · source

instance (g : NetGraph) (src dst : Host) (port : Nat) :

ReachableAny — ⚪ definition

def · source

Any-port reachability as a Prop. Go source: reachability.go:138-182 (canReachAnyPort, lifted to Prop)

def ReachableAny (g : NetGraph) (src dst : Host) : Prop

Seclib.Network.Verdict

Verdict.rank — ⚪ definition

def · source

Verdict severity rank (lower = worse). Go source: proof.go:465 “SAT > EVIDENCE_GATED > UNSAT”

def Verdict.rank : Verdict → Nat
  | .sat => 0
  | .evidenceGated => 1
  | .unsat => 2

Counterexample — ⚪ definition

structure · source

Counterexample witness for a SAT or EVIDENCE_GATED verdict. Go source: proof.go:24-33

structure Counterexample where

ProofResult — ⚪ definition

structure · source

A proof result pairs a verdict with an optional counterexample. Go source: proof.go:11-21

structure ProofResult where

Seclib.Prim

— ⚪ definition

instance · source

instance : ToString Tri where

Seclib.Prim.Context

Request — ⚪ definition

structure · source

Vendor-neutral authorization request and evaluation context. No cloud provider noun appears in this module.

structure Request where

CondContext — ⚪ definition

structure · source

structure CondContext where

mkContext — ⚪ definition

def · source

def mkContext (j : Json) : Except String CondContext

CondContext.lookup — ⚪ definition

def · source

def CondContext.lookup (ctx : CondContext) (key : String) : Option Json

Seclib.Prim.Finding

Severity.toString — ⚪ definition

def · source

def Severity.toString : Severity → String
  | .critical => "critical"
  | .high     => "high"
  | .medium   => "medium"
  | .low      => "low"

— ⚪ definition

instance · source

instance : ToString Severity

Evidence — ⚪ definition

structure · source

structure Evidence where

Fix — ⚪ definition

structure · source

structure Fix where

Finding — ⚪ definition

structure · source

structure Finding where

Seclib.Prim.Glob

toLowerStr — ⚪ definition

def · source

Vendor-neutral case folding, glob pattern matching, and string lemmas. No cloud provider noun appears in this module.

def toLowerStr (s : String) : String

matchPatternGo — ⚪ definition

def · source

def matchPatternGo (ps vs : List Char) : Bool

matchPattern — ⚪ definition

def · source

def matchPattern (pattern : String) (value : String) : Bool

ciEq — ⚪ definition

def · source

def ciEq (s₁ s₂ : String) : Bool

ciEq_toLowerStr — 🟢 proved

theorem · source

theorem ciEq_toLowerStr (s s' : String) (h : ciEq s s' = true) :
    toLowerStr s = toLowerStr s'

matchPatternGo_literal_eq — 🟢 proved

theorem · source

theorem matchPatternGo_literal_eq (ps vs : List Char)
    (hno_star : '*' ∉ ps) (hno_q : '?' ∉ ps)
    (h : matchPatternGo ps vs = true) :
    ps = vs

matchPattern_literal_mp — 🟢 proved

theorem · source

theorem matchPattern_literal_mp (p s : String)
    (hno_star : '*' ∉ p.toList) (hno_q : '?' ∉ p.toList)
    (h : matchPattern p s = true) :
    ciEq p s = true

matchPattern_cs_literal_eq — 🟢 proved

theorem · source

theorem matchPattern_cs_literal_eq (p s : String)
    (hno_star : '*' ∉ p.toList) (hno_q : '?' ∉ p.toList)
    (h : matchPattern p s = true) : p = s

toLower_eq_star — 🟢 proved

theorem · source

theorem toLower_eq_star (c : Char) (h : c.toLower = '*') : c = '*'

toLower_eq_question — 🟢 proved

theorem · source

theorem toLower_eq_question (c : Char) (h : c.toLower = '?') : c = '?'

Seclib.Prim.Rule

Rule — ⚪ definition

structure · source

Vendor-neutral authorization primitives: Rule, appliesOf, denyOverrides. No cloud provider noun appears in this module.

structure Rule where

denyOverridesRules — ⚪ definition

def · source

def denyOverridesRules (rules : List Rule) : Bool

denyOverrides_remove_allow_narrows — 🟢 proved

theorem · source

Lemma 1: Removing an allow rule narrows access

theorem denyOverrides_remove_allow_narrows (rules : List Rule) (i : Nat)
    (hi : i < rules.length) (hallow : (rules[i]).decision = .allow)
    (h : denyOverridesRules (rules.eraseIdx i) = true) :
    denyOverridesRules rules = true

denyOverrides_add_deny_narrows — 🟢 proved

theorem · source

Lemma 2: Adding a deny narrows

theorem denyOverrides_add_deny_narrows (rules : List Rule) (i : Nat)
    (hi : i < rules.length) (hdeny : (rules[i]).decision = .deny)
    (h : denyOverridesRules rules = true) :
    denyOverridesRules (rules.eraseIdx i) = true

conj_narrows — 🟢 proved

theorem · source

Lemma 3: Conjunction of evaluation gates never widens access

theorem conj_narrows (a b : Bool) (h : a && b = true) : a = true ∧ b = true

appliesOf_unknown_conservative — 🟢 proved

theorem · source

Lemma 4: Unknown applicability is conservative

theorem appliesOf_unknown_conservative (rules rules_noCtx : List Rule)
    (hlen : rules.length = rules_noCtx.length)
    (hpair : ∀ j (hj : j < rules.length),
      (rules_noCtx[j]'(hlen ▸ hj)).decision = (rules[j]).decision ∧
      (rules_noCtx[j]'(hlen ▸ hj)).sat = (rules[j]).sat ∧
      ((rules_noCtx[j]'(hlen ▸ hj)).applicability = .t ∨
       (rules_noCtx[j]'(hlen ▸ hj)).applicability = .u) ∧
      ((rules_noCtx[j]'(hlen ▸ hj)).applicability = .t →
       (rules[j]).applicability = .t))
    (h : denyOverridesRules rules = true) :
    denyOverridesRules rules_noCtx = true

Seclib.Schema.Bridge

CatalogSummaryRecord — ⚪ definition

structure · source

Contract test bridge for the CEL predicate type system. Parses JSONL records exported by lean-celtype-bridge, validates structural properties of the catalog, contract, and capability vocabulary. Four record kinds: catalog_summary: aggregate counts control: per-control identity + field paths contract_field: per-field from collector-contract.yaml capability: per-capability with chain reference count

structure CatalogSummaryRecord where

ControlRecord — ⚪ definition

structure · source

structure ControlRecord where

ContractFieldRecord — ⚪ definition

structure · source

structure ContractFieldRecord where

CapabilityRec — ⚪ definition

structure · source

structure CapabilityRec where

parseSeverity — ⚪ definition

def · source

def parseSeverity : String → Option Severity
  | "info" => some .info
  | "low" => some .low
  | "medium" => some .medium
  | "high" => some .high
  | "critical" => some .critical
  | _ => none

parseControlType — ⚪ definition

def · source

def parseControlType : String → Option ControlType
  | "unsafe_state" => some .unsafeState
  | "unsafe_duration" => some .unsafeDuration
  | "unsafe_recurrence" => some .unsafeRecurrence
  | "prefix_exposure" => some .prefixExposure
  | "marker" => some .marker
  | _ => none

parseClassification — ⚪ definition

def · source

def parseClassification : String → Option Classification
  | "state_assertion" => some .stateAssertion
  | "parameterized_check" => some .parameterizedCheck
  | "absence_check" => some .absenceCheck
  | "aggregate_check" => some .aggregateCheck
  | _ => none

parseFieldType — ⚪ definition

def · source

def parseFieldType : String → Option FieldType
  | "boolean" => some .boolean
  | "string" => some .string
  | "integer" => some .integer
  | "number" => some .number
  | "list" => some .list
  | "object" => some .object
  | _ => none

parseOperator — ⚪ definition

def · source

def parseOperator : String → Option Operator
  | "eq" => some .eq
  | "ne" => some .ne
  | "gt" => some .gt
  | "lt" => some .lt
  | "gte" => some .gte
  | "lte" => some .lte
  | "missing" => some .missing
  | "present" => some .present
  | "in" => some .in
  | "list_empty" => some .listEmpty
  | "not_subset_of_field" => some .notSubsetOfField
  | "neq_field" => some .neqField
  | "not_in_field" => some .notInField
  | "contains" => some .contains
  | "any_match" => some .anyMatch
  | "any_identity_match" => some .anyIdentityMatch
  | "any_in_field" => some .anyInField
  | _ => none

getJsonStringArray — ⚪ definition

def · source

def getJsonStringArray (j : Json) (key : String) : List String

parseCatalogSummary — ⚪ definition

def · source

def parseCatalogSummary (j : Json) : Except String CatalogSummaryRecord

parseControlRecord — ⚪ definition

def · source

def parseControlRecord (j : Json) : Except String ControlRecord

parseContractFieldRecord — ⚪ definition

def · source

def parseContractFieldRecord (j : Json) : Except String ContractFieldRecord

parseCapabilityRec — ⚪ definition

def · source

def parseCapabilityRec (j : Json) : Except String CapabilityRec

checkCatalogSummary — ⚪ definition

def · source

Checks

def checkCatalogSummary (r : CatalogSummaryRecord) : Bool × String

checkControlRecord — ⚪ definition

def · source

def checkControlRecord (r : ControlRecord) : Bool × String

checkContractField — ⚪ definition

def · source

def checkContractField (r : ContractFieldRecord) : Bool × String

checkCapability — ⚪ definition

def · source

def checkCapability (r : CapabilityRec) : Bool × String

bridgeCheck — ⚪ definition

def · source

Main bridge check

def bridgeCheck (path : System.FilePath) : IO UInt32

Seclib.Schema.BridgeMain

main — ⚪ definition

def · source

def main (args : List String) : IO UInt32

Seclib.Schema.Capability

builtinCapabilities — ⚪ definition

def · source

The 99 builtin capability strings from the catalog. Go source: internal/core/capabilities/capabilities.go:20-99 Sorted alphabetically for review-diff stability.

def builtinCapabilities : List Capability

isValidCapability — ⚪ definition

def · source

def isValidCapability (cap : Capability) : Bool

builtinCapabilities_length — 🟢 proved

theorem · source

theorem builtinCapabilities_length : builtinCapabilities.length = 78

Seclib.Schema.Contract

ContractField — ⚪ definition

structure · source

ContractField — one entry in the collector contract

structure ContractField where

Contract.fieldPaths — ⚪ definition

def · source

Contract queries

def Contract.fieldPaths (c : Contract) : List String

Contract.consumersOf — ⚪ definition

def · source

def Contract.consumersOf (c : Contract) (path : String) : List ControlId

Contract.fieldsForControl — ⚪ definition

def · source

def Contract.fieldsForControl (c : Contract) (id : ControlId) : List ContractField

Contract.hasField — ⚪ definition

def · source

def Contract.hasField (c : Contract) (path : String) : Bool

predicateConsistentWithContract — ⚪ definition

def · source

Schema-predicate consistency check A predicate is contract-consistent when every field path it references (after stripping the “properties.” prefix) appears in the contract.

def predicateConsistentWithContract (pred : UnsafePredicate) (contract : Contract) : Bool

Seclib.Schema.Control

ControlDef — ⚪ definition

structure · source

ControlDef — projected control definition Go source: internal/core/controldef/definition.go:32-133

structure ControlDef where

ControlDef.requiresCELValidation — ⚪ definition

def · source

def ControlDef.requiresCELValidation (c : ControlDef) : Bool

ControlDef.isEvaluatable — ⚪ definition

def · source

def ControlDef.isEvaluatable (c : ControlDef) : Bool

ControlDef.appliesToAssetType — ⚪ definition

def · source

Go source: definition.go:281-286. Empty applicable list = applies to all asset types.

def ControlDef.appliesToAssetType (c : ControlDef) (at_ : AssetType) : Bool

ControlDef.predicateFieldPaths — ⚪ definition

def · source

def ControlDef.predicateFieldPaths (c : ControlDef) : List FieldPath

Catalog.controlIds — ⚪ definition

def · source

def Catalog.controlIds (cat : Catalog) : List ControlId

Catalog.assetTypes — ⚪ definition

def · source

def Catalog.assetTypes (cat : Catalog) : List AssetType

Catalog.findById — ⚪ definition

def · source

def Catalog.findById (cat : Catalog) (id : ControlId) : Option ControlDef

Catalog.controlsForAssetType — ⚪ definition

def · source

def Catalog.controlsForAssetType (cat : Catalog) (at_ : AssetType) : List ControlDef

Seclib.Schema.Predicate

UnsafePredicate — ⚪ definition

structure · source

UnsafePredicate — top-level predicate container Go source: internal/core/controldef/predicate.go:9-14

structure UnsafePredicate where

UnsafePredicate.isEmpty — ⚪ definition

def · source

def UnsafePredicate.isEmpty (p : UnsafePredicate) : Bool

UnsafePredicate.fieldPaths — ⚪ definition

def · source

def UnsafePredicate.fieldPaths (p : UnsafePredicate) : List FieldPath

UnsafePredicate.operators — ⚪ definition

def · source

def UnsafePredicate.operators (p : UnsafePredicate) : List Operator

Seclib.Schema.Properties

fieldPath_strip_properties_cons — 🟢 proved

theorem · source

Theorem 1: Schema-predicate consistency Every field path in a predicate that starts with “properties.” can be stripped to produce a contract-queryable path. (Full cross-reference is bridge-tested via JSONL.)

theorem fieldPath_strip_properties_cons (rest : List String)
    (h : ("properties" :: rest).length > 0

missing_no_value — 🟢 proved

theorem · source

Theorem 2: Null safety Operators missing, present, and list_empty do not require a comparison value. All other operators do.

theorem missing_no_value : Operator.missing.requiresValue = false

present_no_value — 🟢 proved

theorem · source

theorem present_no_value : Operator.present.requiresValue = false

list_empty_no_value — 🟢 proved

theorem · source

theorem list_empty_no_value : Operator.listEmpty.requiresValue = false

eq_requires_value — 🟢 proved

theorem · source

theorem eq_requires_value : Operator.eq.requiresValue = true

ne_requires_value — 🟢 proved

theorem · source

theorem ne_requires_value : Operator.ne.requiresValue = true

contains_requires_value — 🟢 proved

theorem · source

theorem contains_requires_value : Operator.contains.requiresValue = true

null_safety_complete — 🟢 proved

theorem · source

theorem null_safety_complete :

appliesToAssetType_empty_means_all — 🟢 proved

theorem · source

Theorem 3: Catalog-schema coupling For every control in a catalog, if it declares no applicable asset types, appliesToAssetType returns true for any type. If it declares types, membership determines the result.

theorem appliesToAssetType_empty_means_all
    (c : ControlDef) (at_ : AssetType)
    (h : c.applicableAssetTypes = []) :
    c.appliesToAssetType at_ = true

appliesToAssetType_contains — 🟢 proved

theorem · source

theorem appliesToAssetType_contains
    (c : ControlDef) (at_ : AssetType)
    (h : at_ ∈ c.applicableAssetTypes) :
    c.appliesToAssetType at_ = true

embed_set_equality — 🟢 proved

theorem · source

Theorem 4: Embed invariant If two sorted lists of control IDs are equal, they contain the same elements (set equality from list equality).

theorem embed_set_equality
    {ids₁ ids₂ : List ControlId}
    (h : ids₁ = ids₂) :
    ∀ id, id ∈ ids₁ ↔ id ∈ ids₂

builtin_nonempty — 🟢 proved

theorem · source

Theorem 5: Capability liveness Every capability in the builtin set is a string. The bridge checker verifies each capability is referenced by ≥1 chain via JSONL. Here we prove the vocabulary is non-empty and closed.

theorem builtin_nonempty : builtinCapabilities.length > 0

capability_membership — 🟢 proved

theorem · source

theorem capability_membership (cap : String) :
    isValidCapability cap = true ↔ cap ∈ builtinCapabilities

allOperators — ⚪ definition

def · source

Theorem 6: Coverage bridge — operator set is closed The Lean Operator type has exactly 17 constructors, matching the Go IsSupported switch.

def allOperators : List Operator

operator_count — 🟢 proved

theorem · source

theorem operator_count : allOperators.length = 17

operator_exhaustive — 🟢 proved

theorem · source

theorem operator_exhaustive : ∀ op : Operator, op ∈ allOperators

cel_validation_types — 🟢 proved

theorem · source

CEL validation type coverage requiresCELValidation is true exactly for unsafeState and marker.

theorem cel_validation_types :

severity_total_order — 🟢 proved

theorem · source

Severity ordering is total

theorem severity_total_order :
    ∀ a b : Severity, a.toNat ≤ b.toNat ∨ b.toNat ≤ a.toNat

empty_predicate_no_fields — 🟢 proved

theorem · source

Predicate emptiness An empty predicate yields no field paths.

theorem empty_predicate_no_fields
    (p : UnsafePredicate) (h1 : p.any = []) (h2 : p.all = []) :
    p.fieldPaths = []

Seclib.Schema.Types

validAssetType — ⚪ definition

def · source

Validation predicate for asset type strings. Go source: internal/core/kernel/asset_type.go regex ^[a-z0-9][a-z0-9_.-]*$

def validAssetType (s : String) : Bool

Severity.toNat — ⚪ definition

def · source

def Severity.toNat : Severity → Nat
  | .info => 1
  | .low => 2
  | .medium => 3
  | .high => 4
  | .critical => 5

— ⚪ definition

instance · source

instance : Ord Severity where

— ⚪ definition

instance · source

instance : LE Severity where

— ⚪ definition

instance · source

instance (a b : Severity) : Decidable (a ≤ b)

Severity.max — ⚪ definition

def · source

def Severity.max (a b : Severity) : Severity

ControlType.requiresCELValidation — ⚪ definition

def · source

def ControlType.requiresCELValidation : ControlType → Bool
  | .unsafeState => true
  | .marker => true
  | _ => false

ControlType.isEvaluatable — ⚪ definition

def · source

def ControlType.isEvaluatable : ControlType → Bool
  | .unsafeState | .unsafeDuration | .unsafeRecurrence
  | .prefixExposure | .marker => true

Operator.requiresValue — ⚪ definition

def · source

def Operator.requiresValue : Operator → Bool
  | .missing => false
  | .present => false
  | .listEmpty => false
  | _ => true

FieldPath — ⚪ definition

structure · source

FieldPath Go source: internal/core/predicate/field_path.go:14 Dot-separated property path, eagerly split into segments

structure FieldPath where

— ⚪ definition

instance · source

instance : BEq FieldPath where

— ⚪ definition

instance · source

instance : DecidableEq FieldPath

FieldPath.raw — ⚪ definition

def · source

def FieldPath.raw (fp : FieldPath) : String

FieldPath.hasPathPrefix — ⚪ definition

def · source

def FieldPath.hasPathPrefix (fp : FieldPath) (pfx : String) : Bool

FieldPath.stripPropertiesPrefix — ⚪ definition

def · source

def FieldPath.stripPropertiesPrefix (fp : FieldPath) : List String

IamExplainer.Checks

checkAdminEquiv — ⚪ definition

def · source

def checkAdminEquiv (s : Statement) : List Finding

checkServiceWildcard — ⚪ definition

def · source

def checkServiceWildcard (s : Statement) : List Finding

checkResourceWildcard — ⚪ definition

def · source

def checkResourceWildcard (s : Statement) : List Finding

checkNotAction — ⚪ definition

def · source

def checkNotAction (s : Statement) : List Finding

checkNotResource — ⚪ definition

def · source

def checkNotResource (s : Statement) : List Finding

checkPassRole — ⚪ definition

def · source

def checkPassRole (s : Statement) : List Finding

evaluate — ⚪ definition

def · source

def evaluate (p : Policy) : List Finding

IamExplainer.Condition

CondWarning — ⚪ definition

structure · source

structure CondWarning where

CondKeyVal — ⚪ definition

structure · source

structure CondKeyVal where

CondOp — ⚪ definition

structure · source

structure CondOp where

decodeCondBlocks — ⚪ definition

def · source

def decodeCondBlocks (cond : Option Json) : CondBlocks × List CondWarning

evalCond_noContext_tu — 🟢 proved

theorem · source

theorem evalCond_noContext_tu (blocks : CondBlocks) :
    (evalCond noContext blocks).1 = .t ∨ (evalCond noContext blocks).1 = .u

evalCond_noContext_T_imp — 🟢 proved

theorem · source

theorem evalCond_noContext_T_imp (blocks : CondBlocks) (ctx : CondContext)
    (h : (evalCond noContext blocks).1 = .t) :
    (evalCond ctx blocks).1 = .t

IamExplainer.Emit

Need — ⚪ definition

structure · source

structure Need where

Needs — ⚪ definition

structure · source

structure Needs where

Transform — ⚪ definition

structure · source

structure Transform where

Residual — ⚪ definition

structure · source

structure Residual where

Withheld — ⚪ definition

structure · source

structure Withheld where

EmitReport — ⚪ definition

structure · source

structure EmitReport where

hasWildcard — ⚪ definition

def · source

def hasWildcard (s : String) : Bool

allNeedResourcesExact — ⚪ definition

def · source

def allNeedResourcesExact (stmt : Statement) (ns : List Need) : Bool

touchingResources — ⚪ definition

def · source

def touchingResources (stmt : Statement) (ns : List Need) : List String

emitFixed — ⚪ definition

def · source

def emitFixed (p : Policy) (ns : Needs) : Policy × EmitReport

parseNeeds — ⚪ definition

def · source

def parseNeeds (input : String) : Except String Needs

stmtToJson — ⚪ definition

def · source

def stmtToJson (s : Statement) : Json

policyToJson — ⚪ definition

def · source

def policyToJson (p : Policy) : Json

IamExplainer.Ghost.Aws

AwsGhostKind.defaultAssumption — ⚪ definition

def · source

def AwsGhostKind.defaultAssumption : AwsGhostKind → GhostAssumption
  | .managedPolicyArn _ => .overPermissive
  | .crossAccountRole _ _ => .overPermissive
  | .serviceLinkedRole _ =>

AwsGhostKind.id — ⚪ definition

def · source

def AwsGhostKind.id : AwsGhostKind → String
  | .managedPolicyArn arn => arn
  | .crossAccountRole arn _ => arn
  | .serviceLinkedRole sp => s!"aws-service-role/{sp}"
  | .crossAccountResource arn => arn
  | .unmodeledService arn => arn

AwsGhostKind.toRefStatus — ⚪ definition

def · source

def AwsGhostKind.toRefStatus (kind : AwsGhostKind) : RefStatus α

IamExplainer.Ghost.Parse

parseGhostKind — ⚪ definition

def · source

Parse ghost-annotated observation fields into RefStatus. When a reference field in the observation JSON carries _ghost: true plus a _ghost_kind discriminator, construct the appropriate AwsGhostKind and its default GhostAssumption. When _ghost is absent or false, construct RefStatus.resolved.

def parseGhostKind (j : Json) : Option AwsGhostKind

parseRefStatus — ⚪ definition

def · source

def parseRefStatus [FromJson α] (j : Json) : Except String (RefStatus α)

IamExplainer.Ghost.XAGhost

xaTrustSeverity — ⚪ definition

def · source

Ghost-aware cross-account trust check. Retrofits XA.TRUST severity to operate on RefStatus Principal. Resolved: run severity classification. Ghost: emit critical (overPermissive = worst case). Proves ghostConservative.

def xaTrustSeverity (p : Principal) : FindingSeverity

xaTrustGhostCheck — ⚪ definition

def · source

def xaTrustGhostCheck (ref : RefStatus Principal) : FindingSeverity

critical_is_top — 🟢 proved

theorem · source

theorem critical_is_top (s : FindingSeverity) : s ≤ .critical

xaTrust_ghost_conservative — 🟢 proved

theorem · source

theorem xaTrust_ghost_conservative (ga : GhostAssumption) :
    ghostConservative xaTrustSeverity ga .critical

IamExplainer.Grants

CondState.toString — ⚪ definition

def · source

def CondState.toString : CondState → String
  | .t => "T"
  | .f => "F"
  | .u => "U"
  | .none_ => "NONE"

— ⚪ definition

instance · source

instance : ToString CondState

Grant — ⚪ definition

structure · source

structure Grant where

stmtGrants — ⚪ definition

def · source

def stmtGrants (ctx : Context) (condCtx : CondContext) (s : Statement) : List Grant

grants — ⚪ definition

def · source

def grants (ctx : Context) (condCtx : CondContext) (p : Policy) : List Grant

grantToJson — ⚪ definition

def · source

def grantToJson (g : Grant) : Json

IamExplainer.Layers

Layers — ⚪ definition

structure · source

structure Layers where

LayerVerdict — ⚪ definition

structure · source

structure LayerVerdict where

LayerResult — ⚪ definition

structure · source

structure LayerResult where

evalLayers — ⚪ definition

def · source

def evalLayers (req : Request) (ctx : CondContext) (layers : Layers)
    (rcpServices : List String) (kind : DocKind) : LayerResult

noLayers — ⚪ definition

def · source

def noLayers : Layers

validateScp — ⚪ definition

def · source

def validateScp (p : Policy) : Option String

validateRcp — ⚪ definition

def · source

def validateRcp (p : Policy) : Option String

evalLayers_noLayers_blocked — 🟢 proved

theorem · source

theorem evalLayers_noLayers_blocked (req : Request) (ctx : CondContext)
    (rcpSvcs : List String) (kind : DocKind) :
    (evalLayers req ctx noLayers rcpSvcs kind).blocked = []

evalLayers_blocked_noContext_empty — 🟢 proved

theorem · source

theorem evalLayers_blocked_noContext_empty (req : Request) (ctx : CondContext)
    (layers : Layers) (rcpSvcs : List String) (kind : DocKind)
    (h : (evalLayers req ctx layers rcpSvcs kind).blocked = []) :
    (evalLayers req noContext layers rcpSvcs kind).blocked = []

IamExplainer.Match

matchResourcePattern — ⚪ definition

def · source

def matchResourcePattern (pattern : String) (resource : String) : Bool

IamExplainer.Policy

— ⚪ definition

instance · source

instance : ToJson Effect where

— ⚪ definition

instance · source

instance : FromJson Effect where

Statement — ⚪ definition

structure · source

structure Statement where

ParseWarning — ⚪ definition

structure · source

structure ParseWarning where

— ⚪ definition

instance · source

instance : ToJson ParseWarning where

parseStatement — ⚪ definition

def · source

def parseStatement (j : Json) (idx : Nat) : Except String (Statement × List ParseWarning)

Policy — ⚪ definition

structure · source

structure Policy where

parsePolicy — ⚪ definition

def · source

def parsePolicy (input : String) : Except String (Policy × List ParseWarning)

IamExplainer.Principal

PrincipalType.toString — ⚪ definition

def · source

def PrincipalType.toString : PrincipalType → String
  | .aws => "AWS"
  | .federated => "Federated"
  | .service => "Service"
  | .canonicalUser => "CanonicalUser"
  | .wildcard => "Wildcard"

— ⚪ definition

instance · source

instance : ToString PrincipalType

Principal — ⚪ definition

structure · source

structure Principal where

isBareAccountId — ⚪ definition

def · source

def isBareAccountId (s : String) : Bool

normPrincipal — ⚪ definition

def · source

def normPrincipal (s : String) : Principal

parsePrincipals — ⚪ definition

def · source

def parsePrincipals (j : Json) : List Principal

Principal.isRoot — ⚪ definition

def · source

def Principal.isRoot (p : Principal) : Bool

Principal.accountId — ⚪ definition

def · source

def Principal.accountId (p : Principal) : Option String

Scope.toString — ⚪ definition

def · source

def Scope.toString : Scope → String
  | .sameAccount => "SAME_ACCOUNT"
  | .inOrg       => "IN_ORG"
  | .crossOrg    => "CROSS_ORG"
  | .pub         => "PUBLIC"
  | .federated   => "FEDERATED"
  | .service     => "SERVICE"
  | .unverified  => "UNVERIFIED"

— ⚪ definition

instance · source

instance : ToString Scope

Context — ⚪ definition

structure · source

structure Context where

condOrgIds — ⚪ definition

def · source

def condOrgIds (cond : Option Json) : List String

scopeOf — ⚪ definition

def · source

def scopeOf (ctx : Context) (p : Principal) (cond : Option Json) : Scope

DocKind.toString — ⚪ definition

def · source

def DocKind.toString : DocKind → String
  | .identity => "IDENTITY"
  | .trust    => "TRUST"
  | .resource => "RESOURCE"
  | .mixed    => "MIXED"

— ⚪ definition

instance · source

instance : ToString DocKind

detectKind — ⚪ definition

def · source

def detectKind (stmts : List Statement) : DocKind

IamExplainer.Proofs

Policy.removeStmt — ⚪ definition

def · source

Soundness theorems: policy transforms (T1-T3) and emitFixed can only narrow access, never grant new permissions. All theorems are universally quantified over the condition context.

def Policy.removeStmt (p : Policy) (i : Nat) : Policy

iamSem — ⚪ definition

def · source

def iamSem : PolicySem Statement Request CondContext where

removeAllow_narrows — 🟢 proved

theorem · source

theorem removeAllow_narrows (p : Policy) (i : Nat)
    (hi : i < p.statements.length)
    (heff : (p.statements[i]'hi).effect = .allow)
    (req : Request) (ctx : CondContext)
    (h : allows (p.removeStmt i) req ctx = true) :

matchPattern_ci_congr — 🟢 proved

theorem · source

theorem matchPattern_ci_congr (p s s' : String)
    (h : matchActionPattern p s = true) (heq : ciEq s s' = true) :
    matchActionPattern p s' = true

stmtGrantsAction_ci_congr — 🟢 proved

theorem · source

theorem stmtGrantsAction_ci_congr (st : Statement) (ℓ a : String)
    (h : stmtGrantsAction st ℓ = true) (heq : ciEq ℓ a = true) :
    stmtGrantsAction st a = true

stmtGrantsAction_narrow — 🟢 proved

theorem · source

theorem stmtGrantsAction_narrow (s new_stmt : Statement)
    (hnew_notactions : new_stmt.notActions = none)
    (hnew_actions : ∃ acts, new_stmt.actions = some acts ∧

allows_replaceAllow_mono — 🟢 proved

theorem · source

theorem allows_replaceAllow_mono (p : Policy) (i : Nat) (hi : i < p.statements.length)
    (heff : (p.statements[i]).effect = .allow)
    (new_stmt : Statement) (hnew_eff : new_stmt.effect = .allow)
    (hnew_res : new_stmt.resources = (p.statements[i]).resources)
    (hnew_notres : new_stmt.notResources = (p.statements[i]).notResources)
    (hnew_cond : new_stmt.condition = (p.statements[i]).condition)
    (hgrants : ∀ a, stmtGrantsAction new_stmt a = true → stmtGrantsAction (p.statements[i]) a = true)
    (req : Request) (ctx : CondContext)
    (h : allows { p with statements

narrowActions_narrows — 🟢 proved

theorem · source

theorem narrowActions_narrows
    (p : Policy) (i : Nat)
    (hi : i < p.statements.length)
    (heff : (p.statements[i]).effect = .allow)
    (new_stmt : Statement)
    (hnew : new_stmt.effect = .allow)
    (hnew_notactions : new_stmt.notActions = none)
    (hnew_actions : ∃ acts, new_stmt.actions = some acts ∧

allows_replace_stmt_mono — 🟢 proved

theorem · source

Generalized statement replacement mono

theorem allows_replace_stmt_mono (p : Policy) (i : Nat) (hi : i < p.statements.length)
    (heff : (p.statements[i]).effect = .allow)
    (new_stmt : Statement) (hnew_eff : new_stmt.effect = .allow)
    (hnew_cond : new_stmt.condition = (p.statements[i]).condition)
    (hmono : ∀ req, stmtMatches new_stmt req = true → stmtMatches (p.statements[i]) req = true)
    (req : Request) (ctx : CondContext)
    (h : allows { p with statements

narrowResources_narrows — 🟢 proved

theorem · source

NEW: narrowResources_narrows (T3)

theorem narrowResources_narrows
    (p : Policy) (i : Nat)
    (hi : i < p.statements.length)
    (heff : (p.statements[i]).effect = .allow)
    (new_stmt : Statement) (hnew_eff : new_stmt.effect = .allow)
    (hnew_act : new_stmt.actions = (p.statements[i]).actions)
    (hnew_notact : new_stmt.notActions = (p.statements[i]).notActions)
    (hnew_cond : new_stmt.condition = (p.statements[i]).condition)
    (hnew_notres : new_stmt.notResources = none)
    (hnew_res : ∃ rlist, new_stmt.resources = some rlist ∧

emitFixed_narrows — 🟢 proved

theorem · source

theorem emitFixed_narrows (p : Policy) (ns : Needs)
    (hns : ∀ n ∈ ns.needs, '?' ∉ n.action.toList ∧ '*' ∉ n.action.toList)
    (req : Request) (ctx : CondContext)
    (h : allows (emitFixed p ns).1 req ctx = true) :
    allows p req ctx = true

grants_complete — 🟢 proved

theorem · source

Grants completeness and no-context conservatism

theorem grants_complete (p : Policy) (req : Request) (ctx : CondContext)
    (h : allows p req ctx = true) :

allows_nocontext_conservative — 🟢 proved

theorem · source

theorem allows_nocontext_conservative (p : Policy) (req : Request) (ctx : CondContext)
    (h : allows p req ctx = true) :

layers_narrow — 🟢 proved

theorem · source

Layer theorems: layered evaluation only narrows access.

theorem layers_narrow (p : Policy) (req : Request) (ctx : CondContext)
    (layers : Layers) (rcpSvcs : List String) (kind : DocKind)
    (h : (allowsLayered p req ctx layers rcpSvcs kind).allowed = true) :
    allows p req ctx = true

layer_add_monotone — 🟢 proved

theorem · source

theorem layer_add_monotone (p : Policy) (req : Request) (ctx : CondContext)
    (rcpSvcs : List String) (kind : DocKind)
    (h : allows p req ctx = true) :
    (allowsLayered p req ctx noLayers rcpSvcs kind).allowed = true

layered_nocontext_conservative — 🟢 proved

theorem · source

theorem layered_nocontext_conservative (p : Policy) (req : Request) (ctx : CondContext)
    (layers : Layers) (rcpSvcs : List String) (kind : DocKind)
    (h : (allowsLayered p req ctx layers rcpSvcs kind).allowed = true) :
    (allowsLayered p req noContext layers rcpSvcs kind).allowed = true

IamExplainer.Report

Counts — ⚪ definition

structure · source

structure Counts where

countFindings — ⚪ definition

def · source

def countFindings (fs : List Finding) : Counts

Report — ⚪ definition

structure · source

structure Report where

buildReport — ⚪ definition

def · source

def buildReport (findings : List Finding) (warnings : List ParseWarning) : Report

reportToJson — ⚪ definition

def · source

def reportToJson (r : Report) : Json

renderText — ⚪ definition

def · source

def renderText (r : Report) : String

IamExplainer.XAChecks

condHasKey — ⚪ definition

def · source

def condHasKey (cond : Option Json) (key : String) : Bool

checkXA — ⚪ definition

def · source

def checkXA (ctx : Context) (kind : DocKind) (s : Statement) : List Finding

xaWarnings — ⚪ definition

def · source

def xaWarnings (ctx : Context) (s : Statement) : List ParseWarning

Main

CliOpts — ⚪ definition

structure · source

structure CliOpts where

parseOpts — ⚪ definition

def · source

def parseOpts (args : List String) : CliOpts

loadAccounts — ⚪ definition

def · source

def loadAccounts (path : String) : IO (List String)

buildContext — ⚪ definition

def · source

def buildContext (opts : CliOpts) : IO Context

runExplain — ⚪ definition

def · source

def runExplain (opts : CliOpts) : IO UInt32

loadCondContext — ⚪ definition

def · source

def loadCondContext (opts : CliOpts) : IO CondContext

runGrants — ⚪ definition

def · source

def runGrants (opts : CliOpts) : IO UInt32

loadLayerDoc — ⚪ definition

def · source

def loadLayerDoc (path : String) : IO (Policy × List ParseWarning)

rcpServicesPath — ⚪ definition

def · source

def rcpServicesPath : String

loadRcpServices — ⚪ definition

def · source

def loadRcpServices : IO (List String)

runCan — ⚪ definition

def · source

def runCan (opts : CliOpts) : IO UInt32

runEmitFixed — ⚪ definition

def · source

def runEmitFixed (opts : CliOpts) : IO UInt32

main — ⚪ definition

def · source

def main (args : List String) : IO UInt32