File tree Expand file tree Collapse file tree 4 files changed +30
-0
lines changed Expand file tree Collapse file tree 4 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -525,6 +525,15 @@ run on the machine.
525525A list of default pasta options that should be used running pasta.
526526It accepts the pasta cli options, see pasta(1) for the full list of options.
527527
528+ ** default_host_ip** =""
529+
530+ The default host IP address to bind published container ports to when no host IP
531+ is explicitly specified (e.g., ` -p 8000:8000 ` ). If empty, the default behavior is to
532+ bind to all network interfaces (` 0.0.0.0 ` ). For instance, setting this to ` 127.0.0.1 ` restricts
533+ published ports to localhost only, improving security on desktop installations.
534+ Note that explicitly specifying a host IP in the ` -p ` flag (e.g., ` -p 192.168.1.10:8000:8000 ` )
535+ will always override this default.
536+
528537## ENGINE TABLE
529538The ` engine ` table contains configuration options used to set up container engines such as Podman and Buildah.
530539
Original file line number Diff line number Diff line change @@ -634,6 +634,11 @@ type NetworkConfig struct {
634634 // PastaOptions contains a default list of pasta(1) options that should
635635 // be used when running pasta.
636636 PastaOptions attributedstring.Slice `toml:"pasta_options,omitempty"`
637+
638+ // DefaultHostIP is the default host IP to bind published container ports
639+ // to when no host IP is explicitly specified in the -p flag (e.g., -p 80:80).
640+ // If empty, the default behavior is to bind to all interfaces (0.0.0.0).
641+ DefaultHostIP string `toml:"default_host_ip,omitempty"`
637642}
638643
639644type SubnetPool struct {
Original file line number Diff line number Diff line change @@ -445,6 +445,14 @@ default_sysctls = [
445445#
446446#pasta_options = []
447447
448+ # The default host IP address to bind published container ports to when no
449+ # host IP is explicitly specified (e.g., -p 8000:8000). If empty, the default
450+ # behavior is to bind to all network interfaces (0.0.0.0). For instance,
451+ # setting this to 127.0.0.1 restricts published ports to localhost only.
452+ # Note that explicitly specifying a host IP via `-p` will always override this.
453+ #
454+ #default_host_ip = ""
455+
448456[engine]
449457# Index to the active service
450458#
Original file line number Diff line number Diff line change @@ -335,6 +335,14 @@ default_sysctls = [
335335#
336336#network_config_dir = "/usr/local/etc/cni/net.d/"
337337
338+ # The default host IP address to bind published container ports to when no
339+ # host IP is explicitly specified (e.g., -p 8000:8000). If empty, the default
340+ # behavior is to bind to all network interfaces (0.0.0.0). For instance,
341+ # setting this to 127.0.0.1 restricts published ports to localhost only.
342+ # Note that explicitly specifying a host IP via `-p` will always override this.
343+ #
344+ #default_host_ip = ""
345+
338346[engine]
339347# Index to the active service
340348#
You can’t perform that action at this time.
0 commit comments