Skip to content

Commit 5a1c086

Browse files
fix(security): Docker/infra hardening — CORS, Grafana, .dockerignore, CODEOWNERS
- Replace hardcoded Grafana admin passwords with env var refs in 7 docker-compose files (CWE-798) - Replace wildcard CORS allow_origins=[*] with env-driven origins in 6 production services (CWE-942) - Add secret exclusion patterns (.env, *.key, *.pem, *.p12) to root and caas .dockerignore files (CWE-532) - Add security contact, supported versions, and 90-day disclosure policy to SECURITY.md (CWE-693) - Add CODEOWNERS rules for scripts/, Dockerfile, docker-compose*, .dockerignore, .clusterfuzzlite/ (CWE-862) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0716f10 commit 5a1c086

File tree

17 files changed

+69
-13
lines changed

17 files changed

+69
-13
lines changed

.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,13 @@
1717
.vscode
1818
coverage.xml
1919
node_modules
20+
21+
# Security: exclude secrets from build context
22+
.env
23+
.env.*
24+
*.key
25+
*.pem
26+
*.p12
27+
*.crt
28+
secrets/
29+
*.token

.github/CODEOWNERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@
2727
/packages/*/src/**/identity* @microsoft/agent-governance-toolkit
2828
/packages/*/src/**/crypto* @microsoft/agent-governance-toolkit
2929

30+
# Infrastructure & container security — require maintainer review
31+
/scripts/ @microsoft/agent-governance-toolkit
32+
**/Dockerfile @microsoft/agent-governance-toolkit
33+
**/docker-compose* @microsoft/agent-governance-toolkit
34+
/.dockerignore @microsoft/agent-governance-toolkit
35+
/.clusterfuzzlite/ @microsoft/agent-governance-toolkit
36+
3037
# Documentation
3138
/docs/ @microsoft/agent-governance-toolkit
3239
*.md @microsoft/agent-governance-toolkit

SECURITY.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,31 @@ please review the latest guidance for Microsoft repositories at
1313

1414
<!-- END MICROSOFT SECURITY.MD BLOCK -->
1515

16+
## Security Contact
17+
18+
To report a vulnerability, email **secure@microsoft.com**. You will receive acknowledgement
19+
within 24 hours and a detailed response within 72 hours indicating next steps.
20+
21+
## Supported Versions
22+
23+
| Version | Supported |
24+
|---------|--------------------|
25+
| 2.1.x | :white_check_mark: |
26+
| 2.0.x | :white_check_mark: |
27+
| < 2.0 | :x: |
28+
29+
## Disclosure Policy
30+
31+
We follow a **90-day coordinated disclosure** timeline. After a vulnerability is
32+
reported and confirmed, we will:
33+
34+
1. Acknowledge receipt within **24 hours**.
35+
2. Provide a fix or mitigation within **90 days**.
36+
3. Coordinate public disclosure with the reporter after the fix is released.
37+
38+
If a fix requires more than 90 days, we will negotiate an extended timeline with
39+
the reporter before any public disclosure.
40+
1641
## Security Advisories
1742

1843
### CostGuard Organization Kill Switch Bypass (Fixed in v2.1.0)

packages/agent-hypervisor/examples/docker-compose/app/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ async def lifespan(app: FastAPI): # type: ignore[no-untyped-def]
155155

156156
app.add_middleware(
157157
CORSMiddleware,
158-
allow_origins=["*"],
158+
allow_origins=os.environ.get("CORS_ALLOWED_ORIGINS", "http://localhost:3000,http://localhost:8080").split(","),
159159
allow_methods=["*"],
160160
allow_headers=["*"],
161161
)

packages/agent-hypervisor/src/hypervisor/api/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from __future__ import annotations
1313

1414
import logging
15+
import os
1516
from contextlib import asynccontextmanager
1617
from typing import Any
1718

@@ -126,7 +127,7 @@ def create_app() -> FastAPI:
126127

127128
application.add_middleware(
128129
CORSMiddleware,
129-
allow_origins=["*"],
130+
allow_origins=os.environ.get("CORS_ALLOWED_ORIGINS", "http://localhost:3000,http://localhost:8080").split(","),
130131
allow_credentials=True,
131132
allow_methods=["*"],
132133
allow_headers=["*"],

packages/agent-mesh/examples/docker-compose/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ services:
141141
- "3000:3000"
142142
environment:
143143
GF_SECURITY_ADMIN_USER: admin
144-
GF_SECURITY_ADMIN_PASSWORD: agentmesh
144+
GF_SECURITY_ADMIN_PASSWORD: ${GF_ADMIN_PASSWORD:?Set GF_ADMIN_PASSWORD in .env}
145145
GF_USERS_ALLOW_SIGN_UP: "false"
146146
GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH: /etc/grafana/provisioning/dashboards/trust-metrics.json
147147
volumes:

packages/agent-os/examples/carbon-auditor/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ services:
5050
container_name: carbon-auditor-grafana
5151
environment:
5252
- GF_SECURITY_ADMIN_USER=admin
53-
- GF_SECURITY_ADMIN_PASSWORD=admin
53+
- GF_SECURITY_ADMIN_PASSWORD=${GF_ADMIN_PASSWORD:?Set GF_ADMIN_PASSWORD in .env}
5454
- GF_USERS_ALLOW_SIGN_UP=false
5555
volumes:
5656
- ./observability/grafana/provisioning:/etc/grafana/provisioning:ro

packages/agent-os/examples/defi-sentinel/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ services:
4444
container_name: defi-sentinel-grafana
4545
environment:
4646
- GF_SECURITY_ADMIN_USER=admin
47-
- GF_SECURITY_ADMIN_PASSWORD=admin
47+
- GF_SECURITY_ADMIN_PASSWORD=${GF_ADMIN_PASSWORD:?Set GF_ADMIN_PASSWORD in .env}
4848
volumes:
4949
- ./observability/grafana/provisioning:/etc/grafana/provisioning:ro
5050
- ./observability/grafana/dashboards:/var/lib/grafana/dashboards:ro

packages/agent-os/examples/grid-balancing/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ services:
4545
container_name: grid-grafana
4646
environment:
4747
- GF_SECURITY_ADMIN_USER=admin
48-
- GF_SECURITY_ADMIN_PASSWORD=admin
48+
- GF_SECURITY_ADMIN_PASSWORD=${GF_ADMIN_PASSWORD:?Set GF_ADMIN_PASSWORD in .env}
4949
volumes:
5050
- ./observability/grafana/provisioning:/etc/grafana/provisioning:ro
5151
- ./observability/grafana/dashboards:/var/lib/grafana/dashboards:ro

packages/agent-os/examples/pharma-compliance/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ services:
4444
container_name: pharma-grafana
4545
environment:
4646
- GF_SECURITY_ADMIN_USER=admin
47-
- GF_SECURITY_ADMIN_PASSWORD=admin
47+
- GF_SECURITY_ADMIN_PASSWORD=${GF_ADMIN_PASSWORD:?Set GF_ADMIN_PASSWORD in .env}
4848
volumes:
4949
- ./observability/grafana/provisioning:/etc/grafana/provisioning:ro
5050
- ./observability/grafana/dashboards:/var/lib/grafana/dashboards:ro

0 commit comments

Comments
 (0)