Domain 2: Security Flashcards
What is IAM?
Identity Access Management
What are the IAM Identities and how are each of them used?
Users: Represents a person or service who uses IAM to interact with AWS
Groups: A collection of IAM users
Roles: An identity with permission policies that determine what the identity can and cannot do in AWS. Can be assumed by a user, federated user or a service.
What are the AWS policy types?
AWS Managed Policy - AWS managed policies that are designed to provide permissions for many common use cases
AWS Customer Managed Policy - Customer managed policies that can be assigned to a user/group/role
Inline policies - A policy that’s embedded in an IAM user, group or role
What is the format of an IAM Policy document?
JSON
How is access managed on an EC2 level?
Security Groups - A stateful “virtual” firewall for incoming and outgoing traffic
What is the default behaviour of Security Group rules?
All outbound traffic permitted and all inbound traffic is blocked
Can you block traffic with Security Groups?
No - Security Group rules are permissive only
Security Groups are stateful. What does this mean?
If you send a request from the instance the request and response for that request is permitted regardless of inbound/outbound security rules
What is AWS KMS?
AWS Key Management Service - Centralized control of cryptographic keys used to protect your data
What is a CMK? (Within KMS)
Customer Master Key - Encrypting/decrypting data up to 4 KB which is used to generate/encrypt/decrypt the data key which is then used to encrypt/decrypt your data
How is the CMK used with envelope encryption?
A data key is generated from the CMK, this key is then used to encypt/decrypt your data. The (CMK encrypted) data key can be stored alongside the encrypted file to be used to easily encrypt/decrypt the large files
What the the KMS AWS CLI commands?
aws kms encrypt # Encrypt up to 4 kB
aws kms decrypt # Decrypt up to 4 kB
aws kms re-encrypt # Decrypt a file and encrypts it without saving the file to memory, can be used for re-encrypting with a new CMK
aws kms enable-key-rotation # Rotate your CMK on an annual basis
aws kms generate-data-key # Generate data key for encrypt/decrypt for files above 4 kB
Can you used AWS CMKs in crypto ops directly?
No - this is managed by AWS
Are KMS encryption keys regional or global?
Regional - Keys are only stored in the region in which they are created and used, you cannot transfer CMKs
What are NACLs?
Network Access Control List: A layer of security that acts as a firewall for controlling traffic in and out of a subnet
What are the NACL default rules?
Allows all inbound and outbound traffic
Are NACLs stateful or stateless?
Stateless - Which means responses are allowed to inbound traffic are subject to the rules for outbound traffic
Does S3 block public permissions by default?
Yes
What is a VPC endpoint?
A logical entity within a VPC that allows connectivity only to S3, it helps prevent traffic traversing the internet and speed up requests
What are the different ways S3 bucket access is manged?
IAM Policies: Allow S3 operations at the IAM level
S3 bucket policies: Allows access at the bucket level
Access Control Lists (ACLs): A sub resource that’s attached to every S3 bucket and object - generally a legacy concept
What is AWS System Manager Parameter Store?
A secure service to create, store and manage parameters with values, great for storing sensitive data such as passwords
It uses AWS KMS on the backend
What is AWS CloudTrail?
A web service that records activity made on your account: IP, when, what resource, how it was changed, whether it was denied or not. Great for auditing.
What are CIDR blocks?
An IP addressing scheme which represents a group of IP addresses. Used in subnets, routing tables etc.
- 0.0.0/32 matches only 10.0.0.0
- 0.0.0/24 matches 10.0.0.0 - 10.0.0.255
- 0.0.0/16 matches 10.0.0.0 - 10.0.255.255
What is the secure way to share objects with S3?
Granting temporary access with a presigned URL and giving them out to a client
How to ensure server-side encryption for all objects stored in a bucket?
Add a bucket policy that denies permissions to upload an object unless the request includes the:
“x-amz-server-side-encryption” header
What are the S3 encryption options?
SSE-S3 (Server Side Encryption S3)
SSE-KMS
How can you test whether a policy document works?
IAM Policy Simulator
What is AWS Cognito?
An AWS Identity broker you to easily allow users to sign-up and sign in to your app
What is the Web Identity Federation?
Allows users of your app to sign in using a well-known external provider (Amazon, Google etc)
How does AWS Cognito work?
The user authenticates against a “user pool” (or user directory) and once authenticated obtains JWT.
These JWT are then exchanged with the “identity pool” for temporary AWS credentials to access the apps AWS resources.
How does AWS Cognito keep data in sync across devices?
Push data is used to sync data across multiple devices
What is an AWS User Pool?
User directory in AWS Cognito with sign-in/sign-up functionality which you can authenticate via:
- Web Identity Federation
- Directly with your App
- Other SAML identity providers (like a companies organization)
It is also has other authentication features such as phone verification, MFA etc.
What are Identity Pools?
Provide temporary AWS credentials for users who are guests or for users who have a token
What is AWS SSO?
AWS Single Sign-On - Easy to centrally manage SSO access to all your AWS accounts and their permissions. Great for leveraging existing corporate identities
What is AWS STS?
AWS Security Token Service (STS) enables you to request temporary credentials.
E.g.
aws sts assume-role # Return a set of temporary security credentials that you can use to access AWS resources
What do temporary AWS security credentials consist of?
Access Key ID, secret access key and a security token