惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

SecWiki News
SecWiki News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
I
Intezer
月光博客
月光博客
Cyberwarzone
Cyberwarzone
雷峰网
雷峰网
Security Latest
Security Latest
量子位
博客园 - 聂微东
小众软件
小众软件
NISL@THU
NISL@THU
C
Cisco Blogs
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tor Project blog
Y
Y Combinator Blog
V
V2EX
博客园 - 三生石上(FineUI控件)
P
Privacy & Cybersecurity Law Blog
F
Full Disclosure
Cisco Talos Blog
Cisco Talos Blog
Microsoft Security Blog
Microsoft Security Blog
S
Security @ Cisco Blogs
The Register - Security
The Register - Security
Google DeepMind News
Google DeepMind News
J
Java Code Geeks
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
IT之家
IT之家
Webroot Blog
Webroot Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
aimingoo的专栏
aimingoo的专栏
腾讯CDC
S
Schneier on Security
L
LINUX DO - 最新话题
Latest news
Latest news
Simon Willison's Weblog
Simon Willison's Weblog
罗磊的独立博客
A
Arctic Wolf
MyScale Blog
MyScale Blog
云风的 BLOG
云风的 BLOG
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
Secure Thoughts
S
Securelist
Stack Overflow Blog
Stack Overflow Blog
T
Troy Hunt's Blog
Recorded Future
Recorded Future
I
InfoQ
The Cloudflare Blog
H
Heimdal Security Blog
Hugging Face - Blog
Hugging Face - Blog

Wiz Blog | RSS feed

