| 
									
										
										
										
											2024-02-22 21:43:06 +01:00
										 |  |  | [Unit] | 
					
						
							| 
									
										
										
										
											2024-02-22 22:31:17 +01:00
										 |  |  | Description=l4p - Layer 4 proxy | 
					
						
							| 
									
										
										
										
											2024-02-22 21:43:06 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | After=network-online.target | 
					
						
							|  |  |  | Wants=network-online.target | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [Install] | 
					
						
							|  |  |  | WantedBy=default.target | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [Service] | 
					
						
							|  |  |  | Type=simple | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Allow read-only access to the config directory | 
					
						
							| 
									
										
										
										
											2024-02-22 22:31:17 +01:00
										 |  |  | ReadOnlyPaths=/etc/l4p | 
					
						
							| 
									
										
										
										
											2024-02-22 21:43:06 +01:00
										 |  |  | # Path to the binary | 
					
						
							| 
									
										
										
										
											2024-02-22 22:31:17 +01:00
										 |  |  | ExecStart=/usr/local/bin/l4p | 
					
						
							| 
									
										
										
										
											2024-02-22 21:43:06 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Needs CAP_NET_BIND_SERVICE in order to bind to lower ports | 
					
						
							|  |  |  | # When using ports above 1024, these should be made empty | 
					
						
							|  |  |  | AmbientCapabilities=CAP_NET_BIND_SERVICE | 
					
						
							|  |  |  | CapabilityBoundingSet=CAP_NET_BIND_SERVICE | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Run as a dynamic user | 
					
						
							|  |  |  | DynamicUser=yes | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Security | 
					
						
							|  |  |  | PrivateTmp=yes | 
					
						
							|  |  |  | PrivateDevices=yes | 
					
						
							|  |  |  | ProtectSystem=strict | 
					
						
							|  |  |  | ProtectHome=yes | 
					
						
							|  |  |  | SystemCallFilter=@basic-io @file-system @network-io @system-service | 
					
						
							|  |  |  | SystemCallFilter=~@privileged | 
					
						
							|  |  |  | SystemCallFilter=~@resources | 
					
						
							|  |  |  | NoNewPrivileges=yes | 
					
						
							|  |  |  | ProtectProc=invisible | 
					
						
							|  |  |  | RemoveIPC=yes | 
					
						
							|  |  |  | RestrictAddressFamilies=AF_INET AF_INET6 | 
					
						
							|  |  |  | RestrictNamespaces=yes | 
					
						
							|  |  |  | ProtectHostname=yes | 
					
						
							|  |  |  | ProtectClock=yes | 
					
						
							|  |  |  | ProtectKernelModules=yes | 
					
						
							|  |  |  | ProtectKernelLogs=yes | 
					
						
							|  |  |  | ProtectControlGroups=yes | 
					
						
							|  |  |  | LockPersonality=yes | 
					
						
							|  |  |  | MemoryDenyWriteExecute=yes | 
					
						
							|  |  |  | RestrictRealtime=yes | 
					
						
							|  |  |  | ProcSubset=pid | 
					
						
							|  |  |  | UMask=0077 | 
					
						
							|  |  |  | SystemCallArchitectures=native | 
					
						
							|  |  |  | RestrictSUIDSGID=yes | 
					
						
							|  |  |  | ProtectKernelTunables=yes |