Expand description
Strig: governance and authorization decisions.
A single engine resolves three access models over the same permission catalog:
- RBAC: roles with inheritance (
RoleGraph) and assignment scoped to a resource (RoleAssignment). - ABAC: serializable conditions over attributes of the subject, the resource and the
environment (
Condition), with custom functions you can register (ConditionRegistry). - ReBAC: Zanzibar-style relations (
RelationSchema,TupleStore), used as the subject of a grant (SubjectMatcher::Relation).
A decision goes through three stages: overrides (Override), collection of the applicable
grants and combination by a Strategy. The default strategy (MostSpecific) lets the most
specific target decide and, within it, deny beats allow.
Grant changes and role assignments go through Governance, which applies invariants
(no self-management, no leaving a scope without an administrator, prohibitions) before the
change is persisted and, with the audit feature, records each decision in an audit trail
(audit).
The crate does no IO and does not depend on an async runtime, and it compiles to WebAssembly.
Real time, caching and transports live in strig-sync and the adapters.
See the repository README for the full guide.
Re-exports§
pub use attr::Attributes;pub use attr::Value;pub use audit::AuditAction;pub use audit::AuditError;pub use audit::AuditLevel;pub use audit::AuditOutcome;pub use audit::AuditRecord;pub use audit::AuditSink;pub use audit::AuditStats;pub use audit::AuditStatus;pub use audit::Auditor;pub use audit::ChainError;pub use audit::DropHook;pub use audit::DroppedRecord;pub use audit::Emitted;pub use audit::FailMode;pub use audit::JsonLinesAudit;pub use audit::MemoryAuditLog;pub use audit::PendingQueue;pub use audit::PendingRef;pub use audit::RecertRef;pub use audit::Redactor;pub use audit::RetryPolicy;pub use audit::RoleChange;pub use audit::chain_head;pub use audit::mask_attributes;pub use audit::verify_chain;pub use audit::verify_chain_anchored;pub use catalog::ActionConflict;pub use catalog::Catalog;pub use catalog::CatalogBuilder;pub use catalog::CatalogError;pub use catalog::CatalogErrors;pub use catalog::CatalogExport;pub use catalog::CatalogRule;pub use catalog::ExclusiveKind;pub use catalog::FnRule;pub use catalog::MutualExclusion;pub use catalog::PermissionDef;pub use catalog::RequireMeta;pub use condition::Condition;pub use condition::ConditionError;pub use condition::ConditionRegistry;pub use condition::EvalContext;pub use condition::Operand;pub use decision::Decision;pub use decision::Reason;pub use decision::Request;pub use engine::CapabilitySet;pub use engine::Context;pub use engine::Engine;pub use engine::EngineBuilder;pub use engine::EngineError;pub use engine::GrantError;pub use explain::ConditionTrace;pub use explain::Explanation;pub use explain::GrantTrace;pub use explain::OverrideOutcome;pub use explain::OverrideStep;pub use explain::PrerequisiteStep;pub use explain::TraceResult;pub use explain::Verdict;pub use explain::trace_condition;pub use explain::trace_condition_at;pub use field::FieldExplanation;pub use field::FieldSet;pub use field::FieldVerdict;pub use governance::AppliedWithImpact;pub use governance::Bypass;pub use governance::CatalogConformance;pub use governance::Forbid;pub use governance::Governance;pub use governance::GovernanceAt;pub use governance::Invariant;pub use governance::ManagementOnly;pub use governance::Mutation;pub use governance::MutationKind;pub use governance::NoEscalation;pub use governance::NoLockout;pub use governance::NoSelfManagement;pub use governance::NonDelegable;pub use governance::Prerequisites;pub use governance::Proposal;pub use governance::RequirePermission;pub use governance::Suggestion;pub use governance::Violation;pub use grant::Effect;pub use grant::Grant;pub use grant::GrantIndex;pub use grant::GrantSource;pub use grant::SubjectMatcher;pub use grant::TargetSelector;pub use impact::AUDIT_EXAMPLES;pub use impact::Access;pub use impact::AccessChange;pub use impact::Impact;pub use impact::ImpactOptions;pub use impact::ImpactSource;pub use impact::ImpactSummary;pub use impact::PotentialClash;pub use impact::SampleSpec;pub use overrides::FnOverride;pub use overrides::Override;pub use overrides::OverrideGate;pub use overrides::OverrideReach;pub use overrides::PermissionHolder;pub use overrides::ReachRequest;pub use overrides::ResourceOwner;pub use overrides::SubjectsRequest;pub use pending::elevation::BreakGlassRule;pub use pending::elevation::Elevated;pub use pending::elevation::ElevationInfo;pub use pending::elevation::ElevationKey;pub use pending::elevation::ElevationPolicy;pub use pending::elevation::ElevationRequest;pub use pending::elevation::ElevationRule;pub use pending::elevation::ElevationTarget;pub use pending::elevation::Elevations;pub use pending::elevation::ReviewState;pub use pending::elevation::Revocation;pub use pending::elevation::Revoked;pub use pending::ApprovalError;pub use pending::ApprovalPolicy;pub use pending::ApprovalRule;pub use pending::Approvals;pub use pending::Approved;pub use pending::ImpactReview;pub use pending::MemoryPendingStore;pub use pending::PendingError;pub use pending::PendingRequest;pub use pending::PendingStatus;pub use pending::PendingStore;pub use pending::Proposed;pub use pending::Review;pub use query::AccessFilter;pub use query::AccessVia;pub use query::CheckAnswer;pub use query::Expr;pub use query::FilterOutcome;pub use query::FilterResidual;pub use query::FilterResolution;pub use query::FilterShape;pub use query::InMemorySubjects;pub use query::PartyAccess;pub use query::PathLayout;pub use query::QueryContext;pub use query::QueryError;pub use query::QueryLimits;pub use query::SubjectRef;pub use query::SubjectResolver;pub use query::WhoCan;pub use query::WhoCanEntry;pub use query::WhoCanExcept;pub use rbac::RbacError;pub use rbac::RoleGraph;pub use rebac::InMemoryTuples;pub use rebac::RebacError;pub use rebac::RelationSchema;pub use rebac::Rewrite;pub use rebac::Tuple;pub use rebac::TupleIndex;pub use rebac::TupleStore;pub use rebac::TupleSubject;pub use recert::Campaign;pub use recert::CampaignReport;pub use recert::CampaignSpec;pub use recert::CampaignStatus;pub use recert::Closed;pub use recert::Decided;pub use recert::DefaultAction;pub use recert::Delegation;pub use recert::ItemState;pub use recert::MemoryRecertStore;pub use recert::RecertDecision;pub use recert::RecertError;pub use recert::RecertItem;pub use recert::RecertScope;pub use recert::RecertStore;pub use recert::RecertTarget;pub use recert::Recertifications;pub use recert::ReviewerRoute;pub use recert::ReviewerRule;pub use recert::ReviewerTally;pub use resource::Anchor;pub use resource::GLOBAL;pub use resource::ObjectRef;pub use resource::Resource;pub use revision::DEFAULT_SCOPE;pub use revision::MemoryRevisions;pub use revision::Reached;pub use revision::Revised;pub use revision::Revision;pub use revision::RevisionParseError;pub use revision::RevisionSource;pub use separation::Clash;pub use separation::SEPARATION_PREFIX;pub use separation::SeparationOfDuties;pub use separation::SeparationRule;pub use separation::clashes_of;pub use spec::EngineSpec;pub use spec::InvariantSpec;pub use spec::OverrideRule;pub use spec::OverrideSpec;pub use spec::RelationSpec;pub use spec::ReserveSpec;pub use spec::RoleSpec;pub use spec::SpecError;pub use spec::StrategySpec;pub use strategy::Candidate;pub use strategy::DenyOverrides;pub use strategy::FirstApplicable;pub use strategy::MostSpecific;pub use strategy::NativeStrategy;pub use strategy::PermitOverrides;pub use strategy::Strategy;pub use subject::ANONYMOUS;pub use subject::AUTHENTICATED;pub use subject::RoleAssignment;pub use subject::Subject;pub use template::Materialized;pub use template::RoleTemplate;pub use template::TemplateGrant;pub use validity::Validity;pub use validity::ValidityError;pub use validity::next_boundary;pub use why_not::Cause;pub use why_not::Caveat;pub use why_not::Change;pub use why_not::Remedies;pub use why_not::Remedy;pub use why_not::WhyNotOptions;
Modules§
- attr
- audit
- Audit trail of permission changes (feature
audit). - audit_
report - Conformance report over an audit trail (feature
audit). - catalog
- condition
- decision
- engine
- explain
- Full trace of a decision: why each grant got in or stayed out, what each override answered
and how the strategy chose.
crate::Engine::explainreturns the sameDecisionascrate::Engine::decide, plus the path that led to it. - field
- Field-level permissions: a grant that names fields gives or takes away only those fields of the resource.
- governance
- grant
- impact
- What a change does to access, before it is applied.
- merkle
- Merkle tree over audit records (feature
audit), after RFC 6962 / RFC 9162 §2.1. - overrides
- pending
- Approval flow for a
Mutation: a change theApprovalPolicymarks as needing approval does not apply on the spot. It becomes aPendingRequestthat another actor approves or refuses. - query
- Listing and reverse queries: which resources a subject reaches, and who reaches a resource.
- rbac
- rebac
- recert
- Access recertification: a periodic review of the grants and role assignments in force by someone accountable for them, with what nobody renews taken away when the time is up (ISO 27001 A.5.18, SOX access reviews).
- resource
- revision
- Revision tokens: read your own writes, end to end.
- separation
- Separation of duties.
- spec
- Declarative configuration of the engine and of governance, in JSON, TOML or YAML.
- strategy
- subject
- template
- Role templates: a versioned set of model grants that is copied, never linked.
- validity
- Validity windows for grants and role assignments.
- why_not
- “Why not?”: for a denial, the smallest changes that would turn it into an
allow.