nmdata

package
v0.78.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PeerCapabilitySourcePrefixes      int32 = 1
	PeerCapabilityIPv6Overlay         int32 = 2
	PeerCapabilityComponentNetworkMap int32 = 3
)

Peer capability constants mirror the proto enum values.

View Source
const (
	NetworkTypeInvalid = 0
	NetworkTypeIPv4    = 1
	NetworkTypeIPv6    = 2
	NetworkTypeDomain  = 3
)

NetworkType mirrors route.NetworkType iota values.

View Source
const GroupAllName = "All"

GroupAllName is the reserved name of the default group that contains every peer in an account.

Variables

This section is empty.

Functions

func PassesChecks

func PassesChecks(checks []Check, peer *Peer) bool

PassesChecks is Passes over an already built check set, for callers that evaluate many peers against the same bundle.

func PolicyRuleImpliesLegacySSH

func PolicyRuleImpliesLegacySSH(rule *PolicyRule) bool

PolicyRuleImpliesLegacySSH is the twin-typed sibling of types.PolicyRuleImpliesLegacySSH.

func PostureVerdictChanged

func PostureVerdictChanged(checks []*PostureChecks, oldPeer, newPeer *Peer) bool

PostureVerdictChanged reports whether any check in the bundles gives a different verdict for newPeer than for oldPeer. Checks are replayed one by one, so a change that moves a field but stays on the same side of a threshold does not count. An evaluation error is a deny, like in PassesChecks.

Types

type AccountSettingsInfo

type AccountSettingsInfo struct {
	PeerLoginExpirationEnabled      bool
	PeerLoginExpiration             time.Duration
	PeerInactivityExpirationEnabled bool
	PeerInactivityExpiration        time.Duration
	DNSDomain                       string
	IPv6EnabledGroups               []string
	RoutingPeerDNSResolutionEnabled bool
	LazyConnectionEnabled           bool
	AutoUpdateVersion               string
	AutoUpdateAlways                bool
	MetricsPushEnabled              bool
}

AccountSettingsInfo is the slim twin of types.AccountSettingsInfo.

type Check

type Check interface {
	// contains filtered or unexported methods
}

Check is the slim twin of posture.Check. It is sealed: only the check types in this package implement it.

type ChecksDefinition

type ChecksDefinition struct {
	NBVersionCheck        *NBVersionCheck
	OSVersionCheck        *OSVersionCheck
	GeoLocationCheck      *GeoLocationCheck
	PeerNetworkRangeCheck *PeerNetworkRangeCheck
	ProcessCheck          *ProcessCheck
}

ChecksDefinition is the slim twin of posture.ChecksDefinition.

type CustomZone

type CustomZone struct {
	Domain               string
	Records              []SimpleRecord
	SearchDomainDisabled bool
	NonAuthoritative     bool
}

CustomZone is the slim twin of dns.CustomZone.

type DNSSettings

type DNSSettings struct {
	DisabledManagementGroups []string
}

DNSSettings is the slim twin of types.DNSSettings.

type File

type File struct {
	Path             string
	ProcessIsRunning bool
}

File is the slim twin of peer.File.

type Flags

type Flags struct {
	ServerSSHAllowed bool
	DisableIPv6      bool
}

Flags is the slim twin of peer.Flags.

type GeoLocation

type GeoLocation struct {
	CountryCode string
	CityName    string
}

GeoLocation is the slim twin of posture.Location.

type GeoLocationCheck

type GeoLocationCheck struct {
	Locations []GeoLocation
	Action    string
}

GeoLocationCheck is the slim twin of posture.GeoLocationCheck.

type Group

type Group struct {
	ID        string
	Name      string
	PublicID  string
	Peers     []string
	Resources []Resource
}

Group is the slim twin of types.Group.

func (*Group) Copy

func (g *Group) Copy() *Group

func (*Group) IsGroupAll

func (g *Group) IsGroupAll() bool

type MinKernelVersionCheck

type MinKernelVersionCheck struct {
	MinKernelVersion string
}

MinKernelVersionCheck is the slim twin of posture.MinKernelVersionCheck.

type MinVersionCheck

type MinVersionCheck struct {
	MinVersion string
}

MinVersionCheck is the slim twin of posture.MinVersionCheck.

type NBVersionCheck

type NBVersionCheck struct {
	MinVersion string
}

NBVersionCheck is the slim twin of posture.NBVersionCheck.

type NameServer

type NameServer struct {
	IP     netip.Addr
	NSType int
	Port   int
}

NameServer is the slim twin of dns.NameServer.

type NameServerGroup

type NameServerGroup struct {
	ID                   string
	PublicID             string
	Name                 string
	Description          string
	NameServers          []NameServer
	Groups               []string
	Primary              bool
	Domains              []string
	Enabled              bool
	SearchDomainsEnabled bool
}

NameServerGroup is the slim twin of dns.NameServerGroup.

type Network

type Network struct {
	Identifier string
	Net        net.IPNet
	NetV6      net.IPNet
	Dns        string
	Serial     int64
}

Network is the slim twin of types.Network.

func (*Network) CurrentSerial

func (n *Network) CurrentSerial() uint64

type NetworkAddress

type NetworkAddress struct {
	NetIP netip.Prefix
}

NetworkAddress is the slim twin of peer.NetworkAddress.

type NetworkResource

type NetworkResource struct {
	ID          string
	NetworkID   string
	AccountID   string
	PublicID    string
	Name        string
	Description string
	Type        string
	Address     string // TODO: isn't persisted in the DB
	Domain      string
	Prefix      netip.Prefix
	Enabled     bool
}

NetworkResource is the slim twin of resources/types.NetworkResource.

type NetworkRouter

type NetworkRouter struct {
	PublicID   string
	PeerGroups []string
	Masquerade bool
	Metric     int
	Enabled    bool
}

NetworkRouter is the slim twin of routers/types.NetworkRouter.

type OSVersionCheck

type OSVersionCheck struct {
	Android *MinVersionCheck
	Darwin  *MinVersionCheck
	Ios     *MinVersionCheck
	Linux   *MinKernelVersionCheck
	Windows *MinKernelVersionCheck
}

OSVersionCheck is the slim twin of posture.OSVersionCheck.

type Peer

type Peer struct {
	ID                     string
	Key                    string
	SSHKey                 string
	DNSLabel               string
	UserID                 string
	SSHEnabled             bool
	LoginExpirationEnabled bool
	LastLogin              *time.Time
	IP                     netip.Addr
	IPv6                   netip.Addr
	RequiresApproval       bool
	Connected              bool
	ExtraDNSLabels         []string
	Meta                   PeerSystemMeta
	ProxyMeta              ProxyMeta
	Location               PeerLocation
}

Peer is the slim twin of peer.Peer.

func (*Peer) AddedWithSSOLogin

func (p *Peer) AddedWithSSOLogin() bool

func (*Peer) FQDN

func (p *Peer) FQDN(dnsDomain string) string

func (*Peer) GetLastLogin

func (p *Peer) GetLastLogin() time.Time

func (*Peer) HasCapability

func (p *Peer) HasCapability(capability int32) bool

func (*Peer) LoginExpired

func (p *Peer) LoginExpired(expiresIn time.Duration) (bool, time.Duration)

func (*Peer) SessionExpiresAt

func (p *Peer) SessionExpiresAt(accountExpirationEnabled bool, expiresIn time.Duration) time.Time

SessionExpiresAt mirrors peer.Peer.SessionExpiresAt.

func (*Peer) SupportsIPv6

func (p *Peer) SupportsIPv6() bool

func (*Peer) SupportsSourcePrefixes

func (p *Peer) SupportsSourcePrefixes() bool

type PeerLocation

type PeerLocation struct {
	CountryCode  string
	CityName     string
	ConnectionIP net.IP
}

PeerLocation is the slim twin of peer.Location.

type PeerNetworkRangeCheck

type PeerNetworkRangeCheck struct {
	Action string
	Ranges []netip.Prefix
}

PeerNetworkRangeCheck is the slim twin of posture.PeerNetworkRangeCheck.

type PeerSystemMeta

type PeerSystemMeta struct {
	WtVersion          string
	GoOS               string
	OSVersion          string
	KernelVersion      string
	NetworkAddresses   []NetworkAddress
	Files              []File
	Capabilities       []int32
	Flags              Flags
	SyncMessageVersion int
}

