assets_guardian.core.domain.engines.compliance_engine๏
Classes
|
IAM compliance engine. |
- class assets_guardian.core.domain.engines.compliance_engine.ComplianceEngine(rules: list[IRule])[source]๏
Bases:
objectIAM compliance engine.
Responsible for executing audit rules by category (comparison, compliance, matrix) on the collected data.
- Variables:
_rules โ List of rule instances to evaluate.
Initializes the engine with a list of rules.
- Parameters:
rules โ List of rule instances to evaluate.
- run_all(*, old_data: Mapping[str, Iterable[Any]] | None = None, new_data: Mapping[str, Iterable[Any]] | None = None, live_data: Mapping[str, Iterable[Any]] | None = None, config: dict[str, Any] | None = None, accesses: Iterable[Any] | None = None, matrix: dict[tuple[str, str], str] | None = None, profiles: dict[str, list[str]] | None = None) Iterator[Finding][source]๏
Executes all rule categories and yields findings incrementally.
- Parameters:
old_data โ Comparison data (old state).
new_data โ Comparison data (new state).
live_data โ Data for standard compliance.
config โ Global rules configuration.
accesses โ Actual access data for matrix checks.
matrix โ Authorized rights matrix.
profiles โ User profiles mapping.
- Yields:
Finding โ All anomalies detected by all rules.
- run_comparison(old_data: Mapping[str, Iterable[Any]], new_data: Mapping[str, Iterable[Any]]) Iterator[Finding][source]๏
Executes comparison rules in streaming mode.
- Parameters:
old_data โ Data extracted from the old state (e.g., previous Excel sheet).
new_data โ Freshly collected data.
- Yields:
Finding โ Detected discrepancies on the fly.
- run_compliance(live_data: Mapping[str, Iterable[Any]], config: dict[str, Any]) Iterator[Finding][source]๏
Executes IAM compliance rules in streaming mode.
- Parameters:
live_data โ Data collected in real time.
config โ Configuration parameters (thresholds, etc.).
- Yields:
Finding โ Detected non-conformities on the fly.
- run_matrix(accesses: Iterable[Any], matrix: dict[tuple[str, str], str], profiles: dict[str, list[str]]) Iterator[Finding][source]๏
Executes matrix checks in streaming mode.
- Parameters:
accesses โ List of actual collected accesses.
matrix โ Dictionary representing the matrix (profile -> asset -> role).
profiles โ Mapping of employees to their expected profiles.
- Yields:
Finding โ Detected unauthorized or missing accesses.