@raghulm/aegis-mcp 1.0.5 → 1.0.9

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.
package/README.md CHANGED
@@ -1,323 +1,340 @@
1
- <div align="center">
2
- <img src="docs/aegis-mcp-logo-v2.svg" width="100%" alt="Aegis MCP logo"/>
3
- <h1>🛡️ Aegis MCP Server</h1>
4
- <p><b>Aegis MCP is an open-source, DevSecOps-focused Model Context Protocol server that allows AI agents to safely interact with cloud infrastructure, CI/CD systems, and security tooling.</b></p>
5
-
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
- [![Python version](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
8
- [![MCP Protocol](https://img.shields.io/badge/MCP-Server-green.svg)](https://modelcontextprotocol.io/)
9
- [![Docker](https://img.shields.io/badge/docker-ready-blue.svg)](https://www.docker.com/)
10
- </div>
11
-
12
- ---
13
-
14
- **Aegis MCP Server** empowers AI assistants (like Claude, Cursor, and GitHub Copilot) to perform cloud architecture administration, security scanning, and network analyses directly from their execution environments. It wraps powerful underlying tools and SDKs into secure, audited MCP tool sets.
15
-
16
- ---
17
-
18
- ## 📸 Demo in Action
19
-
20
- ```text
21
- AI Agent: "Check if any S3 bucket is publicly accessible"
22
-
23
- Tool call → aws_check_s3_public_access
24
- Result → bucket audit report
25
- ```
26
-
27
- <p align="center">
28
- <img src="docs/demo-aegis.gif" width="900"/>
29
- </p>
30
-
31
- ---
32
-
33
- ## 🌟 Key Features
34
-
35
- - 🚀 **FastMCP Server** — Exposes domain-specific tools for AWS, Kubernetes, security scanning, Git, network analysis, and CI/CD pipelines.
36
- - 🔐 **Flexible Authorization** — JWT-based RBAC for production deployments; automatically disabled for local stdio sessions (Claude Desktop, Agent IDEs).
37
- - 📜 **Structured Audit Logging** — Emits clean JSON audit logs for every invocation, suitable for SIEM integrations.
38
- - 🛠 **Expandable Tooling** — Easily add new integrations. Includes ready-to-use scanners for dependencies, secrets, SSL/TLS certs, Semgrep, Trivy, and more.
39
- - 📦 **Docker Ready** — Containerized deployment using a non-root runtime with built-in health checks.
40
- - 🌐 **ASGI Integration** — FastAPI health endpoint alongside MCP streamable-http transport.
41
-
42
- ---
43
-
44
- ## 📐 Architecture
45
-
46
- ```mermaid
47
- flowchart TD
48
- Client[MCP Client / AI Agent] -->|Tool Call| AuthZ[Auth & RBAC Layer]
49
-
50
- subgraph aegis-mcp["Aegis MCP Server"]
51
- AuthZ --> Audit[Audit Logger]
52
- Audit --> ToolsLayer[Tool Dispatch Layer]
53
- end
54
-
55
- ToolsLayer --> AWS[AWS SDK]
56
- ToolsLayer --> K8s[kubectl / K8s SDK]
57
- ToolsLayer --> Sec[Trivy / Semgrep]
58
- ToolsLayer --> Net[Nmap / SSL]
59
- ToolsLayer --> Git[Git CLI]
60
- ```
61
-
62
- The server receives MCP tool-call requests over **streamable HTTP** or **stdio** transport. In HTTP mode, each request requires a JWT bearer token for authorization. In stdio mode (local usage), authorization is automatically disabled.
63
-
64
- ---
65
-
66
- ## 📂 Repository Structure
67
-
68
- ```text
69
- aegis-mcp/
70
-
71
- ├── server/
72
- ├── main.py
73
- │ ├── health.py
74
- │ ├── auth.py
75
- └── tools/
76
- ├── aws/
77
- │ ├── kubernetes/
78
- │ ├── security/
79
- └── network/
80
-
81
- ├── policies/
82
- ├── tests/
83
- ├── Dockerfile
84
- └── run_stdio.py
85
- ```
86
-
87
- ---
88
-
89
- ## 🧰 Available Tools
90
-
91
- ### Example Tool Invocation
92
-
93
- ```text
94
- Tool: security_run_trivy_scan
95
-
96
- Input:
97
- image=nginx:latest
98
-
99
- Output:
100
- CRITICAL: 2
101
- HIGH: 4
102
- MEDIUM: 7
103
- ```
104
-
105
- ### Cloud & DevOps
106
- | Tool | Description |
107
- |------|-------------|
108
- | `aws_list_ec2_instances` | List EC2 instances in a specific AWS region |
109
- | `aws_check_s3_public_access` | Audit S3 buckets for public access settings |
110
- | `k8s_list_pods` | List Kubernetes pods in a given namespace |
111
- | `cicd_pipeline_status` | Fetch CI/CD pipeline execution status |
112
- | `git_recent_commits` | Fetch recent commit history from the active Git repo |
113
-
114
- ### Application Security & SAST
115
- | Tool | Description |
116
- |------|-------------|
117
- | `security_semgrep_scan` | Run Semgrep SAST scan on a local directory or file |
118
- | `security_run_trivy_scan` | Run Trivy vulnerability scan on a container image |
119
- | `security_scan_secrets` | Scan files/directories for exposed secrets |
120
- | `security_check_dependencies` | Check dependency files for known CVEs via OSV.dev |
121
-
122
- ### Network & Infrastructure Security
123
- | Tool | Description |
124
- |------|-------------|
125
- | `k8s_security_audit` | Audit Kubernetes clusters (privileged containers, wildcard RBAC, etc.) |
126
- | `network_port_scan` | TCP port scan to detect exposed services |
127
- | `security_check_ssl_certificate` | Validate SSL/TLS certificate details and expiry |
128
- | `security_check_http_headers` | Audit URLs for security headers (HSTS, CSP, etc.) |
129
-
130
- > [!IMPORTANT]
131
- > **SAST (Semgrep scan) works only on Agent IDEs (e.g., Antigravity, Cursor) or Claude Co-work.**
132
- > It does **not** work on Claude Desktop due to Windows subprocess pipe limitations with `semgrep-core.exe`. All other tools (secrets scan, SSL check, port scan, etc.) work on all platforms including Claude Desktop.
133
-
134
- ---
135
-
136
- ## 🚀 Getting Started
137
-
138
- ### Prerequisites
139
-
140
- - **Python 3.12+**
141
- - **Node.js 18+** (only if you want to run via npm/npx)
142
- - **Semgrep** `pip install semgrep` (for SAST scanning)
143
- - Optional: AWS CLI / `boto3`, `kubectl`, Trivy (for their respective tools)
144
-
145
- ### Installation
146
-
147
- ```bash
148
- git clone https://github.com/raghulvj01/aegis-mcp.git
149
- cd aegis-mcp
150
-
151
- # Create virtual environment
152
- python -m venv .venv
153
-
154
- # Activate it
155
- # Linux/Mac:
156
- source .venv/bin/activate
157
- # Windows:
158
- .venv\Scripts\activate
159
-
160
- # Install dependencies
161
- pip install -r requirements.txt
162
- ```
163
-
164
- ### Install via npm (Public Package)
165
-
166
- ```bash
167
- npm install -g @raghulm/aegis-mcp
168
- # or run without installing globally:
169
- npx -y @raghulm/aegis-mcp
170
- ```
171
-
172
- On first run, the npm wrapper creates a local Python virtual environment and installs dependencies from `requirements.txt` automatically.
173
-
174
- ---
175
-
176
- ## 🤖 Usage with AI Agents
177
-
178
- ### Agent IDE / Antigravity (Recommended)
179
-
180
- Add to your MCP config (e.g., `mcp_config.json`):
181
-
182
- ```json
183
- {
184
- "mcpServers": {
185
- "aegis": {
186
- "command": "npx",
187
- "args": ["-y", "@raghulm/aegis-mcp"]
188
- }
189
- }
190
- }
191
- ```
192
-
193
- > ✅ **All 12 tools work**, including Semgrep SAST.
194
-
195
- ### Claude Desktop
196
-
197
- Add to `claude_desktop_config.json`:
198
- - **Windows**: `%LOCALAPPDATA%\Packages\Claude_...\LocalCache\Roaming\Claude\`
199
- - **Mac**: `~/Library/Application Support/Claude/`
200
-
201
- ```json
202
- {
203
- "mcpServers": {
204
- "aegis": {
205
- "command": "npx",
206
- "args": ["-y", "@raghulm/aegis-mcp"]
207
- }
208
- }
209
- }
210
- ```
211
-
212
- > ⚠️ **11 of 12 tools work.** Semgrep SAST does not work due to Windows pipe limitations.
213
-
214
- ### Cursor / Windsurf (HTTP Mode)
215
-
216
- Start the server, then add to `.cursor/mcp.json`:
217
-
218
- ```bash
219
- uvicorn server.health:app --host 0.0.0.0 --port 8000
220
- ```
221
-
222
- ```json
223
- {
224
- "mcpServers": {
225
- "aegis": {
226
- "url": "http://localhost:8000/mcp"
227
- }
228
- }
229
- }
230
- ```
231
-
232
- ### Docker Deployment
233
-
234
- ```bash
235
- docker build -t aegis-mcp .
236
- docker run -p 8000:8000 aegis-mcp
237
- ```
238
-
239
- ---
240
-
241
- ## ⚙️ Configuration
242
-
243
- | Variable | Description | Default |
244
- |----------|-------------|---------|
245
- | `MCP_AUTH_DISABLED` | Disable JWT auth (auto-set for stdio) | `false` |
246
- | `MCP_SERVICE_NAME` | Name of the MCP service | `aegis` |
247
- | `MCP_ENV` | Environment (`dev`, `staging`, `prod`) | `dev` |
248
- | `MCP_ROLES_FILE` | Path to roles policy YAML | `policies/roles.yaml` |
249
- | `MCP_SCOPES_FILE` | Path to scopes policy YAML | `policies/scope_rules.yaml` |
250
- | `OIDC_ISSUER` | Expected JWT `iss` claim | *None* |
251
- | `OIDC_AUDIENCE` | Expected JWT `aud` claim | *None* |
252
-
253
- ---
254
-
255
- ## 🗝 Access Control
256
-
257
- In **HTTP mode**, every tool requires a `token` argument containing a JWT. The authorization layer checks roles and scopes defined in `policies/roles.yaml` and `policies/scope_rules.yaml`.
258
-
259
- In **stdio mode** (local usage via `run_stdio.py`), authorization is **automatically disabled** — no token required.
260
-
261
- ### Policy Example (`policies/roles.yaml`)
262
-
263
- ```yaml
264
- roles:
265
- viewer:
266
- - aws_list_ec2_instances
267
- - k8s_list_pods
268
- security:
269
- - security_run_trivy_scan
270
- - security_semgrep_scan
271
- admin:
272
- - aws_list_ec2_instances
273
- - k8s_list_pods
274
- - security_run_trivy_scan
275
- - security_semgrep_scan
276
- # ... all tools
277
- ```
278
-
279
- ---
280
-
281
- ## 📝 Audit Logging
282
-
283
- The `@audit_tool_call` decorator emits structured JSON logs for every invocation:
284
-
285
- ```json
286
- {
287
- "timestamp": "2026-03-06T08:00:01+00:00",
288
- "level": "INFO",
289
- "event": "tool_call_succeeded",
290
- "tool": "security_run_trivy_scan",
291
- "duration_ms": 1204
292
- }
293
- ```
294
-
295
- ---
296
-
297
- ## 🛡️ Security Best Practices
298
-
299
- 1. **Enforce JWT Signature Validation** — Update `server/auth.py` to verify RS256 JWTs using your IdP's JWKS endpoint for production.
300
- 2. **Least-Privilege Credentials** — Assign ReadOnly IAM / K8s roles to the server environment.
301
- 3. **Monitor Audit Logs** — Forward JSON logs to a SIEM. Set up anomaly detection for aggressive looping.
302
-
303
- ---
304
-
305
- ## 🛣️ Roadmap
306
-
307
- - [ ] Terraform security scanner
308
- - [ ] IAM policy risk detection
309
- - [ ] Kubernetes misconfiguration scanner (Basic `k8s_security_audit` implemented!)
310
- - [ ] GitHub Actions security audit
311
- - [ ] Cloud cost analysis tools
312
-
313
- ---
314
-
315
- ## 🤝 Contributing
316
-
317
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for contribution and maintainer release workflows.
318
-
319
- ---
320
-
321
- ## 📄 License
322
-
323
- Distributed under the MIT License. See `LICENSE` for more information.
1
+ <div align="center">
2
+ <img src="docs/aegis-mcp-logo-v2.svg" width="100%" alt="Aegis MCP logo"/>
3
+ <h1>🛡️ Aegis MCP Server</h1>
4
+ <p><b>Aegis MCP is an open-source, DevSecOps-focused Model Context Protocol server that allows AI agents to safely interact with cloud infrastructure, CI/CD systems, and security tooling.</b></p>
5
+
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
+ [![Python version](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
8
+ [![MCP Protocol](https://img.shields.io/badge/MCP-Server-green.svg)](https://modelcontextprotocol.io/)
9
+ [![Docker](https://img.shields.io/badge/docker-ready-blue.svg)](https://www.docker.com/)
10
+ </div>
11
+
12
+ ---
13
+
14
+ **Aegis MCP Server** empowers AI assistants (like Claude, Cursor, and GitHub Copilot) to perform cloud architecture administration, security scanning, and network analyses directly from their execution environments. It wraps powerful underlying tools and SDKs into secure, audited MCP tool sets.
15
+
16
+ ---
17
+
18
+ ## 📸 Demo in Action
19
+
20
+ ```text
21
+ AI Agent: "Check if any S3 bucket is publicly accessible"
22
+
23
+ Tool call → aws_check_s3_public_access
24
+ Result → bucket audit report
25
+ ```
26
+
27
+ <p align="center">
28
+ <img src="docs/demo-aegis.gif" width="900"/>
29
+ </p>
30
+
31
+ ---
32
+
33
+ ## 🌟 Key Features
34
+
35
+ - 🚀 **FastMCP Server** — Exposes domain-specific tools for AWS, Kubernetes, security scanning, Git, network analysis, Jenkins, and CI/CD pipelines.
36
+ - 🔐 **Flexible Authorization** — JWT-based RBAC for production deployments; automatically disabled for local stdio sessions (Claude Desktop, Agent IDEs).
37
+ - 📜 **Structured Audit Logging** — Emits clean JSON audit logs for every invocation, suitable for SIEM integrations.
38
+ - 🛠 **Expandable Tooling** — Easily add new integrations. Includes ready-to-use scanners for dependencies, secrets, SSL/TLS certs, Semgrep, Trivy, and more.
39
+ - 📦 **Docker Ready** — Containerized deployment using a non-root runtime with built-in health checks.
40
+ - 🌐 **ASGI Integration** — FastAPI health endpoint alongside MCP streamable-http transport.
41
+
42
+ ---
43
+
44
+ ## 📐 Architecture
45
+
46
+ ```mermaid
47
+ flowchart TD
48
+ Client[MCP Client / AI Agent] -->|Tool Call| AuthZ[Auth & RBAC Layer]
49
+
50
+ subgraph aegis-mcp["Aegis MCP Server"]
51
+ AuthZ --> Audit[Audit Logger]
52
+ Audit --> ToolsLayer[Tool Dispatch Layer]
53
+ end
54
+
55
+ ToolsLayer --> AWS[AWS SDK]
56
+ ToolsLayer --> K8s[kubectl / K8s SDK]
57
+ ToolsLayer --> Sec[Trivy / Semgrep]
58
+ ToolsLayer --> Net[Nmap / SSL]
59
+ ToolsLayer --> Git[Git CLI]
60
+ ToolsLayer --> Jenkins[Jenkins API]
61
+ ```
62
+
63
+ The server receives MCP tool-call requests over **streamable HTTP** or **stdio** transport. In HTTP mode, each request requires a JWT bearer token for authorization. In stdio mode (local usage), authorization is automatically disabled.
64
+
65
+ ---
66
+
67
+ ## 📂 Repository Structure
68
+
69
+ ```text
70
+ aegis-mcp/
71
+
72
+ ├── server/
73
+ │ ├── main.py
74
+ │ ├── health.py
75
+ ├── auth.py
76
+ └── tools/
77
+ │ ├── aws/
78
+ │ ├── cicd/ # Jenkins + pipeline tools
79
+ ├── kubernetes/
80
+ ├── security/
81
+ │ └── network/
82
+
83
+ ├── policies/
84
+ ├── tests/
85
+ ├── Dockerfile
86
+ └── run_stdio.py
87
+ ```
88
+
89
+ ---
90
+
91
+ ## 🧰 Available Tools
92
+
93
+ ### Example Tool Invocation
94
+
95
+ ```text
96
+ Tool: security_run_trivy_scan
97
+
98
+ Input:
99
+ image=nginx:latest
100
+
101
+ Output:
102
+ CRITICAL: 2
103
+ HIGH: 4
104
+ MEDIUM: 7
105
+ ```
106
+
107
+ ### Cloud & DevOps
108
+ | Tool | Description |
109
+ |------|-------------|
110
+ | `aws_list_ec2_instances` | List EC2 instances in a specific AWS region |
111
+ | `aws_check_s3_public_access` | Audit S3 buckets for public access settings |
112
+ | `k8s_list_pods` | List Kubernetes pods in a given namespace |
113
+ | `cicd_pipeline_status` | Fetch CI/CD pipeline execution status |
114
+ | `git_recent_commits` | Fetch recent commit history from the active Git repo |
115
+
116
+ ### Jenkins CI/CD
117
+ | Tool | Description |
118
+ |------|-------------|
119
+ | `jenkins_list_jobs` | List all jobs on a Jenkins server |
120
+ | `jenkins_get_job_info` | Get detailed info about a specific job (build history, health) |
121
+ | `jenkins_create_job` | Create a new Jenkins job from XML config |
122
+ | `jenkins_trigger_build` | Trigger a build with optional parameters (JSON) |
123
+ | `jenkins_get_build_info` | Get result, duration, and status of a specific build |
124
+ | `jenkins_get_build_log` | Fetch console output of a build |
125
+ | `jenkins_delete_job` | Delete a Jenkins job |
126
+
127
+ > [!TIP]
128
+ > **Jenkins tools require per-call credentials** — pass `url`, `username`, and `api_token` with each call. No global env vars needed.
129
+
130
+ ### Application Security & SAST
131
+ | Tool | Description |
132
+ |------|-------------|
133
+ | `security_semgrep_scan` | Run Semgrep SAST scan on a local directory or file |
134
+ | `security_run_trivy_scan` | Run Trivy vulnerability scan on a container image |
135
+ | `security_scan_secrets` | Scan files/directories for exposed secrets |
136
+ | `security_check_dependencies` | Check dependency files for known CVEs via OSV.dev |
137
+
138
+ ### Network & Infrastructure Security
139
+ | Tool | Description |
140
+ |------|-------------|
141
+ | `k8s_security_audit` | Audit Kubernetes clusters (privileged containers, wildcard RBAC, etc.) |
142
+ | `network_port_scan` | TCP port scan to detect exposed services |
143
+ | `security_check_ssl_certificate` | Validate SSL/TLS certificate details and expiry |
144
+ | `security_check_http_headers` | Audit URLs for security headers (HSTS, CSP, etc.) |
145
+
146
+ > [!IMPORTANT]
147
+ > **SAST (Semgrep scan) works only on Agent IDEs (e.g., Antigravity, Cursor) or Claude Co-work.**
148
+ > It does **not** work on Claude Desktop due to Windows subprocess pipe limitations with `semgrep-core.exe`. All other tools (secrets scan, SSL check, port scan, etc.) work on all platforms including Claude Desktop.
149
+
150
+ ---
151
+
152
+ ## 🚀 Getting Started
153
+
154
+ ### Prerequisites
155
+
156
+ - **Python 3.12+**
157
+ - **Node.js 18+** (only if you want to run via npm/npx)
158
+ - **Semgrep** — `pip install semgrep` (for SAST scanning)
159
+ - Optional: AWS CLI / `boto3`, `kubectl`, Trivy (for their respective tools)
160
+
161
+ ### Installation
162
+
163
+ ```bash
164
+ git clone https://github.com/raghulvj01/aegis-mcp.git
165
+ cd aegis-mcp
166
+
167
+ # Create virtual environment
168
+ python -m venv .venv
169
+
170
+ # Activate it
171
+ # Linux/Mac:
172
+ source .venv/bin/activate
173
+ # Windows:
174
+ .venv\Scripts\activate
175
+
176
+ # Install dependencies
177
+ pip install -r requirements.txt
178
+ ```
179
+
180
+ ### Install via npm (Public Package)
181
+
182
+ ```bash
183
+ npm install -g @raghulm/aegis-mcp
184
+ # or run without installing globally:
185
+ npx -y @raghulm/aegis-mcp
186
+ ```
187
+
188
+ On first run, the npm wrapper creates a local Python virtual environment and installs dependencies from `requirements.txt` automatically.
189
+
190
+ ---
191
+
192
+ ## 🤖 Usage with AI Agents
193
+
194
+ ### Agent IDE / Antigravity (Recommended)
195
+
196
+ Add to your MCP config (e.g., `mcp_config.json`):
197
+
198
+ ```json
199
+ {
200
+ "mcpServers": {
201
+ "aegis": {
202
+ "command": "npx",
203
+ "args": ["-y", "@raghulm/aegis-mcp"]
204
+ }
205
+ }
206
+ }
207
+ ```
208
+
209
+ > ✅ **All 19 tools work**, including Semgrep SAST and Jenkins integration.
210
+
211
+ ### Claude Desktop
212
+
213
+ Add to `claude_desktop_config.json`:
214
+ - **Windows**: `%LOCALAPPDATA%\Packages\Claude_...\LocalCache\Roaming\Claude\`
215
+ - **Mac**: `~/Library/Application Support/Claude/`
216
+
217
+ ```json
218
+ {
219
+ "mcpServers": {
220
+ "aegis": {
221
+ "command": "npx",
222
+ "args": ["-y", "@raghulm/aegis-mcp"]
223
+ }
224
+ }
225
+ }
226
+ ```
227
+
228
+ > ⚠️ **18 of 19 tools work.** Semgrep SAST does not work due to Windows pipe limitations.
229
+
230
+ ### Cursor / Windsurf (HTTP Mode)
231
+
232
+ Start the server, then add to `.cursor/mcp.json`:
233
+
234
+ ```bash
235
+ uvicorn server.health:app --host 0.0.0.0 --port 8000
236
+ ```
237
+
238
+ ```json
239
+ {
240
+ "mcpServers": {
241
+ "aegis": {
242
+ "url": "http://localhost:8000/mcp"
243
+ }
244
+ }
245
+ }
246
+ ```
247
+
248
+ ### Docker Deployment
249
+
250
+ ```bash
251
+ docker build -t aegis-mcp .
252
+ docker run -p 8000:8000 aegis-mcp
253
+ ```
254
+
255
+ ---
256
+
257
+ ## ⚙️ Configuration
258
+
259
+ | Variable | Description | Default |
260
+ |----------|-------------|---------|
261
+ | `MCP_AUTH_DISABLED` | Disable JWT auth (auto-set for stdio) | `false` |
262
+ | `MCP_SERVICE_NAME` | Name of the MCP service | `aegis` |
263
+ | `MCP_ENV` | Environment (`dev`, `staging`, `prod`) | `dev` |
264
+ | `MCP_ROLES_FILE` | Path to roles policy YAML | `policies/roles.yaml` |
265
+ | `MCP_SCOPES_FILE` | Path to scopes policy YAML | `policies/scope_rules.yaml` |
266
+ | `OIDC_ISSUER` | Expected JWT `iss` claim | *None* |
267
+ | `OIDC_AUDIENCE` | Expected JWT `aud` claim | *None* |
268
+
269
+ ---
270
+
271
+ ## 🗝 Access Control
272
+
273
+ In **HTTP mode**, every tool requires a `token` argument containing a JWT. The authorization layer checks roles and scopes defined in `policies/roles.yaml` and `policies/scope_rules.yaml`.
274
+
275
+ In **stdio mode** (local usage via `run_stdio.py`), authorization is **automatically disabled** — no token required.
276
+
277
+ ### Policy Example (`policies/roles.yaml`)
278
+
279
+ ```yaml
280
+ roles:
281
+ viewer:
282
+ - aws_list_ec2_instances
283
+ - k8s_list_pods
284
+ security:
285
+ - security_run_trivy_scan
286
+ - security_semgrep_scan
287
+ admin:
288
+ - aws_list_ec2_instances
289
+ - k8s_list_pods
290
+ - security_run_trivy_scan
291
+ - security_semgrep_scan
292
+ # ... all tools
293
+ ```
294
+
295
+ ---
296
+
297
+ ## 📝 Audit Logging
298
+
299
+ The `@audit_tool_call` decorator emits structured JSON logs for every invocation:
300
+
301
+ ```json
302
+ {
303
+ "timestamp": "2026-03-06T08:00:01+00:00",
304
+ "level": "INFO",
305
+ "event": "tool_call_succeeded",
306
+ "tool": "security_run_trivy_scan",
307
+ "duration_ms": 1204
308
+ }
309
+ ```
310
+
311
+ ---
312
+
313
+ ## 🛡️ Security Best Practices
314
+
315
+ 1. **Enforce JWT Signature Validation** — Update `server/auth.py` to verify RS256 JWTs using your IdP's JWKS endpoint for production.
316
+ 2. **Least-Privilege Credentials** — Assign ReadOnly IAM / K8s roles to the server environment.
317
+ 3. **Monitor Audit Logs** — Forward JSON logs to a SIEM. Set up anomaly detection for aggressive looping.
318
+
319
+ ---
320
+
321
+ ## 🛣️ Roadmap
322
+
323
+ - [x] Jenkins CI/CD integration (list, create, trigger, inspect, delete jobs) ✅
324
+ - [ ] Terraform security scanner
325
+ - [ ] IAM policy risk detection
326
+ - [ ] Kubernetes misconfiguration scanner (Basic `k8s_security_audit` implemented!)
327
+ - [ ] GitHub Actions security audit
328
+ - [ ] Cloud cost analysis tools
329
+
330
+ ---
331
+
332
+ ## 🤝 Contributing
333
+
334
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for contribution and maintainer release workflows.
335
+
336
+ ---
337
+
338
+ ## 📄 License
339
+
340
+ Distributed under the MIT License. See `LICENSE` for more information.