Red-Teaming Cloud Infrastructure with Neo
Summary
ProjectDiscovery's AI security engineer, Neo, successfully executed a full red-teaming engagement against a simulated AWS environment in approximately two and a half hours. The setup involved a vulnerable TeamCity CI/CD server (version 2023.11.2, build 147486) in a public subnet, mirroring common misconfigurations like overpermissive cloud credentials and scattered secrets. Neo exploited CVE-2024-27198, a path traversal flaw with a CVSS of 9.8, to gain administrative access. Subsequently, it harvested temporary AWS credentials via IMDSv1, enumerated S3 buckets to retrieve 1,000 customer PII records and static IAM keys, and accessed SSM Parameter Store for production secrets. Pivoting into the private subnet through the build agent, Neo forged a JWT to access an internal API, confirming 847,295 customer records and exposing executive compensation data. The engagement also uncovered a debug SQL endpoint in TeamCity, revealing user password hashes.
Key takeaway
For security engineers and MLOps teams evaluating cloud infrastructure security, this demonstration highlights that traditional annual pentests are insufficient for environments with daily changes. You should implement continuous, autonomous red-teaming for internet-facing CI/CD servers and admin panels to validate security posture between formal assessments. Prioritize patching critical vulnerabilities like CVE-2024-27198 immediately. Also, enforce IMDSv2 (`HttpTokens=required`) across all EC2 instances to prevent credential theft. A single exposed port can lead to full production database compromise.
Key insights
AI can autonomously execute complex red-teaming chains from initial access to business impact in cloud environments.
Principles
- CI/CD servers concentrate risk due to broad permissions and secret storage.
- Network segmentation is not a standalone access control for internal APIs.
- Legacy configurations and unpatched software create critical attack paths.
Method
Neo's procedure involved fingerprinting, exploiting CVE-2024-27198, credential harvesting via IMDSv1 and build configs, cloud enumeration, lateral movement via build agents, and JWT forging to access internal services.
In practice
- Configure EC2 instances with `HttpTokens=required` for IMDSv2.
- Regularly audit and scope CI/CD IAM roles to least privilege.
- Scan self-hosted TeamCity for CVE-2024-27198 using Nuclei templates.
Topics
- Red Teaming
- Cloud Security
- CI/CD Security
- AWS IMDSv1
- CVE-2024-27198
- TeamCity
Code references
Best for: AI Security Engineer, Security Engineer, MLOps Engineer
Related on AIssential
See Counsel's argued verdicts on the open AI decisions leaders are weighing →
Editorial summary, takeaway, and curation by AIssential. Original article published by ProjectDiscovery Blog.