Upload terraform/modules/guardduty/main.tf with huggingface_hub
Browse files
terraform/modules/guardduty/main.tf
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# =============================================================================
|
| 2 |
+
# AWS GuardDuty — Threat Detection
|
| 3 |
+
# =============================================================================
|
| 4 |
+
|
| 5 |
+
resource "aws_guardduty_detector" "this" {
|
| 6 |
+
enable = true
|
| 7 |
+
|
| 8 |
+
datasources {
|
| 9 |
+
s3_logs {
|
| 10 |
+
enable = true
|
| 11 |
+
}
|
| 12 |
+
kubernetes {
|
| 13 |
+
audit_logs {
|
| 14 |
+
enable = true
|
| 15 |
+
}
|
| 16 |
+
}
|
| 17 |
+
malware_protection {
|
| 18 |
+
scan_ec2_instance_with_findings {
|
| 19 |
+
ebs_volumes {
|
| 20 |
+
enable = true
|
| 21 |
+
}
|
| 22 |
+
}
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
finding_publishing_frequency = "FIFTEEN_MINUTES"
|
| 27 |
+
|
| 28 |
+
tags = merge(var.tags, {
|
| 29 |
+
Name = "${var.name}-guardduty"
|
| 30 |
+
})
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
# Auto-publish findings to S3 + CloudWatch
|
| 34 |
+
resource "aws_guardduty_publishing_destination" "s3" {
|
| 35 |
+
detector_id = aws_guardduty_detector.this.id
|
| 36 |
+
destination_type = "S3"
|
| 37 |
+
destination_arn = var.findings_bucket_arn
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
# IP set for known malicious IPs
|
| 41 |
+
resource "aws_guardduty_ipset" "threat_intel" {
|
| 42 |
+
detector_id = aws_guardduty_detector.this.id
|
| 43 |
+
format = "TXT"
|
| 44 |
+
location = var.threat_intel_ip_set_url
|
| 45 |
+
name = "threat-intel-ipset"
|
| 46 |
+
activate = true
|
| 47 |
+
}
|