# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 patterns = { "cloudfront": '%timestamp\t%x-edge-location\t%sc-bytes\t%c-ip\t%cs-method\t%cs-host\t%cs-uri-stem\t' '%sc-status\t%cs-referer\t%cs-user-agent\t%cs-uri-query\t%cs-cookie\t%x-edge-result-type\t' '%x-edge-request-id\t%x-host-header\t%cs-protocol\t%cs-bytes\t%time-taken\t%x-forwarded-for\t' '%ssl-protocol\t%ssl-cipher\t%x-edge-response-result-type\t%cs-protocol-version\t%fle-status\t ' '%fle-encrypted-fields\t%c-port\t%time-to-first-byte\t%x-edge-detailed-result-type\t' '%sc-content-type\t%sc-content-len\t%sc-range-start\t%sc-range-end', "elf": '%h - - [%d %Z] "%m %U %H" %s %b "%R" "%u"', "clf": '%h - - [%d %Z] "%m %U %H" %s %b', "elf-vhost": '%v:%h - - [%d %Z] "%m %U %H" %s %b "%R" "%u"', "clf-vhost": '%v:%h - - [%d %Z] "%m %U %H" %s %b', } # Preview time in minutes preview_time = 30 log_lines = 10000 output_name = "cloudfront_fake_log.gz" # US CIDR, count 100 ip_cidr_us = ["23.148.64.0/28", "23.157.32.0/28", "23.165.96.0/28", "23.173.176.0/28", "23.182.16.0/28", "23.237.0.0/28", "28.0.0.0/28", "45.42.28.0/28", "45.116.168.0/28", "46.22.64.0/28", "52.124.32.0/28", "64.46.64.0/28", "64.224.248.0/28", "66.81.208.0/28", "66.212.64.0/28", "68.68.16.0/28", "69.196.192.0/28", "74.114.52.0/28", "76.76.11.0/28", "83.229.96.0/28", "89.34.78.0/28", "91.92.138.0/28", "92.119.44.0/28", "94.199.128.0/28", "103.70.38.0/28", "103.254.160.0/28", "104.193.108.0/28", "104.255.33.0/28", "128.0.60.0/28", "130.55.0.0/28", "132.192.0.0/28", "136.149.0.0/28", "138.43.208.0/28", "140.87.0.0/28", "142.54.0.0/28", "143.244.64.0/28", "146.71.96.0/28", "147.185.35.0/28", "149.75.0.0/28", "152.85.0.0/28", "156.45.0.0/28", "158.76.0.0/28", "159.229.0.0/28", "161.133.0.0/28", "162.212.240.0/28", "162.247.128.0/28", "164.49.0.0/28", "166.82.0.0/28", "168.151.56.0/28", "170.96.0.0/28", "172.99.32.0/28", "173.247.160.0/28", "185.3.92.0/28", "185.81.72.0/28", "185.145.44.0/28", "185.186.60.0/28", "185.223.56.0/28", "188.240.40.0/28", "192.31.41.0/28", "192.42.152.0/28", "192.58.90.0/28", "192.69.102.0/28", "192.82.144.0/28", "192.92.87.0/28", "192.102.90.0/28", "192.111.40.0/28", "192.133.29.0/28", "192.146.194.0/28", "192.152.45.0/28", "192.159.86.0/28", "192.188.118.0/28", "192.196.224.0/28", "192.225.1.0/28", "192.250.0.0/28", "193.118.96.0/28", "194.29.100.0/28", "194.156.162.0/28", "195.252.192.0/28", "198.51.232.0/28", "198.99.149.0/28", "198.167.168.0/28", "198.252.166.0/28", "199.43.198.0/28", "199.89.140.0/28", "199.168.44.0/28", "199.204.210.0/28", "202.182.96.0/28", "204.48.96.0/28", "204.145.98.0/28", "205.153.231.0/28", "205.236.127.0/28", "206.168.216.0/28", "207.174.8.0/28", "208.69.60.0/28", "208.87.162.0/28", "209.50.48.0/28", "209.201.0.0/28", "213.188.64.0/28", "216.106.112.0/28", "216.181.230.0/28"] # GB CIDR, count 65 ip_cidr_gb = ["2.24.0.0/28", "5.181.4.0/28", "31.216.48.0/28", "45.12.188.0/28", "45.136.152.0/28", "46.18.8.0/28", "51.1.0.0/28", "62.182.96.0/28", "78.32.0.0/28", "80.87.0.0/28", "81.208.128.0/28", "83.243.96.0/28", "85.232.32.0/28", "88.104.0.0/28", "89.40.212.0/28", "91.132.80.0/28", "91.202.136.0/28", "91.212.131.0/28", "91.224.92.0/28", "91.238.238.0/28", "93.94.72.0/28", "94.185.128.0/28", "107.161.160.0/28", "128.240.0.0/28", "141.92.0.0/28", "147.77.0.0/28", "157.96.152.0/28", "164.138.224.0/28", "178.78.64.0/28", "185.10.144.0/28", "185.25.144.0/28", "185.41.24.0/28", "185.59.92.0/28", "185.74.168.0/28", "185.91.20.0/28", "185.108.12.0/28", "185.123.80.0/28", "185.140.80.0/28", "185.158.128.0/28", "185.176.76.0/28", "185.192.156.0/28", "185.209.242.0/28", "185.227.196.0/28", "185.250.8.0/28", "188.214.94.0/28", "192.84.75.0/28", "192.147.217.0/28", "192.207.141.0/28", "193.29.251.0/28", "193.39.224.0/28", "193.105.188.0/28", "193.164.160.0/28", "193.219.108.0/28", "194.9.28.0/28", "194.35.232.0/28", "194.62.175.0/28", "194.140.226.0/28", "194.247.64.0/28", "195.60.86.0/28", "195.128.250.0/28", "195.218.32.0/28", "209.42.0.0/28", "212.105.160.0/28", "213.152.224.0/28", "217.22.80.0/28"] # DE CIDR, count 61 ip_cidr_de = ["2.56.20.0/28", "5.180.156.0/28", "31.209.112.0/28", "37.228.130.0/28", "45.83.64.0/28", "45.95.120.0/28", "45.139.136.0/28", "45.153.24.0/28", "46.175.130.0/28", "62.112.32.0/28", "78.94.0.0/28", "80.208.208.0/28", "82.145.0.0/28", "84.246.120.0/28", "87.120.94.0/28", "89.191.64.0/28", "91.198.137.0/28", "91.209.26.0/28", "91.217.251.0/28", "91.233.249.0/28", "92.246.84.0/28", "94.143.231.0/28", "109.71.72.0/28", "130.133.0.0/28", "141.9.0.0/28", "149.172.0.0/28", "164.59.0.0/28", "178.23.24.0/28", "185.6.96.0/28", "185.25.132.0/28", "185.44.132.0/28", "185.62.88.0/28", "185.80.120.0/28", "185.99.228.0/28", "185.115.236.0/28", "185.134.108.0/28", "185.154.28.0/28", "185.169.212.0/28", "185.186.220.0/28", "185.202.20.0/28", "185.214.228.0/28", "185.230.84.0/28", "185.246.212.0/28", "188.119.84.0/28", "192.84.245.0/28", "192.145.88.0/28", "193.17.224.0/28", "193.28.48.0/28", "193.36.100.0/28", "193.84.66.0/28", "193.110.153.0/28", "193.151.44.0/28", "193.194.144.0/28", "194.0.143.0/28", "194.26.158.0/28", "194.45.6.0/28", "194.59.6.0/28", "194.99.36.0/28", "194.121.66.0/28", "194.153.160.0/28", "195.3.248.0/28"] # CN CIDR, count 41 ip_cidr_cn = ["1.0.1.0/28", "42.0.32.0/28", "43.241.112.0/28", "43.255.200.0/28", "45.126.48.0/28", "60.55.0.0/28", "103.4.168.0/28", "103.24.128.0/28", "103.41.220.0/28", "103.57.12.0/28", "103.75.152.0/28", "103.90.100.0/28", "103.102.168.0/28", "103.115.148.0/28", "103.134.196.0/28", "103.147.124.0/28", "103.158.16.0/28", "103.195.148.0/28", "103.214.168.0/28", "103.234.172.0/28", "103.250.32.0/28", "111.119.64.0/28", "116.68.136.0/28", "118.244.0.0/28", "122.128.120.0/28", "139.5.92.0/28", "157.119.240.0/28", "182.16.144.0/28", "202.9.34.0/28", "202.44.146.0/28", "202.91.128.0/28", "202.173.0.0/28", "203.5.120.0/28", "203.14.24.0/28", "203.19.228.0/28", "203.24.202.0/28", "203.28.226.0/28", "203.32.212.0/28", "203.57.5.0/28", "203.119.24.0/28"] # CA CIDR, count 39 ip_cidr_ca = ["5.23.0.0/28", "23.156.80.0/28", "24.36.0.0/28", "45.59.188.0/28", "64.77.0.0/28", "66.36.96.0/28", "66.232.60.0/28", "69.42.48.0/28", "74.56.0.0/28", "89.208.240.0/28", "104.153.96.0/28", "104.247.100.0/28", "132.225.0.0/28", "141.193.4.0/28", "147.185.251.0/28", "161.38.62.0/28", "162.222.56.0/28", "165.140.32.0/28", "172.84.160.0/28", "174.35.128.0/28", "192.34.36.0/28", "192.80.160.0/28", "192.150.185.0/28", "192.214.100.0/28", "198.22.237.0/28", "198.135.107.0/28", "198.202.130.0/28", "199.59.128.0/28", "199.165.212.0/28", "199.204.211.0/28", "204.48.64.0/28", "204.225.210.0/28", "205.233.15.0/28", "206.163.224.0/28", "207.244.140.0/28", "208.87.52.0/28", "209.105.192.0/28", "216.7.192.0/28", "216.144.112.0/28"] # FR CIDR, count 36 ip_cidr_fr = ["1.179.112.0/28", "37.18.42.0/28", "45.84.112.0/28", "45.154.60.0/28", "62.68.65.0/28", "79.141.192.0/28", "83.173.64.0/28", "89.44.110.0/28", "91.208.207.0/28", "91.221.244.0/28", "91.243.76.0/28", "95.141.96.0/28", "134.214.0.0/28", "155.132.0.0/28", "178.20.48.0/28", "185.13.100.0/28", "185.37.11.0/28", "185.61.160.0/28", "185.90.96.0/28", "185.122.160.0/28", "185.150.252.0/28", "185.176.232.0/28", "185.203.176.0/28", "185.226.252.0/28", "185.249.140.0/28", "192.136.54.0/28", "193.33.46.0/28", "193.57.109.0/28", "193.160.102.0/28", "193.228.147.0/28", "194.50.29.0/28", "194.149.94.0/28", "195.49.140.0/28", "195.200.195.0/28", "212.180.0.0/28", "217.171.16.0/28"] # IN CIDR, count 35 ip_cidr_in = ["1.6.0.0/28", "43.227.128.0/28", "43.250.208.0/28", "45.116.68.0/28", "45.126.168.0/28", "61.11.0.0/28", "103.10.24.0/28", "103.19.196.0/28", "103.31.144.0/28", "103.46.200.0/28", "103.56.28.0/28", "103.66.112.0/28", "103.74.244.0/28", "103.82.96.0/28", "103.90.32.0/28", "103.98.85.0/28", "103.106.20.0/28", "103.113.160.0/28", "103.121.112.0/28", "103.131.92.0/28", "103.138.78.0/28", "103.143.6.0/28", "103.148.164.0/28", "103.154.233.0/28", "103.159.178.0/28", "103.164.94.0/28", "103.170.6.0/28", "103.174.158.0/28", "103.180.106.0/28", "103.203.36.0/28", "103.211.152.0/28", "103.224.184.0/28", "103.233.101.0/28", "103.243.144.0/28", "103.252.140.0/28"] # JP CIDR, count 24 ip_cidr_jp = ["1.0.16.0/28", "43.224.32.0/28", "58.145.234.0/28", "103.1.244.0/28", "103.22.152.0/28", "103.54.156.0/28", "103.117.21.0/28", "103.171.218.0/28", "103.233.196.0/28", "110.76.180.0/28", "115.42.96.0/28", "119.15.144.0/28", "123.98.144.0/28", "137.40.0.0/28", "160.235.0.0/28", "180.149.160.0/28", "192.132.31.0/28", "202.42.45.0/28", "202.70.208.0/28", "202.152.96.0/28", "203.114.228.0/28", "203.152.51.0/28", "210.24.173.0/28", "221.120.168.0/28"] # BR CIDR, count 21 ip_cidr_br = ["24.152.0.0/28", "45.162.64.0/28", "45.171.136.0/28", "45.179.204.0/28", "45.188.24.0/28", "45.227.248.0/28", "45.236.48.0/28", "131.108.240.0/28", "138.97.180.0/28", "138.204.208.0/28", "160.238.188.0/28", "168.194.144.0/28", "170.78.140.0/28", "170.233.96.0/28", "170.254.220.0/28", "181.191.76.0/28", "189.126.10.0/28", "192.83.207.0/28", "200.9.102.0/28", "200.71.64.0/28", "201.148.160.0/28"] # KR CIDR, count 9 ip_cidr_kr = ["1.11.0.0/28", "58.120.0.0/28", "103.54.60.0/28", "103.241.76.0/28", "114.199.128.0/28", "122.32.0.0/28", "156.147.0.0/28", "202.8.160.0/28", "211.168.0.0/28"] global_ip_cidrs = ip_cidr_us + ip_cidr_gb + ip_cidr_de + ip_cidr_cn + \ ip_cidr_ca + ip_cidr_fr + ip_cidr_in + ip_cidr_jp + ip_cidr_br + ip_cidr_kr