PeerSystemMeta is the slim twin of peer.PeerSystemMeta.

type Policy

type Policy struct {
	ID                  string
	PublicID            string
	Enabled             bool
	SourcePostureChecks []string
	Rules               []*PolicyRule
}

Policy is the slim twin of types.Policy.

func (*Policy) SourceGroups

func (p *Policy) SourceGroups() []string

type PolicyRule

type PolicyRule struct {
	ID                  string
	PolicyID            string
	Enabled             bool
	Action              string
	Protocol            string
	Bidirectional       bool
	Sources             []string
	Destinations        []string
	SourceResource      Resource
	DestinationResource Resource
	Ports               []string
	PortRanges          []RulePortRange
	AuthorizedGroups    map[string][]string
	AuthorizedUser      string
}

PolicyRule is the slim twin of types.PolicyRule.

type PostureChecks

type PostureChecks struct {
	ID     string
	Checks ChecksDefinition
}

PostureChecks is the slim twin of posture.Checks.

func (*PostureChecks) GetChecks

func (pc *PostureChecks) GetChecks() []Check

GetChecks returns the initialized checks in the same order as posture.Checks.GetChecks.

func (*PostureChecks) Passes

func (pc *PostureChecks) Passes(peer *Peer) bool

Passes reports whether the peer satisfies every check in this bundle. It mirrors the server posture path: a check returning (false, _) — including on an evaluation error — fails the bundle.

type Process

type Process struct {
	LinuxPath   string
	MacPath     string
	WindowsPath string
}

Process is the slim twin of posture.Process.

type ProcessCheck

type ProcessCheck struct {
	Processes []Process
}

ProcessCheck is the slim twin of posture.ProcessCheck.

type ProxyDomain

type ProxyDomain struct {
	Domain        string
	TargetCluster string
}

ProxyDomain is the slim twin of a registered reverse-proxy domain, carrying what private-service zone resolution needs: the apex a service domain can sit under, and the cluster it is registered against.

type ProxyMeta

type ProxyMeta struct {
	Embedded bool
	Cluster  string
}

ProxyMeta is the slim twin of peer.ProxyMeta.

type Resource

type Resource struct {
	ID   string
	Type string
}

Resource is the slim twin of types.Resource.

type Route

type Route struct {
	ID                  string
	AccountID           string
	PublicID            string
	Network             netip.Prefix
	Domains             domain.List
	KeepRoute           bool
	NetID               string
	Description         string
	Peer                string
	PeerID              string
	PeerGroups          []string
	NetworkType         int
	Masquerade          bool
	Metric              int
	Enabled             bool
	Groups              []string
	AccessControlGroups []string
	SkipAutoApply       bool
}

Route is the slim twin of route.Route.

func (*Route) Copy

func (r *Route) Copy() *Route

func (*Route) Equal

func (r *Route) Equal(other *Route) bool

func (*Route) GetHAUniqueID

func (r *Route) GetHAUniqueID() string

func (*Route) GetResourceID

func (r *Route) GetResourceID() string

func (*Route) IsDynamic

func (r *Route) IsDynamic() bool

func (*Route) NetString

func (r *Route) NetString() string

type RulePortRange

type RulePortRange struct {
	Start uint16
	End   uint16
}

RulePortRange is the slim twin of types.RulePortRange.

type Service

type Service struct {
	ID           string
	Enabled      bool
	Private      bool
	Mode         string
	Domain       string
	ProxyCluster string
	AccessGroups []string
	Targets      []*ServiceTarget
}

Service is the slim twin of the reverse-proxy service.Service. It carries only the state proxy-policy injection reads: the persisted reverse-proxy services and the in-memory ones synthesised from agent-network state, which are never written to the database.

type ServiceTarget

type ServiceTarget struct {
	Enabled    bool
	Path       string
	Port       uint16
	Protocol   string
	TargetID   string
	TargetType string
}

ServiceTarget is the slim twin of service.Target.

type SimpleRecord

type SimpleRecord struct {
	Name  string
	Type  int
	Class string
	TTL   int
	RData string
}

SimpleRecord is the slim twin of dns.SimpleRecord.

Jump to

Keyboard shortcuts

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