SlideShare a Scribd company logo
1 of 16
Anatomy of an AWS
Account Cryptojack
DevOpsDays Boston 2018
Presented by Anton Gurov
9/24/18
Introduction
3 © 2018 CLOUDHEALTH® TECHNOLOGIES INC.
About me
Anton Gurov
• Director of TechOps @ CloudHealth Technologies
- Security
- Compliance
- Operations
• Experience in PCI-DSS/SOC2/GDPR compliance
- Private/Hybrid/Cloud
• Mobile payments
• Ad tech
• Cloud management
• 3 successful exits
• Avid car racer, juggler and acro-base!
• Contact: www.linkedin.com/in/antongurov
4 © 2018 CLOUDHEALTH® TECHNOLOGIES INC.
Cryptojack summary
• Cryptojack - compute resource take-over for the purposes of crypto-
mining operations
• Browsers
• Endpoints/Home routers
• Compute resources - physical/cloud
• Tesla/Aviva/Gemalto - 2018
- Open Kubernetes clusters
- Leaked AWS creds
- Many more go unreported
• Could be worse!
- CodeSpaces - 2014
• Ransom
• Company murdered
“Money Doesn’t
Grow on Trees,
but it’s Growing
in the Cloud” -
RedLock CSI Team
Incident
6 © 2018 CLOUDHEALTH® TECHNOLOGIES INC.
Cryptojack incident
Incident info
● Support email from CloudHealth Tech customer requesting assistance
● 200 c4.8xlarge instances in AWS account - multiple regions
○ 100% CPU utilization, $12k per day in EC2 compute $
● No CloudTrail. No audit logs.
● Innocent user framed!
7 © 2018 CLOUDHEALTH® TECHNOLOGIES INC.
Cryptojack incident
Incident handling and response
● AWS Support
○ Account cleanup
○ CloudTrail enabled
○ AWS refund (case dependent)
● CloudHealth
○ Forensics
○ Developed timeline
○ Configured customer CHT security module reporting and best
practices
Timeline
9 © 2018 CLOUDHEALTH® TECHNOLOGIES INC.
Cryptojack incident
Timeline
• 3/14 10:30 UTC
A series of public AMIs like ami-6dbd137b created and shared globally across all regions
• 3/21 14:43 UTC
Customer admin user Access Key 1 Rotated
• 3/21 14:44 UTC
Framed user console pwd and admin perms set
• 3/21 14:45 UTC
Instances/VPCs/SGs started getting created
• 3/21 14:52 UTC
Customer admin user Access Key 1 Last Used - IAM Service
• 3/21 14:54 UTC
200 c3.8xlarge Windows instances discovered in customer account by CHT platform
• 3/22
Cost spike discovered in CloudHealth app by customer
}Less than
10 minutes
Pre-stage}
10 © 2018 CLOUDHEALTH® TECHNOLOGIES INC.
Cryptojack incident
Timeline summary
● Most useful data came from AWS Credentials Report
○ generate-credential-report
● Compromised AWS Key rotated immediately by an attacker
● Highly automated
○ Pre-baked AMIs
○ SGs/VPCs/EC2 templated
● Limited to 200 machines
○ AWS default account limits
Prevention & Detection
12 © 2018 CLOUDHEALTH® TECHNOLOGIES INC.
Cryptojack incident
Protection
● Secure AWS root account
○ Physical MFA - $13
○ Disable API
● Users/Operators
○ Enable and force MFA for all operations (Console/API)
■ AWS Tutorial: Enable Your Users to Configure Their Own Credentials and MFA Settings
● https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_users-self-manage-mfa-and-creds.html
■ CLI wrapper for MFA - aws-vault
● https://github.com/99designs/aws-vault
○ Use Idp federation (SAML/SSO)
■ Google, OKTA, Ping Identity, OneLogin, etc
○ No direct permissions to users, use IAM AssumeRole
13 © 2018 CLOUDHEALTH® TECHNOLOGIES INC.
Cryptojack incident
Protection - cont.
● Application/Service accounts
○ Say “bye-bye” to AWS Key/Secret keys
■ IAM roles and instance profiles
■ Enable IP whitelisting in IAM policies
○ Limit application and service permissions
■ No blanket *:*
○ Scan your code for AWS keys before they do
■ GitGuardian, keynuker, gitsecrets
● General
○ Keep existing EC2 limits unless required
○ AWS CIS Benchmark
■ ThreatStack, CloudHealth, others
○ Enable CloudTrail and AWS Config!
14 © 2018 CLOUDHEALTH® TECHNOLOGIES INC.
Cryptojack incident
Detection
● Watch and alert on AWS costs projections
○ Create a Billing Alarm to Monitor Your Estimated AWS Charges
■ https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html
○ CloudHealth - % change from baseline
● CloudTrail monitoring
○ Setup
■ All regions
■ Forward to central secure AWS account
○ Real-time monitoring and alerting
■ ThreatStack, SumoLogic, Splunk, etc
■ Look and flag API credentials changes
● Misc
○ AMI Provenance and VPC Flow Logs
3 Takeaways
16 © 2018 CLOUDHEALTH® TECHNOLOGIES INC.
Key Takeaways
● Enforce MFA on user and root accounts
● Use IAM Roles, ban Key/Secret Keys
● Enable CloudTrail/Config monitoring and Cost alerting

More Related Content

Similar to AWS Cryptojack Incident Timeline and Prevention

Detecting Malicious Cloud Account Behavior: A Look at the New Native Platform...
Detecting Malicious Cloud Account Behavior: A Look at the New Native Platform...Detecting Malicious Cloud Account Behavior: A Look at the New Native Platform...
Detecting Malicious Cloud Account Behavior: A Look at the New Native Platform...Priyanka Aash
 
Distributed Solar Systems at EDF Renewables and AWS IoT: A Natural Fit (PUT30...
Distributed Solar Systems at EDF Renewables and AWS IoT: A Natural Fit (PUT30...Distributed Solar Systems at EDF Renewables and AWS IoT: A Natural Fit (PUT30...
Distributed Solar Systems at EDF Renewables and AWS IoT: A Natural Fit (PUT30...Amazon Web Services
 
004 - Logging in the Cloud -- hide01.ir.pptx
004 - Logging in the Cloud  --  hide01.ir.pptx004 - Logging in the Cloud  --  hide01.ir.pptx
004 - Logging in the Cloud -- hide01.ir.pptxnitinscribd
 
How to Secure your Hybrid Enviroment - Pop-up Loft Tel Aviv
How to Secure your Hybrid Enviroment - Pop-up Loft Tel AvivHow to Secure your Hybrid Enviroment - Pop-up Loft Tel Aviv
How to Secure your Hybrid Enviroment - Pop-up Loft Tel AvivAmazon Web Services
 
Recent AWS Security Improvements - AWS User Group Perth - November 2018
Recent AWS Security Improvements - AWS User Group Perth - November 2018Recent AWS Security Improvements - AWS User Group Perth - November 2018
Recent AWS Security Improvements - AWS User Group Perth - November 2018James Bromberger
 
Slide share device to iot solution – a blueprint
Slide share   device to iot solution – a blueprintSlide share   device to iot solution – a blueprint
Slide share device to iot solution – a blueprintGuy Vinograd ☁
 
Computing at the Edge with AWS Greengrass and Amazon FreeRTOS, ft. Enel (IOT2...
Computing at the Edge with AWS Greengrass and Amazon FreeRTOS, ft. Enel (IOT2...Computing at the Edge with AWS Greengrass and Amazon FreeRTOS, ft. Enel (IOT2...
Computing at the Edge with AWS Greengrass and Amazon FreeRTOS, ft. Enel (IOT2...Amazon Web Services
 
TENDENCIAS DE SEGURIDAD PARA AMBIENTES EN LA NUBE
TENDENCIAS DE SEGURIDAD PARA AMBIENTES EN LA NUBETENDENCIAS DE SEGURIDAD PARA AMBIENTES EN LA NUBE
TENDENCIAS DE SEGURIDAD PARA AMBIENTES EN LA NUBECristian Garcia G.
 
[2021 Somos Summit] - Rethinking Identity Access Management and The Rise of t...
[2021 Somos Summit] - Rethinking Identity Access Management and The Rise of t...[2021 Somos Summit] - Rethinking Identity Access Management and The Rise of t...
[2021 Somos Summit] - Rethinking Identity Access Management and The Rise of t...WSO2
 
[DOST] OpenStack & the Enterprise Hybrid Cloud - Tech, People, Processes
[DOST] OpenStack & the Enterprise Hybrid Cloud - Tech, People, Processes[DOST] OpenStack & the Enterprise Hybrid Cloud - Tech, People, Processes
[DOST] OpenStack & the Enterprise Hybrid Cloud - Tech, People, ProcessesGerd Prüßmann
 
Anthos Security: modernize your security posture for cloud native applications
Anthos Security: modernize your security posture for cloud native applicationsAnthos Security: modernize your security posture for cloud native applications
Anthos Security: modernize your security posture for cloud native applicationsGreg Castle
 
Kubernetes fingerprinting with Prometheus.pdf
Kubernetes fingerprinting with Prometheus.pdfKubernetes fingerprinting with Prometheus.pdf
Kubernetes fingerprinting with Prometheus.pdfKawimbaLofgrens
 
Iot 1906 - approaches for building applications with the IBM IoT cloud
Iot 1906 - approaches for building applications with the IBM IoT cloudIot 1906 - approaches for building applications with the IBM IoT cloud
Iot 1906 - approaches for building applications with the IBM IoT cloudPeterNiblett
 
Introduction to Serverless through Architectural Patterns
Introduction to Serverless through Architectural PatternsIntroduction to Serverless through Architectural Patterns
Introduction to Serverless through Architectural PatternsMathieu Mailhos
 
Oracle Open World 2018 - Cloud Lift Accelerator Suite
Oracle Open World 2018 - Cloud Lift Accelerator SuiteOracle Open World 2018 - Cloud Lift Accelerator Suite
Oracle Open World 2018 - Cloud Lift Accelerator SuiteIke Aniagoh
 
Beyond S3 Buckets - Effective Countermeasures for Emerging Cloud Threats
Beyond S3 Buckets - Effective Countermeasures for Emerging Cloud ThreatsBeyond S3 Buckets - Effective Countermeasures for Emerging Cloud Threats
Beyond S3 Buckets - Effective Countermeasures for Emerging Cloud ThreatsSBWebinars
 
Internet of things basics
Internet of things basicsInternet of things basics
Internet of things basicscumulocity
 

Similar to AWS Cryptojack Incident Timeline and Prevention (20)

Detecting Malicious Cloud Account Behavior: A Look at the New Native Platform...
Detecting Malicious Cloud Account Behavior: A Look at the New Native Platform...Detecting Malicious Cloud Account Behavior: A Look at the New Native Platform...
Detecting Malicious Cloud Account Behavior: A Look at the New Native Platform...
 
Distributed Solar Systems at EDF Renewables and AWS IoT: A Natural Fit (PUT30...
Distributed Solar Systems at EDF Renewables and AWS IoT: A Natural Fit (PUT30...Distributed Solar Systems at EDF Renewables and AWS IoT: A Natural Fit (PUT30...
Distributed Solar Systems at EDF Renewables and AWS IoT: A Natural Fit (PUT30...
 
The rise of microservices
The rise of microservicesThe rise of microservices
The rise of microservices
 
Check Point and Accenture Webinar
Check Point and Accenture Webinar Check Point and Accenture Webinar
Check Point and Accenture Webinar
 
004 - Logging in the Cloud -- hide01.ir.pptx
004 - Logging in the Cloud  --  hide01.ir.pptx004 - Logging in the Cloud  --  hide01.ir.pptx
004 - Logging in the Cloud -- hide01.ir.pptx
 
How to Secure your Hybrid Enviroment - Pop-up Loft Tel Aviv
How to Secure your Hybrid Enviroment - Pop-up Loft Tel AvivHow to Secure your Hybrid Enviroment - Pop-up Loft Tel Aviv
How to Secure your Hybrid Enviroment - Pop-up Loft Tel Aviv
 
Recent AWS Security Improvements - AWS User Group Perth - November 2018
Recent AWS Security Improvements - AWS User Group Perth - November 2018Recent AWS Security Improvements - AWS User Group Perth - November 2018
Recent AWS Security Improvements - AWS User Group Perth - November 2018
 
Slide share device to iot solution – a blueprint
Slide share   device to iot solution – a blueprintSlide share   device to iot solution – a blueprint
Slide share device to iot solution – a blueprint
 
The Perimeter Is Dead
The Perimeter Is DeadThe Perimeter Is Dead
The Perimeter Is Dead
 
Computing at the Edge with AWS Greengrass and Amazon FreeRTOS, ft. Enel (IOT2...
Computing at the Edge with AWS Greengrass and Amazon FreeRTOS, ft. Enel (IOT2...Computing at the Edge with AWS Greengrass and Amazon FreeRTOS, ft. Enel (IOT2...
Computing at the Edge with AWS Greengrass and Amazon FreeRTOS, ft. Enel (IOT2...
 
TENDENCIAS DE SEGURIDAD PARA AMBIENTES EN LA NUBE
TENDENCIAS DE SEGURIDAD PARA AMBIENTES EN LA NUBETENDENCIAS DE SEGURIDAD PARA AMBIENTES EN LA NUBE
TENDENCIAS DE SEGURIDAD PARA AMBIENTES EN LA NUBE
 
[2021 Somos Summit] - Rethinking Identity Access Management and The Rise of t...
[2021 Somos Summit] - Rethinking Identity Access Management and The Rise of t...[2021 Somos Summit] - Rethinking Identity Access Management and The Rise of t...
[2021 Somos Summit] - Rethinking Identity Access Management and The Rise of t...
 
[DOST] OpenStack & the Enterprise Hybrid Cloud - Tech, People, Processes
[DOST] OpenStack & the Enterprise Hybrid Cloud - Tech, People, Processes[DOST] OpenStack & the Enterprise Hybrid Cloud - Tech, People, Processes
[DOST] OpenStack & the Enterprise Hybrid Cloud - Tech, People, Processes
 
Anthos Security: modernize your security posture for cloud native applications
Anthos Security: modernize your security posture for cloud native applicationsAnthos Security: modernize your security posture for cloud native applications
Anthos Security: modernize your security posture for cloud native applications
 
Kubernetes fingerprinting with Prometheus.pdf
Kubernetes fingerprinting with Prometheus.pdfKubernetes fingerprinting with Prometheus.pdf
Kubernetes fingerprinting with Prometheus.pdf
 
Iot 1906 - approaches for building applications with the IBM IoT cloud
Iot 1906 - approaches for building applications with the IBM IoT cloudIot 1906 - approaches for building applications with the IBM IoT cloud
Iot 1906 - approaches for building applications with the IBM IoT cloud
 
Introduction to Serverless through Architectural Patterns
Introduction to Serverless through Architectural PatternsIntroduction to Serverless through Architectural Patterns
Introduction to Serverless through Architectural Patterns
 
Oracle Open World 2018 - Cloud Lift Accelerator Suite
Oracle Open World 2018 - Cloud Lift Accelerator SuiteOracle Open World 2018 - Cloud Lift Accelerator Suite
Oracle Open World 2018 - Cloud Lift Accelerator Suite
 
Beyond S3 Buckets - Effective Countermeasures for Emerging Cloud Threats
Beyond S3 Buckets - Effective Countermeasures for Emerging Cloud ThreatsBeyond S3 Buckets - Effective Countermeasures for Emerging Cloud Threats
Beyond S3 Buckets - Effective Countermeasures for Emerging Cloud Threats
 
Internet of things basics
Internet of things basicsInternet of things basics
Internet of things basics
 

Recently uploaded

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Recently uploaded (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

AWS Cryptojack Incident Timeline and Prevention

  • 1. Anatomy of an AWS Account Cryptojack DevOpsDays Boston 2018 Presented by Anton Gurov 9/24/18
  • 3. 3 © 2018 CLOUDHEALTH® TECHNOLOGIES INC. About me Anton Gurov • Director of TechOps @ CloudHealth Technologies - Security - Compliance - Operations • Experience in PCI-DSS/SOC2/GDPR compliance - Private/Hybrid/Cloud • Mobile payments • Ad tech • Cloud management • 3 successful exits • Avid car racer, juggler and acro-base! • Contact: www.linkedin.com/in/antongurov
  • 4. 4 © 2018 CLOUDHEALTH® TECHNOLOGIES INC. Cryptojack summary • Cryptojack - compute resource take-over for the purposes of crypto- mining operations • Browsers • Endpoints/Home routers • Compute resources - physical/cloud • Tesla/Aviva/Gemalto - 2018 - Open Kubernetes clusters - Leaked AWS creds - Many more go unreported • Could be worse! - CodeSpaces - 2014 • Ransom • Company murdered “Money Doesn’t Grow on Trees, but it’s Growing in the Cloud” - RedLock CSI Team
  • 6. 6 © 2018 CLOUDHEALTH® TECHNOLOGIES INC. Cryptojack incident Incident info ● Support email from CloudHealth Tech customer requesting assistance ● 200 c4.8xlarge instances in AWS account - multiple regions ○ 100% CPU utilization, $12k per day in EC2 compute $ ● No CloudTrail. No audit logs. ● Innocent user framed!
  • 7. 7 © 2018 CLOUDHEALTH® TECHNOLOGIES INC. Cryptojack incident Incident handling and response ● AWS Support ○ Account cleanup ○ CloudTrail enabled ○ AWS refund (case dependent) ● CloudHealth ○ Forensics ○ Developed timeline ○ Configured customer CHT security module reporting and best practices
  • 9. 9 © 2018 CLOUDHEALTH® TECHNOLOGIES INC. Cryptojack incident Timeline • 3/14 10:30 UTC A series of public AMIs like ami-6dbd137b created and shared globally across all regions • 3/21 14:43 UTC Customer admin user Access Key 1 Rotated • 3/21 14:44 UTC Framed user console pwd and admin perms set • 3/21 14:45 UTC Instances/VPCs/SGs started getting created • 3/21 14:52 UTC Customer admin user Access Key 1 Last Used - IAM Service • 3/21 14:54 UTC 200 c3.8xlarge Windows instances discovered in customer account by CHT platform • 3/22 Cost spike discovered in CloudHealth app by customer }Less than 10 minutes Pre-stage}
  • 10. 10 © 2018 CLOUDHEALTH® TECHNOLOGIES INC. Cryptojack incident Timeline summary ● Most useful data came from AWS Credentials Report ○ generate-credential-report ● Compromised AWS Key rotated immediately by an attacker ● Highly automated ○ Pre-baked AMIs ○ SGs/VPCs/EC2 templated ● Limited to 200 machines ○ AWS default account limits
  • 12. 12 © 2018 CLOUDHEALTH® TECHNOLOGIES INC. Cryptojack incident Protection ● Secure AWS root account ○ Physical MFA - $13 ○ Disable API ● Users/Operators ○ Enable and force MFA for all operations (Console/API) ■ AWS Tutorial: Enable Your Users to Configure Their Own Credentials and MFA Settings ● https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_users-self-manage-mfa-and-creds.html ■ CLI wrapper for MFA - aws-vault ● https://github.com/99designs/aws-vault ○ Use Idp federation (SAML/SSO) ■ Google, OKTA, Ping Identity, OneLogin, etc ○ No direct permissions to users, use IAM AssumeRole
  • 13. 13 © 2018 CLOUDHEALTH® TECHNOLOGIES INC. Cryptojack incident Protection - cont. ● Application/Service accounts ○ Say “bye-bye” to AWS Key/Secret keys ■ IAM roles and instance profiles ■ Enable IP whitelisting in IAM policies ○ Limit application and service permissions ■ No blanket *:* ○ Scan your code for AWS keys before they do ■ GitGuardian, keynuker, gitsecrets ● General ○ Keep existing EC2 limits unless required ○ AWS CIS Benchmark ■ ThreatStack, CloudHealth, others ○ Enable CloudTrail and AWS Config!
  • 14. 14 © 2018 CLOUDHEALTH® TECHNOLOGIES INC. Cryptojack incident Detection ● Watch and alert on AWS costs projections ○ Create a Billing Alarm to Monitor Your Estimated AWS Charges ■ https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html ○ CloudHealth - % change from baseline ● CloudTrail monitoring ○ Setup ■ All regions ■ Forward to central secure AWS account ○ Real-time monitoring and alerting ■ ThreatStack, SumoLogic, Splunk, etc ■ Look and flag API credentials changes ● Misc ○ AMI Provenance and VPC Flow Logs
  • 16. 16 © 2018 CLOUDHEALTH® TECHNOLOGIES INC. Key Takeaways ● Enforce MFA on user and root accounts ● Use IAM Roles, ban Key/Secret Keys ● Enable CloudTrail/Config monitoring and Cost alerting