0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

AWSのセキュリティグループ(SG)のインバウンドのソースに0.0.0.0/0や::0が指定されるのを防ぎたい

0
Posted at

悲しい事実

2026/1/17現在そのような指定はできませんでした。。

悲しい代案

  • セキュリティグループそのものを作成するのを禁止する
    カジュアルに0.0.0.0/0を指定されるのは防げる。
    既存のセキュリティグループは選べるので危ないSGがなければ許される。
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "DenyAddOrModifyIngressRules",
      "Effect": "Deny",
      "Action": [
        "ec2:AuthorizeSecurityGroupIngress",
        "ec2:ModifySecurityGroupRules"
      ],
      "Resource": "*"
    }
  ]
}

余談

AWS configであれば一度作成された後に削除は可能。
ただし、一度許しちゃうので事後対応になる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?