CloudTrail shows `CreateUser`, `AttachUserPolicy` (AdministratorAccess) and `CreateAccessKey` at 03:12 from an unfamiliar IP, made by a CI role
AdvancedTroubleshootingCertificates, TLS and security incident response
Answer
Likely causes → The CI role's credentials, or the pipeline itself, were compromised, and the attacker is setting up persistence that survives revoking the CI credentials.
Diagnose →
aws cloudtrail lookup-events --lookup-attributes AttributeKey=Username,AttributeValue=<new-user>
aws cloudtrail lookup-events --start-time <t> --query 'Events[?contains(CloudTrailEvent, `<ip>`)].[EventTime,EventName]'
Trace back to the session: which workflow run or OIDC sub assumed the role at that time.
Fix → Contain first. Deactivate the new keys, attach a deny-all to the new user, revoke sessions on the CI role, and disable the pipeline. Then remove the persistence, hunt in every region and service, and find the entry point (a malicious PR, a compromised action, a leaked token). Preserve the logs.
Prevent → CI roles should not have iam:*. Use permission boundaries, an SCP denying iam:CreateUser and CreateAccessKey, GuardDuty, and alerts on IAM write events from CI roles.
More on Certificates, TLS and security incident response
A cert-manager Certificate stays `Ready=False` and the Challenge shows `Waiting for HTTP-01 challenge propagation: wrong status code '404', expected '200'`IntermediateA DNS-01 challenge hangs forever with `DNS record for "acme.com" not yet propagated`, although `dig` from your laptop shows the TXT recordAdvancedIssuance fails with `429 urn:ietf:params:acme:error:rateLimited: too many certificates already issued`BeginnerA service calling another internal service fails with `x509: certificate signed by unknown authority`BeginnerAt 05:30 every client starts failing with `x509: certificate has expired or is not yet valid`BeginnerBrowsers load `https://api.acme.com` fine, but `curl` and Java clients fail with `unable to get local issuer certificate`Intermediate