aegis-devops 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. aegis_core/__init__.py +7 -0
  2. aegis_core/_examples/__init__.py +0 -0
  3. aegis_core/_examples/__pycache__/__init__.cpython-312.pyc +0 -0
  4. aegis_core/_examples/authority.example.yaml +12 -0
  5. aegis_core/_examples/authority.example.yaml.sig +2 -0
  6. aegis_core/_examples/constraints.example.yaml +338 -0
  7. aegis_core/_examples/constraints.example.yaml.sig +2 -0
  8. aegis_core/_examples/environments.example.yaml +51 -0
  9. aegis_core/_examples/environments.example.yaml.sig +2 -0
  10. aegis_core/_examples/example-signing.key +7 -0
  11. aegis_core/_examples/plan_constraints.example.yaml +76 -0
  12. aegis_core/_examples/plan_constraints.example.yaml.sig +2 -0
  13. aegis_core/_examples/sources/AEGIS-MANIFEST.sig +32 -0
  14. aegis_core/_examples/sources/PRINCIPALS.yaml +31 -0
  15. aegis_core/_examples/sources/git-4001.json +17 -0
  16. aegis_core/_examples/sources/git-789abc.json +17 -0
  17. aegis_core/_examples/sources/git-abc123.json +15 -0
  18. aegis_core/_examples/sources/git-bcd234.json +15 -0
  19. aegis_core/_examples/sources/git-def456.json +16 -0
  20. aegis_core/_examples/sources/jira-1001.json +28 -0
  21. aegis_core/_examples/sources/jira-1002.json +16 -0
  22. aegis_core/_examples/sources/jira-2001.json +17 -0
  23. aegis_core/_examples/sources/jira-2002.json +15 -0
  24. aegis_core/_examples/sources/jira-3001.json +17 -0
  25. aegis_core/_examples/sources/jira-3002.json +15 -0
  26. aegis_core/_examples/sources/jira-3003.json +17 -0
  27. aegis_core/_examples/sources/jira-3004.json +17 -0
  28. aegis_core/_examples/sources/jira-3005.json +17 -0
  29. aegis_core/_examples/sources/jira-5001.json +17 -0
  30. aegis_core/_examples/sources/jira-5002.json +15 -0
  31. aegis_core/_examples/sources/jira-5003.json +18 -0
  32. aegis_core/_examples/sources/jira-5004.json +17 -0
  33. aegis_core/_examples/sources/jira-5006.json +15 -0
  34. aegis_core/_examples/sources/plan-1001.json +10 -0
  35. aegis_core/_examples/sources/plan-1002.json +17 -0
  36. aegis_core/_examples/sources/plan-1003.json +24 -0
  37. aegis_core/_examples/sources/plan-1004.json +18 -0
  38. aegis_core/_examples/sources/plan-5005.json +16 -0
  39. aegis_core/_examples/sources/slack-perma-1.json +18 -0
  40. aegis_core/adversarial.py +708 -0
  41. aegis_core/authority.py +49 -0
  42. aegis_core/baselines/__init__.py +11 -0
  43. aegis_core/baselines/base.py +43 -0
  44. aegis_core/baselines/external.py +483 -0
  45. aegis_core/baselines/llm.py +363 -0
  46. aegis_core/baselines/metrics.py +143 -0
  47. aegis_core/baselines/opa.py +222 -0
  48. aegis_core/cli.py +1073 -0
  49. aegis_core/config.py +186 -0
  50. aegis_core/environments.py +292 -0
  51. aegis_core/intent.py +43 -0
  52. aegis_core/interceptor.py +328 -0
  53. aegis_core/ledger.py +484 -0
  54. aegis_core/parser.py +2767 -0
  55. aegis_core/parsers/__init__.py +27 -0
  56. aegis_core/parsers/pulumi.py +218 -0
  57. aegis_core/parsers/sql.py +1062 -0
  58. aegis_core/plan.py +703 -0
  59. aegis_core/provenance.py +260 -0
  60. aegis_core/shell.py +574 -0
  61. aegis_core/signing.py +301 -0
  62. aegis_core/store.py +1054 -0
  63. aegis_devops-0.1.0.dist-info/METADATA +933 -0
  64. aegis_devops-0.1.0.dist-info/RECORD +68 -0
  65. aegis_devops-0.1.0.dist-info/WHEEL +5 -0
  66. aegis_devops-0.1.0.dist-info/entry_points.txt +2 -0
  67. aegis_devops-0.1.0.dist-info/licenses/LICENSE +202 -0
  68. aegis_devops-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,28 @@
