説明
各受信・送信ルールの description に、接続を必要とするシステムとその理由を記載します。
想定される影響
用途が分からないと、不要になったポートやアドレス範囲の許可が残りやすくなります。
対処方法
AWS が許可する文字を使い、説明を実際の送信元または宛先、プロトコル、ポートと照合します。説明を追加しても通信の許可範囲は変わりません。
例
どちらの web-sg も 10.0.0.0/16 から TCP 443 を許可します。追加した英語の説明には、アプリケーションネットワークからの HTTPS 接続という用途を記載しています。
変更前
hcl
resource "aws_security_group" "web" {
name = "web-sg"
vpc_id = aws_vpc.main.id
ingress {
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = ["10.0.0.0/16"]
}
}
変更後
hcl
resource "aws_security_group" "web" {
name = "web-sg"
vpc_id = aws_vpc.main.id
ingress {
description = "Allow HTTPS from the application network"
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = ["10.0.0.0/16"]
}
}