Skip to Content
Asterrr's Handbook
Service cheat sheets

Compute services

API Gateway, EC2, EKS, EMR, Lambda and Data Lifecycle Manager with the security facts the exam asks about.

These are workload services. The exam asks how to restrict who can call them, how to protect credentials and secrets they hold, and how to encrypt what they store.

HTTPSfilterauthorizeinvokesigned codeget secretAPI clientAWS WAFCognito userpoolAPI GatewayLambda functionAWS SignerSecrets Manager
A serverless API. WAF filters, an authorizer identifies the caller, API Gateway invokes Lambda. Signed code goes in, secrets come from Secrets Manager.

Service table

ServiceWhat it isExam factSecurity controls
Amazon API GatewayManaged front door for REST, HTTP and WebSocket APIsAPI keys and usage plans track and limit use. They are not authenticationResource policies (source IP or VPC endpoint), IAM, Lambda authorizers, Cognito authorizers, private APIs with endpoint policies, AWS WAF on REST APIs, client-side certificates to prove calls come from API Gateway
Amazon EC2Virtual serversIMDSv2 uses a session token. Set tokens to required to block IMDSv1IAM instance roles, IMDSv2, EBS encryption, Instance Connect with IAM-controlled keys, CloudTrail for API calls
Amazon EKSManaged Kubernetes control planeEnvelope encryption of all Kubernetes API data is on by default from Kubernetes 1.28KMS v2 envelope encryption (AWS owned key or your own), degraded cluster if your key is disabled
Amazon EMRManaged Hadoop and Spark clustersEncryption settings live in a reusable security configuration chosen when the cluster is createdS3 SSE-S3, SSE-KMS, CSE-KMS, local disk and EBS encryption, in-transit TLS
AWS LambdaFunctionsCode signing blocks unsigned code only at deployment timeExecution role, resource-based policy, env var encryption, AWS Signer code signing, Secrets Manager for secrets
Amazon Data Lifecycle ManagerAutomates EBS snapshots and EBS-backed AMIs by policyCannot manage snapshots or AMIs created another way. Cannot manage instance store-backed AMIsIAM, EventBridge and CloudTrail monitoring. Supports backup to isolated Regions or accounts

API Gateway access control

MechanismUse it for
Resource policyAllow or deny by source IP or VPC endpoint
IAM roles and policiesCallers that already have AWS credentials. Works per API or per method
Lambda authorizerCustom logic on a bearer token or on headers, query strings and stage variables
Cognito user pool authorizerUsers who sign in through Cognito
VPC endpoint policyRestricts which private APIs an interface endpoint can reach
AWS WAFCommon web exploits on REST APIs
Client-side certificateBackend verifies the request came from API Gateway
Usage plan and API keyThrottle and meter a customer. Not an authorization control

Exam trap

"Use API keys to restrict who can call the API" is wrong. Keys identify a client for metering. Use IAM, a Lambda authorizer or a Cognito authorizer to authorize.

EC2 specifics

  • IMDSv2 needs a PUT to get a token, then the token on each GET. Token lifetime is 1 second to 6 hours.
  • By default both IMDSv1 and IMDSv2 work. With tokens set to required, a call with no valid token gets 401.
  • The PUT response hop limit defaults to 1. A container on the instance may need a larger limit.
  • A PUT carrying an X-Forwarded-For header is rejected, which blunts SSRF through reverse proxies.
  • EC2 Instance Connect pushes a one-time public key to instance metadata where it stays 60 seconds. An IAM policy decides who may push it, and each request is logged in CloudTrail.

EKS and EMR encryption

TopicFact
EKS defaultClusters on 1.28 or later encrypt all Kubernetes API data in etcd with KMS v2 envelope encryption. An AWS owned key is the default
EKS own keyOptional customer managed key. A key alias is accepted
EKS key lossDisabling the key degrades the cluster. Restore within 30 days. A deleted or missing key or revoked grants make it unrecoverable
EMR S3 dataSSE-S3, SSE-KMS, CSE-KMS or a custom CSE provider. SSE-C is not available
EMR local diskEBS encryption (release 5.24.0 and later, KMS only) or LUKS for attached volumes. NVMe instance stores are always encrypted
EMR in transitTLS certificates from EMR, an S3 zip, or a custom class. Some endpoints need Kerberos for SASL

Legacy

Older notes say EKS secrets encryption must be enabled at cluster creation and covers only Secrets. Current EKS encrypts all API data by default on 1.28 or later.

Lambda specifics

  • Environment variables are encrypted at rest. A customer managed key can replace the default. The total size limit is 4 KB.
  • AWS recommends Secrets Manager for credentials and API keys instead of environment variables.
  • Code signing uses AWS Signer. A code signing configuration checks integrity, expiry, signing profile match and revocation at deploy time.
  • The policy action is Warn (default, allows the deploy and emits a warning) or Enforce (blocks it).
  • Adding a configuration to a function with unsigned code does not stop that code. It keeps running until the next deployment. Layers must be signed too.

Exam signal

"Ensure only approved code is deployed to Lambda" is a code signing configuration with Enforce. "Rotate or hide database passwords used by a function" is Secrets Manager, not env vars.

Application integration covers the SNS and Step Functions targets that Lambda joins. GuardDuty has EKS and Lambda protection plans.

Further reading

On this page