SlideShare a Scribd company logo
SESSION	ID:SESSION	ID:
#RSAC
Javier	Godinez
DevSecOps on	the	Offense:	Automating	
Amazon	Web	Services	Account	Takeover
IDY-W10
Founding	Member
DevSecOps.org
@isomorphix
Ian	Allison
Founding	Member
DevSecOps.org
@iallison
#RSAC
Disclaimer
2
This	is	not	an	Amazon	Web	Services	(AWS)	issue
This	is	a	DevOps	education	issue
It	is	the	user’s	responsibility	to	understand	the	technology	being	used
With	power	user	privileges	come	great	responsibilities
#RSAC
How	our	Grandfathers	Ran	a	Stack
3
Glen	Beck	(background)	and	Betty	Snyder	(foreground)	program	ENIAC	in	BRL	building	328.	(U.S.	Army	photo)
#RSAC
How	our	Mothers	Ran	a	Stack
4
Lawrence	Livermore	National	Laboratory	[Attribution],	via	Wikimedia	Commons
#RSAC
©	2007	Nuno Pinheiro &	David	Vignoni &	David	Miller	&	Johann	Ollivier Lapeyre &	Kenneth	Wimer &	Riccardo	Iaconelli / KDE,	via	Wikimedia	Commons
5
aws ec2	run-instances	ami-12345678 -t	m3.large	-k	$my-key-pair	-g	$my-security-group
How	We	Run	a	Stack
#RSAC
6
Attack	Surface	+	Misunderstanding	of	Technology	==	Low	Hanging	Fruit
The	Cloud	is	Ripe	for	the	Picking
#RSAC
Acceleration	into	the	Cloud
7
Information	Security	Job	Postings DevOps	Jobs	Postings
#RSAC
Understanding	the	Technology	You	Use
8
How	fast	can	I	move	while	still	staying	safe?
Always	develop	in	separate	account	(Blast	Radius	Containment)
Read	the	docs	for	everything	and	make	conscious	decisions	and	
document	those	decisions	
Attackers	will	try	to	leverage	everything against	you
Bleeding	edge	does	not	mean	stable	and	secure.	However,	it	can	be	
with	enough	testing
#RSAC
Instance
9
Virtual	host
Virtual	environment	on	
Xen	hypervisor
Feels	very	much	like	a	
host	running	on	bare	
metal
Hypervisor
Instance
Operating		System
#RSAC
Metadata	Service
10
Internal	HTTP	service	
that	provides	Instances	
information	about	its	
environemt
Available	from	host	at	
http://169.254.169.254/
Provides	temporary	
credentials	to	hosts	with	
instance	profiles
Hypervisor
Instance
Metadata
OS
Instance
OS
#RSAC
Instance	Profile
11
AWS	construct	that	maps	
a	role	to	an	instance
Instance	may	or	may	not	
have	a	profile	associated	
with	it
Instance
#RSAC
AWS	Identity	and	Access	Management	Overview
12
Users
Groups
Roles
Policies
Effect
Actions
Resources
Condition
#RSAC
The	Good
13
Policy	is	specifically	created	for	
the	application
Least	privilege
Made	to	be	as	granular	as	
possible
#RSAC
The	Bad
14
ec2:*
iam:*
anything:*
#RSAC
The	Ugly
15
All	Access
Great	for	Development
Really	Bad	for	Security
#RSAC
16
What	Does	Ugly	Really	Look	Like?
The	best	way	to	determine	whether	you	truly	have	an	ugly	duck	is	by	exploiting	the	
most	dangerous	vulnerabilities.
#RSAC
How	do	we	catch	up?
17
Through	automation	with	a	dash	of	Ruby
#RSAC
AWS	Create	IAM	User	(CIAMU)	Module
18
Allows	for	the	creation	of	a	user	with	Admin	Privileges	to	the	
AWS	account
Needs	access	to	AWS	Access	Keys	or	Instance	Role	with:
iam:CreateUser
iam:CreateGroup
iam:PutGroupPolicy
iam:AddUserToGroup
iam:CreateAccessKey
If	you	have	instances/instance	roles		with	this	combination	of	
IAM	privileges	it’s	very	dangerous.
#RSAC
AWS	Launch	Instances	Module
19
Launches	an	EC2	instance	with	a		Public	IP
Required	Privileges:
ec2:RunInstances
ec2:ImportKeyPair
ec2:CreateSecurityGroup
ec2:AuthorizeSecurityGroupIngress
ec2:Describe*
Can	launch	instance	with	Instance	Profile
Can	launch	cluster	of	Instances
Can	automate	tasks	via	bootstrap
#RSAC
AWS	IAM	Account	Lockout	Module
20
Requires	an	IAM	admin	role	(created	by	CIAMU	module)
Enumerates	all	users	and	access	keys
Accepts	a	user	to	keep
Locks	out	all	other	accounts
Allows	security	teams	to	protect	potentially	compromised	accounts
#RSAC
Demonstration	Network	Diagram
#RSAC
Demonstration
#RSAC
Upcoming	Modules	and	Ongoing	Projects
23
AWS	IAM	privilege	enumeration		module
AWS	Lambda	module
AWS	s3	bucket	and	access	enumeration	
module
Cumulus	Cloud	Attack	Toolkit
AWS
Google	Cloud	Platform
DevSecOps.org Community
https://github.com/devsecops/lambhack
#RSAC
24
Helping	you	get	from	ugly	to…
#RSAC
How	Apply	This	Knowledge
25
Read	the	AWS	IAM	Best	Practices	Documents:
http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html
Monitor	IAM	actions	using	AWS	CloudTrail
Get	creative	with	AWS	services:	Config +	CloudWatch Events	+	Lambda
Audit	your	AWS	Account	IAM	Policies	and	Roles
Red	Team	your	applications	and	instances
Think	to	yourself:	“How	would	an	attacker	use	this	against	me?”
Use	repeatable	secure	patterns:	https://github.com/devsecops
Help	build	awareness	through	community:	http://www.devsecops.org
#RSAC
Appendix
Demo	Slides
26
#RSAC
Load	Metasploit
#RSAC
Use	sshexec to	gain	a	foothold
#RSAC
Instantiate	a	shell
#RSAC
Retrieve	temporary	credentials
#RSAC
Enumerate	the	network
#RSAC
Enumerate	the	Metadata	service
#RSAC
Enumerate	the	Metadata	service
#RSAC
Escalate	privileges	on	account	A
#RSAC
Login
#RSAC
Explore	account
#RSAC
Discover	Networks
#RSAC
Explore	the	network
#RSAC
Discover	services
#RSAC
Setup	a	tunnel	and	scan	for	vulns
#RSAC
Exploit	Jenkins
#RSAC
Retrieve	temporary	credentials
#RSAC
Launch	a	new	instance	with	Admin	privs
#RSAC
Launch	a	new	instance	with	Admin	privs
#RSAC
Launch	a	new	instance	with	Admin	privs
#RSAC
Establish	a	session	with	new	host
#RSAC
Establish	a	session	with	new	host
#RSAC
Establish	a	session	with	new	host
#RSAC
Escalate	privileges	on	account	B
#RSAC
Open	the	console

More Related Content

PPTX
Continuous Automated Red Teaming (CART) - Bikash Barai
PDF
Red team-view-gaps-in-the-serverless-application-attack-surface
PDF
Red Team vs. Blue Team on AWS
PDF
Security precognition chaos engineering in incident response
PDF
Advanced red teaming all your badges are belong to us
PPTX
Elizabeth Lawler - Devops, security, and compliance working in unison
PDF
Beyond the mcse red teaming active directory
PPTX
AllDayDevOps 2019 AppSensor
Continuous Automated Red Teaming (CART) - Bikash Barai
Red team-view-gaps-in-the-serverless-application-attack-surface
Red Team vs. Blue Team on AWS
Security precognition chaos engineering in incident response
Advanced red teaming all your badges are belong to us
Elizabeth Lawler - Devops, security, and compliance working in unison
Beyond the mcse red teaming active directory
AllDayDevOps 2019 AppSensor

What's hot (19)

PDF
ChaoSlingr: Introducing Security-Based Chaos Testing
PDF
Guy Podjarmy - Secure Node Code
PPTX
RSA 2018: Recon For the Defender - You know nothing (about your assets)
PDF
Recon for the Defender: You Know Nothing (about Your Assets), Jon Snow
PDF
[OPD 2019] Governance as a missing part of IT security architecture
PDF
A Pragmatic Union: Security and SRE
PDF
[OPD 2019] Top 10 Security Facts of 2020
PPTX
Unraveling Detection Methodologies: Indicators vs. Anomalies vs. Behaviors
PDF
Serverless Security: What's Left To Protect
PDF
AWS live hack: Docker + Snyk Container on AWS
PDF
Collaborative security : Securing open source software
PDF
Transfer Learning: Repurposing ML Algorithms from Different Domains to Cloud ...
PPTX
The path of secure software by Katy Anton
PDF
BlueHat v18 || Dep for the app layer - time for app sec to grow up
PDF
[OPD 2019] Life after pentest
PDF
Securing 100 products - How hard can it be?
PDF
Secure Coding for Java - An Introduction
PPTX
[OPD 2019] AST Platform and the importance of multi-layered application secu...
PPTX
[OPD 2019] Inter-application vulnerabilities
ChaoSlingr: Introducing Security-Based Chaos Testing
Guy Podjarmy - Secure Node Code
RSA 2018: Recon For the Defender - You know nothing (about your assets)
Recon for the Defender: You Know Nothing (about Your Assets), Jon Snow
[OPD 2019] Governance as a missing part of IT security architecture
A Pragmatic Union: Security and SRE
[OPD 2019] Top 10 Security Facts of 2020
Unraveling Detection Methodologies: Indicators vs. Anomalies vs. Behaviors
Serverless Security: What's Left To Protect
AWS live hack: Docker + Snyk Container on AWS
Collaborative security : Securing open source software
Transfer Learning: Repurposing ML Algorithms from Different Domains to Cloud ...
The path of secure software by Katy Anton
BlueHat v18 || Dep for the app layer - time for app sec to grow up
[OPD 2019] Life after pentest
Securing 100 products - How hard can it be?
Secure Coding for Java - An Introduction
[OPD 2019] AST Platform and the importance of multi-layered application secu...
[OPD 2019] Inter-application vulnerabilities
Ad

Similar to Dev secops on the offense automating amazon web services account takeover (20)

PDF
Orchestrating Software Defined Networks To Disrupt The Apt Kill Chain
PDF
Secure Cloud Development Resources with DevOps
PDF
Cloud security : Automate or die
PDF
Security Process in DevSecOps
PPTX
API Security: Assume Possible Interference
PDF
DETECTE E INVESTIGUE LAS AMENAZAS AVANZADAS
PDF
Aspirin as a Service: Using the Cloud to Cure Security Headaches
PDF
Keeping Up with the Adversary: Creating a Threat-Based Cyber Team
PPTX
Cloud Security Essentials 2.0 at RSA
PDF
DevSecOps in Baby Steps
PDF
DevSecOps in Baby Steps
PDF
RSA 2015 Realities of Private Cloud Security
PPTX
AWS Lambda Security Inside & Out
PDF
Westjets Security Architecture Made Simple We Finally Got It Right
PDF
How Security can be the Next Force Multiplier in DevOps
PPTX
Red Team vs Blue Team on AWS - RSA 2018
PDF
Automated prevention of ransomware with machine learning and gpos
PDF
SPO2-T11_Automated-Prevention-of-Ransomware-with-Machine-Learning-and-GPOs
PPTX
Cloud Security or: How I Learned to Stop Worrying & Love the Cloud
PPTX
How Long to Boom: Understanding and Measuring ICS Hacker Maturity
Orchestrating Software Defined Networks To Disrupt The Apt Kill Chain
Secure Cloud Development Resources with DevOps
Cloud security : Automate or die
Security Process in DevSecOps
API Security: Assume Possible Interference
DETECTE E INVESTIGUE LAS AMENAZAS AVANZADAS
Aspirin as a Service: Using the Cloud to Cure Security Headaches
Keeping Up with the Adversary: Creating a Threat-Based Cyber Team
Cloud Security Essentials 2.0 at RSA
DevSecOps in Baby Steps
DevSecOps in Baby Steps
RSA 2015 Realities of Private Cloud Security
AWS Lambda Security Inside & Out
Westjets Security Architecture Made Simple We Finally Got It Right
How Security can be the Next Force Multiplier in DevOps
Red Team vs Blue Team on AWS - RSA 2018
Automated prevention of ransomware with machine learning and gpos
SPO2-T11_Automated-Prevention-of-Ransomware-with-Machine-Learning-and-GPOs
Cloud Security or: How I Learned to Stop Worrying & Love the Cloud
How Long to Boom: Understanding and Measuring ICS Hacker Maturity
Ad

