Created
February 7, 2025 04:20
-
-
Save Seitaro-Yuki/3c8d7641474d390692581ecf21786b39 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "aws" { | |
region = "ap-northeast-1" | |
} | |
# 不適切なセキュリティグループ設定例 | |
resource "aws_security_group" "insecure_sg" { | |
name = "insecure-sg" | |
description = "Security group allowing unrestricted SSH access" | |
vpc_id = "vpc-12345678" # ご自身のVPC IDに置き換えてください | |
ingress { | |
description = "Allow SSH from anywhere" | |
from_port = 22 | |
to_port = 22 | |
protocol = "tcp" | |
cidr_blocks = ["0.0.0.0/0"] # 全世界からのアクセスを許可 | |
} | |
egress { | |
from_port = 0 | |
to_port = 0 | |
protocol = "-1" | |
cidr_blocks = ["0.0.0.0/0"] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment