OnixMall Production-Hardened Cloud & Observability Stack
Hardened AWS EC2 infrastructure with Prometheus metrics collection, Grafana observability dashboards, Trivy vulnerability scanning, and strict UFW firewall policies.
Executive Overview & Context
Designed and deployed a production-hardened Linux cloud infrastructure for an e-commerce platform. Features continuous automated Trivy CVE vulnerability scans, Prometheus metric scraping of host resources, Grafana operational telemetry dashboards, and strict network isolation.
Project Objectives
1. Build real-time host and process metrics telemetry with Prometheus. 2. Design Grafana dashboards for CPU, memory, network, and disk I/O monitoring. 3. Implement automated vulnerability scanning using Trivy. 4. Enforce CIS-inspired Linux OS hardening standards and UFW firewall rules.
Challenges & Pain Points
Overcame lack of server health visibility, unmonitored disk/memory usage surges, unpatched OS package vulnerabilities, and unprotected network attack surfaces on public cloud instances.
Engineered Implementation
Configured Prometheus server scraping Node Exporter on localhost:9100. Built custom Grafana dashboards for alert notifications on high CPU or memory thresholds. Automated Trivy scans running scheduled daily audits with Markdown vulnerability reports.
Key Engineering Features
System Topology & Traffic Flow
Ingress → AWS EC2 Security Group → Linux UFW Firewall → Nginx Web Server. Prometheus server periodically scrapes Node Exporter on localhost:9100, providing telemetry to Grafana.
DevSecOps Multi-Container Architecture
Docker Compose multi-container stack with Ansible orchestration and Trivy security auditing
Client Public Visitor
Nginx Hardened Web Server
Frontend Web Application
Express REST API Backend
MongoDB Document Store
DevOps Alert & PDF Reporter
Trivy Security Scanner
GitHub Actions CI/CD
Ansible Control Host
| # | From → To | Flow / Action | Protocol / Type |
|---|---|---|---|
| 1 | Client Public Visitor→Nginx Hardened Web Server | HTTPS Web Ingress | HTTPS / TLS 1.3 |
| 2 | Nginx Hardened Web Server→Frontend Web Application | Frontend Proxy Pass | HTTP / Port 80 |
| 3 | Frontend Web Application→Express REST API Backend | REST API Requests | HTTP /api/malls |
| 4 | Express REST API Backend→MongoDB Document Store | Database CRUD Operations | Mongoose / Port 27017 |
| A | GitHub Actions CI/CD→Trivy Security Scanner | CI Vulnerability Gatesecondary | Trivy Action / Exit 1 |
| B | GitHub Actions CI/CD→sec-onix-docker | SSH Compose Deploysecondary | docker-compose up -d --build |
| C | GitHub Actions CI/CD→Ansible Control Host | Trigger Ansible CIsecondary | ansible-deploy.yml |
| D | Ansible Control Host→sec-onix-docker | Ansible Playbook Rolloutsecondary | ansible-playbook |
| E | Trivy Security Scanner→DevOps Alert & PDF Reporter | Email Daily PDF Reportsecondary | Nodemailer / SMTP 465 |
Inspect Detailed Cloud & Security Architecture
Explore full multi-layer topology, live active ports, security controls, and verified repository evidence in the Architecture Explorer.
Implementation Details & Workflow
Created standardized Bash provisioning scripts to configure non-root system users, disable SSH password authentication, configure sysctl kernel parameters (such as disabling IP forwarding and enabling SYN cookies), and automate security updates via unattended-upgrades.
CI/CD & Automation Pipeline
Automated cron jobs execute Trivy security audits daily, generating formatted Markdown status reports to verify zero unaddressed High or Critical CVEs in installed packages.
Security & Hardening Controls
Fail2ban daemon actively monitors SSH authentication failures and injects temporary iptables drop rules against repeat offenders. Ingress ports for Grafana and Prometheus are restricted to localhost and accessible only via SSH tunnels or authenticated reverse proxies.
Technologies & Cloud Services
Measurable Results
100% visibility into server resource consumption and instant alerting before memory exhaustion occurs. System security posture verified against common vulnerability benchmarks.
Balancing Prometheus memory consumption on standard EC2 instances was resolved by fine-tuning storage retention policies (--storage.tsdb.retention.time=15d) and scrape intervals.
