본문 바로가기

AWS

[AWS: Security Group] Security group의 source에 security group을 넣는것의 의미는?

"This allows instances that are associated with the specified security group to access instances associated with this security group. ... 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 group. Incoming traffic is allowed based on the private IP addresses of the instances that are associated with the source security group (and not the public IP or Elastic IP addresses)."

[참고] Security group rules

 

웹서버의 보안그룹

 

source security group과 연관된 모든 인스턴스가 해당 security group의 적용을 받은 인스턴스에 접근하는 것을 허용한다는 것이다.

즉, security group과 associate된 리소스 자체 또한 허용을 하게 된다. 그렇기에 WEB Security Group의 Source에 직접 Bastion 서버의 IP주소를 넣어주지 않아도 Bastion Security Group(Admin Desktop → Bastion 허용)을 넣음으로써 Admin Desktop → Bastion → WEB 으로의 접근이 허용이 된다는 뜻이다.

이렇게 되면, 만약 Bastion 서버의 주소가 바뀌더라도 WEB의 Security Group의 source를 바꿔주지 않아도 되기에 관리가 용이하다는 장점이 있다. 만약 Source에 IP주소를 static하게 넣었다면, 그 IP주소를 바꿔줘야하기 때문이다.

또한, security group을 씀으로써 IP 주소 노출을 방지하여 보안적인 측면에서도 안전하다.