Meet Wiz for M365: Bringing SaaS into the Security Graph How to Harden GitHub Actions: An Updated Guide Bringing Security Visibility to Vercel with Wiz Axios NPM Distribution Compromised in Supply Chain Attack Tracking TeamPCP: Investigating Post-Compromise Attacks Seen in the Wild The Wiz Blue Agent, now Generally Available Beyond the Badge: What Achieving Microsoft’s Certified Software Designation Means for Your Cloud Security Introducing the Green Agent: AI-Powered Remediation for the Cloud Three’s a Crowd: TeamPCP trojanizes LiteLLM in Continuation of Campaign KICS GitHub Action Compromised: TeamPCP Strikes Again in Supply Chain Attack Introducing the Wiz Red Agent- AI-Powered Attacker Introducing Wiz AI Application Protection Platform (AI-APP) Introducing Wiz Agents & Workflows: Security at the Speed of AI AI Runtime Threat Detection: From Input to Real-World Impact Trivy Compromised: Everything You Need to Know about the Latest Supply Chain Attack It’s Official: Wiz Joins Google Understanding and Reducing AI Risk in Modern Applications Introducing Wiz Tenant Manager: Multi-Tenant Management for Federated Organizations The Agile FedRAMP Playbook, Part 4: Reactive Risk Management through Enriched Incident Response Wiz Achieves CPSTIC Certification in Spain Seeing AI Clearly: Building Visibility Across Modern AI Applications The Agile FedRAMP Playbook, Part 3: Preventative Risk Management by building Secure by Design Wiz Leads the 2026 Latio Application Security Report with awards in 4 categories Building an Agentic Cloud Security Ecosystem: A Reference Architecture with Wiz MCP and Infosys Cyber Next The Agile FedRAMP Playbook, Part 2: Proactive Risk Management with Continuous Monitoring Cloud-native Security for your Windows environment: Announcing the Wiz Runtime Sensor for Windows Would You Click ‘Accept’? Automatically detecting malicious Azure OAuth applications using LLMs Wiz Named a Leader in The Forrester Wave™: Cloud Native Application Protection Solutions, Q1 2026 From Detection to Remediation: It’s Time to Rethink AppSec Around Exploitability and Root Cause Fixes The Agile FedRAMP Playbook, Part 1: Why Risk is Your Best Starting Point Introducing AI Cyber Model Arena: A Real-World Benchmark for AI Agents in Cybersecurity Wiz + Spotify Backstage: Security at the Developer’s Desk Building AI Security Together: New Ways to Partner with Wiz for AI Security in 2026 Hacking Moltbook: The AI Social Network Any Human Can Control The Year in Wiz Research: 2025 Most Read Blogs WizExtend is Here: AI and Cloud Security Insights in Your Daily Workflow From Detection to Remediation: Wiz in Your JetBrains IDE Agentic Browser Security: 2025 Year-End Review CodeBreach: Infiltrating the AWS Console Supply Chain and Hijacking AWS GitHub Repositories via CodeBuild A 90-Day Action Plan to Turn Resolutions into Results with Wiz Introducing the Wiz Partner Alliance: A New Chapter for Partner Success Preparing for Post-Quantum Cryptography Wiz Recognized as a 2025 Customers’ Choice in the Gartner® Peer Insights™ Voice of the Customer for CNAPP Expanding the Zero Critical Club to set a new standard for AppSec and SecOps teams Snipping the Long Tail of Shai-Hulud 2.0 Protecting Against Zero-Day Vulnerabilities with SOC-Level ASM Alert MongoBleed (CVE-2025-14847) exploited in the wild: everything you need to know The Kenna Transition: Your Strategic Shift to Exposure Management From MCP to Vibe Coding: Full Endpoint Visibility in Wiz AI Security Bringing Oracle Cloud Identity to Wiz Zero‑Days in the Age of AI: Behind the Scenes of ZeroDay.cloud 2025, with a Record High of CVEs in Critical Cloud Infra Gogs 0-Day Exploited in the Wild Code to Cloud Attacks: From Github PAT to Cloud Control Plane Top AWS re:Invent Announcements for Security Teams in 2025 React2Shell: Technical Deep-Dive & In-the-Wild Exploitation of CVE-2025-55182 React2Shell (CVE-2025-55182): Everything You Need to Know About the Critical React Vulnerability Wiz Product Announcements at re:Invent 2025: Expanding Visibility from Code to Cloud Introducing Wiz SAST: Where Code Risk Meets Cloud Context Wiz Becomes Fastest Security ISV to Reach $1 Billion in AWS Marketplace Lifetime Sales It's Here! Wiz Exposure Management is Now GA Shai-Hulud 2.0 Aftermath: Trends, Victimology and Impact Service Catalog is Here: Expand Risk Visibility for Your Service and Its Dependencies, Simplify Issue Ownership WizOS: Powering Secured Image Adoption with AI 3 OAuth TTPs Seen This Month — and How to Detect Them with Entra ID Logs Mastering Software Governance with Hosted Technologies Inventory Shai-Hulud 2.0 Supply Chain Attack: 25K+ Repos Exposing Secrets Get Certified on Wiz Defend for Threat Detection and Response Blueprint for Security: A Guide to Code, Governance, and Response Frameworks Google Unified Security Recommended Program Names Wiz Among First 3 Strategic Partners Introducing Posture Issues: Transform Security Findings into Actionable Outcomes Empower and Accelerate Your SOC with the Blue Agent Exposure Report: 65% of Leading AI Companies Found with Verified Secret Leaks Wizdom 2025 Product Announcements: Extending the Cloud Operating Model When AI Becomes the Heart of Security: Powering a Future You Can Trust AI-Powered Wiz: From Agents to Everyday Intelligence Defend Agentless Workload Detection: Bringing Visibility to Blind Spots in Threat Detection Securing AI Agents with Wiz AI-SPM Introducing Wiz ASM: Context-Driven Attack Surface Management Securing Critical Infrastructure in the Cloud Era: A Policy and Technology Blueprint How CISOs Should Plan Security Budgets for 2026 Beyond the Checkbox: How Wiz Transforms SOC 2 into a Security Powerhouse Bringing Visibility to Kubernetes: Unified Inventory and Network Insight The Foundation Modern AppSec Is Still Missing: Code to Cloud, Rebuilt the Right Way Dismantling a Critical Supply Chain Risk in VSCode Extension Marketplaces Introducing HoneyBee: How We Automate Honeypot Deployment for Threat Research RediShell: Critical Remote Code Execution Vulnerability (CVE-2025-49844) in Redis, 10 CVSS score Defending against database ransomware attacks AI Security 101: Mapping the AI Attack Surface Introducing zeroday.cloud: First-of-its-kind cloud and AI hacking competition Unifying Cloud Risk and Network Defense: Wiz and Check Point The emerging use of malware invoking AI Wiz achieves FedRAMP High authorization Wiz + HCP Terraform: Close the IaC-to-Cloud Infrastructure Security Gap IMDS Abused: Hunting Rare Behaviors to Uncover Exploits Beyond CVEs: The Exploitation of Everyday Misconfigurations Wiz Research Discovers One in Five Organizations Exposed to Systemic Risks in Vibe-Coded Applications - Here's How to Secure Them Introducing Wiz Incident Response: Your Expert Partner for Cloud Security Incidents Shai-Hulud: Ongoing Package Supply Chain Worm Delivering Data-Stealing Malware DORA Compliance in the Cloud Era: Insights from Deloitte and Wiz How Wiz Customers like Brex and FICO See AI Changing Security
The many ways to obtain credentials in AWS
Scott Piper · 2024-12-20 · via Wiz Blog | RSS feed

Attackers with cloud knowledge will look for cloud credentials on any resources they gain access to.  On AWS, this may mean looking for IAM role credentials, but there are many ways they might obtain those credentials beyond making requests to 169.254.169.254.  

 The Wiz Sensor needs to detect those methods, so this blog post will discuss how various AWS services give applications IAM role credentials, along with other arcane knowledge of AWS credentials.  

AWS SDK credential providers 

The AWS SDK defines a number of ways in which credentials can be obtained.  

  1. IAM user access keys are one way AWS privileges are obtained.  These access keys can unfortunately still be found in many places, such as source code.  Credentials that are explicitly set in code will take precedence by the SDK.   

  2. The next place for the SDK to look will be environmental variables.  AWS Lambda, which was released in 2014 for serverless execution, puts the IAM role session credentials in the environment variables by using the variables AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN (docs).  Prior to the release of IAM roles in 2012, EC2 user-data (http://169.254.169.254/latest/user-data) was sometimes used to store credentials, and these were often set as environment variables before use. 

  3. The AWS SDK will then look in the files ~/.aws/credentials and ~/.aws/config for credentials.  Older file paths that the SDK may use are /etc/boto.cfg and ~/.boto.   

  4. Now we get to the Instance Metadata Service (IMDS), but it’s not just a single IP address that some think it is.   

IAM roles were first created for EC2 instances back in 2012, and involved an HTTP GET request to http://169.254.169.254/latest/meta-data/iam/security-credentials/ to learn the name of the IAM role, and a subsequent request to the get the session credentials.  In 2019, AWS released IMDSv2 which made a few changes to this (a PUT request, challenge response, Time-To-Live, and HTTP header), to improve it.  That magic host can also be accessed by IPv6 via the address [fd00:ec2::254]. LightSail supports this same mechanism for obtaining role credentials.   

Container services on AWS, such as ECS and EKS, use the environment variable AWS_CONTAINER_CREDENTIALS_RELATIVE_URI along with the IP address 169.254.170.2 to perform an HTTP GET to a URL such as http://169.254.170.2/v2/credentials/00000000-0000-0000-0000-000000000000. That same technique also works for SageMaker Notebooks, App Runner, CodeBuild, and Batch.  Nick Jones documented much of this and more in his blog post AWS Access Keys - A Reference

That URL can also be found through the environment variable AWS_CONTAINER_CREDENTIALS_FULL_URI which is used by CloudShell and IoT Greengrass 2.0 to reach a service running on localhost and also requires setting the HTTP header Authorization to the value of the environment variable AWS_CONTAINER_AUTHORIZATION_TOKEN

EKS Pod Identities works similarly, but uses the IP address 169.254.170.23 (or [fd00:ec2::23] for IPv6).  This also uses the variable AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE (by default set to /var/run/secrets/pods.eks.amazonaws.com/serviceaccount/eks-pod-identity-token) which sets an HTTP header Authorization to the value of that file. This is shown in the AWS SDK here.  Prior research by Wiz on this feature can be found here.  

IRSA (IAM Roles for Service Accounts) was released before EKS Pod Identities, and uses OIDC instead. The container has the environment variables AWS_WEB_IDENTITY_TOKEN_FILE and AWS_ROLE_ARN set, which are used to make an anonymous call to sts:AssumeRoleWithWebIdentity.  By default the token file will be at /var/run/secrets/eks.amazonaws.com/serviceaccount/token.   

Default Host Management Configuration 

The above notes on the SDK describe the ways to obtain the “normal” IAM role of an EC2 or other resources, but did you know an EC2 can have two IAM roles assigned to it? 

AWS Systems Manager (SSM) includes functionality for an agent to run on your compute resources that can then manage them by doing things like downloading and executing scripts. Customers may find it useful for the agent to have access to an S3 bucket or be given other AWS privileges. 

In order to avoid forcing the IAM role associated with all EC2s at a company to be modified for the privileges someone wants to assign to this agent, AWS released Default Host Management Configuration (DHMC).  This feature must be enabled for a region to use it.  By default, this uses an IAM role named AWSSystemsManagerDefaultEC2InstanceManagementRole and has the AWS Managed IAM policy AmazonSSMManagedEC2InstanceDefaultPolicy, but the role name can be changed and more privileges can be added. 

This feature uses http://169.254.169.254/latest/meta-data/identity-credentials/ec2/security-credentials/ec2-instance and a few additional steps described here in research by Aidan Steele.  The additional steps involved in getting the creds involve generating a key pair, which is stored in /var/lib/amazon/ssm/Vault/Store/EC2RegistrationKey.

Systems Manager hybrid activation 

Systems Manager hybrid activation is also based on the SSM agent, and is used for managing compute resources within an on-prem environment or other non-AWS resources.  This same technique is also used by ECS Anywhere and is part of IoT Greengrass. The agent is activated using an activation code and activation id, and then creates the files /var/lib/amazon/ssm/Vault/Store/RegistrationKey and /var/lib/amazon/ssm/Vault/Store/InstanceFingerprint which are then used to obtain credentials. Access to those files is sufficient for obtaining credentials.  The SSM agent will then store these credentials in /var/lib/amazon/ssm/credentials or /root/.aws/credentials

Internet of Things 

The API iot:AssumeRoleWithCertificate was the first mechanism AWS released that was specifically made for non-AWS environments.  This uses an X.509 certificate, and although the trust policy involved references that privilege, the mechanism uses an account specific endpoint prefix and some other features as described here. This certificate file can be placed anywhere and has no discerning attributes that identify it as being used for this use case so there is not a simple way for defenders or attackers to find these certificates and understand this is their use case. 

IAM Roles Anywhere 

Released in 2022, this service is the most recent way, at the time of this writing, that AWS has provided for non-AWS resources to access IAM Roles.  It also uses X.509 certs and initially only worked with those files being stored on disk.  In September 2023, AWS added PKCS#11 capabilities, so that cryptographic modules could be used to store the certificates instead. If that is used, then there will be a credential_process that can be called to obtain the credentials. 

Cognito 

Cognito is a service for customer identity and access management.  It offers an API called GetCredentialsForIdentity which is passed an identity ID, which is just a region and GUID value, and will return AWS session credentials. 

Datasync 

Datasync is an AWS service for keeping two storage locations in-sync, such as ensuring that an S3 bucket has the same files as a local directory on a server.  Although it does not appear to obtain IAM role credentials, it is able to access the objects of an S3 bucket through an undocumented mechanism.  Within /usr/local/aws-storage-gateway/var/ it will use the files cert.pem and keypair.pem to authenticate to AWS (some discussion here), and the datasync agent will then use those to potentially sync an S3 bucket and a local directory.  

Conclusion  

There are many ways that compute services on AWS obtain their credentials and there are many features and services that have special credentials.  This can result in a single EC2 having multiple IAM principals accessible from it.  In order to detect attackers, we need to know the various ways they might attempt to obtain these credentials.  This article has shown how this is not a simple problem and requires defenders to have just as much, if not more, expertise as attackers in credential access.