ipx

package
v0.0.557 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreAllAssociatedIPsAllowed

func AreAllAssociatedIPsAllowed(pairs map[string]string) error

AreAllAssociatedIPsAllowed fails if one of the pairs is failing.

func IsAssociatedIPAllowed

func IsAssociatedIPAllowed(ipOrHostnameOrURL string) error

IsAssociatedIPAllowed returns nil for a domain (with NS lookup), IP, or IPv6 address if it does not resolve to a private IP subnet. This is a first level of defense against SSRF attacks by disallowing any domain or IP to resolve to a private network range.

Please keep in mind that validations for domains is valid only when looking up. A malicious actor could easily update the DSN record post validation to point to an internal IP

func IsAssociatedIPAllowedWhenSet

func IsAssociatedIPAllowedWhenSet(ipOrHostnameOrURL string) error

IsAssociatedIPAllowedWhenSet is a wrapper for IsAssociatedIPAllowed which returns valid when ipOrHostnameOrURL is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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