-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathsecurity-audit.policy.yaml
More file actions
152 lines (133 loc) · 3.03 KB
/
security-audit.policy.yaml
File metadata and controls
152 lines (133 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# Security Audit Agent Policy
# Constrains a security auditing agent to read-only operations with
# tightly controlled write access for reports. The agent can scan
# code, check for vulnerabilities, inspect configurations, and generate
# audit reports — but NEVER modify source code or deploy anything.
version: "1.0"
name: "security-audit"
description: "Policy for a security audit agent that scans code, checks dependencies, inspects configurations, validates secrets management, and generates audit reports."
capabilities:
- tool: "file:read"
scope:
paths:
- "./**"
- tool: "file:write"
scope:
paths:
- "./audit-reports/**"
- "./tmp/audit/**"
- tool: "file:copy"
scope:
paths:
- "./**"
- tool: "directory:list"
scope:
paths:
- "./**"
- tool: "directory:create"
scope:
paths:
- "./audit-reports/**"
- "./tmp/audit/**"
- tool: "command:run"
scope:
binaries:
- "npm"
- "npx"
- "node"
- "git"
- "grep"
- "find"
- "wc"
- "cat"
- "ls"
- "sha256sum"
- "openssl"
- "semgrep"
- "trivy"
- "snyk"
- tool: "git:diff"
scope:
repos: ["."]
- tool: "git:status"
scope:
repos: ["."]
- tool: "http:request"
scope:
domains:
- "api.github.com"
- "registry.npmjs.org"
- "osv.dev"
- "cve.circl.lu"
- "nvd.nist.gov"
methods:
- "GET"
- tool: "env:read"
scope: {}
- tool: "network:dns"
scope:
domains:
- "api.github.com"
- "registry.npmjs.org"
- "osv.dev"
limits:
max_runtime_ms: 1800000 # 30 minutes
max_output_bytes: 104857600 # 100 MB
max_files_changed: 20 # Only report files
max_retries: 2
max_cost_usd: 5.0
gates:
- action: "command:run"
approval: "human"
risk_level: "high"
condition: "outside_scope"
- action: "http:request"
approval: "auto"
risk_level: "low"
evidence:
require:
- "checksums"
- "diffs"
- "exit_codes"
- "logs"
format: "jsonl"
forbidden:
- pattern: "**/.env"
- pattern: "**/.env.*"
- pattern: "**/credentials*"
- pattern: "**/secrets*"
- pattern: "**/private_key*"
- pattern: "**/*.pem"
- pattern: "**/*.key"
- pattern: "rm -rf"
- pattern: "curl | sh"
- pattern: "wget | sh"
- pattern: "npm publish"
- pattern: "npm install"
- pattern: "git push"
- pattern: "git commit"
- pattern: "docker run"
- pattern: "kubectl"
- pattern: "eval("
- pattern: "exec("
session:
max_actions: 300
max_denials: 30
rate_limit:
max_per_minute: 60
escalation:
- after_actions: 100
require: human_checkin
- after_minutes: 15
require: human_checkin
remediation:
rules:
- match: "ENOENT"
action: "skip"
- match: "EACCES"
action: "skip"
- match: "ECONNREFUSED"
action: "retry"
- match: "timeout"
action: "retry"
fallback_chain: ["retry", "skip", "abort"]