1
+ {
2
+ "provider": "kubernetes",
3
+ "resource_pattern": "deployment/*",
4
+ "actions": [
5
+ "scale"
6
+ ],
7
+ "scope": {
8
+ "namespace": "prod"
9
+ },
10
+ "time_window": {
11
+ "days": [
12
+ "Mon",
13
+ "Tue",
14
+ "Wed",
15
+ "Thu",
16
+ "Fri"
17
+ ],
18
+ "start": "09:00",
19
+ "end": "17:00",
20
+ "tz": "America/New_York"
21
+ },
22
+ "effect": "BLOCK",
23
+ "constraint_class": "scaling",
24
+ "principal": "sre_lead",
25
+ "source_ref": "jira-1001",
26
+ "source_timestamp": "2026-01-15T09:00:00+00:00",
27
+ "rule_text": "Do not scale deployments in prod during business hours (09:00-17:00 ET, weekdays)."
28
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "provider": "kubernetes",
3
+ "resource_pattern": "configmap/*",
4
+ "actions": [
5
+ "delete",
6
+ "update"
7
+ ],
8
+ "scope": {},
9
+ "time_window": null,
10
+ "effect": "ESCALATE",
11
+ "constraint_class": "configuration",
12
+ "principal": "developer",
13
+ "source_ref": "jira-1002",
14
+ "source_timestamp": "2026-03-01T08:00:00+00:00",
15
+ "rule_text": "Escalate configmap changes for review before they are applied."
16
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "provider": "aws",
3
+ "resource_pattern": "ec2/instance/*",
4
+ "actions": [
5
+ "delete"
6
+ ],
7
+ "scope": {
8
+ "region": "us-east-1"
9
+ },
10
+ "time_window": null,
11
+ "effect": "BLOCK",
12
+ "constraint_class": "deletion",
13
+ "principal": "admin",
14
+ "source_ref": "jira-2001",
15
+ "source_timestamp": "2026-03-10T09:00:00+00:00",
16
+ "rule_text": "Block deleting EC2 instances in us-east-1; terminate through the runbook instead."
17
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "provider": "gcp",
3
+ "resource_pattern": "sql/instance/*",
4
+ "actions": [
5
+ "delete"
6
+ ],
7
+ "scope": {},
8
+ "time_window": null,
9
+ "effect": "BLOCK",
10
+ "constraint_class": "deletion",
11
+ "principal": "admin",
12
+ "source_ref": "jira-2002",
13
+ "source_timestamp": "2026-03-14T13:00:00+00:00",
14
+ "rule_text": "Block deleting Cloud SQL instances directly; use the decommission runbook instead."
15
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "provider": "helm",
3
+ "resource_pattern": "release/*",
4
+ "actions": [
5
+ "delete"
6
+ ],
7
+ "scope": {
8
+ "namespace": "prod"
9
+ },
10
+ "time_window": null,
11
+ "effect": "BLOCK",
12
+ "constraint_class": "deletion",
13
+ "principal": "admin",
14
+ "source_ref": "jira-3001",
15
+ "source_timestamp": "2026-03-20T09:00:00+00:00",
16
+ "rule_text": "Block deleting Helm releases in the prod namespace; use the decommission runbook instead."
17
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "provider": "github",
3
+ "resource_pattern": "workflow/deploy-prod*",
4
+ "actions": [
5
+ "run"
6
+ ],
7
+ "scope": {},
8
+ "time_window": null,
9
+ "effect": "ESCALATE",
10
+ "constraint_class": "configuration",
11
+ "principal": "sre_lead",
12
+ "source_ref": "jira-3002",
13
+ "source_timestamp": "2026-03-20T10:30:00+00:00",
14
+ "rule_text": "Escalate manual runs of production deploy workflows for human review."
15
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "provider": "argocd",
3
+ "resource_pattern": "app/prod-*",
4
+ "actions": [
5
+ "sync"
6
+ ],
7
+ "scope": {
8
+ "prune": true
9
+ },
10
+ "time_window": null,
11
+ "effect": "ESCALATE",
12
+ "constraint_class": "configuration",
13
+ "principal": "sre_lead",
14
+ "source_ref": "jira-3003",
15
+ "source_timestamp": "2026-03-20T09:30:00+00:00",
16
+ "rule_text": "Escalate ArgoCD syncs of prod applications with --prune for human review."
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "provider": "kubernetes",
3
+ "resource_pattern": "*",
4
+ "actions": [
5
+ "delete"
6
+ ],
7
+ "scope": {
8
+ "namespace": "prod"
9
+ },
10
+ "time_window": null,
11
+ "effect": "BLOCK",
12
+ "constraint_class": "deletion",
13
+ "principal": "admin",
14
+ "source_ref": "jira-3004",
15
+ "source_timestamp": "2026-03-21T09:00:00+00:00",
16
+ "rule_text": "Block deleting any resource in the prod namespace (including deleting the namespace itself, which cascades to everything in it); only the runbook may delete in prod."
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "provider": "helm",
3
+ "resource_pattern": "release/*",
4
+ "actions": [
5
+ "delete"
6
+ ],
7
+ "scope": {
8
+ "env": "prod"
9
+ },
10
+ "time_window": null,
11
+ "effect": "BLOCK",
12
+ "constraint_class": "deletion",
13
+ "principal": "admin",
14
+ "source_ref": "jira-3005",
15
+ "source_timestamp": "2026-03-20T09:15:00+00:00",
16
+ "rule_text": "Block deleting Helm releases in any production environment (resolved from the kube context), whatever the namespace; use the decommission runbook instead."
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "provider": "sql",
3
+ "resource_pattern": "table/*",
4
+ "actions": [
5
+ "delete"
6
+ ],
7
+ "scope": {
8
+ "unbounded": true
9
+ },
10
+ "time_window": null,
11
+ "effect": "BLOCK",
12
+ "constraint_class": "deletion",
13
+ "principal": "admin",
14
+ "source_ref": "jira-5001",
15
+ "source_timestamp": "2026-04-01T09:00:00+00:00",
16
+ "rule_text": "Block unbounded DELETE statements against any table (a DELETE with no WHERE clause)."
17
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "provider": "sql",
3
+ "resource_pattern": "database/*",
4
+ "actions": [
5
+ "delete"
6
+ ],
7
+ "scope": {},
8
+ "time_window": null,
9
+ "effect": "BLOCK",
10
+ "constraint_class": "deletion",
11
+ "principal": "admin",
12
+ "source_ref": "jira-5002",
13
+ "source_timestamp": "2026-04-01T09:05:00+00:00",
14
+ "rule_text": "Block DROP DATABASE / DROP SCHEMA statements outright."
15
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "provider": "sql",
3
+ "resource_pattern": "table/*",
4
+ "actions": [
5
+ "update"
6
+ ],
7
+ "scope": {
8
+ "ddl": true,
9
+ "drop_column": true
10
+ },
11
+ "time_window": null,
12
+ "effect": "ESCALATE",
13
+ "constraint_class": "configuration",
14
+ "principal": "sre_lead",
15
+ "source_ref": "jira-5003",
16
+ "source_timestamp": "2026-04-01T09:10:00+00:00",
17
+ "rule_text": "Escalate ALTER TABLE ... DROP COLUMN statements for human review before they run."
18
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "provider": "mongodb",
3
+ "resource_pattern": "collection/*",
4
+ "actions": [
5
+ "delete"
6
+ ],
7
+ "scope": {
8
+ "unbounded": true
9
+ },
10
+ "time_window": null,
11
+ "effect": "BLOCK",
12
+ "constraint_class": "deletion",
13
+ "principal": "admin",
14
+ "source_ref": "jira-5004",
15
+ "source_timestamp": "2026-04-01T09:15:00+00:00",
16
+ "rule_text": "Block unbounded deleteMany/remove calls against any Mongo collection (an empty filter matches everything)."
17
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "provider": "migration",
3
+ "resource_pattern": "database/*",
4
+ "actions": [
5
+ "delete"
6
+ ],
7
+ "scope": {},
8
+ "time_window": null,
9
+ "effect": "BLOCK",
10
+ "constraint_class": "deletion",
11
+ "principal": "admin",
12
+ "source_ref": "jira-5006",
13
+ "source_timestamp": "2026-04-01T09:25:00+00:00",
14
+ "rule_text": "Block database-wiping migration commands (flyway clean, rails db:drop/db:reset, prisma migrate reset) outright."
15
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "provider": "terraform",
3
+ "effect": "ESCALATE",
4
+ "constraint_class": "configuration",
5
+ "principal": "sre_lead",
6
+ "source_ref": "plan-1001",
7
+ "source_timestamp": "2026-04-01T09:00:00+00:00",
8
+ "rule_text": "Escalate any terraform plan that touches more than 25 resources for human review.",
9
+ "max_intents": 25
10
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "provider": "terraform",
3
+ "effect": "BLOCK",
4
+ "constraint_class": "deletion",
5
+ "principal": "admin",
6
+ "source_ref": "plan-1002",
7
+ "source_timestamp": "2026-04-02T09:00:00+00:00",
8
+ "rule_text": "Block any terraform plan that deletes or replaces an aws_db_instance.",
9
+ "max_matching": {
10
+ "actions": [
11
+ "delete",
12
+ "replace"
13
+ ],
14
+ "resource_pattern": "aws_db_instance.*",
15
+ "max": 0
16
+ }
17
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "provider": "terraform",
3
+ "effect": "BLOCK",
4
+ "constraint_class": "deletion",
5
+ "principal": "admin",
6
+ "source_ref": "plan-1003",
7
+ "source_timestamp": "2026-04-03T09:00:00+00:00",
8
+ "rule_text": "Block a terraform plan that both deletes resources in us-east-1 and creates resources anywhere; split the change into separate plans for review.",
9
+ "forbid_together": [
10
+ {
11
+ "actions": [
12
+ "delete"
13
+ ],
14
+ "scope": {
15
+ "region": "us-east-1"
16
+ }
17
+ },
18
+ {
19
+ "actions": [
20
+ "create"
21
+ ]
22
+ }
23
+ ]
24
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "provider": "kubernetes",
3
+ "effect": "ESCALATE",
4
+ "constraint_class": "deletion",
5
+ "principal": "admin",
6
+ "source_ref": "plan-1004",
7
+ "source_timestamp": "2026-04-04T09:00:00+00:00",
8
+ "rule_text": "Escalate a kubectl batch where more than 50% of the touched resources are deletes.",
9
+ "ratio": {
10
+ "numerator": {
11
+ "actions": [
12
+ "delete"
13
+ ]
14
+ },
15
+ "denominator": {},
16
+ "max": 0.5
17
+ }
18
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "provider": "pulumi",
3
+ "resource_pattern": "aws/rds/*",
4
+ "actions": [
5
+ "delete",
6
+ "replace"
7
+ ],
8
+ "scope": {},
9
+ "time_window": null,
10
+ "effect": "ESCALATE",
11
+ "constraint_class": "deletion",
12
+ "principal": "admin",
13
+ "source_ref": "plan-5005",
14
+ "source_timestamp": "2026-04-01T09:20:00+00:00",
15
+ "rule_text": "Escalate any Pulumi delete or replace of an RDS resource for human review before applying."
16
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "provider": "terraform",
3
+ "resource_pattern": "aws_instance.*",
4
+ "actions": [
5
+ "delete",
6
+ "replace"
7
+ ],
8
+ "scope": {
9
+ "region": "us-east-1"
10
+ },
11
+ "time_window": null,
12
+ "effect": "ESCALATE",
13
+ "constraint_class": "deletion",
14
+ "principal": "admin",
15
+ "source_ref": "slack-perma-1",
16
+ "source_timestamp": "2026-02-10T18:30:00+00:00",
17
+ "rule_text": "Escalate any destructive terraform change to prod EC2 instances in us-east-1 for human review."
18
+ }