SlideShare a Scribd company logo
Red Team vs. Blue Team on AWS ~ re:Invent 2018
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
RedTeam vs. BlueTeam onAWS
Teri Radichel
CEO
2nd Sight Lab
D V C 3 0 4
Kolby Allen
Platform Engineer
Zipwhip
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Attackervs.Defender
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CloudAdmin ...
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Would be aboring talk...
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Instead...
Let’s
search
for buried
treasure!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AccountSetup
Vanilla Account
Single Admin User
Base VPC & Default Configuration
AWS Tutorial: Elastic Beanstalk with WordPress
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/php-hawordpress-tutorial.html
AWS Tutorial: Lambda Accessing RDS in VPC
https://docs.aws.amazon.com/lambda/latest/dg/vpc.html
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
PilferCredentials
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Look for RDSDatabases
aws rds describe-db-instances --filter --query
DBInstances[].[DBInstanceIdentifier,MasterUsername,
DBSubnetGroup.VpcId,Endpoint.Address] --output=table
--color off
supersecretdb?! That sounds like a good
target…
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ExamineSelectedDatabaseSubnets
aws rds describe-db-instances --filter "Name=db-
instance-id,Values=supersecretdb" --query
DBInstances[].DBSubnetGroup.Subnets[].SubnetIdentifier
--output table --color off
Hmm… let’s check out: subnet-1ae9df57
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
WhatTrafficdo NACLsAllow?
aws ec2 describe-network-acls --filter
"Name=association.subnet-id,Values=subnet-1ae9df57" --
query NetworkAcls[].Entries --output table --color off
All traffic allowed ~ Sweet.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
WhatTrafficdo DBSecurityGroupsAllow?
aws ec2 describe-security-groups
--filter "Name=groupid,
Values=sg-217f3e4a"
--output table
--color off
Port 3306
172.31.0.0/16
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
FindVPCWithAccess toDatabase
aws ec2 describe-vpcs --filter
"Name=cidrBlock,Values=172.31.0.0/16" --query
Vpcs[].VpcId --output table --color off
vpc-96c34cfe is assigned to CIDR
172.31.0.0/16
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
VPCSecurityGroup – 3306 Egress
aws ec2 describe-security-groups --
filter Name=ip-permission.to-
port,Values=3306 Name=egress.ip-
permission.cidr,Values=vpc-96c34cfe
--output table --color off --query
'SecurityGroups[].GroupId'
Cool. Let’s see what’s using this.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CheckLambda Functions
aws lambda list-functions --query
Functions[?VpcConfig.SecurityGroupIds
==[`sg-93aadef8`]].FunctionName
--output table --color off
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
QueryLambdaCode
aws lambda get-function --function-name
CreateTableAddRecordsAndRead
--query Code.Location
Gives us URL to code location in
S3…
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Go toURL...CheckOutTheCode
Hmm, what’s in this file?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
About thatrds_config file...
Oops. Database credentials.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Look for InstancesThatCanExfil
aws ec2 describe-instances --output text --query
Reservations[].Instances[].NetworkInterfaces[].
Association.[PublicIp,PublicDnsName]
Check the domains in a browser to find web
sites.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
SecurityGroups – NoOutbound Restrictions
aws ec2 describe-security-groups --filter "Name=egress.ip-
permission.cidr,Values='0.0.0.0/0',Name=vpc-id,Values=vpc-96c34cfe"
--output table --color off --query SecurityGroups[].GroupId
Cool. Wide Open Outbound.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Look for InstancesThatCanExfil
Scan Site.
Exploit
Vulnerability.
Upload code to
connect to DB.
Publish to public
web site.
Scrape data.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Samplevulnerabilities...
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
InSummary...
Super Secret
Lambda RDS
WordPress
RDS
Lambda
function
WordPress
EC2 Instance
security
group
security
group
security
group
security
group
VPC subnet
5. Pivot
1. Steal Keys
2. Recon
3. Steal Creds
4. Exploit
6. Exfil
Read Only.
Single Factor
Credentials
Open network
Secrets in Code
And more…
*
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ProtectingCredentials
• User training - Phishing and handling of credentials
• Password policies and rotation
• MFA!!
• Require frequent re-authentication – especially to sensitive apps
• Prevent deployment of code with embedded credentials:
https://github.com/awslabs/git-secrets
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ProtectingCredentials – git-secrets
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
IAM BestPractices
Roles
Least Privilege
Segregation of Duties
Minimum
Permissions to
manage self
Create
Amazon EC2
Set MFA
token
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Sid: AllowUserstoListAccounts
Effect: Allow
Action:
- "iam:ListAccountAliases"
- "iam:ListUsers"
- "iam:GetAccountPasswordPolicy"
- "iam:GetAccountSummary"
Resource: "*"
Allows users to view
enough information to
get into IAM
Can get the password
policy IMPORTANT so
it can apply
List Users – needed in
order to find themselves
IAM – InitialRoles
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Sid: AllowUserstoManageOwnAccount
Effect: Allow
Action:
- "iam:ChangePassword"
- "iam:CreateAccessKey"
- "iam:CreateLoginProfile"
- "iam:DeleteAccessKey"
- "iam:DeleteLoginProfile"
- "iam:GetLoginProfile"
- "iam:ListAccessKeys"
- "iam:UpdateAccessKey"
- "iam:UpdateLoginProfile"
- "iam:ListSigningCertificates"
- "iam:DeleteSigningCertificate"
- "iam:UpdateSigningCertificate"
- "iam:UploadSigningCertificate"
- "iam:ListSSHPublicKeys"
- "iam:GetSSHPublicKey"
- "iam:DeleteSSHPublicKey"
- "iam:UpdateSSHPublicKey"
- "iam:UploadSSHPublicKey"
Resource: "arn:aws:iam::*:user/${aws:username}"
Actions allow users to
manage their account
– BUT NOT CHANGE
PERMISSIONS
Resource only allows
them to perform on
their username – can’t
modify anyone else
IAM – InitialRoles
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Sid: AllowUserstoListOnlyThierMFA
Effect: Allow
Action:
- "iam:ListVirtualMFADevices"
- "iam:ListMFADevices"
Resource:
- "arn:aws:iam::*:mfa/*"
- "arn:aws:iam::*:user/${aws:username}"
Sid: AllowUsertoManageThierMFA
Effect: Allow
Action:
- "iam:CreateVirtualMFADevice"
- "iam:EnableMFADevice"
- "iam:ResyncMFADevice"
Resource:
- "arn:aws:iam::*:mfa/${aws:username}"
- "arn:aws:iam::*:user/${aws:username}"
User can only ADD
MFA
Administrators must
reset MFA enrollment
IAM – InitialRoles
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Initial role has no
permissions except
to assume other
roles
MFA Required to
assume role with
temp creds
IAM –AssumedRoles
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Failure due to default policy not
having permissions
MFA!
Commands work!
Temporary credential
request and setting at
environmental variable
IAM –AssumedRoles
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Monitor all
API Actions
Feed data
to events
Respond
CloudTrail
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Encryption in flight
with only specific IAM
role with rights
Instance retrieves
encrypted value
Instance IAM Role
allows rights to use
key to decrypt
EC2 Parameter Store for secrets
SecretManagement
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
New: No
password in
rds_config.py
Instance retrieves encrypted value
OLD: Password
embedded in
rds_config.py
SecretManagement
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Calls AWS SSM
EC2ParameterStore
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Monitoring
• AWS GuardDuty
• VPC Flow Logs
• CloudTrail
• AWS Config
• Log shipping
• Secure log backups
• Automate Remediation
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Monitoring
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Patch all software & servers regularly – AWS System Manager
CVE Scanning – AWS Inspector
CVE
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
WAFSecurity
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
NetworkArchitecture
Presentation Layer
Application Layer
Data Layer
Limited NACL & Security Groups
between subnets
Limit all outbound traffic
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
NACLs are wide open
Wide open outbound rules on
security groups
Security Groups all full VPC CIDR
Allows Lateral movement
NetworkArchitecture:Original
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
NACLs limit access between
subnets
Security Groups are only
allowed access from other
security groups
Blocking internet where not
needed
NetworkArchitecture:Better
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Red Team:
Attackers can use the same tools used by DevOps teams.
Cloud APIs provide a means for mapping out an entire account.
Read only access can be powerful.
Wide open networks are an attacker’s best friend.
Blue Team:
Restrict access
Automated deployment
Architect networks to minimize open ports and pivoting
Protect secrets - don't embed in code!
Monitor everything
Conclusion
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Teri Radichel
@teriradichel
Kolby Allen
@kolbyallen
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

