Files
llm-wiki/raw/official-docs/aws-security-group-referencing-official.md

9.6 KiB

title, source_type, url, archive_url, related_branches, related_projects, tags, created
title source_type url archive_url related_branches related_projects tags created
official-doc / AWS VPC — Security group rules (Security group referencing, rule aggregation) official-doc https://docs.aws.amazon.com/vpc/latest/userguide/security-group-rules.html
feature-keycloak-header-spoofing-defense
keycloak-patterns
official-doc
keycloak-patterns
security
aws
networking
2026-07-16

official-doc / AWS VPC — Security group rules (Security group referencing, rule aggregation)

Layer: raw/ — 외부 자료(공식 문서)의 원문 발췌·출처 기록. 검증된 요약은 /ingestwiki/concepts/source-summary-template 형식으로 별도 작성. 원본은 raw에 영구 보관.

Parent / 활용 branch (필수, 최소 1개+)

Branch 이 자료가 정당화하는 결정
raw/branch-notes/feature-keycloak-header-spoofing-defense D4 — EC2 backend 의 Security Group inbound source 를 다른 Security Group (SG-reference) 로 제한하면 그 SG 에 연결된 인스턴스로만 트래픽을 허용해 VPC lateral movement 를 막을 수 있고, 이는 CIDR-source 로는 얻을 수 없는 성질이다; SG-reference 는 same VPC / peering / transit gateway 범위 안에서만 동작한다.

출처 / Source

왜 저장했는지 / Why archived

feature-keycloak-header-spoofing-defense 의 D4(EC2/VM 환경 방어책: backend SG inbound 를 ALB/ingress SG 만 허용)가 현재 UNSUPPORTED_DECISION으로 표시되어 있음 — AWS EC2 Security Group 공식 인용이 raw 에 없었기 때문. 본 문서는 SG-reference 가 실제로 "그 SG 에 연결된 인스턴스만" 대상으로 하고, same-VPC/peering/TGW 범위 조건과 multi-SG aggregation(union) 시맨틱을 공식으로 확인해 D4 를 뒷받침하기 위해 저장.

핵심 인용 / Key quotes (verbatim, 5문장)

[§Security group referencing] "When you specify a security group as the source or destination for a rule, the rule affects all instances that are associated with the security groups. The instances can communicate in the specified direction, using the private IP addresses of the instances, over the specified protocol and port."

[§Security group referencing] "The security groups are associated with the same VPC."

[§Security group referencing] "There is a peering connection between the VPCs that the security groups are associated with."

[§Security group referencing] "There is a transit gateway between the VPCs that the security groups are associated with."

[§Security group rule basics] "When you associate multiple security groups with a resource, the rules from each security group are aggregated to form a single set of rules that are used to determine whether to allow access."

Claims Extracted / 추출된 주장

Claim ID Claim (이 자료가 직접 말하는 것) Evidence quote Strength Applies to Does not prove
AWS-SG-REF-C1 rule 의 source/destination 으로 security group 을 지정하면, 그 rule 은 해당 security group 에 연결된 모든 인스턴스에 적용되고, 인스턴스 간 통신은 각자의 private IP 주소를 사용해 이뤄진다 [§Security group referencing] "When you specify a security group as the source or destination for a rule, the rule affects all instances that are associated with the security groups. The instances can communicate in the specified direction, using the private IP addresses of the instances, over the specified protocol and port." official-vendor-doc EC2 인스턴스가 inbound/outbound rule 의 source/destination 으로 다른 security group 을 참조하는 모든 시나리오 (범위 조건은 AWS-SG-REF-C2 참조) SG-source 가 CIDR-source 보다 VPC lateral movement 를 "더 잘 막는다"는 비교 결론 자체를 직접 진술하지 않음 — 이는 "SG 에 연결된 인스턴스만 대상" 이라는 이 claim 과 CIDR 이 IP 대역 전체를 대상으로 한다는 별도 상식의 결합 추론
AWS-SG-REF-C2 다른 security group 의 inbound rule 에서 특정 security group 을 참조하려면 (a) 두 SG 가 같은 VPC 에 연결되어 있거나, (b) 두 VPC 간 peering connection 이 있거나, (c) 두 VPC 간 transit gateway 가 있어야 한다 [§Security group referencing] "The security groups are associated with the same VPC." / "There is a peering connection between the VPCs that the security groups are associated with." / "There is a transit gateway between the VPCs that the security groups are associated with." official-vendor-doc inbound rule 에서의 SG-reference 범위 판단 (same-VPC / VPC peering / transit gateway) outbound rule 에서도 동일하게 transit gateway 를 통한 SG-reference 가 가능하다는 것 — 원문은 outbound 조건을 "same VPC 또는 peering" 2가지로만 별도 나열하고 transit gateway 를 포함하지 않음
AWS-SG-REF-C3 하나의 리소스(ENI)에 여러 security group 이 연결되면, 각 SG 의 rule 들은 하나의 rule 집합으로 aggregate 되어 access 허용 여부를 결정하는 데 사용된다 [§Security group rule basics] "When you associate multiple security groups with a resource, the rules from each security group are aggregated to form a single set of rules that are used to determine whether to allow access." official-vendor-doc 하나의 EC2 인스턴스(ENI)에 여러 SG 가 연결된 모든 상황에서의 rule 평가 방식 "aggregate 되므로 leftover 한 broad CIDR allow rule 이 SG-narrow rule 과 무관하게 여전히 트래픽을 허용한다"는 구체적 문장은 원문에 없음 — 이는 aggregation=union 시맨틱에서 도출되는 논리적 추론이며, "allow rule 만 존재하고 deny rule 은 없다"는 별도 문장(본 raw 노트에 verbatim 미포함, 원문 §Security group rule basics 첫 항목)과 결합해야 완성되는 추론. D4 에 이 추론을 그대로 쓸 경우 needs-confirmation 로 표시 권장

