Skip to content

CI/CD to cloud pivot chain

Source: ProjectDiscovery, Red-Teaming Cloud Infrastructure with Neo, published 2026-05-21.

A self-hosted CI/CD server is often the shortest path from public recon to cloud impact. The durable operator lesson from ProjectDiscovery's Neo red-team lab is not the AI branding; it is the repeatable chain: internet-facing build service → admin/API access → build-agent code execution → instance metadata credentials → cloud secret stores and backups → private-subnet service validation.

Authorized testing only

Run this workflow only in an owned lab or an engagement where CI/CD, cloud resources, and private-network pivots are explicitly in scope. Stop before broad data extraction once impact is proven.

When to use this playbook

Use it when external recon finds a self-hosted build, deployment, or automation surface such as TeamCity, Jenkins, GitLab runners, Buildkite agents, Drone, GoCD, or bespoke release tooling.

High-signal conditions:

  • The service is internet-reachable for webhooks, SSO, or developer convenience.
  • Version, plugin, or banner metadata is visible pre-authentication.
  • The build agent runs in AWS, GCP, Azure, Kubernetes, or another privileged deployment network.
  • Pipeline definitions reference production deploys, secrets, artifacts, cloud buckets, or parameter stores.
  • Private services rely on subnet placement as the main access control.

Operator chain

  1. Fingerprint the CI/CD control plane. Capture product, version, plugins, exposed REST endpoints, login behavior, and known-CVE fit. For TeamCity, unauthenticated server metadata and version disclosure can be enough to select the right validation template.
  2. Validate initial access with the smallest proof. A scanner result is not the finding. Prove whether the issue reaches authenticated API context, token minting, project read access, or build configuration access.
  3. Inventory build secrets. With authorized admin/API access, review project parameters, environment variables, VCS credentials, deploy keys, webhook tokens, artifact references, and masked-secret behavior. Treat plaintext values, reversible encryption, or secret names plus target paths as evidence.
  4. Turn build execution into cloud-context discovery. If rules permit, run a benign build step that proves agent execution context and checks cloud metadata reachability. Capture role/account identity before enumerating resources.
  5. Enumerate only what proves impact. Prioritize identity, S3/object storage names, SSM/Secrets Manager paths, container registries, database endpoints, and private service DNS. Avoid bulk downloads unless the engagement explicitly authorizes it.
  6. Pivot through the build agent to private services. Use the agent as the network vantage point for scoped HTTP checks, not as a general-purpose tunnel unless approved. Validate claim checks, admin endpoints, debug paths, and database error behavior.
  7. Close the loop with business impact. A strong report connects public exposure to cloud credentials, specific sensitive stores, reachable private systems, and one or two controlled data-access proofs.

AWS validation checklist

From an authorized build step or controlled shell on the agent, collect narrow evidence:

aws sts get-caller-identity
aws ec2 describe-instances --filters 'Name=tag:Environment,Values=prod,production' --max-results 20
aws s3 ls
aws ssm describe-parameters --max-results 10
aws secretsmanager list-secrets --max-results 10
aws rds describe-db-instances --max-records 20

If instance metadata is in scope, prove the exposure without printing live credentials into long-lived logs:

curl -sS --max-time 2 http://169.254.169.254/latest/meta-data/iam/security-credentials/

For IMDSv2-required hosts, capture the token requirement as a boundary condition instead of trying to bypass it.

Private-service checks

When the build agent has private-subnet reachability, validate only scoped endpoints first:

  • GET /health, /version, /metrics, /debug, /admin, /internal
  • Auth behavior with no token, malformed token, and a controlled valid test token
  • Whether JWT claims are enforced or merely signature-checked
  • Whether SQL/database errors reflect attacker-controlled claim values
  • Whether debug database/query endpoints exist on the CI/CD server itself

Evidence should show the pivot path and access-control failure, not a broad dump of private data.

Reporting heuristic

Structure the report as an exploit path, not isolated findings:

Internet-exposed CI/CD service
  -> version-specific initial access / admin token
  -> build config secrets and deploy keys
  -> build-agent execution
  -> cloud role or metadata credential access
  -> S3/SSM/Secrets/RDS discovery
  -> private API access via agent network position
  -> controlled proof of customer, financial, or production-system impact

For each hop, include:

  • Entry condition and exact scoped asset.
  • Minimum request/command used to prove the hop.
  • Credential or identity obtained, redacted to safe evidence.
  • What the credential could access.
  • Why the next hop was reachable.
  • Where testing stopped and why.

November 25 follow-up: the AWS-managed SSM runbook that writes your commands into the Session Manager preferences document, and why "latest revision" is not a fix (CVE-2026-134070 / GHSA-j242-6f68-5fhq, high)

The AWS-managed runbook AWSConfigRemediation-EnableSystemsManagerSessionManagerAuditLogsToS3 accepts a crafted S3KeyPrefix parameter that injects unintended configuration, including arbitrary commands, into the account/Region's SSM-SessionManagerRunShell preferences document, but only when that document does not already exist in the Region. Commands planted there run on managed instances when other users start Session Manager sessions: runbook-execution permission becomes cross-user command execution on the fleet via an account-level config artifact. The second, rarer axis: because any user permitted to run the runbook selects which revision to run, vulnerable revisions stay exploitable after the fix ships; AWS is not deprecating pre-2026-10-22 revisions until January 15, 2027, so upgrading alone is not sufficient, the old revisions themselves are the attack surface.

Operator rules for the AWS checklist above:

  1. Managed runbooks that write config documents are privilege-escalation candidates. Enumerate automation you can execute (aws ssm list-documents --filters key=Owner,value=Amazon), triage those whose actions write SSM-SessionManagerRunShell, Lambda configs, State Manager associations, or Config remediations. The pattern: principal with runbook-exec but no direct ssm:UpdateDocument still reaches the document through the runbook's own permissions (confused deputy via managed automation).
  2. Absent-resource injection windows are real gates. "Only vulnerable when the document doesn't exist" reads as an edge case; in a fresh Region it is the default state. Before claiming or dismissing, check existence: aws ssm get-document --name SSM-SessionManagerRunShell --region <r>; an absent document plus any runnable vulnerable revision = open path.
  3. Revision pinning is an attack surface; enumerate versions, not just the latest. aws ssm describe-document --name <book> shows LatestVersion; test whether older revisions still execute (--version on start-automation-execution). A fixed latest version does not mean the class is closed; record the version your proof used.
  4. Session Manager preferences are a persistence layer worth auditing red-team-side too: whoever controls SSM-SessionManagerRunShell controls a pre-auth shell hook that executes at every operator's session start on managed instances. Proof discipline: your own sandbox account/Region, a marker-command pref doc (write /bin/true-class inert command), never a live account without explicit authorization, and check for DOCUMENT CREATE OR UPDATE FAILED traces as the detection artifact.

Durable lesson

CI/CD is both an identity concentrator and a network bridge. A finding that looks like "one stale TeamCity/Jenkins/GitLab issue" can become a full cloud compromise when the build agent has production IAM permissions, access to backups, secret-store read privileges, or private-subnet reachability. Red-team reports should validate that chain end to end, while staying inside the authorized data-access boundary.