|
1 | | -data "aws_caller_identity" "current" {} |
2 | | -data "aws_partition" "current" {} |
3 | | -data "aws_region" "current" {} |
4 | | - |
5 | | -locals { |
6 | | - ordered_partition_keys = [ |
7 | | - { key = "aws_account_id", value = "string" }, |
8 | | - { key = "aws_service", value = "string" }, |
9 | | - { key = "aws_region", value = "string" }, |
10 | | - { key = "year", value = "string" }, |
11 | | - { key = "month", value = "string" }, |
12 | | - { key = "day", value = "string" }, |
13 | | - { key = "hour", value = "string" } |
14 | | - ] |
15 | | - |
16 | | - //https://docs.aws.amazon.com/vpc/latest/userguide/flow-log-records.html#flow-logs-fields |
17 | | - ordered_table_columns = [ |
18 | | - { key = "version", value = "int" }, |
19 | | - { key = "account_id", value = "string" }, |
20 | | - { key = "action", value = "string" }, |
21 | | - { key = "interface_id", value = "string" }, |
22 | | - { key = "srcaddr", value = "string" }, |
23 | | - { key = "dstaddr", value = "string" }, |
24 | | - { key = "srcport", value = "int" }, |
25 | | - { key = "dstport", value = "int" }, |
26 | | - { key = "protocol", value = "int" }, |
27 | | - { key = "packets", value = "bigint" }, |
28 | | - { key = "bytes", value = "bigint" }, |
29 | | - { key = "start", value = "bigint" }, |
30 | | - { key = "end", value = "bigint" }, |
31 | | - { key = "log_status", value = "string" }, |
32 | | - { key = "vpc_id", value = "string" }, |
33 | | - { key = "subnet_id", value = "string" }, |
34 | | - { key = "instance_id", value = "string" }, |
35 | | - { key = "tcp_flags", value = "int" }, |
36 | | - { key = "type", value = "string" }, |
37 | | - { key = "pkt_srcaddr", value = "string" }, |
38 | | - { key = "pkt_dstaddr", value = "string" }, |
39 | | - { key = "region", value = "string" }, |
40 | | - { key = "az_id", value = "string" }, |
41 | | - { key = "sublocation_type", value = "string" }, |
42 | | - { key = "sublocation_id", value = "string" }, |
43 | | - { key = "pkt_src_aws_service", value = "string" }, |
44 | | - { key = "pkt_dst_aws_service", value = "string" }, |
45 | | - { key = "flow_direction", value = "string" }, |
46 | | - { key = "traffic_path", value = "int" }, |
47 | | - { key = "ecs_task_id", value = "string" }, |
48 | | - { key = "reject_reason", value = "string" }, |
49 | | - ] |
50 | | - |
51 | | - log_format = join( |
52 | | - " ", |
53 | | - [ |
54 | | - for col in local.ordered_table_columns : |
55 | | - "$${${replace(col.key, "_", "-")}}" |
56 | | - ] |
57 | | - ) |
58 | | -} |
59 | | - |
60 | 1 | # S3 Bucket for VPC Flow Logs |
61 | 2 | # trivy:ignore:AVD-AWS-0088 S3 Buckets should be encrypted to protect the data that is stored within them if access is compromised. |
62 | 3 | # trivy:ignore:AVD-AWS-0132 S3 Encryption using AWS keys provides protection for your S3 buckets. To increase control of the encryption and manage factors like rotation use customer managed keys. |
|
0 commit comments