Ravindra BagaleCourses & study guides मराठी Track your progress

Chapter 5: Amazon EC2 (Elastic Compute Cloud)

Practice Questions and Lab Exercises

Come on, practice time now! Spend more time on the labs – you cannot learn EC2 without getting your hands dirty in the console. And when the lab is over, don't forget to terminate the instances and release the Elastic IP.

  1. List five advantages of EC2 over on-premises servers. Explain the shared responsibility model.
  2. Define AMI, instance type, key pair, security group, EBS, Elastic IP, Region and AZ.
  3. Decode the instance type m7g.2xlarge.
  4. Compare On-Demand, Reserved, Savings Plans and Spot pricing with a use case for each.
  5. What are the default SSH users for Amazon Linux, Ubuntu and CentOS Stream AMIs?
  6. What happens to the public IP, the EBS volume and billing when you stop vs terminate an instance?
  7. Lab: Launch an Amazon Linux 2023 t3.micro in Mumbai with a security group allowing SSH (My IP) and HTTP. Use the user-data script from Step 8 and open the page in a browser.
  8. Lab: Connect to the same instance from Windows using both PuTTY and OpenSSH.
  9. Lab: Stop and start the instance and note the public IP change. Then allocate and associate an Elastic IP, repeat, and observe. Finally release the EIP.

Quick Revision

  • EC2 = IaaS virtual servers; pay-as-you-go; launch in minutes.
  • Launch = AMI + instance type + key pair + security group + storage (+ user data).
  • Instance types: family/generation/attribute.size, e.g. t3.micro.
  • Pricing: On-Demand, Savings Plans, Reserved, Spot, Dedicated.
  • SSH: chmod 400 key.pem; ssh -i key.pem ec2-user@IP (Ubuntu → ubuntu). Windows: OpenSSH (icacls), PuTTY (.ppk), MobaXterm.
  • Stop keeps EBS but releases auto public IP; terminate deletes root EBS. Use Elastic IP for fixed IP.

Got it? Your first EC2 server is ready – well done! If not, do 5.3 and 5.4 once again. Now let's move on to web servers – Nginx and Apache.

Extended teaching notes

Why this lesson matters

Cloud security is mostly IAM, network exposure, logging and secure defaults. The shared responsibility model means the provider patches the metal; you patch what you configure.

  • No public databases or public admin panels.
  • Roles / OIDC instead of long-lived access keys.
  • CloudTrail / Activity Logs / Audit Logs on and retained.
  • S3/Blob/GCS: Block Public Access; encrypt; least privilege.

Mini case study

Suppose we are on a purple-team exercise for an Indian mid-size company (sample data). Red notes a technique from this lesson against a lab clone. Blue must show the control that stops it, the log that would have fired, and the ticket that hardens production. That is the standard this course trains you for.

Defender's worksheet (do this today)

  1. Write the lesson title, date and the exact lab target you are allowed to use.
  2. List three owned systems (VMs, apps, or cloud accounts) where this lesson applies.
  3. Run one safe check from the lesson on a lab system only. Paste the command and output.
  4. Write a two-sentence fix you would give a teammate.
  5. Name one related public advisory (CERT-In, CISA, NVD, or a vendor bulletin) with its date.

Indian workplace (sample data)

Suppose we are a junior analyst at Infosys, TCS, Wipro or a fintech SOC in Bengaluru/Pune. Turn this lesson into one checklist item with an owner, a due date and a place to store evidence (ticket + screenshot).

Global practice

Compare your notes with OWASP, CIS Benchmarks, NIST CSF/IR guidance or a cloud Well-Architected security question. Write five lines on what overlaps.

Everyday analogy

Explain the risk and the fix to a family member without jargon. If they can repeat the warning, you understand it well enough to teach juniors.

Key terms

  • Control: a safeguard (patch, config, process, detection).
  • Finding: a weakness backed by evidence.
  • Remediation: the fix plus how you verified it.
  • Scope: systems you have written permission to touch.
  • Least privilege: only the access the task needs.
  • Defence in depth: several layers so one failure does not end the story.

Common mistakes

  • Skipping written permission "just for a quick scan".
  • Practising on hostel, office or public targets without authorisation.
  • Collecting tool output without writing the fix.
  • Copying attack steps onto production to "verify". Defenders verify with versions, configs and patches.
  • Publishing screenshots that contain secrets, cookies or internal hostnames.

Recap

  • Evidence, fix, owner, date.
  • Own lab only.
  • Fix > spectacle.