Skip to content

Instantly share code, notes, and snippets.

@Seitaro-Yuki
Created February 7, 2025 04:20
Show Gist options
  • Save Seitaro-Yuki/3c8d7641474d390692581ecf21786b39 to your computer and use it in GitHub Desktop.
Save Seitaro-Yuki/3c8d7641474d390692581ecf21786b39 to your computer and use it in GitHub Desktop.
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