SlideShare una empresa de Scribd logo
1 de 21
Descargar para leer sin conexión
Limiting Blast Radius
Automating AWS IAM using Policy Sentry
@kmcquade3
Kinnaird McQuade, Lead Cloud Security Engineer
Kinnaird McQuade
Lead Cloud Security Engineer
Twitter: @kmcquade3
* Hacker, Builder, dog lover
● Motivation
● Bad IAM Policies
● Secure IAM Policies
● How Policy Sentry solves these Problems
● Demo
Agenda
● AWS IAM is difficult to manage,
especially at scale
● User roles generally undergo more
scrutiny than machine roles (EC2
instance profiles)
● Developers typically define IAM
policies for machine roles
Motivation
● Machine roles are rich targets for
attackers
● In the case of a breach, restricting
IAM on machine roles helps to limit
the blast radius of those credentials
by only giving access to what they
need.
Resource Constraints
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": "*"
}]
}
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::example"
}]
}
Insecure: Wildcard resources More secure: Resource Constraints
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"s3:Get*",
"s3:List*"
],
"Resource": [
"arn:aws:s3:::example/*"
]}]
}
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::example/*"
]
}]
}
Access Levels
Insecure: All Access Levels More secure: Specific Access Levels
AWS
Managed
Policies
Eyeball it
Actions: "*"
Resources:
"*"
How do we automate our way out of the
problem?
● Open Source CLI tool
● Creates Least Privilege IAM policies in seconds
● Scopes policies down to:
○ Access levels
○ Resource ARNs
● Uses simple YAML templates to generate policies
Generate Least-Privilege IAM Policies in seconds
Policy Sentry
Policy Sentry Templates
mode: crud
read:
-'arn:aws:s3:::example/*'
write:
-'arn:aws:s3:::example/*'
● “I need Read and Write access to
the objects in the S3 bucket called
mybucket”
● “I need Tagging access to the
secret titled mysecret in us-east-1”
Policy Sentry
mode: crud
read:
-'arn:aws:s3:::mybucket/*'
write:
-'arn:aws:s3:::mybucket/*'
mode: crud
tagging:
-'arn:aws:secretsmanager:u
s-east-1:123456789012:secr
et:mysecret'
Writing Policies - Three easy steps
1. Generate the YAML template
policy_sentry create-template
--output-file demo.yml
--template-type crud
2. Copy and paste ARNs
3. Run the write-policy command
policy_sentry write-policy
--input-file demo.yml
mode: crud
read:
-'arn:aws:s3:::mybucket/*'
write:
-'arn:aws:s3:::mybucket/*'
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "SsmReadParameter",
"Effect": "Allow",
"Action": [
"ssm:GetParameter",
"ssm:GetParameterHistory",
"ssm:GetParameters",
"ssm:GetParametersByPath"
],
"Resource":
"arn:aws:ssm:us-east-1:123456789012:pa
rameter/myparameter"
}]
}
Demo time!
https://github.com/salesforce/policy_sentry/
How Policy Sentry Works
Leveraging the AWS Documentation on Actions, Resources, and Condition Keys
Actions
Access
Level
Resource Type
ssm:DescribeParameters List *
ssm:DescribeDocument Read document
ssm:GetParameter Read parameter
ssm:GetParametersByPath Read parameter
ssm:PutParameter Write parameter
Source: https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awssystemsmanager.html
How Policy Sentry Works
Leveraging the AWS Documentation on Actions, Resources, and Condition Keys
Actions
Access
Level
Resource Type
ssm:DescribeParameters List *
ssm:DescribeDocument Read document
ssm:GetParameter Read parameter
ssm:GetParametersByPath Read parameter
ssm:PutParameter Write parameter
Policy Sentry
auto-selects the
proper Access Levels
and Resource Types
to determine the
necessary actions,
based on user input.
Source: https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awssystemsmanager.html
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "SsmReadParameter",
"Effect": "Allow",
"Action": [
"ssm:GetParameter",
"ssm:GetParameterHistory",
"ssm:GetParameters",
"ssm:GetParametersByPath"
],
"Resource":
"arn:aws:ssm:us-east-1:123456789012:parame
ter/myparameter"
}]}
mode: crud
read:
-'arn:aws:ssm:us-east-1:12345678
9012:parameter/myparameter'
Input: Output:
● Process:
1. Generate the Template file
2. Copy/paste ARNs
3. Run command to write the policy
● Policy Sentry…
○ Speeds up time to develop IAM
policies
○ Abstracts the complexity of IAM
○ Auditable, repeatable, store in version
control
○ You don’t need to be an IAM expert to
use it
○ Developer friendly - just paste into
YAML!
Recap
https://github.com/salesforce/policy_sentry/
● DevOps Engineers
● Director/Senior Manager for IAM
● Infrastructure Security Engineers
● Threat/Vulnerability Management
● Penetration Testing
● Security Architects
● ...much more
● DM me on Twitter or the Cloud
Security Forum Slack if you are
interested
○ https://twitter.com/kmcquade3
PS: We’re hiring!
https://github.com/salesforce/policy_sentry/
Questions?
https://github.com/salesforce/policy_sentry/

Más contenido relacionado

Último

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Último (20)

A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 

Destacado

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
Simplilearn
 

Destacado (20)

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 

Limiting Blast Radius: Automating AWS IAM using Policy Sentry - Kinnaird McQuade (fwd:cloudsec 2020)

  • 1. Limiting Blast Radius Automating AWS IAM using Policy Sentry @kmcquade3 Kinnaird McQuade, Lead Cloud Security Engineer
  • 2. Kinnaird McQuade Lead Cloud Security Engineer Twitter: @kmcquade3 * Hacker, Builder, dog lover
  • 3. ● Motivation ● Bad IAM Policies ● Secure IAM Policies ● How Policy Sentry solves these Problems ● Demo Agenda
  • 4. ● AWS IAM is difficult to manage, especially at scale ● User roles generally undergo more scrutiny than machine roles (EC2 instance profiles) ● Developers typically define IAM policies for machine roles Motivation ● Machine roles are rich targets for attackers ● In the case of a breach, restricting IAM on machine roles helps to limit the blast radius of those credentials by only giving access to what they need.
  • 5. Resource Constraints { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": [ "s3:GetObject" ], "Resource": "*" }] } { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": [ "s3:GetObject" ], "Resource": [ "arn:aws:s3:::example" }] } Insecure: Wildcard resources More secure: Resource Constraints
  • 6. { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": [ "s3:Get*", "s3:List*" ], "Resource": [ "arn:aws:s3:::example/*" ]}] } { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": "s3:*", "Resource": [ "arn:aws:s3:::example/*" ] }] } Access Levels Insecure: All Access Levels More secure: Specific Access Levels
  • 8. How do we automate our way out of the problem?
  • 9. ● Open Source CLI tool ● Creates Least Privilege IAM policies in seconds ● Scopes policies down to: ○ Access levels ○ Resource ARNs ● Uses simple YAML templates to generate policies Generate Least-Privilege IAM Policies in seconds Policy Sentry
  • 10. Policy Sentry Templates mode: crud read: -'arn:aws:s3:::example/*' write: -'arn:aws:s3:::example/*'
  • 11. ● “I need Read and Write access to the objects in the S3 bucket called mybucket” ● “I need Tagging access to the secret titled mysecret in us-east-1” Policy Sentry mode: crud read: -'arn:aws:s3:::mybucket/*' write: -'arn:aws:s3:::mybucket/*' mode: crud tagging: -'arn:aws:secretsmanager:u s-east-1:123456789012:secr et:mysecret'
  • 12. Writing Policies - Three easy steps 1. Generate the YAML template policy_sentry create-template --output-file demo.yml --template-type crud 2. Copy and paste ARNs 3. Run the write-policy command policy_sentry write-policy --input-file demo.yml mode: crud read: -'arn:aws:s3:::mybucket/*' write: -'arn:aws:s3:::mybucket/*'
  • 13. { "Version": "2012-10-17", "Statement": [{ "Sid": "SsmReadParameter", "Effect": "Allow", "Action": [ "ssm:GetParameter", "ssm:GetParameterHistory", "ssm:GetParameters", "ssm:GetParametersByPath" ], "Resource": "arn:aws:ssm:us-east-1:123456789012:pa rameter/myparameter" }] }
  • 15. How Policy Sentry Works Leveraging the AWS Documentation on Actions, Resources, and Condition Keys Actions Access Level Resource Type ssm:DescribeParameters List * ssm:DescribeDocument Read document ssm:GetParameter Read parameter ssm:GetParametersByPath Read parameter ssm:PutParameter Write parameter Source: https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awssystemsmanager.html
  • 16. How Policy Sentry Works Leveraging the AWS Documentation on Actions, Resources, and Condition Keys Actions Access Level Resource Type ssm:DescribeParameters List * ssm:DescribeDocument Read document ssm:GetParameter Read parameter ssm:GetParametersByPath Read parameter ssm:PutParameter Write parameter Policy Sentry auto-selects the proper Access Levels and Resource Types to determine the necessary actions, based on user input. Source: https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awssystemsmanager.html
  • 17. { "Version": "2012-10-17", "Statement": [{ "Sid": "SsmReadParameter", "Effect": "Allow", "Action": [ "ssm:GetParameter", "ssm:GetParameterHistory", "ssm:GetParameters", "ssm:GetParametersByPath" ], "Resource": "arn:aws:ssm:us-east-1:123456789012:parame ter/myparameter" }]} mode: crud read: -'arn:aws:ssm:us-east-1:12345678 9012:parameter/myparameter' Input: Output:
  • 18. ● Process: 1. Generate the Template file 2. Copy/paste ARNs 3. Run command to write the policy ● Policy Sentry… ○ Speeds up time to develop IAM policies ○ Abstracts the complexity of IAM ○ Auditable, repeatable, store in version control ○ You don’t need to be an IAM expert to use it ○ Developer friendly - just paste into YAML! Recap https://github.com/salesforce/policy_sentry/
  • 19. ● DevOps Engineers ● Director/Senior Manager for IAM ● Infrastructure Security Engineers ● Threat/Vulnerability Management ● Penetration Testing ● Security Architects ● ...much more ● DM me on Twitter or the Cloud Security Forum Slack if you are interested ○ https://twitter.com/kmcquade3 PS: We’re hiring! https://github.com/salesforce/policy_sentry/
  • 20.