0%

Book Description

Secure your Amazon Web Services (AWS) infrastructure with permission policies, key management, and network security, along with following cloud security best practices

Key Features

  • Explore useful recipes for implementing robust cloud security solutions on AWS
  • Monitor your AWS infrastructure and workloads using CloudWatch, CloudTrail, config, GuardDuty, and Macie
  • Prepare for the AWS Certified Security-Specialty exam by exploring various security models and compliance offerings

Book Description

As a security consultant, securing your infrastructure by implementing policies and following best practices is critical. This cookbook discusses practical solutions to the most common problems related to safeguarding infrastructure, covering services and features within AWS that can help you implement security models such as the CIA triad (confidentiality, integrity, and availability), and the AAA triad (authentication, authorization, and availability), along with non-repudiation.

The book begins with IAM and S3 policies and later gets you up to speed with data security, application security, monitoring, and compliance. This includes everything from using firewalls and load balancers to secure endpoints, to leveraging Cognito for managing users and authentication. Over the course of this book, you'll learn to use AWS security services such as Config for monitoring, as well as maintain compliance with GuardDuty, Macie, and Inspector. Finally, the book covers cloud security best practices and demonstrates how you can integrate additional security services such as Glacier Vault Lock and Security Hub to further strengthen your infrastructure.

By the end of this book, you'll be well versed in the techniques required for securing AWS deployments, along with having the knowledge to prepare for the AWS Certified Security - Specialty certification.

What you will learn

  • Create and manage users, groups, roles, and policies across accounts
  • Use AWS Managed Services for logging, monitoring, and auditing
  • Check compliance with AWS Managed Services that use machine learning
  • Provide security and availability for EC2 instances and applications
  • Secure data using symmetric and asymmetric encryption
  • Manage user pools and identity pools with federated login

Who this book is for