More Related Content

PPTX
Serverless Attack Vectors
PPTX
Are You Ready for a Cloud Pentest?
PPTX
AWS re:Inforce 2019 - Threat Hunting in CloudTrail & GuardDuty
PPTX
Are you ready for a cloud pentest? AWS re:Inforce 2019
PPTX
Red Team vs Blue Team on AWS - RSA 2018
PDF
Overview of secret management solutions and architecture
PDF
MozDef Workshop slide
PDF
Cloud Security: Attacking The Metadata Service v2
Serverless Attack Vectors
Are You Ready for a Cloud Pentest?
AWS re:Inforce 2019 - Threat Hunting in CloudTrail & GuardDuty
Are you ready for a cloud pentest? AWS re:Inforce 2019
Red Team vs Blue Team on AWS - RSA 2018
Overview of secret management solutions and architecture
MozDef Workshop slide
Cloud Security: Attacking The Metadata Service v2

More from 2nd Sight Lab (20)

PPTX
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
PPTX
Cross-Cloud Comparison and Security Notes
PPTX
Threat Modeling a Batch Job System - AWS Security Community Day
PPTX
Azure Security - Day6 - Operations And Risk
PPTX
Azure Security - Day5 - Governance And Architecture
PPTX
AzureSecurity Day4 Compute And Application Service Security
PPTX
AzureSecurity - Day3 - Storage And Key Vault
PPTX
AzureSecurity - Day2 - Azure Network Security
PPTX
AzureSecurity Day1: Identity and Access Management
PPTX
So You Want a Job in Cybersecurity
PPTX
Cloud Offense Informs Cloud Defense.pptx
PPTX
Underrated AWS Security Controls ~ AWS Atlanta Summit 2022
PPTX
Real World Cloud Compromise
PPTX
Top Priorities for Cloud Application Security
PPTX
Azure for Auditors
PPTX
How the Cloud Changes Cyber Security
PPTX
Top 5 Priorities for Cloud Security
PPTX
Crypto Miners in the Cloud
PPTX
Locking Down Your Cloud
PPTX
The Threat Is Real. Protect Yourself.
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
Cross-Cloud Comparison and Security Notes
Threat Modeling a Batch Job System - AWS Security Community Day
Azure Security - Day6 - Operations And Risk
Azure Security - Day5 - Governance And Architecture
AzureSecurity Day4 Compute And Application Service Security
AzureSecurity - Day3 - Storage And Key Vault
AzureSecurity - Day2 - Azure Network Security
AzureSecurity Day1: Identity and Access Management
So You Want a Job in Cybersecurity
Cloud Offense Informs Cloud Defense.pptx
Underrated AWS Security Controls ~ AWS Atlanta Summit 2022
Real World Cloud Compromise
Top Priorities for Cloud Application Security
Azure for Auditors
How the Cloud Changes Cyber Security
Top 5 Priorities for Cloud Security
Crypto Miners in the Cloud
Locking Down Your Cloud
The Threat Is Real. Protect Yourself.
Ad

Recently uploaded (20)

PDF
Hybrid model detection and classification of lung cancer
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Getting Started with Data Integration: FME Form 101
PPTX
Programs and apps: productivity, graphics, security and other tools
PPT
Module 1.ppt Iot fundamentals and Architecture
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
Tartificialntelligence_presentation.pptx
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
Hybrid model detection and classification of lung cancer
Group 1 Presentation -Planning and Decision Making .pptx
Getting Started with Data Integration: FME Form 101
Programs and apps: productivity, graphics, security and other tools
Module 1.ppt Iot fundamentals and Architecture
TLE Review Electricity (Electricity).pptx
Assigned Numbers - 2025 - Bluetooth® Document
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Tartificialntelligence_presentation.pptx
DP Operators-handbook-extract for the Mautical Institute
A comparative study of natural language inference in Swahili using monolingua...
A novel scalable deep ensemble learning framework for big data classification...
A contest of sentiment analysis: k-nearest neighbor versus neural network
cloud_computing_Infrastucture_as_cloud_p
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Final SEM Unit 1 for mit wpu at pune .pptx
Hindi spoken digit analysis for native and non-native speakers
1 - Historical Antecedents, Social Consideration.pdf
Zenith AI: Advanced Artificial Intelligence
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
Ad

Red Team vs. Blue Team on AWS ~ re:Invent 2018

  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. RedTeam vs. BlueTeam onAWS Teri Radichel CEO 2nd Sight Lab D V C 3 0 4 Kolby Allen Platform Engineer Zipwhip
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Attackervs.Defender
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CloudAdmin ...
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Would be aboring talk...
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Instead... Let’s search for buried treasure!
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AccountSetup Vanilla Account Single Admin User Base VPC & Default Configuration AWS Tutorial: Elastic Beanstalk with WordPress https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/php-hawordpress-tutorial.html AWS Tutorial: Lambda Accessing RDS in VPC https://docs.aws.amazon.com/lambda/latest/dg/vpc.html
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. PilferCredentials
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Look for RDSDatabases aws rds describe-db-instances --filter --query DBInstances[].[DBInstanceIdentifier,MasterUsername, DBSubnetGroup.VpcId,Endpoint.Address] --output=table --color off supersecretdb?! That sounds like a good target…
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. ExamineSelectedDatabaseSubnets aws rds describe-db-instances --filter "Name=db- instance-id,Values=supersecretdb" --query DBInstances[].DBSubnetGroup.Subnets[].SubnetIdentifier --output table --color off Hmm… let’s check out: subnet-1ae9df57
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. WhatTrafficdo NACLsAllow? aws ec2 describe-network-acls --filter "Name=association.subnet-id,Values=subnet-1ae9df57" -- query NetworkAcls[].Entries --output table --color off All traffic allowed ~ Sweet.
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. WhatTrafficdo DBSecurityGroupsAllow? aws ec2 describe-security-groups --filter "Name=groupid, Values=sg-217f3e4a" --output table --color off Port 3306 172.31.0.0/16
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. FindVPCWithAccess toDatabase aws ec2 describe-vpcs --filter "Name=cidrBlock,Values=172.31.0.0/16" --query Vpcs[].VpcId --output table --color off vpc-96c34cfe is assigned to CIDR 172.31.0.0/16
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. VPCSecurityGroup – 3306 Egress aws ec2 describe-security-groups -- filter Name=ip-permission.to- port,Values=3306 Name=egress.ip- permission.cidr,Values=vpc-96c34cfe --output table --color off --query 'SecurityGroups[].GroupId' Cool. Let’s see what’s using this.
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CheckLambda Functions aws lambda list-functions --query Functions[?VpcConfig.SecurityGroupIds ==[`sg-93aadef8`]].FunctionName --output table --color off
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. QueryLambdaCode aws lambda get-function --function-name CreateTableAddRecordsAndRead --query Code.Location Gives us URL to code location in S3…
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Go toURL...CheckOutTheCode Hmm, what’s in this file?
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. About thatrds_config file... Oops. Database credentials.
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Look for InstancesThatCanExfil aws ec2 describe-instances --output text --query Reservations[].Instances[].NetworkInterfaces[]. Association.[PublicIp,PublicDnsName] Check the domains in a browser to find web sites.
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. SecurityGroups – NoOutbound Restrictions aws ec2 describe-security-groups --filter "Name=egress.ip- permission.cidr,Values='0.0.0.0/0',Name=vpc-id,Values=vpc-96c34cfe" --output table --color off --query SecurityGroups[].GroupId Cool. Wide Open Outbound.
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Look for InstancesThatCanExfil Scan Site. Exploit Vulnerability. Upload code to connect to DB. Publish to public web site. Scrape data.
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Samplevulnerabilities...
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. InSummary... Super Secret Lambda RDS WordPress RDS Lambda function WordPress EC2 Instance security group security group security group security group VPC subnet 5. Pivot 1. Steal Keys 2. Recon 3. Steal Creds 4. Exploit 6. Exfil Read Only. Single Factor Credentials Open network Secrets in Code And more… *
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. ProtectingCredentials • User training - Phishing and handling of credentials • Password policies and rotation • MFA!! • Require frequent re-authentication – especially to sensitive apps • Prevent deployment of code with embedded credentials: https://github.com/awslabs/git-secrets
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. ProtectingCredentials – git-secrets
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. IAM BestPractices Roles Least Privilege Segregation of Duties Minimum Permissions to manage self Create Amazon EC2 Set MFA token
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Sid: AllowUserstoListAccounts Effect: Allow Action: - "iam:ListAccountAliases" - "iam:ListUsers" - "iam:GetAccountPasswordPolicy" - "iam:GetAccountSummary" Resource: "*" Allows users to view enough information to get into IAM Can get the password policy IMPORTANT so it can apply List Users – needed in order to find themselves IAM – InitialRoles
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Sid: AllowUserstoManageOwnAccount Effect: Allow Action: - "iam:ChangePassword" - "iam:CreateAccessKey" - "iam:CreateLoginProfile" - "iam:DeleteAccessKey" - "iam:DeleteLoginProfile" - "iam:GetLoginProfile" - "iam:ListAccessKeys" - "iam:UpdateAccessKey" - "iam:UpdateLoginProfile" - "iam:ListSigningCertificates" - "iam:DeleteSigningCertificate" - "iam:UpdateSigningCertificate" - "iam:UploadSigningCertificate" - "iam:ListSSHPublicKeys" - "iam:GetSSHPublicKey" - "iam:DeleteSSHPublicKey" - "iam:UpdateSSHPublicKey" - "iam:UploadSSHPublicKey" Resource: "arn:aws:iam::*:user/${aws:username}" Actions allow users to manage their account – BUT NOT CHANGE PERMISSIONS Resource only allows them to perform on their username – can’t modify anyone else IAM – InitialRoles
  • 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Sid: AllowUserstoListOnlyThierMFA Effect: Allow Action: - "iam:ListVirtualMFADevices" - "iam:ListMFADevices" Resource: - "arn:aws:iam::*:mfa/*" - "arn:aws:iam::*:user/${aws:username}" Sid: AllowUsertoManageThierMFA Effect: Allow Action: - "iam:CreateVirtualMFADevice" - "iam:EnableMFADevice" - "iam:ResyncMFADevice" Resource: - "arn:aws:iam::*:mfa/${aws:username}" - "arn:aws:iam::*:user/${aws:username}" User can only ADD MFA Administrators must reset MFA enrollment IAM – InitialRoles
  • 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Initial role has no permissions except to assume other roles MFA Required to assume role with temp creds IAM –AssumedRoles
  • 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Failure due to default policy not having permissions MFA! Commands work! Temporary credential request and setting at environmental variable IAM –AssumedRoles
  • 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Monitor all API Actions Feed data to events Respond CloudTrail
  • 33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Encryption in flight with only specific IAM role with rights Instance retrieves encrypted value Instance IAM Role allows rights to use key to decrypt EC2 Parameter Store for secrets SecretManagement
  • 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. New: No password in rds_config.py Instance retrieves encrypted value OLD: Password embedded in rds_config.py SecretManagement
  • 35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Calls AWS SSM EC2ParameterStore
  • 36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Monitoring • AWS GuardDuty • VPC Flow Logs • CloudTrail • AWS Config • Log shipping • Secure log backups • Automate Remediation
  • 37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Monitoring
  • 38. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Patch all software & servers regularly – AWS System Manager CVE Scanning – AWS Inspector CVE
  • 39. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. WAFSecurity
  • 40. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. NetworkArchitecture Presentation Layer Application Layer Data Layer Limited NACL & Security Groups between subnets Limit all outbound traffic
  • 41. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. NACLs are wide open Wide open outbound rules on security groups Security Groups all full VPC CIDR Allows Lateral movement NetworkArchitecture:Original
  • 42. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. NACLs limit access between subnets Security Groups are only allowed access from other security groups Blocking internet where not needed NetworkArchitecture:Better
  • 43. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Red Team: Attackers can use the same tools used by DevOps teams. Cloud APIs provide a means for mapping out an entire account. Read only access can be powerful. Wide open networks are an attacker’s best friend. Blue Team: Restrict access Automated deployment Architect networks to minimize open ports and pivoting Protect secrets - don't embed in code! Monitor everything Conclusion
  • 44. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Teri Radichel @teriradichel Kolby Allen @kolbyallen
  • 45. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Editor's Notes

  • #36: Fix parameter store image
  • #39: Fix 1st line