Skip to main content
Welcome back, future solutions architects. I’m Michael Forrester. This lesson dives into AWS knobs that improve security for compute services. Compute in AWS spans multiple shared-responsibility models — low-level infrastructure (EC2), container/platform services (EKS/ECS), and fully managed/serverless (Lambda) — so you’ll frequently work across all three when designing secure solutions.

Shared responsibility model — quick refresher

As you choose services, customer responsibility generally decreases as you move from IaaS (EC2) toward more managed services (e.g., RDS, S3, DynamoDB, Lambda). RDS is a managed database service (PaaS), not a container platform.
An infographic of the "Shared Responsibility Model" showing how customer and AWS responsibilities differ for Infrastructure (EC2), Container (RDS) and Managed Services (S3/KMS/DynamoDB). Colored bars list specific duties (customer data, encryption, network, OS, hardware) and arrows indicate more vs. less customer responsibility and customizability.
Use this simple mapping as a checklist when designing or auditing systems: Links and references:

Shared responsibility question (scenario)

A rapidly growing startup migrates to AWS. The CTO asks which statement best describes the AWS shared responsibility model.
An instructional slide presenting a scenario where a startup CTO new to cloud computing asks which statement best describes the AWS Shared Responsibility Model. Below the question are four multiple-choice options summarizing different responsibility splits between AWS and customers.
Answer and explanation:
  • Correct summary: customers are responsible for security in the cloud (customer data, OS, applications, IAM, configuration), while AWS is responsible for security of the cloud (hardware, virtualization, physical facilities, foundational services). The exact split shifts depending on IaaS, PaaS, or SaaS, but this is the general rule.

EC2 common secure access patterns

A traditional secure pattern is to place a single hardened entry point (bastion host/jump box) in a public subnet and keep application servers in private subnets. IAM roles grant instance permissions to access S3, CloudTrail, or other services instead of using static credentials.
A simplified AWS architecture diagram showing a bastion host in a public subnet (protected by a security group) connecting to an EC2 instance via AWS STS. It also shows IAM roles linking the bastion to Amazon S3 and AWS CloudTrail.
Best-practice notes:
  • Use a single, hardened bastion host to reduce attack surface.
  • Restrict inbound SSH (TCP/22) to known admin IP ranges (or a VPN) using Security Groups and NACLs.
  • Consider VPN, AWS Client VPN, or AWS Managed Microsoft AD plus jump hosts for centralized access.
  • Prefer AWS Systems Manager Session Manager to remove the need for inbound SSH/RDP altogether.

Bastion host question (scenario)

A leading e-commerce company wants secure administrative access for a multi-tier EC2 application. Which approach should they adopt? Options summary:
  1. Bastion in a public subnet, restrict SSH to known IPs, use it as a jump box to application servers in private subnets.
  2. Put a bastion in a private subnet and allow direct SSH from the internet to application servers.
  3. Deploy multiple bastions in different public subnets and allow unrestricted SSH from the internet.
  4. Avoid using bastion hosts that open SSH to all EC2 instances.
Answer and explanation:
  • Option 1 is the recommended approach: place the bastion in a public subnet, restrict SSH access (security groups + NACLs) to authorized IP ranges or VPNs, and use it to reach application servers in private subnets.
  • Option 2 is incorrect because private subnets are not directly reachable from the internet for inbound SSH.
  • Option 3 is unsafe unless inbound access is tightly restricted; resilience is fine, but never allow unrestricted SSH.
  • Option 4 is a good caution: do not expose SSH to every instance — use a controlled entry point or Session Manager.

EC2 key pair management — best practices

Key pair management is critical for environments with strict compliance and auditing requirements.
An infographic presenting a scenario about a global financial institution securing EC2 key pairs and asking which management approach to adopt. It shows four numbered options, including using a single key for all regions, generating unique per-region keys stored in centralized encrypted storage, sharing private keys by email, or relying on username/passwords instead.
Recommendations:
  • Generate unique key pairs and enforce per-user accountability. Assign per-user public keys to instances they must access.
  • Avoid a single private key shared across regions or users.
  • Store private keys in an enterprise secret store such as AWS Secrets Manager or HashiCorp Vault with strict access control and auditing.
  • Avoid transferring private keys via unencrypted channels (email, chat).
  • Prefer identity-based access (IAM + SSM Session Manager) to reduce distribution of private key material.