If you are an IT security professional, cloud security architect, or a cloud application developer working on security-related roles and are interested in using AWS infrastructure for secure application deployments, then this Amazon Web Services book is for you. You will also find this book useful if you're looking to achieve AWS certification. Prior knowledge of AWS and cloud computing is required to get the most out of this book.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. AWS Security Cookbook
  3. Dedication
  4. About Packt
    1. Why subscribe?
  5. Contributors
    1. About the author
    2. About the reviewers
    3. Packt is searching for authors like you
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Sections
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more…
      5. See also
    5. Get in touch
      1. Reviews
  7. Managing AWS Accounts with IAM and Organizations
    1. Technical requirements
    2. Configuring IAM for a new account
      1. Getting ready
      2. How to do it...
        1. Creating a billing alarm
      3. How it works...
      4. There's more...
      5. See also
    3. Creating IAM policies
      1. Getting ready
      2. How to do it...
        1. Creating policies with the IAM visual editor
        2. Creating policies using the AWS CLI
      3. How it works...
      4. There's more...
      5. See also
    4. Creating a master account for AWS Organizations
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    5. Creating a new account under an AWS Organization
      1. Getting ready
      2. How to do it...
        1. Creating an account and OU from the CLI
        2. Creating and moving an account from the console
      3. How it works...
      4. There's more...
      5. See also
    6. Switching roles with AWS Organizations
      1. Getting ready
      2. How to do it...
        1. Switching as an administrator
        2. Granting permission for a non-admin user to switch roles
        3. Granting permission for a non-admin user to switch roles using the CLI
      3. How it works...
        1. Switching roles between any two accounts
      4. There's more...
      5. See also
  8. Securing Data on S3 with Policies and Techniques
    1. Technical requirements
    2. Creating S3 access control lists
      1. Getting ready
      2. How to do it...
        1. Granting READ ACLs for a bucket to everyone from the console
        2. Granting READ for AWS users using predefined groups from the CLI
        3. Granting public READ for an object with canned ACLs from the CLI
      3. How it works...
      4. There's more...
        1. Comparing ACLs, bucket policies, and IAM policies
      5. See also
    3. Creating an S3 bucket policy
      1. Getting ready
      2. How to do it...
        1. Bucket public access with a bucket policy from the console
        2. Bucket list access with a bucket policy from the CLI
      3. How it works...
      4. There's more...
      5. See also
    4. S3 cross-account access from the CLI
      1. Getting ready
      2. How to do it...
        1. Uploading to a bucket in another account
        2. Uploading to a bucket in another account with a bucket policy
      3. How it works...
      4. There's more...
      5. See also
    5. S3 pre-signed URLs with an expiry time using the CLI and Python
      1. Getting ready
      2. How to do it...
        1. Generating a pre-signed URL from the CLI
        2. Generating a pre-signed URL using the Python SDK
      3. How it works...
      4. There's more...
      5. See also
    6. Encrypting data on S3
      1. Getting ready
      2. How to do it...
        1. Server-side encryption with S3-managed keys (SSE-S3)
        2. Server-side encryption with KMS-managed keys (SSE-KMS)
        3. Server-side encryption with customer-managed keys (SSE-C)
      3. How it works...
      4. There's more...
      5. See also
    7. Protecting data with versioning
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    8. Implementing S3 cross-region replication within the same account
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    9. Implementing S3 cross-region replication across accounts
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
  9. User Pools and Identity Pools with Cognito
    1. Technical requirements
    2. Creating Amazon Cognito user pools
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    3. Creating an Amazon Cognito app client
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
        1. Customizing workflows with triggers
      5. See also
    4. User creation and user signups
      1. Getting ready
      2. How to do it...
        1. Creating a user by an administrator
        2. Creating a user through self-signup with admin confirmation
        3. Creating a user through self-signup with self-confirmation
      3. How it works...
      4. There's more...
      5. See also
    5. Implementing an admin authentication flow
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    6. Implementing a client-side authentication flow
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    7. Working with Cognito groups
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    8. Federated identity with Cognito user pools
      1. Getting ready
      2. How to do it...
        1. Configuring within the Amazon developer portal
        2. Configuring in Cognito
      3. How it works...
      4. There's more...
      5. See also
  10. Key Management with KMS and CloudHSM
    1. Technical requirements
    2. Creating keys in KMS
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    3. Using keys with external key material
      1. Getting ready
      2. How to do it...
        1. Creating key configuration for an external key
        2. Generating our key material using OpenSSL
        3. Continuing with key creation from the console
      3. How it works...
      4. There's more...
      5. See also
    4. Rotating keys in KMS
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    5. Granting permissions programmatically with grants
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    6. Using key policies with conditional keys
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    7. Sharing customer-managed keys across accounts
      1. Getting ready
      2. How to do it...
        1. Creating a key and giving permission to the other account
        2. Using the key as an administrator user from account 2
        3. Using the key as a non-admin user from account 2
      3. How it works...
      4. There's more...
      5. See also
    8. Creating a CloudHSM cluster
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    9. Initializing and activating a CloudHSM cluster
      1. Getting ready
      2. How to do it...
        1. Initializing the cluster and creating our first HSM
        2. Launching an EC2 client instance and activating the cluster
      3. How it works...
      4. There's more...
      5. See also
  11. Network Security with VPC
    1. Technical requirements
    2. Creating a VPC in AWS
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    3. Creating subnets in a VPC
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    4. Configuring an internet gateway and a route table for internet access
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    5. Setting up and configuring NAT gateways
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    6. Working with NACLs
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    7. Using a VPC gateway endpoint to connect to S3
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    8. Configuring and using VPC flow logs
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
  12. Working with EC2 Instances
    1. Technical requirements
    2. Creating and configuring security groups
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    3. Launching an EC2 instance into a VPC
      1. Getting ready
      2. How to do it...
        1. General steps for launching an EC2 instance and doing SSH
        2. Launching an instance into our public subnet
        3. Launching an instance into our private subnet
      3. How it works...
      4. There's more...
      5. See also
    4. Setting up and configuring NAT instances
      1. Getting ready
      2. How to do it...
        1. Adding a route for the NAT instance
      3. How it works...
      4. There's more...
      5. See also
    5. Creating and attaching an IAM role to an EC2 instance
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    6. Using our own private and public keys with EC2
      1. Getting ready
      2. How to do it...
        1. Generating the keys
        2. Uploading a key to EC2
      3. How it works...
      4. There's more... 
      5. See also
    7. Using EC2 user data to launch an instance with a web server
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    8. Storing sensitive data with the Systems Manager Parameter Store
      1. Getting ready
      2. How to do it...
        1. Creating a parameter in the AWS Systems Manager Parameter Store
        2. Creating and attaching role for the AWS Systems Manager
        3. Retrieving parameters from the AWS Systems Manager Parameter Store
      3. How it works...
      4. There's more...
      5. See also
    9. Using KMS to encrypt data in EBS
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
  13. Web Security Using ELBs, CloudFront, and WAF
    1. Technical requirements
    2. Enabling HTTPS on an EC2 instance 
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    3. Creating an SSL/TLS certificate with ACM
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    4. Creating a classic load balancer
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    5. Creating ELB target groups
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    6. Using an application load balancer with TLS termination at the ELB
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    7. Using a network load balancer with TLS termination at EC2
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    8. Securing S3 using CloudFront and TLS
      1. Getting ready
      2. How to do it...
        1. CloudFront distribution with CloudFront default domain
        2. CloudFront distribution with a custom domain and ACM certificate
      3. How it works...
      4. There's more...
      5. See also
    9. Configuring and using the AWS web application firewall (WAF)
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
  14. Monitoring with CloudWatch, CloudTrail, and Config
    1. Technical requirements
    2. Creating an SNS topic to send emails
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    3. Working with CloudWatch alarms and metrics
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    4. Creating a dashboard in CloudWatch
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    5. Creating a CloudWatch log group
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    6. Working with CloudWatch events
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    7. Reading and filtering logs in CloudTrail
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    8. Creating a trail in CloudTrail
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    9. Using Athena to query CloudTrail logs in S3
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    10. Cross-account CloudTrail logging
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    11. Integrating CloudWatch and CloudTrail
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    12. Setting up and using AWS Config
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
  15. Compliance with GuardDuty, Macie, and Inspector
    1. Technical requirements
    2. Setting up and using Amazon GuardDuty
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    3. Aggregating findings from multiple accounts in GuardDuty
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    4. Setting up and using Amazon Macie
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    5. Setting up and using Amazon Inspector
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    6. Creating a custom Inspector template
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
  16. Additional Services and Practices for AWS Security
    1. Technical requirements
    2. Setting up and using AWS Security Hub
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    3. Setting up and using AWS SSO
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    4. Setting up and using AWS Resource Access Manager
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    5. Protecting S3 Glacier vaults with Vault Lock
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    6. Using AWS Secrets Manager to manage RDS credentials
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    7. Creating an AMI instead of using EC2 user data
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    8. Using security products from AWS Marketplace
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    9. Using AWS Trusted Advisor for recommendations
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    10. Using AWS Artifact for compliance reports
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
  17. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think
3.145.131.238