AWS Security & Encryption Flashcards
How do you prevent a man in the middle attack?
Encryption in Flight (SSL) - SSL certificates allow for HTTPS encryption. Data is encrypted before sending and decrypted after receiving.
How does a server protect data?
Server side encryption at rest - data is encrypted after being received by the server, and decrypted before being sent. This encryption is enabled by a data key, and is a separate process to SSL.
How can a client protect data?
Client side encryption - data is encrypted by the client and never decrypted by the server - instead is is decrypted by a receiving client
How can you analyse KMS Key usage?
Can audit KMS Key usage using CloudTrail
What type of KMS keys do AWS services that are integrated with KMS use?
Symmetric keys (AES-256)
- Single encryption key used for both encryption and decryption
- Never get access to the KMS Key unencrypted - must call KMS API to use
How would you allow encryption by users outside of AWS, who can’t call the KMS API?
Asymmetric keys (RSA & ECC key pairs)
- Public (encrypt) and Private (decrypt) pairs
- Public key is downloadable, but cannot access the private key unencrypted
How would you move an encrypted EBS volume across regions?
Would need to create a snapshot of the volume, then reencrypt with a different KMS key (KMS keys cannot be used across regions).
- Move the new snapshot across and restore.
How can you control access to KMS keys?
KMS Key Policies - similar to bucket policy, except default access for a key with no policy is no access
What is the default key policy, and when is it created?
Created if you don’t provide a specific key policy
- complete access to the key to the root user
How can you allow cross-account access of a KMS key?
Create a custom key policy and allow access for specific account
What is the max size limit for KMS encryption via the Encrypt API?
4kb
How do you encrypt > max size limit for Encrypt API?
Use Envelope Encryption using the GenerateDataKey API (generates a unique symmetric data key - DEK - and returns a plaintext copy of the DEK along with a copy encrypted using the CMK you specify)
What calls should you use for envelope encryption - for both ‘now’ and ‘in the future’?
GenerateDataKey for ‘now’
GenerateDataKeyWithoutPlaintext for ‘in the future’
How would you avoid getting a ThrottlingException for KMS?
- Reduce number of calls via Exponential Backoff
- For GenerateDataKey, cache the DEK (caching is available through the Encryption SDK)
- Request a Request Quota increase through API or AWS support
How can you reduce the number of KMS calls made by S3?
Use SSE-KMS encryption
- A ‘S3 bucket key’ is generated, and is used to encrypt KMS objects with new data keys