Compare commits
	
		
			No commits in common. "bc1d3bdec332dec3878fd90be44393d4ad2513ae" and "936630322f8258abc9859a3e4f339e3da3f047a2" have entirely different histories.
		
	
	
		
			bc1d3bdec3
			...
			936630322f
		
	
		
					 13 changed files with 35 additions and 159 deletions
				
			
		|  | @ -41,12 +41,6 @@ defaults = { | |||
|         }, | ||||
|         'zones': set(), | ||||
|     }, | ||||
|     'nftables': { | ||||
|         'input': { | ||||
|             'tcp dport 53 accept', | ||||
|             'udp dport 53 accept', | ||||
|         }, | ||||
|     }, | ||||
|     'telegraf': { | ||||
|         'config': { | ||||
|             'inputs': { | ||||
|  |  | |||
|  | @ -13,20 +13,15 @@ defaults = { | |||
|             'catdoc':               {}, # catdoc, catppt, xls2csv | ||||
|         }, | ||||
|     }, | ||||
|     'dovecot': { | ||||
|         'database': { | ||||
|             'dbname': 'mailserver', | ||||
|             'dbuser': 'mailserver', | ||||
|         }, | ||||
|     }, | ||||
|     'letsencrypt': { | ||||
|         'reload_after': { | ||||
|             'dovecot', | ||||
|         }, | ||||
|     }, | ||||
|     'nftables': { | ||||
|         'input': { | ||||
|             'tcp dport {143, 993, 4190} accept', | ||||
|     'dovecot': { | ||||
|         'database': { | ||||
|             'dbname': 'mailserver', | ||||
|             'dbuser': 'mailserver', | ||||
|         }, | ||||
|     }, | ||||
| } | ||||
|  |  | |||
|  | @ -20,11 +20,6 @@ defaults = { | |||
|             } | ||||
|         }, | ||||
|     }, | ||||
|     'nftables': { | ||||
|         'input': { | ||||
|             'tcp dport 5665 accept', | ||||
|         }, | ||||
|     }, | ||||
|     'postgresql': { | ||||
|         'databases': { | ||||
|             'icinga2': { | ||||
|  |  | |||
|  | @ -10,11 +10,6 @@ defaults = { | |||
|             'deb https://repos.influxdata.com/debian {release} stable', | ||||
|         }, | ||||
|     }, | ||||
|     'nftables': { | ||||
|         'input': { | ||||
|             'tcp dport 8200 accept', | ||||
|         }, | ||||
|     }, | ||||
|     'influxdb': { | ||||
|         'port': '8200', | ||||
|         'username': 'admin', | ||||
|  |  | |||
|  | @ -1,65 +0,0 @@ | |||
| #!/usr/sbin/nft -f | ||||
| 
 | ||||
| flush ruleset | ||||
| 
 | ||||
| table inet filter { | ||||
| 
 | ||||
|   # INPUT | ||||
| 
 | ||||
| 	chain input { | ||||
| 		type filter hook input priority 0; | ||||
|     policy drop; | ||||
| 
 | ||||
|     # Allow traffic from established and related packets, drop invalid | ||||
|     ct state vmap { established : accept, related : accept, invalid : drop } | ||||
| 
 | ||||
|     # Allow loopback traffic. | ||||
|     iifname lo accept | ||||
| 
 | ||||
|     # accepting ping (icmp-echo-request) for diagnostic purposes. | ||||
|     icmp type echo-request limit rate 5/second accept | ||||
|     icmpv6 type { nd-neighbor-solicit, nd-router-advert, nd-neighbor-advert } accept | ||||
| 
 | ||||
|     # Jump to chain according to layer 3 protocol using a verdict map | ||||
|     meta protocol vmap { ip : jump inbound_ipv4, ip6 : jump inbound_ipv6 } | ||||
| 
 | ||||
|     #rules | ||||
| % for rule in sorted(input): | ||||
|     ${rule} | ||||
| % endfor | ||||
| 	} | ||||
| 
 | ||||
|   chain inbound_ipv4 { | ||||
|     # accepting ping (icmp-echo-request) for diagnostic purposes. | ||||
|     icmp type echo-request limit rate 5/second accept | ||||
|   } | ||||
| 
 | ||||
|   chain inbound_ipv6 { | ||||
|     # accept neighbour discovery otherwise connectivity breaks | ||||
|     icmpv6 type { nd-neighbor-solicit, nd-router-advert, nd-neighbor-advert } accept | ||||
| 
 | ||||
|     # accepting ping (icmpv6-echo-request) for diagnostic purposes. | ||||
|     icmpv6 type echo-request limit rate 5/second accept | ||||
|   } | ||||
| 
 | ||||
|   # FORWARD | ||||
| 
 | ||||
| 	chain forward { | ||||
| 		type filter hook forward priority 0; | ||||
| 
 | ||||
|     #rules | ||||
| % for rule in sorted(forward): | ||||
|     ${rule} | ||||
| % endfor | ||||
| 	} | ||||
| 
 | ||||
|   # OUTPUT | ||||
| 
 | ||||
| 	chain output { | ||||
| 		type filter hook output priority 0; | ||||
| 
 | ||||
| % for rule in sorted(output): | ||||
|     ${rule} | ||||
| % endfor | ||||
| 	} | ||||
| } | ||||
|  | @ -1,22 +0,0 @@ | |||
| files = { | ||||
|     '/etc/nftables.conf': { | ||||
|         'content_type': 'mako', | ||||
|         'mode': '0755', | ||||
|         'context': { | ||||
|             'input': node.metadata.get('nftables/input'), | ||||
|             'forward': node.metadata.get('nftables/forward'), | ||||
|             'output': node.metadata.get('nftables/output'), | ||||
|         }, | ||||
|         'triggers': [ | ||||
|             'svc_systemd:nftables.service:reload', | ||||
|         ], | ||||
|     }, | ||||
| } | ||||
| 
 | ||||
| svc_systemd = { | ||||
|     'nftables.service': { | ||||
|         'needs': [ | ||||
|             'pkg_apt:nftables', | ||||
|         ], | ||||
|     }, | ||||
| } | ||||
|  | @ -1,14 +0,0 @@ | |||
| defaults = { | ||||
|     'apt': { | ||||
|         'packages': { | ||||
|             'nftables': {}, | ||||
|         }, | ||||
|     }, | ||||
|     'nftables': { | ||||
|         'input': { | ||||
|             'tcp dport 22 accept', | ||||
|         }, | ||||
|         'forward': {}, | ||||
|         'output': {}, | ||||
|     }, | ||||
| } | ||||
|  | @ -8,12 +8,26 @@ defaults = { | |||
|             'nginx': {}, | ||||
|         }, | ||||
|     }, | ||||
|     'nftables': { | ||||
|         'input': { | ||||
|             'tcp dport {80, 443} accept', | ||||
|         }, | ||||
|     }, | ||||
|     'nginx': { | ||||
|         'default_vhosts': { | ||||
|             '80': { | ||||
|                 'listen': [ | ||||
|                     '80', | ||||
|                     '[::]:80', | ||||
|                 ], | ||||
|                 'location /.well-known/acme-challenge/': { | ||||
|                     'alias': '/var/lib/dehydrated/acme-challenges/', | ||||
|                 }, | ||||
|                 'location /': { | ||||
|                     'return': '301 https://$host$request_uri', | ||||
|                 }, | ||||
|             }, | ||||
|             'stub_status': { | ||||
|                'listen': '127.0.0.1:22999 default_server', | ||||
|                'server_name': '_', | ||||
|                'stub_status': '', | ||||
|             }, | ||||
|         }, | ||||
|         'vhosts': { | ||||
|             # '80': { | ||||
|             #     'content': 'nginx/80.conf', | ||||
|  |  | |||
|  | @ -11,19 +11,11 @@ defaults = { | |||
|             '/var/vmail', | ||||
|         }, | ||||
|     }, | ||||
|     'grafana_rows': { | ||||
|         'postfix_queue', | ||||
|     }, | ||||
|     'letsencrypt': { | ||||
|         'reload_after': { | ||||
|             'postfix', | ||||
|         },  | ||||
|     }, | ||||
|     'nftables': { | ||||
|         'input': { | ||||
|             'tcp dport {25, 465, 587} accept', | ||||
|         }, | ||||
|     }, | ||||
|     'telegraf': { | ||||
|         'config': { | ||||
|             'inputs': { | ||||
|  | @ -31,4 +23,7 @@ defaults = { | |||
|             }, | ||||
|         }, | ||||
|     }, | ||||
|     'grafana_rows': { | ||||
|         'postfix_queue', | ||||
|     }, | ||||
| } | ||||
|  |  | |||
|  | @ -14,11 +14,6 @@ defaults = { | |||
|             '/var/lib/postgresql', | ||||
|         }, | ||||
|     }, | ||||
|     'nftables': { | ||||
|         'input': { | ||||
|             'tcp dport 5432 accept', | ||||
|         }, | ||||
|     }, | ||||
|     'postgresql': { | ||||
|         'conf': {}, | ||||
|         'roles': { | ||||
|  |  | |||
|  | @ -17,11 +17,6 @@ defaults = { | |||
|             }, | ||||
|         }, | ||||
|     }, | ||||
|     'nftables': { | ||||
|         'input': { | ||||
|             'tcp dport 51820 accept', | ||||
|         }, | ||||
|     }, | ||||
|     'wireguard': { | ||||
|         's2s': {}, | ||||
|         'clients': {}, | ||||
|  |  | |||
|  | @ -4,7 +4,6 @@ | |||
|     ], | ||||
|     'bundles': [ | ||||
|         'apt', | ||||
|         'nftables', | ||||
|     ], | ||||
|     'metadata': { | ||||
|         'apt': { | ||||
|  |  | |||
|  | @ -95,7 +95,7 @@ | |||
|         }, | ||||
|         'nextcloud': { | ||||
|             'hostname': 'cloud.sublimity.de', | ||||
|             'version': '24.0.5', | ||||
|             'version': '24.0.4', | ||||
|         }, | ||||
|         'nextcloud-picsort': { | ||||
|             'ckn': { | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue