insecureserverbind

package
v0.23.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package insecureserverbind validates listen addresses for insecure, unauthenticated Kopia servers.

Index

Constants

View Source
const AllowDangerousUnauthenticatedNetworkFlag = "allow-extremely-dangerous-unauthenticated-server-on-the-network"

AllowDangerousUnauthenticatedNetworkFlag is the CLI flag that disables bind restrictions.

View Source
const AllowDangerousUnauthenticatedNetworkFlagHelp = "Allow unauthenticated server to listen on non-loopback addresses; " +
	"exposes full repository and control API to the network without authentication which allows any external attacker to take full control of the server host (extremely dangerous)"

AllowDangerousUnauthenticatedNetworkFlagHelp is the kingpin description for that flag.

Variables

View Source
var ErrDisallowedPublicBind = errors.New("refusing to expose unauthenticated server on non-loopback network bind")

ErrDisallowedPublicBind is returned when the address would expose an unauthenticated server beyond loopback.

Functions

func ParseListenHost

func ParseListenHost(address string) (host string, isUnix bool, err error)

ParseListenHost extracts the host part of a server listen address flag value. If isUnix is true, host is empty and the address refers to a Unix domain socket.

Unix detection runs after stripping a leading http:// or https:// (same as the server’s stripProtocol). Any form that becomes unix:… is treated as a Unix socket, including:

func RestrictionApplies

func RestrictionApplies(insecure, withoutPassword, allowDangerousNetwork bool) bool

RestrictionApplies reports whether insecure unauthenticated bind checks must run.

func ValidateListenAddressFlag

func ValidateListenAddressFlag(address string) error

ValidateListenAddressFlag checks that --address is safe for an insecure server without a UI password.

func ValidateListenAddressIfRestricted

func ValidateListenAddressIfRestricted(insecure, withoutPassword, allowDangerousNetwork bool, address string) error

ValidateListenAddressIfRestricted runs ValidateListenAddressFlag only when RestrictionApplies is true.

func ValidateListenerAddr

func ValidateListenerAddr(addr net.Addr) error

ValidateListenerAddr checks the bound listener address after Listen (covers socket activation).

func ValidateListenerAddrIfRestricted

func ValidateListenerAddrIfRestricted(insecure, withoutPassword, allowDangerousNetwork bool, addr net.Addr) error

ValidateListenerAddrIfRestricted runs ValidateListenerAddr only when RestrictionApplies is true.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL