SlideShare a Scribd company logo
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Security hardening of core AWS services
RUNCY OOMMEN | 28-Sep-2019
runcyoommen
https://runcy.me
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
| Today’s Agenda |
✓ Generic cloud security
❑ Route 53
❑ API Gateway
❑ Cloud Front
✓ AWS security services
✓ Shared Responsibility Model
✓ AWS services for hardening
❑ Amazon Linux
❑ Elastic Load Balancer
❑ AWS Certificates (ACM)
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Let’s define “Cloud Security”
Cloud Security refers to a broad set of policies,
technologies, applications and controls utilized to
protect virtualized IP, data, applications, services and
the associated infrastructure of cloud computing.
Reference:
https://en.wikipedia.org/wiki/Cloud_computing_security
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
IT infrastructure & landscape has
undergone a paradigm shift…
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Traditional view
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Modern view
PaaS
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Why should cloud security differ
from “traditional” network security?
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Ubiquitous
The cloud is always reachable from
anywhere, any time, any device
Scalable
You can add new features and thousands
of users without breaking a sweat
Integrated
Security and other services talk to
each other for full visibility
Comprehensive
The Cloud scans every byte – ingress
and egress – including SSL & CDN
Intelligent
The cloud learns from every user and
connection; any new threat is blocked for all
Important facets of cloud
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Early days of cloud
Move Fast OR Stay Secure
Modern day cloud
Move Fast AND Stay Secure
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Cloud v/s Security
➢ Agility
➢ Self-service
➢ Scale
➢ Automation
➢ Gate Keeper
➢ Standards
➢ Control
➢ Centralized
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Security hardening of core AWS services
Security hardening of core AWS services
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Product Name Category Brief Description
Certificate Manager SSL/TLS Certificates Service that lets you easily provision, manage, deploy SSL/TLS
certificates
Amazon Cognito User Sign Up & Sign In Lets you add user sign-up/sign-in and access control to your
web and mobile apps
Identity Access Management Access Control Identity & Access Management to control user’s access to AWS
services. Create and manage users and groups.
Amazon Inspector Security Assessment Automated security assessment service that helps improve
security and compliance of deployed applications on AWS
Key Management Service Key Store Managed service that makes it easy to create and control the
encryption keys used to encrypt data
Amazon Macie Sensitive Data
Classification
ML powered security service to discover, classify and protect
sensitive data
Secrets Manager Secrets Management Easily rotate, manage and retrieve database credentials, API
Keys and other secrets throughout the lifecycle
AWS Shield DDoS Protection Managed Distributed Denial od Service protection service that
safeguards web applications running on AWS
Security, Identity and Compliance products from AWS
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Weakness #1:
Amazon Linux 2 AMI is shipped with OpenSSH v7.4 that is
outdated and vulnerable to multiple attacks
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Solution: Upgrade to OpenSSH 7.8 or later!
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SITUATION RIGHT NOW!
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What to do now? The elaborate way…
AWS package manager does not
even have a higher version of SSH!!!
➢ Install all the relevant dependencies
➢ Compile package from source
➢ Install the compiled package to upgrade
➢ Download the latest package from openbsd.org
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Get the script - https://tinyurl.com/sshupdate
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Weakness #2:
Default SSH settings (Ciphers & Key Exchange algorithms)
in Amazon Linux are deprecated and weak
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Confirming the presence of weak/deprecated Ciphers & Key Exchanges
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Search for ‘Ciphers’ & ‘KexAlgorithms’ in the man page
Solution:
Check for new ciphers and kex after OpenSSH upgrade
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
➢ Edit the /etc/ssh/sshd_config file
➢ Add default Ciphers and KexAlgorithms in preferred order
Restart the sshd service
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Check the Ciphers and Key Exchange Algorithms now…
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Weakness #3:
TLS 1.0 and TLS 1.1 that have weak cipher suites are set
as the default when provisioning Elastic Load Balancers
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Confirming the presence of weak cipher suites…
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
➢ Select a more stricter and recent security policy for the ELB
Solution:
➢ Force the latest ‘security policy’ on the load balancer
instead of the default lenient one
➢ Navigate to Load Balancer (EC2) → Listeners (tab) → Edit
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Reference chart of
security policies
with SSL Options
and Ciphers
Reference:
https://docs.aws.amazon.com/elasticload
balancing/latest/classic/elb-security-
policy-table.html
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Changes are reflected immediately on
re-running a vulnerability scan again
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Weakness #4:
API Gateway by default, provides support for
TLS 1.0 and TLS 1.1 with weak cipher suites
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
➢ Pick and choose the minimum required SSL for CloudFront
➢ Select the appropriate security policy for strong cipher selection
➢ Create a CloudFront distribution with the ‘Origin Domain Name’
as the API Gateway stage
Solution:
➢ Don’t serve the traffic directly from the API Gateway URL
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Weakness #5:
Certificates generated by ACM and managed by Route53
does not force create a ‘CAA’ record to prevent re-issuance
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Solution:
Create an entry in Route 53 for CAA when certificates
are issued by Amazon Certificate Manager (ACM)
Re-run a SSL scan (Qualys online SSL should be sufficient)
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Questions | Comments | Discussions
runcyoommen
https://runcy.me

More Related Content

Security hardening of core AWS services

  • 1. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Security hardening of core AWS services RUNCY OOMMEN | 28-Sep-2019 runcyoommen https://runcy.me
  • 2. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. | Today’s Agenda | ✓ Generic cloud security ❑ Route 53 ❑ API Gateway ❑ Cloud Front ✓ AWS security services ✓ Shared Responsibility Model ✓ AWS services for hardening ❑ Amazon Linux ❑ Elastic Load Balancer ❑ AWS Certificates (ACM)
  • 3. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Let’s define “Cloud Security” Cloud Security refers to a broad set of policies, technologies, applications and controls utilized to protect virtualized IP, data, applications, services and the associated infrastructure of cloud computing. Reference: https://en.wikipedia.org/wiki/Cloud_computing_security
  • 4. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. IT infrastructure & landscape has undergone a paradigm shift…
  • 5. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Traditional view
  • 6. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Modern view PaaS
  • 7. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Why should cloud security differ from “traditional” network security?
  • 8. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Ubiquitous The cloud is always reachable from anywhere, any time, any device Scalable You can add new features and thousands of users without breaking a sweat Integrated Security and other services talk to each other for full visibility Comprehensive The Cloud scans every byte – ingress and egress – including SSL & CDN Intelligent The cloud learns from every user and connection; any new threat is blocked for all Important facets of cloud
  • 9. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Early days of cloud Move Fast OR Stay Secure Modern day cloud Move Fast AND Stay Secure
  • 10. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Cloud v/s Security ➢ Agility ➢ Self-service ➢ Scale ➢ Automation ➢ Gate Keeper ➢ Standards ➢ Control ➢ Centralized
  • 11. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 14. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Product Name Category Brief Description Certificate Manager SSL/TLS Certificates Service that lets you easily provision, manage, deploy SSL/TLS certificates Amazon Cognito User Sign Up & Sign In Lets you add user sign-up/sign-in and access control to your web and mobile apps Identity Access Management Access Control Identity & Access Management to control user’s access to AWS services. Create and manage users and groups. Amazon Inspector Security Assessment Automated security assessment service that helps improve security and compliance of deployed applications on AWS Key Management Service Key Store Managed service that makes it easy to create and control the encryption keys used to encrypt data Amazon Macie Sensitive Data Classification ML powered security service to discover, classify and protect sensitive data Secrets Manager Secrets Management Easily rotate, manage and retrieve database credentials, API Keys and other secrets throughout the lifecycle AWS Shield DDoS Protection Managed Distributed Denial od Service protection service that safeguards web applications running on AWS Security, Identity and Compliance products from AWS
  • 15. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 16. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 17. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Weakness #1: Amazon Linux 2 AMI is shipped with OpenSSH v7.4 that is outdated and vulnerable to multiple attacks
  • 18. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Solution: Upgrade to OpenSSH 7.8 or later!
  • 19. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 20. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. SITUATION RIGHT NOW!
  • 21. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What to do now? The elaborate way… AWS package manager does not even have a higher version of SSH!!! ➢ Install all the relevant dependencies ➢ Compile package from source ➢ Install the compiled package to upgrade ➢ Download the latest package from openbsd.org
  • 22. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Get the script - https://tinyurl.com/sshupdate
  • 23. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 24. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Weakness #2: Default SSH settings (Ciphers & Key Exchange algorithms) in Amazon Linux are deprecated and weak
  • 25. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Confirming the presence of weak/deprecated Ciphers & Key Exchanges
  • 26. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Search for ‘Ciphers’ & ‘KexAlgorithms’ in the man page Solution: Check for new ciphers and kex after OpenSSH upgrade
  • 27. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ➢ Edit the /etc/ssh/sshd_config file ➢ Add default Ciphers and KexAlgorithms in preferred order Restart the sshd service
  • 28. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Check the Ciphers and Key Exchange Algorithms now…
  • 29. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 30. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Weakness #3: TLS 1.0 and TLS 1.1 that have weak cipher suites are set as the default when provisioning Elastic Load Balancers
  • 31. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Confirming the presence of weak cipher suites…
  • 32. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ➢ Select a more stricter and recent security policy for the ELB Solution: ➢ Force the latest ‘security policy’ on the load balancer instead of the default lenient one ➢ Navigate to Load Balancer (EC2) → Listeners (tab) → Edit
  • 33. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Reference chart of security policies with SSL Options and Ciphers Reference: https://docs.aws.amazon.com/elasticload balancing/latest/classic/elb-security- policy-table.html
  • 34. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Changes are reflected immediately on re-running a vulnerability scan again
  • 35. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 36. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Weakness #4: API Gateway by default, provides support for TLS 1.0 and TLS 1.1 with weak cipher suites
  • 37. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ➢ Pick and choose the minimum required SSL for CloudFront ➢ Select the appropriate security policy for strong cipher selection ➢ Create a CloudFront distribution with the ‘Origin Domain Name’ as the API Gateway stage Solution: ➢ Don’t serve the traffic directly from the API Gateway URL
  • 38. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 39. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Weakness #5: Certificates generated by ACM and managed by Route53 does not force create a ‘CAA’ record to prevent re-issuance
  • 40. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Solution: Create an entry in Route 53 for CAA when certificates are issued by Amazon Certificate Manager (ACM) Re-run a SSL scan (Qualys online SSL should be sufficient)
  • 41. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 42. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Questions | Comments | Discussions runcyoommen https://runcy.me