39 KiB
🚨 Cloud Security Risk Register & Hardening Remediation Roadmap
Target Environment: Ghaymah Cloud Storage & Web Infrastructure
Document Version: 2.0 (Enterprise Hardening Specification — Enhanced Visual Edition)
Standard Frameworks: CVSS v3.1 Scoring, ISO/IEC 27001:2022, NIST SP 800-53 Rev. 5, CIS Benchmarks
🧭 Quick Navigation Index
| Section | Description | Quick Link |
|---|---|---|
| Visual Risk Heatmap & Matrix | 3x3 Impact vs Likelihood Grid & Severity Distribution | Jump to Heatmap |
| Risk Register Summary Table | All 12 Findings with CVSS v3.1 and Severity | Jump to Risk Table |
| Detailed Risk Factsheets | Technical Descriptions, Threat Analysis & Root Causes | Jump to Factsheets |
| Common S3 Misconfigurations | 10 S3 Storage Gaps, Safe Detection & Exact Code | Jump to S3 Misconfigs |
| Common Web Misconfigurations | 10 Web Service Gaps, Safe Detection & Exact Code | Jump to Web Misconfigs |
| 90-Day Remediation Roadmap | Prioritized Gantt Schedule & Phase-by-Phase Plan | Jump to Roadmap |
🗺️ Visual Risk Heatmap & Threat Correlation Matrix
1. Risk Severity Distribution
pie title Discovered Risk Findings by CVSS v3.1 Severity (12 Findings)
"CRITICAL (CVSS >= 9.0) : 0" : 0
"HIGH (CVSS 7.0 - 8.9) : 3" : 3
"MEDIUM (CVSS 4.0 - 6.9) : 9" : 9
"LOW (CVSS 0.1 - 3.9) : 0" : 0
2. 3x3 Likelihood vs Impact Heatmap Matrix
| Likelihood \ Impact | 🟢 Low Impact | 🟡 Medium Impact | 🔴 High Impact |
|---|---|---|---|
| 🔴 High Likelihood | (None) | SEC-WEB-02 Public Swagger UI Exposed |
SEC-WEB-01 Missing HTTP Security Headers |
| 🟡 Medium Likelihood | SEC-SIEM-09 Container Logs Not in SIEM |
SEC-DOCKER-05 Writable RootfsSEC-S3-07 Missing S3 Audit LogsSEC-WAF-08 Missing Perimeter WAFSEC-S3-11 Missing S3 Malware Scan |
SEC-CLI-03 Plaintext CLI Tokens (CWE-312) |
| 🟢 Low Likelihood | (None) | SEC-DR-10 Untested DR Restorations |
SEC-DOCKER-04 Container Root ExecutionSEC-S3-06 Static S3 CredentialsSEC-AUTH-12 MFA Optional for Admins |
3. Threat-to-Defense Correlation Flowchart (Attack Path vs Countermeasure)
flowchart LR
subgraph Threats["⚠️ Identified Threat Vectors"]
T1["UI Redressing & Clickjacking<br/>(SEC-WEB-01: No CSP/XFO)"]
T2["API Surface Reconnaissance<br/>(SEC-WEB-02: Exposed Swagger)"]
T3["Local Token Exfiltration<br/>(SEC-CLI-03: Plaintext CWE-312)"]
T4["Container Escape Escalation<br/>(SEC-DOCKER-04: Root Execution)"]
T5["Webshell Persistence<br/>(SEC-DOCKER-05: Writable Rootfs)"]
T6["Malware Distribution<br/>(SEC-S3-11: No Malware Scanning)"]
end
subgraph Impact["💥 Potential Business Impact"]
I1["Session Hijacking & Client Compromise"]
I2["Targeted Zero-Day API Fuzzing"]
I3["Persistent Account Takeover"]
I4["Host Operating System Breakout"]
I5["Persistent Backdoor in Cluster"]
I6["Ransomware & Malware Spreading"]
end
subgraph Solutions["🛡️ Defensive Countermeasures"]
S1["Enforce HSTS, CSP, X-Frame-Options DENY"]
S2["Disable /docs in Production & Require Auth"]
S3["OS Keychain & Machine DPAPI Encryption"]
S4["Enforce USER appuser & cap_drop: ALL"]
S5["Configure read_only: true with isolated tmpfs"]
S6["Automated ClamAV / ICAP Quarantine Pipeline"]
end
T1 --> I1
T2 --> I2
T3 --> I3
T4 --> I4
T5 --> I5
T6 --> I6
S1 -.->|Neutralizes| T1
S2 -.->|Neutralizes| T2
S3 -.->|Neutralizes| T3
S4 -.->|Neutralizes| T4
S5 -.->|Neutralizes| T5
S6 -.->|Neutralizes| T6
📋 Executive Summary of Identified Risks
The security audit identified 12 actionable risk findings across the cloud storage gateway, web application dashboard, container runtime environment, and client CLI interface. The findings are evaluated using CVSS v3.1 base scoring metrics.
| Finding ID | Severity | CVSS v3.1 | Affected Component | Domain | Audit Status |
|---|---|---|---|---|---|
SEC-WEB-01 |
🔴 High | 5.4 |
Web Dashboard (https://deploy.ghaymah.systems) |
Application Security (A.14 / A.12) | Not existed |
SEC-WEB-02 |
🟡 Medium | 5.3 |
GenAI Service (https://genai.ghaymah.systems/docs) |
API Security / Access Control (A.9, A.14) | Partially existed |
SEC-CLI-03 |
🔴 High | 6.2 |
Ghaymah CLI Client (~/.ghaymah/config.json) |
Data Protection & Authentication (A.8, A.9) | Partially existed |
SEC-DOCKER-04 |
🔴 High | 8.8 |
Docker Microservice Infrastructure | Docker and Container Security (A.8, A.12) | Partially existed |
SEC-DOCKER-05 |
🟡 Medium | 5.3 |
Docker Runtime Environment | Docker and Container Security (A.8, A.12) | Not existed |
SEC-S3-06 |
🟡 Medium | 5.9 |
S3 Storage Gateway / IAM | Authentication and Identity (A.9) | Not existed |
SEC-S3-07 |
🟡 Medium | 5.3 |
S3 Storage Gateway (minio audit webhook) |
Logging and Monitoring (A.12.4) | Partially existed |
SEC-WAF-08 |
🟡 Medium | 5.3 |
Public Reverse Proxy / Ingress Gateway | WAF and Perimeter Protection (A.13) | Not existed |
SEC-SIEM-09 |
🟡 Medium | 4.3 |
Wazuh Agent / Container Logging | Logging and Monitoring (A.12.4) | Partially existed |
SEC-DR-10 |
🟡 Medium | 5.0 |
Backup and Recovery Infrastructure | Backup and Recovery (A.17) | Not existed |
SEC-S3-11 |
🟡 Medium | 5.4 |
S3 Object Ingestion Pipeline | Application Security & Incident Response (A.14, A.16) | Partially existed |
SEC-AUTH-12 |
🟡 Medium | 5.4 |
Authentication Gateway | Authentication and Identity (A.9) | Partially existed |
🔎 Detailed Risk Register Factsheets
🔴 [SEC-WEB-01] Absence of Critical HTTP Security Headers on Web Dashboard
| Metric | Value |
|---|---|
| Severity | High (CVSS v3.1 Base Score: 5.4) |
| CVSS v3.1 Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
| Affected Asset | Web Dashboard (https://deploy.ghaymah.systems) |
| ISO 27001 Domain | Application Security (A.14 / A.12) |
| Likelihood / Impact | Likelihood: High | Impact: Medium |
| Current Control Status | Not existed |
Important
Vulnerability Description:
The web application does not return Content-Security-Policy (CSP), Strict-Transport-Security (HSTS), X-Frame-Options, or X-Content-Type-Options headers. This leaves browser clients susceptible to Clickjacking, MIME-sniffing, and Cross-Site Scripting (XSS) exploitation if dynamic content injection occurs.
Warning
Defensive Threat Analysis:
An attacker can embed the dashboard inside an invisible iframe on a malicious website to conduct UI redressing (Clickjacking) attacks against authenticated users.
🟡 [SEC-WEB-02] Publicly Exposed Interactive Swagger UI / OpenAPI Documentation
| Metric | Value |
|---|---|
| Severity | Medium (CVSS v3.1 Base Score: 5.3) |
| CVSS v3.1 Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N |
| Affected Asset | GenAI Service (https://genai.ghaymah.systems/docs) |
| ISO 27001 Domain | API Security / Access Control (A.9, A.14) |
| Likelihood / Impact | Likelihood: High | Impact: Low |
| Current Control Status | Partially existed |
Important
Vulnerability Description:
The interactive Swagger UI and OpenAPI JSON specification schema are exposed to the public Internet without authentication. This facilitates detailed reconnaissance of API endpoints, parameters, models, and backend types.
Warning
Defensive Threat Analysis:
Threat actors can automatically map the entire API surface and craft targeted exploits against internal models without needing prior knowledge.
🔴 [SEC-CLI-03] Plaintext Credential Storage in Local Client Configuration (CWE-312)
| Metric | Value |
|---|---|
| Severity | High (CVSS v3.1 Base Score: 6.2) |
| CVSS v3.1 Vector | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N |
| Affected Asset | Ghaymah CLI Client (~/.ghaymah/config.json) |
| ISO 27001 Domain | Data Protection & Authentication (A.8, A.9) |
| Likelihood / Impact | Likelihood: Medium | Impact: High |
| Current Control Status | Partially existed |
Important
Vulnerability Description:
The Ghaymah CLI client stores API access tokens and session credentials in plaintext JSON files on the local filesystem without operating system keychain protection (Windows DPAPI, Linux Secret Service, macOS Keychain).
Warning
Defensive Threat Analysis:
Any local unprivileged process or malware executing under the user's context can harvest authentication tokens without requiring elevated privileges.
🔴 [SEC-DOCKER-04] Containers Executing with Default Root Privileges and Capabilities
| Metric | Value |
|---|---|
| Severity | High (CVSS v3.1 Base Score: 8.8) |
| CVSS v3.1 Vector | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H |
| Affected Asset | Docker Microservice Infrastructure |
| ISO 27001 Domain | Docker and Container Security (A.8, A.12) |
| Likelihood / Impact | Likelihood: Low | Impact: High |
| Current Control Status | Partially existed |
Important
Vulnerability Description:
Several application containers run as root (UID 0) inside the container and retain default Linux capabilities rather than enforcingcap_drop: [ALL]and unprivileged runtime users.
Warning
Defensive Threat Analysis:
If an application component suffers a Remote Code Execution (RCE) vulnerability, the attacker possesses root privileges inside the container, substantially increasing the feasibility of container escape.
🟡 [SEC-DOCKER-05] Container Filesystems Mounted Writable Without Immutable Rootfs
| Metric | Value |
|---|---|
| Severity | Medium (CVSS v3.1 Base Score: 5.3) |
| CVSS v3.1 Vector | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L |
| Affected Asset | Docker Runtime Environment |
| ISO 27001 Domain | Docker and Container Security (A.8, A.12) |
| Likelihood / Impact | Likelihood: Medium | Impact: Medium |
| Current Control Status | Not existed |
Important
Vulnerability Description:
Production containers run with writable root filesystems (read_only: false), allowing arbitrary binaries, webshells, or scripts to be downloaded and executed in temporary or application directories.
Warning
Defensive Threat Analysis:
Attackers exploiting application-level vulnerabilities can download post-exploitation toolkits, drop persistent webshells, or modify system binaries in the container.
🟡 [SEC-S3-06] Lack of Automated Periodic Credential Rotation for Storage Keys
| Metric | Value |
|---|---|
| Severity | Medium (CVSS v3.1 Base Score: 5.9) |
| CVSS v3.1 Vector | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N |
| Affected Asset | S3 Storage Gateway / IAM |
| ISO 27001 Domain | Authentication and Identity (A.9) |
| Likelihood / Impact | Likelihood: Low | Impact: High |
| Current Control Status | Not existed |
Important
Vulnerability Description:
S3 API access keys and secret keys remain static without automated 90-day expiration or forced rotation workflows.
Warning
Defensive Threat Analysis:
Compromised or leaked API credentials remain active indefinitely until manual discovery and revocation occur.
🟡 [SEC-S3-07] Missing Granular S3 Object-Level Audit Logging (Webhook/Audit Target)
| Metric | Value |
|---|---|
| Severity | Medium (CVSS v3.1 Base Score: 5.3) |
| CVSS v3.1 Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N |
| Affected Asset | S3 Storage Gateway (minio audit webhook) |
| ISO 27001 Domain | Logging and Monitoring (A.12.4) |
| Likelihood / Impact | Likelihood: Medium | Impact: Medium |
| Current Control Status | Partially existed |
Important
Vulnerability Description:
While reverse proxy records HTTP request lines, dedicated S3 object-level audit logging (PutObject, GetObject, DeleteObject with tenant metadata) is not configured to stream to an immutable audit target.
Warning
Defensive Threat Analysis:
In the event of data exfiltration or malicious object tampering, security teams cannot ascertain which specific object keys were accessed or downloaded.
🟡 [SEC-WAF-08] Absence of Dedicated Web Application Firewall (WAF) with OWASP CRS
| Metric | Value |
|---|---|
| Severity | Medium (CVSS v3.1 Base Score: 5.3) |
| CVSS v3.1 Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N |
| Affected Asset | Public Reverse Proxy / Ingress Gateway |
| ISO 27001 Domain | WAF and Perimeter Protection (A.13) |
| Likelihood / Impact | Likelihood: Medium | Impact: Medium |
| Current Control Status | Not existed |
Important
Vulnerability Description:
Perimeter reverse proxy terminates TLS and routes traffic, but does not perform deep packet inspection or execute OWASP Core Rule Set (CRS) filtering against SQLi, XSS, and command injection patterns.
Warning
Defensive Threat Analysis:
Zero-day application flaws or unhandled parser inputs pass directly to backend containers without perimeter filtering.
🟡 [SEC-SIEM-09] Container Application Logs Excluded from Centralized SIEM Ingestion
| Metric | Value |
|---|---|
| Severity | Medium (CVSS v3.1 Base Score: 4.3) |
| CVSS v3.1 Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| Affected Asset | Wazuh Agent / Container Logging |
| ISO 27001 Domain | Logging and Monitoring (A.12.4) |
| Likelihood / Impact | Likelihood: Medium | Impact: Low |
| Current Control Status | Partially existed |
Important
Vulnerability Description:
Host-level logs (SSH, auth.log) are forwarded to Wazuh, but Docker container application logs (auth-service, web, api) remain on local container stdout.
Warning
Defensive Threat Analysis:
Security analysts lack real-time correlation between application authentication failures and network-level anomalies.
🟡 [SEC-DR-10] Lack of Tested Periodic Disaster Recovery Restoration Procedures
| Metric | Value |
|---|---|
| Severity | Medium (CVSS v3.1 Base Score: 5.0) |
| CVSS v3.1 Vector | CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:H/A:H |
| Affected Asset | Backup and Recovery Infrastructure |
| ISO 27001 Domain | Backup and Recovery (A.17) |
| Likelihood / Impact | Likelihood: Low | Impact: High |
| Current Control Status | Not existed |
Important
Vulnerability Description:
Cloud disk snapshots are captured, but formal periodic recovery exercises validating restoration time and data integrity from backups have not been conducted or documented.
Warning
Defensive Threat Analysis:
In the event of catastrophic storage corruption or ransomware, recovery procedures may fail or severely exceed acceptable Recovery Time Objectives (RTO).
🟡 [SEC-S3-11] Lack of Automated Anti-Malware / ICAP Scanning on Uploaded Objects
| Metric | Value |
|---|---|
| Severity | Medium (CVSS v3.1 Base Score: 5.4) |
| CVSS v3.1 Vector | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N |
| Affected Asset | S3 Object Ingestion Pipeline |
| ISO 27001 Domain | Application Security & Incident Response (A.14, A.16) |
| Likelihood / Impact | Likelihood: Medium | Impact: Medium |
| Current Control Status | Partially existed |
Important
Vulnerability Description:
Objects uploaded to S3 storage are not scanned for malicious payloads, viruses, or embedded macros prior to storage or subsequent distribution to other users.
Warning
Defensive Threat Analysis:
A malicious actor can upload weaponized documents or executables to shared storage, turning the platform into a malware distribution mechanism.
🟡 [SEC-AUTH-12] Multi-Factor Authentication (MFA) Optional for Administrative Accounts
| Metric | Value |
|---|---|
| Severity | Medium (CVSS v3.1 Base Score: 5.4) |
| CVSS v3.1 Vector | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N |
| Affected Asset | Authentication Gateway |
| ISO 27001 Domain | Authentication and Identity (A.9) |
| Likelihood / Impact | Likelihood: Low | Impact: High |
| Current Control Status | Partially existed |
Important
Vulnerability Description:
While MFA is supported by the authentication provider, it is not strictly mandated for all administrative and operational staff.
Warning
Defensive Threat Analysis:
Phished or credential-stuffed administrative credentials can be used directly without secondary verification challenges.
📦 Common S3 Storage Misconfigurations Encyclopedia
This section documents the 10 most critical S3 storage misconfigurations, detailing their threat model, safe non-destructive detection methods, and step-by-step remediation configurations.
🗄️ 1. Public S3 Bucket via Overly Permissive ACL or Bucket Policy
- Description: Buckets configured with
AllUsersorAuthenticatedUsersread/write grants allow anyone on the Internet to list, download, or delete objects without valid credentials. - Threat Model: Mass data breach, unauthorized data tampering, or host compromise through uploaded malicious payloads.
Tip
Safe Non-Destructive Detection:
Runaws --endpoint-url <S3_URL> s3api get-bucket-acl --bucketandaws --endpoint-url <S3_URL> s3api get-bucket-policy --bucket. Or send unauthenticatedcurl -sI <S3_URL>//and check for HTTP 200.
Remediation Steps: Apply S3 Block Public Access settings and enforce explicit deny in bucket policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "EnforcePrivateBucket",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::customer-data",
"arn:aws:s3:::customer-data/*"
],
"Condition": {
"StringNotEquals": {
"aws:PrincipalArn": "arn:aws:iam::account:role/StorageServiceRole"
}
}
}
]
}
🗄️ 2. Missing Default Server-Side Encryption (SSE-S3 / SSE-KMS)
- Description: Buckets created without mandatory default server-side encryption allow plaintext objects on underlying physical disk storage.
- Threat Model: Data exposure if underlying physical media or disk snapshots are accessed directly outside the storage software layer.
Tip
Safe Non-Destructive Detection:
Runaws --endpoint-url <S3_URL> s3api get-bucket-encryption --bucket. AServerSideEncryptionConfigurationNotFoundErrorindicates encryption is not enforced.
Remediation Steps: Enable default SSE-S3 (AES256) or SSE-KMS on the bucket:
aws --endpoint-url <S3_URL> s3api put-bucket-encryption \
--bucket customer-data \
--server-side-encryption-configuration '{"Rules": [{"ApplyServerSideEncryptionByDefault": {"SSEAlgorithm": "AES256"}}]}'
🗄️ 3. Insecure Transport Allowed (Plaintext HTTP Access)
- Description: Storage endpoints that accept plaintext HTTP requests without enforcing TLS encryption transmit credentials and sensitive data unencrypted across the network.
- Threat Model: Man-in-the-Middle (MitM) packet interception, credential harvesting, and session hijacking.
Tip
Safe Non-Destructive Detection:
Send plaintext HTTP request:curl -Iv http:////test.txt. If connection succeeds without redirecting to HTTPS, insecure transport is permitted.
Remediation Steps:
Attach a bucket policy requiring aws:SecureTransport: true and configure reverse proxy to force 301 HTTPS redirection:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "EnforceTLSRequestsOnly",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": ["arn:aws:s3:::customer-data", "arn:aws:s3:::customer-data/*"],
"Condition": {
"Bool": {"aws:SecureTransport": "false"}
}
}
]
}
🗄️ 4. Disabled S3 Object Versioning and Missing MFA Delete
- Description: Without object versioning, overwriting or deleting an object permanently destroys previous versions immediately. Lack of MFA delete allows rogue credentials to erase version history.
- Threat Model: Ransomware data destruction, accidental administrative deletion, or insider threat tampering.
Tip
Safe Non-Destructive Detection:
Runaws --endpoint-url <S3_URL> s3api get-bucket-versioning --bucket. Status should returnEnabledandMFADelete: Enabled.
Remediation Steps: Enable versioning via CLI:
aws --endpoint-url <S3_URL> s3api put-bucket-versioning \
--bucket customer-data \
--versioning-configuration Status=Enabled
🗄️ 5. Overly Permissive Cross-Origin Resource Sharing (CORS) Policy
- Description: CORS configurations specifying
AllowedOrigins: ["*"]with credentials enabled or wildcard methods allow malicious websites to issue authenticated cross-origin requests. - Threat Model: Cross-origin data exfiltration from user browsers visiting attacker-controlled sites.
Tip
Safe Non-Destructive Detection:
Inspect CORS rules viaaws --endpoint-url <S3_URL> s3api get-bucket-cors --bucketand verify no*origins are combined with sensitive data access.
Remediation Steps:
Restrict AllowedOrigins strictly to verified application domains:
{
"CORSRules": [
{
"AllowedHeaders": ["Authorization", "Content-Type"],
"AllowedMethods": ["GET", "HEAD"],
"AllowedOrigins": ["https://deploy.ghaymah.systems"],
"MaxAgeSeconds": 3600
}
]
}
🗄️ 6. Publicly Exposed MinIO / Storage Management Console
- Description: Management web interfaces (e.g. MinIO Console on port 9001) exposed to the Internet provide an entry point for brute-force credential attacks or administrative vulnerabilities.
- Threat Model: Full cluster compromise, deletion of all buckets, and infrastructure takeover.
Tip
Safe Non-Destructive Detection:
Probe host on port 9001:curl -sI https://:9001or inspectdocker psto verify port 9001 is not bound to0.0.0.0.
Remediation Steps:
Unbind port 9001 from host public interface or bind strictly to 127.0.0.1:
# docker-compose.yml
services:
minio:
ports:
- "127.0.0.1:9001:9001" # Bound strictly to loopback
🗄️ 7. Missing S3 Bucket Access Logging and Audit Streams
- Description: Operating object storage without access logging means read, write, and deletion events are never permanently recorded.
- Threat Model: Zero forensic visibility into unauthorized data access, intellectual property exfiltration, or tampering timelines.
Tip
Safe Non-Destructive Detection:
Runaws --endpoint-url <S3_URL> s3api get-bucket-logging --bucket. An empty response indicates logging is inactive.
Remediation Steps: Configure bucket logging to an isolated, append-only log bucket:
aws --endpoint-url <S3_URL> s3api put-bucket-logging \
--bucket customer-data \
--bucket-logging-status '{"LoggingEnabled": {"TargetBucket": "audit-logs-immutable", "TargetPrefix": "customer-data-access/"}}'
🗄️ 8. Overly Broad IAM Role Privileges (Wildcard Actions)
- Description: Granting service accounts
s3:*onarn:aws:s3:::*violates the principle of least privilege, enabling any compromised service to read, modify, and delete all cloud data. - Threat Model: Lateral movement across tenant boundaries and catastrophic data destruction.
Tip
Safe Non-Destructive Detection:
Audit IAM policy JSON documents using Checkov or jq, flagging any statement whereActioncontains*orResourceis unbounded.
Remediation Steps: Scope IAM policies to exact prefixes and required API actions:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:GetObject", "s3:PutObject"],
"Resource": "arn:aws:s3:::app-data/tenant-${user_id}/*"
}
]
}
🗄️ 9. Excessively Long Presigned URL Lifetimes
- Description: Generating presigned URLs with long expiration windows (e.g. 7 days) means that if the URL is leaked in browser history, logs, or chat channels, unauthorized parties retain access for days.
- Threat Model: Unauthorized object access via leaked URLs.
Tip
Safe Non-Destructive Detection:
Review application code generating presigned URLs (e.g.get_presigned_url(expires_in=...)) to ensure expiration <= 900 seconds (15 minutes).
Remediation Steps: Enforce maximum 15-minute expiration in SDK configuration:
url = s3_client.generate_presigned_url(
ClientMethod='get_object',
Params={'Bucket': 'customer-data', 'Key': object_key},
ExpiresIn=900 # 15 minutes max
)
🗄️ 10. Missing S3 Object Malware & Ransomware Quarantine Pipeline
- Description: Storage systems lacking automated antivirus/malware scanning allow users to store and distribute malicious executables or infected documents.
- Threat Model: Platform weaponization, secondary infections of administrative workstations, and legal liability.
Tip
Safe Non-Destructive Detection:
Verify whether S3 bucket events trigger an AWS Lambda / containerized ClamAV scanning webhook upons3:ObjectCreated:*.
Remediation Steps:
Deploy an automated ClamAV container or S3 event webhook that scans newly uploaded files, tagging infected files as Quarantine and revoking read permissions.
🌐 Common Web Service Misconfigurations Encyclopedia
This section documents the 10 most critical Web Service misconfigurations, detailing their threat model, safe non-destructive detection methods, and step-by-step remediation configurations.
🌐 1. Missing HTTP Security Headers (HSTS, CSP, XFO, XCTO)
- Description: Omitting browser security headers leaves users unprotected against Clickjacking, MIME confusion, and script injection attacks.
- Threat Model: Clickjacking credential capture, reflected/stored XSS execution, and downgrade attacks.
Tip
Safe Non-Destructive Detection:
Executecurl -sI https://and check forStrict-Transport-Security,Content-Security-Policy,X-Frame-Options,X-Content-Type-Options.
Remediation Steps: Add security header directives to reverse proxy (Nginx):
# /etc/nginx/conf.d/security_headers.conf
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self'; frame-ancestors 'none';" always;
add_header X-Frame-Options "DENY" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
🌐 2. Publicly Exposed Interactive API Documentation (Swagger /docs)
- Description: Allowing unauthenticated access to Swagger UI (
/docs,/swagger-ui) exposes API schemas, private parameters, and backend route names to potential adversaries. - Threat Model: Automated reconnaissance, zero-day parameter fuzzing, and model exploitation.
Tip
Safe Non-Destructive Detection:
Executecurl -sI https:///docs. If HTTP 200 is returned, interactive documentation is open to the public.
Remediation Steps: Disable docs in production or restrict behind authentication in FastAPI / Express:
# FastAPI production configuration
import os
from fastapi import FastAPI
app = FastAPI(
docs_url=None if os.getenv("ENV") == "production" else "/docs",
redoc_url=None,
openapi_url=None if os.getenv("ENV") == "production" else "/openapi.json"
)
🌐 3. Containers Running with Default Root (UID 0) Privileges
- Description: Running containers as root means any process compromise inside the container executes with root privileges, dramatically elevating container breakout risk.
- Threat Model: Container breakout and host operating system compromise.
Tip
Safe Non-Destructive Detection:
Rundocker inspect --format '{{.Config.User}}'. If output is empty orroot, container runs as root.
Remediation Steps: Define and enforce a dedicated non-root user in Dockerfile:
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
USER appuser:appgroup
🌐 4. Retaining Default Linux Capabilities in Docker
- Description: Docker assigns containers a default set of 14 Linux capabilities (e.g.
CAP_NET_RAW,CAP_MKNOD,CAP_CHOWN), many of which are unnecessary for web workloads. - Threat Model: Exploitation of kernel privilege escalation vulnerabilities.
Tip
Safe Non-Destructive Detection:
Inspect container capabilities:docker inspect --format '{{.HostConfig.CapDrop}}'.
Remediation Steps:
Drop all capabilities in docker-compose.yml:
services:
web:
image: ghaymah-web:prod
cap_drop:
- ALL
cap_add:
- NET_BIND_SERVICE
🌐 5. Container Filesystems Mounted Writable Without Read-Only Rootfs
- Description: Writable root filesystems allow attackers with remote execution capabilities to download backdoors, compile exploits, or alter application files.
- Threat Model: Persistent webshell placement and rootkit installation.
Tip
Safe Non-Destructive Detection:
Rundocker inspect --format '{{.HostConfig.ReadonlyRootfs}}'. Secure state istrue.
Remediation Steps:
Mount root filesystem read-only with tmpfs for volatile paths in docker-compose.yml:
services:
web:
read_only: true
tmpfs:
- /tmp:rw,noexec,nosuid,size=64m
- /app/run:rw,noexec,nosuid,size=16m
🌐 6. Plaintext Secrets Stored in Host Environment Files or Configs (CWE-312)
- Description: Saving production API keys and database passwords in plaintext
.envfiles or CLIconfig.jsonexposes them to any process or inspection command. - Threat Model: Token harvesting by malicious dependencies or unauthorized local users.
Tip
Safe Non-Destructive Detection:
Inspect~/.ghaymah/config.jsonor rundocker inspect --format '{{.Config.Env}}'for unmasked credentials.
Remediation Steps:
Use Docker Secrets or system credential vaults (Windows DPAPI / Linux Keyring) and file permissions chmod 600:
services:
api:
secrets:
- db_password
secrets:
db_password:
file: ./secrets/db_password.txt
🌐 7. Absence of Dedicated Perimeter WAF with OWASP Core Rule Set
- Description: Relying strictly on application code to sanitize inputs without edge WAF filtering means zero-day parser flaws can reach backend runtimes.
- Threat Model: SQL injection, remote code execution (e.g. Log4j/Spring4Shell), and path traversal.
Tip
Safe Non-Destructive Detection:
Review reverse proxy modules or test benign test probe headers (X-WAF-Probe) to confirm absence of WAF inspection.
Remediation Steps: Deploy Coraza WAF or ModSecurity with OWASP Core Rule Set (CRS 4.0) in blocking mode ahead of reverse proxy.
🌐 8. Inadequate Granular API Rate Limiting & Account Lockout
- Description: Allowing unlimited requests to authentication endpoints permits automated dictionary attacks and credential stuffing.
- Threat Model: Brute-force credential takeover and service degradation.
Tip
Safe Non-Destructive Detection:
Execute 20 rapid test requests to login endpoint; verify whether HTTP 429 is returned withRetry-Afterheader.
Remediation Steps: Configure rate limiting in Nginx reverse proxy:
limit_req_zone $binary_remote_addr zone=auth_limit:10m rate=5r/m;
location /api/v1/auth/login {
limit_req zone=auth_limit burst=3 nodelay;
proxy_pass http://auth_backend;
}
🌐 9. Container Application Logs Not Ingested into Central SIEM
- Description: Leaving container logs on host stdout prevents real-time correlation and security operations visibility.
- Threat Model: Delayed or missed incident detection, inability to track attacker lateral movement.
Tip
Safe Non-Destructive Detection:
Verify SIEM agent configuration (/var/ossec/etc/ossec.conf) to ensure docker container logs are collected.
Remediation Steps: Configure Docker logging driver to route to Fluentd / Promtail / Syslog, or configure Wazuh agent to collect container log files:
<localfile>
<log_format>syslog</log_format>
<location>/var/lib/docker/containers/*/*.log</location>
</localfile>
🌐 10. Untested Disaster Recovery and Database Restoration Procedures
- Description: Taking database backups without periodic verification drills leads to undetected backup corruption and catastrophic downtime during outages.
- Threat Model: Total business disruption, permanent data loss upon disaster.
Tip
Safe Non-Destructive Detection:
Review historical audit tickets for verified recovery test drill sign-offs within the last 12 months.
Remediation Steps: Implement automated weekly staging restore pipelines: spin up an ephemeral container, restore the latest backup, verify schema and row counts, and output a signed recovery test report.
📅 Prioritized Remediation Roadmap
90-Day Implementation Timeline
gantt
title Ghaymah Cloud 90-Day Security Hardening Roadmap
dateFormat YYYY-MM-DD
axisFormat %d %b
section Phase 1 (P0: Days 1-7)
Deploy HTTP Security Headers (HSTS, CSP, XFO) :crit, active, p1_1, 2026-09-21, 4d
Disable Production Swagger UI (/docs) :crit, active, p1_2, 2026-09-21, 2d
Encrypt CLI Token Storage (CWE-312) :crit, active, p1_3, 2026-09-22, 5d
Enforce Reverse Proxy API Rate Limiting :active, p1_4, 2026-09-23, 4d
section Phase 2 (P1: Days 8-30)
Enforce Non-Root Execution (USER appuser) :p2_1, 2026-09-28, 7d
Drop Linux Capabilities (cap_drop: ALL) :p2_2, 2026-10-02, 5d
Mount Read-Only Container Rootfs :p2_3, 2026-10-05, 6d
Mandate S3 SSE-S3 AES-256 Default Encryption :p2_4, 2026-10-10, 5d
Enable S3 Object Versioning & MFA Delete :p2_5, 2026-10-15, 6d
section Phase 3 (P2: Days 31-60)
Deploy Coraza/ModSecurity WAF with OWASP CRS :p3_1, 2026-10-21, 14d
Forward Docker Logs to Wazuh SIEM Agent :p3_2, 2026-11-01, 10d
Integrate S3 Audit Webhook with Central SIEM :p3_3, 2026-11-08, 8d
Automate ClamAV Malware Quarantine Pipeline :p3_4, 2026-11-12, 10d
section Phase 4 (P3: Days 61-90)
Codify Formal Cloud Storage Security Policy :p4_1, 2026-11-20, 10d
Implement Automated Quarterly DR Restore Drills:p4_2, 2026-11-28, 12d
Conduct Semi-Annual User Access Reviews (UAR) :p4_3, 2026-12-05, 8d
Deploy Continuous CSPM Compliance Scanning :p4_4, 2026-12-10, 10d
Phase 1: Immediate Critical & High Remediation (P0 - Days 1 to 7)
Strategic Focus: Perimeter Hardening, Secret Protection & Attack Surface Reduction
- Implement all HTTP security headers (
Strict-Transport-Security,Content-Security-Policy,X-Frame-Options,X-Content-Type-Options) on reverse proxy configuration fordeploy.ghaymah.systems. - Disable public interactive Swagger UI (
/docs,/openapi.json) on production GenAI service (https://genai.ghaymah.systems/docs) or restrict access behind internal VPN / admin auth. - Harden Ghaymah CLI client: Encrypt cached credentials in
~/.ghaymah/config.jsonusing OS native secure storage (DPAPI on Windows, Secret Service on Linux, Keychain on macOS) and restrict file permissions (chmod 600). - Enforce rate limiting on authentication and API routes via reverse proxy with HTTP 429 responses and Retry-After headers.
Phase 2: Short-Term Architecture & Container Hardening (P1 - Days 8 to 30)
Strategic Focus: Container Security, Least Privilege & Storage Isolation
- Transition all Docker containers to run as dedicated non-root users (
USER appuser) and codifycap_drop: [ALL]in Docker Compose. - Configure container read-only root filesystems (
read_only: true) with isolated, size-limited tmpfs mounts. - Migrate plain environment variable secrets to native Docker Secrets or HashiCorp Vault.
- Enforce S3 bucket default server-side encryption (SSE-S3 AES-256) and attach mandatory
aws:SecureTransport: truebucket policies. - Enable S3 object versioning and MFA delete across all production storage namespaces.
Phase 3: Medium-Term Monitoring, WAF & Incident Readiness (P2 - Days 31 to 60)
Strategic Focus: Detection Engineering, SIEM Integration & Continuous Security
- Deploy a dedicated Web Application Firewall (WAF) running OWASP Core Rule Set (CRS) in active blocking mode ahead of reverse proxy.
- Integrate Docker container application logs and S3 audit logs (
minio audit webhook) into centralized Wazuh SIEM. - Develop and codify dedicated Incident Response Playbooks for S3 data leakage, account compromise, and container isolation.
- Implement automated CI/CD security scanning gates (SAST via Semgrep, SCA via Dependabot, Container Scanning via Trivy) with build-blocking thresholds.
Phase 4: Long-Term Governance & Compliance Assurance (P3 - Days 61 to 90)
Strategic Focus: Compliance Recertification, DR Testing & Continuous Assurance
- Formalize and publish the standalone Cloud Storage Security Policy and Web Application Security Policy with annual executive sign-off.
- Establish a formal automated Disaster Recovery restoration exercise pipeline validating backup integrity on a recurring quarterly schedule.
- Codify semi-annual User Access Reviews (UAR) and enforce mandatory MFA for all operational personnel.
- Deploy continuous Cloud Security Posture Management (CSPM) to automatically audit storage and web configurations against CIS benchmarks.