More from Priyanka Aash (20)

PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
PDF
From Chatbot to Destroyer of Endpoints - Can ChatGPT Automate EDR Bypasses (1...
PDF
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
PDF
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
PDF
Lessons Learned from Developing Secure AI Workflows.pdf
PDF
Cyber Defense Matrix Workshop - RSA Conference
PDF
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
PDF
Securing AI - There Is No Try, Only Do!.pdf
PDF
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
PDF
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
PDF
10 Key Challenges for AI within the EU Data Protection Framework.pdf
PDF
Techniques for Automatic Device Identification and Network Assignment.pdf
PDF
Keynote : Presentation on SASE Technology
PDF
Keynote : AI & Future Of Offensive Security
PDF
Redefining Cybersecurity with AI Capabilities
PDF
Demystifying Neural Networks And Building Cybersecurity Applications
PDF
Finetuning GenAI For Hacking and Defending
PDF
(CISOPlatform Summit & SACON 2024) Kids Cyber Security .pdf
PDF
(CISOPlatform Summit & SACON 2024) Regulation & Response In Banks.pdf
PDF
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
From Chatbot to Destroyer of Endpoints - Can ChatGPT Automate EDR Bypasses (1...
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Cyber Defense Matrix Workshop - RSA Conference
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Securing AI - There Is No Try, Only Do!.pdf
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Keynote : Presentation on SASE Technology
Keynote : AI & Future Of Offensive Security
Redefining Cybersecurity with AI Capabilities
Demystifying Neural Networks And Building Cybersecurity Applications
Finetuning GenAI For Hacking and Defending
(CISOPlatform Summit & SACON 2024) Kids Cyber Security .pdf
(CISOPlatform Summit & SACON 2024) Regulation & Response In Banks.pdf
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf

Recently uploaded (20)

PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Electronic commerce courselecture one. Pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Spectroscopy.pptx food analysis technology
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Understanding_Digital_Forensics_Presentation.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Electronic commerce courselecture one. Pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
MYSQL Presentation for SQL database connectivity
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Big Data Technologies - Introduction.pptx
Spectroscopy.pptx food analysis technology
20250228 LYD VKU AI Blended-Learning.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Diabetes mellitus diagnosis method based random forest with bat algorithm
Mobile App Security Testing_ A Comprehensive Guide.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Unlocking AI with Model Context Protocol (MCP)
Per capita expenditure prediction using model stacking based on satellite ima...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Dev secops on the offense automating amazon web services account takeover