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.
Service table
| Service | What it is | Exam fact | Security controls |
|---|---|---|---|
| Amazon API Gateway | Managed front door for REST, HTTP and WebSocket APIs | API keys and usage plans track and limit use. They are not authentication | Resource 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 EC2 | Virtual servers | IMDSv2 uses a session token. Set tokens to required to block IMDSv1 | IAM instance roles, IMDSv2, EBS encryption, Instance Connect with IAM-controlled keys, CloudTrail for API calls |
| Amazon EKS | Managed Kubernetes control plane | Envelope encryption of all Kubernetes API data is on by default from Kubernetes 1.28 | KMS v2 envelope encryption (AWS owned key or your own), degraded cluster if your key is disabled |
| Amazon EMR | Managed Hadoop and Spark clusters | Encryption settings live in a reusable security configuration chosen when the cluster is created | S3 SSE-S3, SSE-KMS, CSE-KMS, local disk and EBS encryption, in-transit TLS |
| AWS Lambda | Functions | Code signing blocks unsigned code only at deployment time | Execution role, resource-based policy, env var encryption, AWS Signer code signing, Secrets Manager for secrets |
| Amazon Data Lifecycle Manager | Automates EBS snapshots and EBS-backed AMIs by policy | Cannot manage snapshots or AMIs created another way. Cannot manage instance store-backed AMIs | IAM, EventBridge and CloudTrail monitoring. Supports backup to isolated Regions or accounts |
API Gateway access control
| Mechanism | Use it for |
|---|---|
| Resource policy | Allow or deny by source IP or VPC endpoint |
| IAM roles and policies | Callers that already have AWS credentials. Works per API or per method |
| Lambda authorizer | Custom logic on a bearer token or on headers, query strings and stage variables |
| Cognito user pool authorizer | Users who sign in through Cognito |
| VPC endpoint policy | Restricts which private APIs an interface endpoint can reach |
| AWS WAF | Common web exploits on REST APIs |
| Client-side certificate | Backend verifies the request came from API Gateway |
| Usage plan and API key | Throttle 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
PUTto get a token, then the token on eachGET. 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 gets401. - The
PUTresponse hop limit defaults to 1. A container on the instance may need a larger limit. - A
PUTcarrying anX-Forwarded-Forheader 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
| Topic | Fact |
|---|---|
| EKS default | Clusters 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 key | Optional customer managed key. A key alias is accepted |
| EKS key loss | Disabling the key degrades the cluster. Restore within 30 days. A deleted or missing key or revoked grants make it unrecoverable |
| EMR S3 data | SSE-S3, SSE-KMS, CSE-KMS or a custom CSE provider. SSE-C is not available |
| EMR local disk | EBS encryption (release 5.24.0 and later, KMS only) or LUKS for attached volumes. NVMe instance stores are always encrypted |
| EMR in transit | TLS 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) orEnforce(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.
Related
Application integration covers the SNS and Step Functions targets that Lambda joins. GuardDuty has EKS and Lambda protection plans.
Further reading
- https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-control-access-to-api.html
- https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html
- https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/connect-linux-inst-eic.html
- https://docs.aws.amazon.com/eks/latest/userguide/envelope-encryption.html
- https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-data-encryption-options.html
- https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html
- https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html
- https://docs.aws.amazon.com/ebs/latest/userguide/snapshot-lifecycle.html