보안 그룹과 NACL
인스턴스와 서브넷의 인바운드 및 아웃바운드 트래픽을 제어해 강력한 네트워크 수준 보안을 구현합니다.
보안 그룹과 NACL은(는) CoddyKit의 무료 AWS for Backend Developers (EC2, S3, RDS, Lambda) 강의입니다. 이것은 4개 중 2번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 AWS for Backend Developers (EC2, S3, RDS, Lambda) 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. AWS for Backend Developers (EC2, S3, RDS, Lambda) 강의에는 총 4개의 강의가 포함되어 있습니다.
이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.
Guarding Your AWS Network
Securing your AWS resources is crucial. Think of your cloud environment as a house – you need good locks on the doors and windows.
In AWS, two key services act as virtual firewalls to protect your instances and subnets: Security Groups and Network Access Control Lists (NACLs).
Instance-Level Firewalls
A Security Group acts as a virtual firewall for your EC2 instances (or other resources like RDS instances or Load Balancers).
It controls inbound and outbound traffic at the instance level. When you launch an EC2 instance, you associate one or more security groups with it.
Security Group Rules
Security Groups have rules that specify which traffic is allowed to reach your instances (inbound) and which traffic your instances can send out (outbound).
- Inbound Rules: Define what traffic can enter your instance.
- Outbound Rules: Define what traffic can leave your instance.
By default, outbound traffic is usually allowed, but inbound traffic is denied.
Stateful Protection
A key characteristic of Security Groups is that they are stateful.
This means if you allow an inbound request (e.g., a web request to your server), the Security Group automatically allows the corresponding outbound response to flow back, even if there isn't an explicit outbound rule for it.
It remembers the connection's "state."
What are Network ACLs (NACLs)?
A Network Access Control List (NACL) acts as a virtual firewall for your subnets. It controls traffic entering and exiting the entire subnet.
Unlike Security Groups, NACLs are applied to subnets, meaning all instances within that subnet are subject to its rules.
NACL Rules Explained
NACLs have numbered rules that are evaluated in order, from lowest to highest. When a rule matches traffic, it's applied, and no further rules are evaluated.
NACLs can explicitly allow or deny traffic. Every NACL also has a default deny rule (*) at the end to catch any unmatched traffic.
Stateless Protection
Another key difference: NACLs are stateless.
If you allow inbound traffic, you MUST explicitly create a separate outbound rule to allow the response traffic to return. If you don't, the response will be blocked.
This means you need rules for both directions for any connection.
Key Differences at a Glance
- Scope: SG for instances, NACL for subnets.
- State: SG is stateful, NACL is stateless.
- Rules: SG only allows, NACL allows AND denies.
- Evaluation: SG evaluates all rules, NACL evaluates by rule number (lowest first).
- Default: SG denies inbound, allows outbound. NACL allows all by default, then denies all with * rule.
Layered Security
It's best practice to use both Security Groups and NACLs together for layered security:
- Use NACLs to broadly filter traffic at the subnet boundary, blocking known malicious IPs or port ranges.
- Use Security Groups to provide fine-grained control for specific instances, allowing only necessary traffic to reach them.
This creates a robust defense-in-depth strategy.
Understanding the Layers
You have an EC2 instance in a public subnet. You want to allow SSH (port 22) and HTTP (port 80) traffic to reach it from anywhere, and block all other incoming traffic.
Securing Your Network
Great job! You've learned about two fundamental AWS networking security tools:
- Security Groups: Stateful firewalls for instances, allowing specific inbound/outbound traffic.
- Network ACLs (NACLs): Stateless firewalls for subnets, allowing/denying traffic based on rule order.
Understanding these helps you build a strong, multi-layered defense for your AWS resources. Next, we'll explore IAM Roles and Policies for fine-grained access control.
자주 묻는 질문
“보안 그룹과 NACL” 강의는 무료인가요?
네 — “보안 그룹과 NACL” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 AWS for Backend Developers (EC2, S3, RDS, Lambda) 강의 전체를 잠금 해제할 수 있습니다. AWS for Backend Developers (EC2, S3, RDS, Lambda) 강의에는 총 4개의 강의가 포함되어 있습니다.
“보안 그룹과 NACL”에서 뭘 배우나요?
인스턴스와 서브넷의 인바운드 및 아웃바운드 트래픽을 제어해 강력한 네트워크 수준 보안을 구현합니다. 브라우저에서 직접 실행하는 실습 코드로 AWS for Backend Developers (EC2, S3, RDS, Lambda)을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.
AWS for Backend Developers (EC2, S3, RDS, Lambda)을(를) 시작하는 데 경험이 필요한가요?
사전 경험은 필요하지 않습니다. CoddyKit의 AWS for Backend Developers (EC2, S3, RDS, Lambda)은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 2번째 강의입니다.
“보안 그룹과 NACL” 강의는 얼마나 걸리나요?
대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.
이 AWS for Backend Developers (EC2, S3, RDS, Lambda) 강의에서 코드를 작성하고 실행할 수 있나요?
네. 모든 AWS for Backend Developers (EC2, S3, RDS, Lambda) 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.