assets_guardian.plugins.gitlab.matrix๏ƒ

Classes

GitlabGroupProjectAccessRule(**kwargs)

Verifies that GitLab group and project roles are authorized by the matrix.

InstanceAdminRule(**kwargs)

Verifies that GitLab instance administrators are authorized by the matrix.

class assets_guardian.plugins.gitlab.matrix.GitlabGroupProjectAccessRule(**kwargs: Any)[source]๏ƒ

Bases: IMatrixRule

Verifies that GitLab group and project roles are authorized by the matrix.

Retrieves the rule configuration from YAML.

evaluate(accesses: Iterable[Access], matrix: dict[tuple[str, str], str], profiles: dict[str, list[str]]) Iterable[Finding][source]๏ƒ

Verifies GitLab group and project accesses against the authorization matrix.

Parameters:
  • accesses โ€“ List of accesses to evaluate.

  • matrix โ€“ Authorization matrix (profile, resource) -> role.

  • profiles โ€“ Dictionary of profiles associated with each user by their email.

Yields:

Finding โ€“ Anomalies for each detected unauthorized or excessive access.

property description: str๏ƒ

Description of the rule.

property name: str๏ƒ

Name of the rule.

property rule_category: RuleCategory๏ƒ

MATRIX (matrix rules).

Type:

Rule category

property severity: SeverityType๏ƒ

Severity level of the rule.

property target_entity: str๏ƒ

Entity targeted by the rule.

class assets_guardian.plugins.gitlab.matrix.InstanceAdminRule(**kwargs: Any)[source]๏ƒ

Bases: IMatrixRule

Verifies that GitLab instance administrators are authorized by the matrix.

Retrieves the rule configuration from YAML.

evaluate(accesses: Iterable[Access], matrix: dict[tuple[str, str], str], profiles: dict[str, list[str]]) Iterable[Finding][source]๏ƒ

Verifies that each instance administrator is authorized by the matrix.

Parameters:
  • accesses โ€“ List of accesses to evaluate.

  • matrix โ€“ Authorization matrix (profile, resource) -> role.

  • profiles โ€“ Dictionary of profiles associated with each user by their email.

Yields:

Finding โ€“ Anomalies for each detected unauthorized access.

property description: str๏ƒ

Description of the rule.

property name: str๏ƒ

Name of the rule.

property rule_category: RuleCategory๏ƒ

MATRIX (matrix rules).

Type:

Rule category

property severity: SeverityType๏ƒ

Severity level of the rule.

property target_entity: str๏ƒ

Entity targeted by the rule.