You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
flowchart LR
A[Source Code] -->|SAST| B[Bandit]
A -->|Dependencies| C[pip-audit]
D[Docker Image] -->|Container| E[Trivy]
D -->|Registry| F[ECR Scan]
B --> G[GitHub Security]
C --> G
E --> G
F --> G
Loading
Security Scanning
Static Application Security Testing (SAST)
Property
Value
Tool
Bandit
Trigger
Every push and pull request
Scope
Python source code in app/ directories
Blocking
No (reports only)
Output
JSON report uploaded as artifact
Vulnerabilities Detected:
SQL injection patterns
Command injection risks
Hardcoded passwords and secrets
Insecure cryptographic usage
XML external entity (XXE) vulnerabilities
Container Image Scanning
Property
Value
Tool
Trivy
Trigger
On push to main, on pull requests
Severity Levels
CRITICAL, HIGH
Blocking
Yes
Output
SARIF report to GitHub Security tab
flowchart TD
A[Docker Image] --> B[Trivy Scan]
B --> C{Severity Level}
C -->|CRITICAL| D[Block Deployment]
C -->|HIGH| D
C -->|MEDIUM| E[Allow with Warning]
C -->|LOW| E
D --> F[Fix Required]
E --> G[Continue Pipeline]
Loading
Dependency Scanning
Property
Value
Tool
pip-audit, Trivy filesystem
Trigger
requirements.txt changes, weekly schedule
Schedule
Mondays at 06:00 UTC
Coverage
All 6 microservices
AWS ECR Scanning
Property
Value
Tool
AWS ECR native scanning
Trigger
Automatic on image push
Configuration
scan_on_push = true in Terraform
Pipeline Integration
CI/CD Security Gates
flowchart TD
A[Code Push] --> B[Unit Tests]
B --> C[SAST Scan]
C --> D[Build Image]
D --> E[Trivy Scan]
E --> F{Pass?}
F -->|No| G[Block]
F -->|Yes| H[Push to ECR]
H --> I[ECR Scan]
I --> J[Deploy]
Note: Set <AWS_ACCOUNT_ID> and <AWS_REGION> AWS account ID and region as repository secrets or environment variables.
Protected Services
Service
ECR Repository
user_service
user_service
appointment_service
appointment_service
staff_management
staff_management
service_management
service_management
reports_analytics
reports_analytics
notification_service
notification_service
Vulnerability Management
Severity Classification
Severity
Response Time
Action Required
CRITICAL
Immediate
Block deployment, fix required
HIGH
24 hours
Block deployment, fix required
MEDIUM
7 days
Warning, fix recommended
LOW
30 days
Informational, fix optional
Remediation Process
flowchart TD
A[Vulnerability Detected] --> B{Severity}
B -->|CRITICAL/HIGH| C[Block Pipeline]
B -->|MEDIUM/LOW| D[Log Warning]
C --> E[Review in GitHub Security]
D --> E
E --> F{False Positive?}
F -->|Yes| G[Add to .trivyignore]
F -->|No| H[Update Dependency/Base Image]
G --> I[Re-run Pipeline]
H --> I
I --> J[Verify Fix]