@@ -82,6 +82,9 @@ type RunFlags struct {
8282	// Network isolation 
8383	IsolateNetwork  bool 
8484
85+ 	// Proxy headers 
86+ 	TrustProxyHeaders  bool 
87+ 
8588	// Labels 
8689	Labels  []string 
8790
@@ -195,6 +198,8 @@ func AddRunFlags(cmd *cobra.Command, config *RunFlags) {
195198
196199	cmd .Flags ().BoolVar (& config .IsolateNetwork , "isolate-network" , false ,
197200		"Isolate the container network from the host (default: false)" )
201+ 	cmd .Flags ().BoolVar (& config .TrustProxyHeaders , "trust-proxy-headers" , false ,
202+ 		"Trust X-Forwarded-* headers from reverse proxies (X-Forwarded-Proto, X-Forwarded-Host, X-Forwarded-Port, X-Forwarded-Prefix)" )
198203	cmd .Flags ().StringArrayVarP (& config .Labels , "label" , "l" , []string {}, "Set labels on the container (format: key=value)" )
199204	cmd .Flags ().BoolVarP (& config .Foreground , "foreground" , "f" , false , "Run in foreground mode (block until container exits)" )
200205	cmd .Flags ().StringArrayVar (
@@ -428,6 +433,7 @@ func buildRunnerConfig(
428433		runner .WithAuditConfigPath (runFlags .AuditConfig ),
429434		runner .WithPermissionProfileNameOrPath (runFlags .PermissionProfile ),
430435		runner .WithNetworkIsolation (runFlags .IsolateNetwork ),
436+ 		runner .WithTrustProxyHeaders (runFlags .TrustProxyHeaders ),
431437		runner .WithK8sPodPatch (runFlags .K8sPodPatch ),
432438		runner .WithProxyMode (types .ProxyMode (runFlags .ProxyMode )),
433439		runner .WithTransportAndPorts (transportType , runFlags .ProxyPort , runFlags .TargetPort ),
0 commit comments