-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-ops.json
More file actions
165 lines (165 loc) · 4.66 KB
/
docker-ops.json
File metadata and controls
165 lines (165 loc) · 4.66 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
153
154
155
156
157
158
159
160
161
162
163
164
165
{
"version": "0.2",
"identity_profiles": [
{
"id": "docker-monitor",
"provider": "none",
"subject": {
"kind": "service",
"principal": "agent://ops/docker-monitor",
"display_name": "Docker Monitor Agent"
},
"trust": {
"level": "restricted",
"constraints": {
"max_autonomy": "restricted",
"escalation": "fail"
}
}
},
{
"id": "docker-build",
"provider": "none",
"subject": {
"kind": "service",
"principal": "agent://ops/docker-build",
"display_name": "Docker Build Agent"
},
"trust": {
"level": "supervised",
"constraints": {
"max_autonomy": "supervised",
"escalation": "human-approval"
}
}
}
],
"evidence_profiles": [
{
"id": "docker-evidence",
"provider": "ssh",
"payload": {
"bind": ["execution_id", "declared_identity", "command", "result"],
"format": "canonical-json"
},
"verify": { "required": false }
}
],
"workflows": [
{
"id": "docker-ops",
"name": "Docker Operations",
"contract": {
"sandbox": "permissive",
"network": "unrestricted",
"audit": "always"
},
"tasks": [
{
"id": "list-containers",
"name": "List Running Containers",
"shell": {
"program": "docker",
"args": ["ps", "--format", "json"]
},
"target": { "session_target": "shell" },
"identity": { "ref": "docker-monitor" },
"output": {
"format": "ndjson",
"preview_bytes": 4000,
"offload": "auto"
},
"schedule": { "cron": "*/5 * * * *" }
},
{
"id": "check-images",
"name": "Check Docker Images",
"shell": {
"program": "docker",
"args": ["images", "--format", "json"]
},
"target": { "session_target": "shell" },
"identity": { "ref": "docker-monitor" },
"output": {
"format": "ndjson",
"preview_bytes": 4000,
"offload": "auto"
},
"schedule": { "cron": "0 */6 * * *" }
},
{
"id": "system-df",
"name": "Docker Disk Usage",
"shell": {
"program": "docker",
"args": ["system", "df", "--format", "json"]
},
"target": { "session_target": "shell" },
"identity": { "ref": "docker-monitor" },
"output": {
"format": "json",
"preview_bytes": 2000
},
"schedule": { "cron": "0 8 * * *" }
},
{
"id": "build-image",
"name": "Build Application Image",
"shell": {
"program": "docker",
"args": ["build", "-t", "myapp:latest", "."]
},
"target": { "session_target": "shell" },
"identity": { "ref": "docker-build" },
"evidence": { "ref": "docker-evidence" },
"output": { "format": "text" },
"schedule": { "cron": "0 2 * * *" },
"on_failure": {
"id": "triage-build-failure",
"name": "Triage Build Failure",
"prompt": "The Docker image build failed. Analyze the build output to determine whether this is a Dockerfile syntax issue, dependency resolution failure, or base image problem, and recommend the next step.",
"target": {
"session_target": "isolated",
"agent_id": "main"
},
"intent": {
"mode": "plan",
"read_only": true
},
"context": {
"retrieval": "recent",
"limit": 5
},
"delivery": {
"mode": "announce",
"to": "@owner_dm"
}
}
},
{
"id": "prune-unused",
"name": "Prune Unused Docker Resources",
"shell": {
"program": "docker",
"args": ["system", "prune", "-f"]
},
"target": { "session_target": "shell" },
"identity": { "ref": "docker-build" },
"evidence": { "ref": "docker-evidence" },
"output": { "format": "text" },
"contract": {
"network": "none",
"required_trust_level": "supervised",
"trust_enforcement": "strict"
},
"approval": {
"required": true,
"policy": "manual",
"risk_level": "high"
},
"schedule": { "cron": "0 3 * * 0" }
}
]
}
]
}