Strength 근거

  • 세 claim 모두 official-vendor-doc — AWS VPC User Guide 공식 페이지 원문에서 직접 인용.

Usage Boundaries / 적용 경계

  • 이 자료가 직접 증명하는 것:
    • AWS-SG-REF-C1: SG-reference rule 은 그 SG 에 연결된 인스턴스만을 대상으로 하며 private IP 로 통신한다.
    • AWS-SG-REF-C2: SG-reference 는 same-VPC / VPC peering / (inbound 한정) transit gateway 범위 조건을 충족해야 동작한다.
    • AWS-SG-REF-C3: 여러 SG 가 하나의 리소스에 연결되면 rule 이 aggregate(하나의 집합으로 병합)되어 access 여부를 결정한다.
  • 이 자료가 증명하지 않는 것:
    • "backend SG 를 ALB/ingress SG-reference 로만 구성하면 VPC lateral movement 가 완전히 차단된다"는 결론 — 원문은 aggregation 이 rule 을 병합한다는 것만 말하며, 같은 인스턴스에 붙은 다른 SG 에 broad CIDR allow rule 이 남아 있으면 그 rule 도 aggregate 되어 함께 적용됨을 명시하지 않는다. 이는 aggregation=union 시맨틱의 논리적 귀결이지 원문의 명시적 진술은 아니다.
    • middlebox appliance 경유 라우팅 시나리오에서 SG-reference 가 동작하지 않는다는 별도 Limitation 문구가 원문에 있으나(2개의 서로 다른 subnet 인스턴스 간 미들박스 경유 시 SG-reference source 로는 트래픽이 흐르지 않음), 본 raw 노트는 이를 claim 으로 추출하지 않았다 — D4 가 단일 EC2/backend↔ALB 직접 경로를 가정하므로 범위 밖.
  • 내 프로젝트에 적용하려면 추가 확인이 필요한 것:
    • feature-keycloak-header-spoofing-defense D4 의 실제 EC2/VPC 구성에서 backend SG 의 inbound rule 목록에 broad CIDR allow rule 이 남아있지 않은지(leftover rule 존재 여부) 실측 확인 필요 — 해당 branch Claims To Verify 표의 "EC2 Security Group inbound 가 ALB SG 만 허용해도 VPC 내부 다른 인스턴스의 lateral movement 차단 가능한지" 항목과 직결.
    • 학습 프로젝트가 실제로 단일 VPC 내 운영인지, peering/transit gateway 를 쓰는 멀티-VPC 구조인지에 따라 AWS-SG-REF-C2 의 어느 조건이 적용되는지 확인 필요.

메모 / Notes

  • AWS-SG-REF-C3(aggregation) 는 원문이 "union" 이라는 단어를 쓰지 않는다 — "aggregated to form a single set of rules" 표현을 union 으로 해석한 것은 본 저장자의 해석. deny rule 이 없다는 별도 문장(§rule basics 첫 항목: "You can specify allow rules, but not deny rules.")과 결합해야 "aggregate = union of allows, 가장 넓은 rule 이 이긴다"는 결론이 성립. 이 결합 추론은 branch D4 갱신 시 별도로 명시할 것.
  • 원문 Limitation 문단: middlebox appliance 라우팅 시나리오에서는 SG-reference 를 source 로 써도 트래픽이 허용되지 않고 private IP/CIDR 을 직접 참조해야 한다 — D4 의 단순 ALB→backend 직결 구조에는 해당하지 않지만, 향후 구성이 바뀌면 재검토 필요.