4. Amazon EC2: Launch and Connect to Your Linux Server
4.2 Choosing an Instance Type
Instance type mhanje hardware chi size – vCPU, RAM aani network. Labs sathi chhota burstable type (t3.micro, t2.micro) purto. Naav kasa vachaycha te khali bagha.
t 3 a . micro
│ │ │ └── size: nano, micro, small, medium, large, xlarge, 2xlarge ...
│ │ └──────── extra attribute: a = AMD, g = Graviton (ARM), i = Intel, d = local NVMe, n = network
│ └─────────── generation (higher = newer, better price/performance)
└────────────── family: t = burstable general purpose
| Family | Category | Use case | Examples |
|---|---|---|---|
| T | General purpose, burstable (CPU credits) | Dev/test, small websites, labs | t3.micro, t3.small, t4g.small |
| M | General purpose, balanced | App servers, small databases | m7i.large, m7g.large |
| C | Compute optimised | Batch processing, gaming, high-traffic web | c7i.xlarge |
| R / X | Memory optimised | Large databases, in-memory caches | r7i.large |
| I / D | Storage optimised | NoSQL, data warehouses | i4i.large |
| P / G / Inf / Trn | Accelerated (GPU/ML chips) | Machine learning, video | g5.xlarge |
Free tier
AWS offers a free tier or free credits for new accounts, and the offer changes over time. Look for the "Free tier eligible" label in the console and check the official AWS free tier page. The AWS UI may vary slightly from the screenshots and steps in any book.
Ravindra Bagale's Tip
If you choose a Graviton (t4g) type but keep an x86 AMI, the launch fails – many students get stuck here. The architecture of the type and the AMI (x86_64 or arm64) must match. If in doubt, use t3.micro + 64-bit (x86) for labs.
Ravindra Bagale's Tip – मराठी
Graviton (t4g) type निवडला आणि AMI x86 चा ठेवला तर launch fail होतो – बरेच students इथे अडकतात. Type आणि AMI चं architecture (x86_64 की arm64) जुळायला हवं. शंका असेल तर labs साठी t3.micro + 64-bit (x86) वापरा.
Ravindra Bagale's Tip – हिंदी
Graviton (t4g) type चुना और AMI x86 वाली रखी तो launch fail हो जाता है – बहुत से students यहाँ अटकते हैं. Type और AMI का architecture (x86_64 या arm64) मेल खाना चाहिए. शक हो तो labs के लिए t3.micro + 64-bit (x86) इस्तेमाल करो.
Practice task
Decode these names: t3.micro, t4g.small, m7i.large, c7i.xlarge, r7i.large. For each, write the family, generation, attribute and size.
Extended teaching notes
Why this lesson matters
Use this lesson to strengthen systems you own: understand the risk, practise safely in a lab, then write and apply the fix.
Apply the fix across stacks
Same class of bug, same idea in every language.
Java / Spring Boot
Parameterise queries, encode output, CSRF tokens, limited Actuator, dependency scanning.
ASP.NET Core
EF Core / parameterised SQL, Razor encoding, HTTPS, Data Protection.
Node.js / Express
helmet, parameterised SQL, npm audit, avoid eval and shell concat.
Python / Django / Flask / FastAPI
ORM, autoescape, pip-audit, Bandit; never shell=True with user input.
PHP / Laravel
PDO/Eloquent, Blade escaping, composer audit.
Go / Ruby
database/sql placeholders / ActiveRecord; html/template / ERB escaping; govulncheck / Brakeman.
nginx / Apache / Tomcat
Hide versions, TLS, security headers, least-open ports.
MySQL / PostgreSQL / MongoDB / Redis
Private networks, auth on, least-privilege users, no 0.0.0.0/0.
AWS / Azure / GCP
Roles not long-lived keys, private data stores, cloud audit logs on.
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)
- Write the lesson title, date and the exact lab target you are allowed to use.
- List three owned systems (VMs, apps, or cloud accounts) where this lesson applies.
- Run one safe check from the lesson on a lab system only. Paste the command and output.
- Write a two-sentence fix you would give a teammate.
- 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.