Skip to content

Commit 1c8451d

Browse files
authored
Merge pull request #28 from awslabs/sec_updates
Security improvements and trivy integration
2 parents 3f92e29 + d4b3cf0 commit 1c8451d

5 files changed

Lines changed: 27 additions & 1 deletion

File tree

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,9 @@ Thumbs.db
202202
local_settings.py
203203
instance/
204204
.webassets-cache
205+
206+
# Security scan results
207+
bandit-results*.json
208+
trivy-*.sarif
209+
semgrep-results.json
210+
safety-results.json

.trivyignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Trivy ignore file for security scanning exceptions
2+
3+
# Moto testing library certificates - these are test certificates for AWS mocking
4+
# Not actual private keys used in production
5+
**/.venv/lib/python*/site-packages/moto/moto_proxy/ca.key
6+
**/.venv/lib/python*/site-packages/moto/moto_proxy/cert.key
7+
.venv/lib/python*/site-packages/moto/moto_proxy/ca.key
8+
.venv/lib/python*/site-packages/moto/moto_proxy/cert.key
9+
10+
# Development and test dependencies should not be scanned in production
11+
.venv/**
12+
__pycache__/**
13+
*.pyc
14+
.pytest_cache/**
15+
.coverage
16+
htmlcov/**
17+
.tox/**
18+
.mypy_cache/**

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ ci-security-semgrep: ## Run Semgrep static analysis
572572
ci-security-trivy-fs: ## Run Trivy filesystem scan
573573
@echo "Running Trivy filesystem scan..."
574574
@if command -v trivy >/dev/null 2>&1; then \
575-
trivy fs --format sarif --output trivy-fs-results.sarif . || echo "Trivy filesystem issues found"; \
575+
trivy fs --skip-dirs .venv --format sarif --output trivy-fs-results.sarif . || echo "Trivy filesystem issues found"; \
576576
else \
577577
echo "Trivy not available - install from https://aquasecurity.github.io/trivy/"; \
578578
fi

src/config/schemas/server_schema.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class ServerConfig(BaseModel):
5656
model_config = ConfigDict(extra="forbid")
5757

5858
enabled: bool = Field(False, description="Enable REST API server")
59+
# nosec B104: Intentional binding for server deployment
5960
host: str = Field("0.0.0.0", description="Server host")
6061
port: int = Field(8000, description="Server port")
6162
workers: int = Field(1, description="Number of worker processes")

src/interface/serve_command_handler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ async def handle_serve_api(args) -> Dict[str, Any]:
2121
logger = get_logger(__name__)
2222

2323
# Extract parameters from args
24+
# nosec B104: Intentional binding for server deployment
2425
host = getattr(args, "host", "0.0.0.0")
2526
port = getattr(args, "port", 8000)
2627
workers = getattr(args, "workers", 1)

0 commit comments

Comments
 (0)