Attack scenario · AWS identity & access

Exposed machine identity credentials

What happens when machine credentials leak from code, containers or logs? Service credentials embedded in a container image, environment variable or log file are harvested and reused from outside the organization.

Fictional, educational scenarioData exposurePersistent accessLast updated · ATT&CK v20.1

Attack path · 3 stages

  1. 1

    Harvest credentials from artifacts

    T1552.001

  2. 2

    Use the machine credential

    T1078.004

  3. 3

    Read reachable data

    T1530T1619

For leadership

Executive summary

Machine identities — the credentials services use to talk to each other — now far outnumber people in most cloud environments, and they are managed less carefully. Keys end up inside container images, build logs, configuration files and support tickets. Unlike an employee account, nobody notices when a machine credential is used from somewhere new. Organizations should know how many long-lived machine credentials exist, where they are stored, who owns each one, and how quickly they can be rotated without an outage. Moving services to short-lived, automatically issued credentials removes most of this risk and also removes the operational burden of manual rotation.

For engineers

Technical summary

Access keys or third-party tokens baked into images (ENV / layers), printed to logs, or stored in plaintext configuration are recovered by anyone with read access to those artifacts — including public registries or compromised log pipelines — and used directly against AWS APIs.

Environment and assumptions

Fictional company: a container image in a registry readable by a partner contains an AWS access key in an early layer, added during a debugging session and "removed" in a later layer. The key belongs to an IAM user with read access to several S3 buckets.

  • The image or log is readable by the adversary.
  • The key is active and not restricted by network conditions.
  • Fictional and simplified for education.

Interactive

Attack sequence

Select a stage, or use the arrow keys, to see preconditions, evidence and controls.

Stage 1

Harvest credentials from artifacts

The adversary inspects image layers or logs and extracts the key.

Preconditions
  • Read access to the artifact
Required access
  • Registry or log read access.
Potential evidence
  • Registry pull logs from unfamiliar principals
Defensive controls
  • Secret scanning of images and logs
  • Private registries with restricted pull
Text version of the attack sequence
  1. Harvest credentials from artifacts (T1552.001). The adversary inspects image layers or logs and extracts the key. Preconditions: Read access to the artifact. Evidence: Registry pull logs from unfamiliar principals. Controls: Secret scanning of images and logs; Private registries with restricted pull.
  2. Use the machine credential (T1078.004). The key is used from adversary infrastructure. Preconditions: Key active. Evidence: CloudTrail: calls from IPs outside the workload’s normal network. Controls: Prefer roles; restrict keys with source conditions.
  3. Read reachable data (T1530, T1619). The adversary lists and downloads objects available to the key. Preconditions: S3 read permissions. Evidence: S3 data events. Controls: Bucket policies limited to expected network paths (aws:SourceVpce).

Technique mapping

MITRE ATT&CK and ATLAS techniques referenced in this scenario
IDTechniqueTactics (official)Stages
T1552.001Unsecured Credentials: Credentials In FilesCredential Access1
T1078.004Valid Accounts: Cloud AccountsInitial Access, Persistence, Privilege Escalation, Stealth2
T1530Data from Cloud StorageCollection3
T1619Cloud Storage Object DiscoveryDiscovery3

Technique names and tactic assignments come from the imported MITRE data. Mapping a stage to a technique is Securitain’s analysis.

Why the attack can succeed

  • Deleting a file in a later image layer does not remove it from earlier layers.
  • Machine credentials lack owners and usage baselines.
  • Long-lived keys remain valid until someone rotates them.

What prevents or limits the attack

What may detect the attack

Detection signals and telemetry sources
SignalTelemetry sourceNotes
Machine credential used from outside expected networksCloudTrail management events (sourceIPAddress / vpcEndpointId)—
Registry pulls by unknown principalsECR / registry audit logs—

Telemetry only helps if it is enabled before the incident and someone acts on it. Listing a signal here does not mean it is collected or monitored in your environment.

What Securitain may assess

  • Securitain can assess todayInventory of IAM users, roles, groups, policies, access-key configuration and trust relationships across connected AWS accounts. Learn more
  • Securitain can assess todayCredential prioritization — surfacing access keys and identities whose permissions make a leak more damaging. Learn more
  • Securitain can assess todayDetection of identities with sensitive permissions such as broad S3 access, KMS decrypt or Secrets Manager reads. Learn more

For leadership

Executive implications

confidentiality
Data accessible to the service identity may be exposed.
operations
Rotating hard-coded credentials can require emergency redeployments.

No financial loss estimates are given; impact depends on the data, contracts and regulation involved.

Next steps

  1. Inventory IAM users used by services and their keys.
  2. Scan existing images and logs, not just new ones.
  3. Migrate to workload roles.

References

MITRE ATT&CK® and ATT&CK® are registered trademarks of The MITRE Corporation. ATT&CK data © 2026 The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation (ATT&CK v20.1). Securitain is not affiliated with or endorsed by MITRE. Explanations, scenarios and control mappings on this page are Securitain’s own analysis. Sources and licensing

Stay in the loop

Cloud security insights, early access & compliance updates

Weekly InsightsEarly AccessExpert Content
No spam, everUnsubscribe anytimeWeekly updates
Chat with Securitain