Never share private key material over unencrypted channels. Use centralized, auditable secrets stores and restrict access with least privilege.
Links and references:

Systems Manager and Session Manager

Systems Manager (SSM) allows secure, auditable access to EC2 instances using an agent and IAM-based controls — without opening inbound SSH/RDP ports.
A simplified AWS architecture diagram showing an Admin User accessing AWS via the CLI and Console and interacting with AWS IAM and Systems Manager. The Systems Manager endpoint connects to an Amazon EC2 instance inside a VPC (with security groups) and integrates with Amazon CloudWatch and Amazon S3.
Benefits and notes:
  • Session Manager provides a unified, auditable interface for shell access that integrates with IAM for authentication and CloudWatch/CloudTrail for logging and auditing.
  • Works with private instances (no public IP required).
  • Removes the need to manage SSH keys or to open inbound management ports.
  • Can be combined with IAM session policies and AWS KMS for additional control over recorded session data.
Systems Manager question (scenario) A healthcare organization handling sensitive patient data wants to use Systems Manager instead of SSH/RDP. What are the benefits? Options summary:
  1. Direct access to EC2 hardware for deeper diagnostics.
  2. Unified access to instances without opening inbound ports or managing SSH keys.
  3. Requires instances to be publicly accessible.
  4. Replaces EC2 virtual machines.
Answer and explanation:
  • Option 2 is correct. Session Manager allows secure access without opening inbound ports or distributing SSH keys; it integrates with IAM and audit services.
  • Options 1, 3, and 4 are incorrect — SSM does not give low-level hardware access, does not require public IPs, and does not replace compute.
Use Systems Manager Session Manager to reduce attack surface: you don’t need to open SSH/RDP ports, and access is controlled via IAM and auditable via CloudWatch/CloudTrail.
Links and references:

Nitro Enclaves — isolation for sensitive workloads

Nitro Enclaves let you create isolated compute environments from an EC2 instance to process highly sensitive data (for example, cryptographic key operations, attestation, or sealed compute). Enclaves have no persistent network interfaces and communicate with the parent instance over vsock (a virtualization-local socket), strengthening isolation.
An AWS-themed quiz slide showing a healthcare scenario asking which statement about Nitro Enclaves with EC2 is correct. The right side lists five numbered options describing various (some incorrect) claims about Nitro Enclaves, such as isolation, networking, and encryption.
Key points:
  • Enclaves are isolated from the parent instance and the network.
  • Communication between the instance and enclave happens via vsock, not a network interface.
  • Ideal for processing sensitive payloads, handling private keys, or performing attestation without exposing secrets to the host OS.
Link:

EC2 instance families — choose the right type

You don’t need to memorize every size, but know common family purposes to match workload requirements.
A chart titled "Instance Types" that categorizes AWS EC2 instance families into General Purpose, Compute Optimized, Memory Optimized, Storage Optimized, and Accelerated Computing. Each category lists example instance names (e.g., T3/T4/M5, C5/C6, R5/R6, I3, P3/G4).
Instance family overview:

Accelerated computing (GPU) instances

If you need hardware acceleration for rendering, ML training/inference, or HPC, use accelerated instances that include GPUs or other accelerators. Animation-studio scenario question: Which statement describes the benefits of accelerated computing instances? Options summary:
  1. Optimized for memory-intensive apps with higher RAM.
  2. Come with pre-installed animation software.
  3. Use hardware accelerators (GPUs) for graphics and floating-point calculations.
  4. Designed for storage-intensive workloads.
  5. The most cost-effective option.
Answer and explanation:
  • Option 3 is correct. Accelerated instances provide GPUs or accelerators to offload parallel and floating-point tasks. They are well-suited to rendering, ML, and HPC.
  • They are not preloaded with application software and are typically more expensive than general-purpose instances; cost-effectiveness depends on workload and performance needs.

Summary — quick pickup points

  • Understand the shared responsibility model: AWS secures the cloud; customers secure in the cloud.
  • Use limited, hardened entry points (bastion hosts or Session Manager); avoid exposing SSH/RDP across many instances.
  • Manage EC2 key pairs with per-user keys, centralized encrypted storage, strict access controls, and auditing.
  • Use Systems Manager Session Manager to reduce attack surface and improve auditing.
  • Nitro Enclaves provide isolated environments for sensitive computations and communicate via vsock.
  • Know EC2 instance family purposes (general, compute, memory, storage, accelerated) to choose the right instance type.
Further reading:

Watch Video