gopxgrid

package module
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MDMEndpointTypeNonCompliant MDMEndpointType = "NON_COMPLIANT"
	MDMEndpointTypeRegistered   MDMEndpointType = "REGISTERED"
	MDMEndpointTypeDisconnected MDMEndpointType = "DISCONNECTED"

	MDMOSTypeAndroid MDMOSType = "ANDROID"
	MDMOSTypeIOS     MDMOSType = "IOS"
	MDMOSTypeWindows MDMOSType = "WINDOWS"

	MDMTopicEndpoint MDMTopic = "endpointTopic"

	MDMServiceName = "com.cisco.ise.mdm"
)
View Source
const (
	SessionStateAuthenticating SessionState = "AUTHENTICATING"
	SessionStateAuthenticated  SessionState = "AUTHENTICATED"
	SessionStatePostured       SessionState = "POSTURED"
	SessionStateStarted        SessionState = "STARTED"
	SessionStateDisconnected   SessionState = "DISCONNECTED"

	GroupTypeActiveDirectory            GroupType = "ACTIVE_DIRECTORY"
	GroupTypeIdentity                   GroupType = "IDENTITY"
	GroupTypeExternal                   GroupType = "EXTERNAL"
	GroupTypeInterestingActiveDirectory GroupType = "INTERESTING_ACTIVE_DIRECTORY"

	SessionDirectoryTopicSession    SessionDirectoryTopic = "sessionTopic"
	SessionDirectoryTopicSessionAll SessionDirectoryTopic = "sessionTopicAll"
	SessionDirectoryTopicGroup      SessionDirectoryTopic = "groupTopic"

	SessionDirectoryServiceName = "com.cisco.ise.session"
)
View Source
const (
	PolicyDownloadStatusSuccess PolicyDownloadStatus = "SUCCESS"
	PolicyDownloadStatusFailure PolicyDownloadStatus = "FAILURE"

	TrustSecTopicPolicyDownload TrustSecTopic = "policyDownloadTopic"

	TrustSecServiceName = "com.cisco.ise.trustsec"
)
View Source
const (
	SystemHealthServiceName = "com.cisco.ise.system"
)

Variables

View Source
var (
	ErrNoHosts            = errors.New("no hosts available")
	ErrServiceUnavailable = errors.New("service unavailable")
)
View Source
var (
	ErrCreateForbidden      = errors.New("create account forbidden")
	ErrCreateConflict       = errors.New("create account conflict")
	ErrActivateUnauthorized = errors.New("activate account unauthorized")
)
View Source
var (
	ErrPropertyNotFound  = errors.New("property not found")
	ErrPropertyNotString = errors.New("property is not a string")

	ErrNoNodePicked = errors.New("no node picked")
	ErrNoNodes      = errors.New("no nodes available")
	ErrNodeNotFound = errors.New("node not found")
)
View Source
var DefaultINETFamilyStrategy = IPv46
View Source
var (
	ErrInvalidInput = fmt.Errorf("invalid input")
)

Functions

func ParseDNSHost added in v0.5.0

func ParseDNSHost(host string) (*net.UDPAddr, error)

Types

type ANCApplyPolicyRequest

type ANCApplyPolicyRequest struct {
	Policy       string `json:"policy"`
	MACAddress   string `json:"macAddress"`
	NASIPAddress string `json:"nasIpAddress"`
	SessionID    string `json:"sessionId,omitempty"`
	NASPortID    string `json:"nasPortId,omitempty"`
	IPAddress    string `json:"ipAddress,omitempty"`
	UserName     string `json:"userName,omitempty"`
}

type ANCAsset

type ANCAsset struct {
	AssetId               string        `json:"assetId"`
	AssetName             string        `json:"assetName"`
	AssetIPAddress        string        `json:"assetIpAddress"`
	AssetMACAddress       string        `json:"assetMacAddress"`
	AssetVendor           string        `json:"assetVendor"`
	AssetProductID        string        `json:"assetProductId"`
	AssetSerialNumber     string        `json:"assetSerialNumber"`
	AssetDeviceType       string        `json:"assetDeviceType"`
	AssetSWRevision       string        `json:"assetSwRevision"`
	AssetHWRevision       string        `json:"assetHwRevision"`
	AssetProtocol         string        `json:"assetProtocol"`
	AssetCustomAttributes []ANCKeyValue `json:"assetCustomAttributes"`
	AssetConnectedLinks   []ANCKeyValue `json:"assetConnectedLinks"`
}

type ANCAssetTopicMessage

type ANCAssetTopicMessage struct {
	OperationType OperationType `json:"opType"`
	Asset         ANCAsset      `json:"asset"`
}

type ANCClearPolicyRequest

type ANCClearPolicyRequest struct {
	MACAddress   string `json:"macAddress"`
	NASIPAddress string `json:"nasIpAddress"`
}

type ANCConfig

type ANCConfig interface {
	PxGridService

	Rest() ANCRest

	ANCConfigSubscriber

	Properties() ANCConfigPropsProvider
}

func NewPxGridANCConfig

func NewPxGridANCConfig(ctrl *PxGridConsumer) ANCConfig

type ANCConfigPropsProvider

type ANCConfigPropsProvider interface {
	RestBaseURL() (string, error)
	WSPubsubService() (string, error)
	StatusTopic() (string, error)
}

type ANCConfigSubscriber

type ANCConfigSubscriber interface {
	OnStatusTopic() Subscriber[ANCOperationStatus]
}

type ANCConfigTopic

type ANCConfigTopic string
const (
	ANCConfigTopicStatus ANCConfigTopic = "statusTopic"

	ANCConfigServiceName = "com.cisco.ise.config.anc"
)

type ANCEndpoint

type ANCEndpoint struct {
	MACAddress string `json:"macAddress"`
	PolicyName string `json:"policyName"`
	ID         string `json:"id"`
}

type ANCKeyValue

type ANCKeyValue struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type ANCOperationStatus

type ANCOperationStatus struct {
	ID            string    `json:"operationId"`
	Status        ANCStatus `json:"status"`
	MACAddress    string    `json:"macAddress,omitempty"`
	NASIPAddress  string    `json:"nasIpAddress,omitempty"`
	FailureReason string    `json:"failureReason,omitempty"`
}

type ANCPolicy

type ANCPolicy struct {
	Name    string            `json:"name"`
	Actions []ANCPolicyAction `json:"actions"`
	ID      string            `json:"id"`
}

type ANCPolicyAction

type ANCPolicyAction string
const (
	ANCActionQuarantine     ANCPolicyAction = "QUARANTINE"
	ANCActionShutdown       ANCPolicyAction = "SHUT_DOWN"
	ANCActionPortBounce     ANCPolicyAction = "PORT_BOUNCE"
	ANCActionReAuthenticate ANCPolicyAction = "RE_AUTHENTICATE"
)

func (ANCPolicyAction) Valid

func (a ANCPolicyAction) Valid() bool

type ANCRest added in v0.6.0

type ANCRest interface {
	GetPolicies() CallFinalizer[*[]ANCPolicy]
	GetPolicyByName(name string) CallFinalizer[*ANCPolicy]
	CreatePolicy(policy ANCPolicy) NoResultCallFinalizer
	DeletePolicyByName(name string) NoResultCallFinalizer

	GetEndpoints() CallFinalizer[*[]ANCEndpoint]
	GetEndpointPolicies() CallFinalizer[*[]ANCEndpoint]
	GetEndpointByMAC(mac string) CallFinalizer[*ANCEndpoint]
	GetEndpointByNasIPAddress(mac, nasIP string) CallFinalizer[*ANCEndpoint]
	ApplyEndpointByIPAddress(ip, policyName string) CallFinalizer[*ANCOperationStatus]
	ApplyEndpointByMACAddress(mac, policyName string) CallFinalizer[*ANCOperationStatus]
	ClearEndpointByIPAddress(ip, policyName string) CallFinalizer[*ANCOperationStatus]
	ClearEndpointByMACAddress(mac, policyName string) CallFinalizer[*ANCOperationStatus]

	ApplyEndpointPolicy(request ANCApplyPolicyRequest) CallFinalizer[*ANCOperationStatus]
	ClearEndpointPolicy(request ANCClearPolicyRequest) CallFinalizer[*ANCOperationStatus]

	GetOperationStatus(operationID string) CallFinalizer[*ANCOperationStatus]
}

type ANCStatus

type ANCStatus string
const (
	ANCStatusSuccess ANCStatus = "SUCCESS"
	ANCStatusFailure ANCStatus = "FAILURE"
	ANCStatusRunning ANCStatus = "RUNNING"
)

type AccountActivateResponse

type AccountActivateResponse struct {
	AccountState AccountState `json:"accountState"`
	Version      string       `json:"version"`
}

func (AccountActivateResponse) IsDisabled

func (a AccountActivateResponse) IsDisabled() bool

func (AccountActivateResponse) IsEnabled

func (a AccountActivateResponse) IsEnabled() bool

func (AccountActivateResponse) IsPending

func (a AccountActivateResponse) IsPending() bool

type AccountCreateResponse

type AccountCreateResponse struct {
	NodeName string `json:"nodeName"`
	Password string `json:"password"`
}

type AccountState

type AccountState string
const (
	AccountStatePending  AccountState = "PENDING"
	AccountStateDisabled AccountState = "DISABLED"
	AccountStateEnabled  AccountState = "ENABLED"
)

type AuthConfig

type AuthConfig struct {
	Username string
	Password string
}

type CallFinalizer

type CallFinalizer[T any] interface {
	Do(ctx context.Context) (FullResponse[T], error)
	DoOnNode(ctx context.Context, node int) (FullResponse[T], error)
	DoOnNodeByName(ctx context.Context, nodeName string) (FullResponse[T], error)
	DoOnNodes(ctx context.Context, nodes ...int) (FullResponse[T], error)
}

type Controller

type Controller interface {
	RESTRequest(ctx context.Context, fullURL string, payload any, ops RESTOptions) (*Response, error)
	AccountCreate(ctx context.Context) (AccountCreateResponse, error)
	AccountActivate(ctx context.Context) (AccountActivateResponse, error)
	ServiceLookup(ctx context.Context, svc string) (ServiceLookupResponse, error)
	AccessSecret(ctx context.Context, peerNodeName string) (string, error)
}

type DNSConfig

type DNSConfig struct {
	Server         string
	FamilyStrategy INETFamilyStrategy
}

type EgressMatrix

type EgressMatrix struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	MonitorAll  bool   `json:"monitorAll"`
}

type EgressPolicy

type EgressPolicy struct {
	ID                         string   `json:"id"`
	Name                       string   `json:"name"`
	MatrixId                   string   `json:"matrixId"`
	Status                     string   `json:"status"`
	Description                string   `json:"description"`
	SourceSecurityGroupID      string   `json:"sourceSecurityGroupId"`
	DestinationSecurityGroupID string   `json:"destinationSecurityGroupId"`
	SGACLIDs                   []string `json:"sgaclIds"`
	Timestamp                  string   `json:"timestamp"`
}

type EgressPolicyTopicMessage

type EgressPolicyTopicMessage struct {
	ID                 string   `json:"id"`
	Name               string   `json:"name"`
	Description        string   `json:"description"`
	SourceSGTID        string   `json:"sourceSgtId"`
	SourceSGTName      string   `json:"sourceSgtName"`
	DestinationSGTID   string   `json:"destinationSgtId"`
	DestinationSGTName string   `json:"destinationSgtName"`
	MatrixCellStatus   string   `json:"matrixCellStatus"`
	SGACLIDs           []string `json:"sgaclIds"`
	DefaultRule        string   `json:"defaultRule"`
	Sequence           int      `json:"sequence"`
	Deleted            bool     `json:"deleted"`
	Timestamp          string   `json:"timestamp"`
}

type EndpointAsset

type EndpointAsset interface {
	PxGridService

	EndpointAssetSubscriber

	Properties() EndpointAssetPropsProvider
}

func NewPxGridEndpointAsset

func NewPxGridEndpointAsset(ctrl *PxGridConsumer) EndpointAsset

type EndpointAssetPropsProvider

type EndpointAssetPropsProvider interface {
	WSPubsubService() (string, error)
	AssetTopic() (string, error)
}

type EndpointAssetSubscriber

type EndpointAssetSubscriber interface {
	OnAssetTopic() Subscriber[ANCAssetTopicMessage]
}

type EndpointAssetTopic

type EndpointAssetTopic string
const (
	EndpointAssetTopicAsset EndpointAssetTopic = "assetTopic"

	EndpointAssetServiceName = "com.cisco.endpoint.asset"
)

type Failure

type Failure struct {
	ID                       string   `json:"id"`
	Timestamp                string   `json:"timestamp"`
	FailureReason            string   `json:"failureReason"`
	UserName                 string   `json:"userName"`
	ServerName               string   `json:"serverName"`
	CallingStationID         string   `json:"callingStationId"`
	AuditSessionID           string   `json:"auditSessionId"`
	NASIPAddress             string   `json:"nasIpAddress"`
	NASPortID                string   `json:"nasPortId"`
	NASPortType              string   `json:"nasPortType"`
	IPAddresses              []string `json:"ipAddresses"`
	MACAddress               string   `json:"macAddress"`
	MessageCode              int      `json:"messageCode"`
	DestinationIPAddress     string   `json:"destinationIpAddress"`
	UserType                 string   `json:"userType"`
	AccessService            string   `json:"accessService"`
	IdentityStore            string   `json:"identityStore"`
	IdentityGroup            string   `json:"identityGroup"`
	AuthenticationMethod     string   `json:"authenticationMethod"`
	AuthenticationProtocol   string   `json:"authenticationProtocol"`
	ServiceType              string   `json:"serviceType"`
	NetworkDeviceName        string   `json:"networkDeviceName"`
	DeviceType               string   `json:"deviceType"`
	Location                 string   `json:"location"`
	SelectedAznProfiles      string   `json:"selectedAznProfiles"`
	PostureStatus            string   `json:"postureStatus"`
	CTSSecurityGroup         string   `json:"ctsSecurityGroup"`
	Response                 string   `json:"response"`
	ResponseTime             int      `json:"responseTime"`
	ExecutionSteps           string   `json:"executionSteps"`
	CredentialCheck          string   `json:"credentialCheck"`
	EndpointProfile          string   `json:"endpointProfile"`
	MDMServerName            string   `json:"mdmServerName"`
	PolicySetName            string   `json:"policySetName"`
	AuthorizationRule        string   `json:"authorizationRule"`
	MSEResponseTime          string   `json:"mseResponseTime"`
	MSEServerName            string   `json:"mseServerName"`
	OriginalCallingStationID string   `json:"originalCallingStationId"`
}

type FailureTopicMessage

type FailureTopicMessage struct {
	Sequence int       `json:"sequence"`
	Failures []Failure `json:"failures"`
}

type FullResponse added in v0.10.0

type FullResponse[R any] struct {
	StatusCode int
	Result     R
	Body       string
}

type GenericRESTCaller added in v0.7.0

type GenericRESTCaller interface {
	AnyREST(call string, payload map[string]any) CallFinalizer[any]
}

type GetEgressPoliciesResponse

type GetEgressPoliciesResponse struct {
	TotalCount            int            `json:"totalCount"`
	EgressPolicies        []EgressPolicy `json:"egressPolicies"`
	DeletedEgressPolicies []EgressPolicy `json:"deletedEgressPolicies"`
}

type GetSecurityGroupACLsResponse

type GetSecurityGroupACLsResponse struct {
	TotalCount              int                `json:"totalCount"`
	SecurityGroupACLs       []SecurityGroupACL `json:"securityGroupAcls"`
	DeleteSecurityGroupACLs []SecurityGroupACL `json:"deletedSecurityGroupAcls"`
}

type GetSecurityGroupsResponse

type GetSecurityGroupsResponse struct {
	TotalCount            int             `json:"totalCount"`
	SecurityGroups        []SecurityGroup `json:"securityGroups"`
	DeletedSecurityGroups []SecurityGroup `json:"deletedSecurityGroups"`
}

type GetVirtualNetworksResponse

type GetVirtualNetworksResponse struct {
	TotalCount             int              `json:"totalCount"`
	VirtualNetworks        []VirtualNetwork `json:"virtualNetworks"`
	DeletedVirtualNetworks []VirtualNetwork `json:"deletedVirtualNetworks"`
}

type Group

type Group struct {
	Name string    `json:"name"`
	Type GroupType `json:"type"`
}

type GroupTopicMessage

type GroupTopicMessage struct {
	UserGroups []Group `json:"userGroups"`
}

type GroupType

type GroupType string

type Host

type Host struct {
	Host        string
	ControlPort int
}

type INETFamilyStrategy

type INETFamilyStrategy int
const (
	IPUnknown INETFamilyStrategy = iota
	IPv4
	IPv46
	IPv64
	IPv6
)

type Logger

type Logger interface {
	Debug(msg string, args ...any)
	DebugContext(ctx context.Context, msg string, args ...any)
	Error(msg string, args ...any)
	ErrorContext(ctx context.Context, msg string, args ...any)
	Info(msg string, args ...any)
	InfoContext(ctx context.Context, msg string, args ...any)
	Warn(msg string, args ...any)
	WarnContext(ctx context.Context, msg string, args ...any)
	With(args ...any) Logger
}

func FromSlog

func FromSlog(logger *slog.Logger) Logger

type MDM

type MDM interface {
	PxGridService

	Rest() MDMRest

	MDMSubscriber

	Properties() MDMPropsProvider
}

func NewPxGridMDM

func NewPxGridMDM(ctrl *PxGridConsumer) MDM

type MDMEndpoint

type MDMEndpoint struct {
	MACAddress    string `json:"macAddress"`
	OSVersion     string `json:"osVersion"`
	Registered    bool   `json:"registered"`
	Compliant     bool   `json:"compliant"`
	DiskEncrypted bool   `json:"diskEncrypted"`
	JailBroken    bool   `json:"jailBroken"`
	PinLocked     bool   `json:"pinLocked"`
	Model         string `json:"model"`
	Manufacturer  string `json:"manufacturer"`
	IMEI          string `json:"imei"`
	MEID          string `json:"meid"`
	UDID          string `json:"udid"`
	SerialNumber  string `json:"serialNumber"`
	Location      string `json:"location"`
	DeviceManager string `json:"deviceManager"`
	LastSyncTime  string `json:"lastSyncTime"`
}

type MDMEndpointType

type MDMEndpointType string

type MDMOSType

type MDMOSType string

type MDMPropsProvider

type MDMPropsProvider interface {
	RestBaseURL() (string, error)
	WSPubsubService() (string, error)
	EndpointTopic() (string, error)
}

type MDMRest added in v0.6.0

type MDMRest interface {
	GetEndpoints(filter *MDMEndpoint) CallFinalizer[*[]MDMEndpoint]
	GetEndpointByMacAddress(macAddress string) CallFinalizer[*MDMEndpoint]
	GetEndpointsByType(endpointType MDMEndpointType) CallFinalizer[*[]MDMEndpoint]
	GetEndpointsByOsType(osType MDMOSType) CallFinalizer[*[]MDMEndpoint]
}

type MDMSubscriber

type MDMSubscriber interface {
	OnEndpointTopic() Subscriber[MDMEndpoint]
}

type MDMTopic

type MDMTopic string

type Message

type Message[T any] struct {
	*stomp.Message

	Body           T
	UnmarshalError error
}

type NoResultCallFinalizer

type NoResultCallFinalizer interface {
	Do(ctx context.Context) (NoResultResponse, error)
	DoOnNode(ctx context.Context, node int) (NoResultResponse, error)
	DoOnNodeByName(ctx context.Context, nodeName string) (NoResultResponse, error)
	DoOnNodes(ctx context.Context, nodes ...int) (NoResultResponse, error)
}

type NoResultResponse added in v0.10.0

type NoResultResponse struct {
	StatusCode int
}

type OperationType

type OperationType string
const (
	OperationTypeCreate OperationType = "CREATE"
	OperationTypeUpdate OperationType = "UPDATE"
	OperationTypeDelete OperationType = "DELETE"
)

type Policy

type Policy struct {
	SourceSGT                  int    `json:"sourceSgt"`
	SourceSGTGenerationID      string `json:"sourceSgtGenerationId"`
	DestinationSGT             int    `json:"destinationSgt"`
	DestinationSGTGenerationID string `json:"destinationSgtGenerationId"`
	SGACLName                  string `json:"sgaclName"`
	SGACLGenerationID          string `json:"sgaclGenerationId"`
}

type PolicyDownload

type PolicyDownload struct {
	Timestamp       string               `json:"timestamp"`
	ServerName      string               `json:"serverName"`
	Status          PolicyDownloadStatus `json:"status"`
	FailureReason   string               `json:"failureReason"`
	NASIPAddress    string               `json:"nasIpAddress"`
	MatrixName      string               `json:"matrixName"`
	RBACLSourceList string               `json:"rbaclSourceList"`
	Policies        []Policy             `json:"policies"`
}

type PolicyDownloadStatus

type PolicyDownloadStatus string

type PolicyDownloadTopicMessage

type PolicyDownloadTopicMessage struct {
	PolicyDownloads []PolicyDownload `json:"policyDownloads"`
}

type Profile

type Profile struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	FullName string `json:"fullName"`
}

type ProfilerConfigurationPropsProvider

type ProfilerConfigurationPropsProvider interface {
	RestBaseURL() (string, error)
	WSPubsubService() (string, error)
	Topic() (string, error)
}

type ProfilerConfigurationRest added in v0.6.0

type ProfilerConfigurationRest interface {
	GetProfiles() CallFinalizer[*[]Profile]
}

type ProfilerConfigurationSubscriber

type ProfilerConfigurationSubscriber interface {
	OnTopic() Subscriber[ProfilerTopicMessage]
}

type ProfilerConfigurationTopic

type ProfilerConfigurationTopic string
const (
	ProfilerConfigurationTopicProfile ProfilerConfigurationTopic = "topic"

	ProfilerConfigurationServiceName = "com.cisco.ise.config.profiler"
)

type ProfilerTopicMessage

type ProfilerTopicMessage struct {
	OperationType OperationType `json:"operation"`
	Profile       Profile       `json:"profile"`
}

type PubSub

type PubSub interface {
	PxGridService

	PubSubSubscriber

	Properties() PubSubPropsProvider
}

func NewPxGridPubSub

func NewPxGridPubSub(ctrl *PxGridConsumer, svc string) PubSub

type PubSubEndpoint

type PubSubEndpoint struct {
	// contains filtered or unexported fields
}

func (*PubSubEndpoint) Close

func (e *PubSubEndpoint) Close() error

func (*PubSubEndpoint) Disconnect

func (e *PubSubEndpoint) Disconnect() error

func (*PubSubEndpoint) Read

func (e *PubSubEndpoint) Read(p []byte) (int, error)

func (*PubSubEndpoint) Write

func (e *PubSubEndpoint) Write(p []byte) (int, error)

type PubSubPropsProvider

type PubSubPropsProvider interface {
	WSURL() (string, error)
}

type PubSubSubscriber

type PubSubSubscriber interface {
	Subscribe(ctx context.Context, picker ServiceNodePickerFactory, topic string) (*stomp.Subscription, error)
}

type PxGridConfig

type PxGridConfig struct {
	Hosts       []Host
	Auth        AuthConfig
	NodeName    string
	Description string
	TLS         TLSConfig
	DNS         DNSConfig
	Logger      Logger
}

func NewPxGridConfig

func NewPxGridConfig() *PxGridConfig

func (*PxGridConfig) AddHost

func (c *PxGridConfig) AddHost(host string, controlPort int) *PxGridConfig

func (*PxGridConfig) SetAuth

func (c *PxGridConfig) SetAuth(username, password string) *PxGridConfig

func (*PxGridConfig) SetCA

func (c *PxGridConfig) SetCA(ca *x509.CertPool) *PxGridConfig

func (*PxGridConfig) SetClientCertificate

func (c *PxGridConfig) SetClientCertificate(cert *tls.Certificate) *PxGridConfig

func (*PxGridConfig) SetDNS

func (c *PxGridConfig) SetDNS(server string, family INETFamilyStrategy) *PxGridConfig

func (*PxGridConfig) SetDescription

func (c *PxGridConfig) SetDescription(desc string) *PxGridConfig

func (*PxGridConfig) SetInsecureTLS

func (c *PxGridConfig) SetInsecureTLS(insecure bool) *PxGridConfig

func (*PxGridConfig) SetLogger

func (c *PxGridConfig) SetLogger(logger Logger) *PxGridConfig

func (*PxGridConfig) SetNodeName

func (c *PxGridConfig) SetNodeName(name string) *PxGridConfig

type PxGridConsumer

type PxGridConsumer struct {
	// contains filtered or unexported fields
}

func NewPxGridConsumer

func NewPxGridConsumer(cfg *PxGridConfig) (*PxGridConsumer, error)

func (*PxGridConsumer) ANCConfig

func (c *PxGridConsumer) ANCConfig() ANCConfig

func (*PxGridConsumer) AccessSecret

func (c *PxGridConsumer) AccessSecret(ctx context.Context, peerNodeName string) (string, error)

func (*PxGridConsumer) AccountActivate

func (c *PxGridConsumer) AccountActivate(ctx context.Context) (AccountActivateResponse, error)

func (*PxGridConsumer) AccountCreate

func (c *PxGridConsumer) AccountCreate(ctx context.Context) (AccountCreateResponse, error)

func (*PxGridConsumer) ClientTLSConfig

func (c *PxGridConsumer) ClientTLSConfig() *tls.Config

func (*PxGridConsumer) Control

func (c *PxGridConsumer) Control() Controller

func (*PxGridConsumer) DialContext

func (c *PxGridConsumer) DialContext(ctx context.Context, network, addr string) (net.Conn, error)

func (*PxGridConsumer) EndpointAsset

func (c *PxGridConsumer) EndpointAsset() EndpointAsset

func (*PxGridConsumer) MDM

func (c *PxGridConsumer) MDM() MDM

func (*PxGridConsumer) ProfilerConfiguration

func (c *PxGridConsumer) ProfilerConfiguration() ProfilerConfiguration

func (*PxGridConsumer) PubSub

func (c *PxGridConsumer) PubSub(service string) PubSub

func (*PxGridConsumer) RESTRequest

func (c *PxGridConsumer) RESTRequest(ctx context.Context, fullURL string, payload any, ops RESTOptions) (*Response, error)

func (*PxGridConsumer) RadiusFailure

func (c *PxGridConsumer) RadiusFailure() RadiusFailure

func (*PxGridConsumer) ServiceLookup

func (c *PxGridConsumer) ServiceLookup(ctx context.Context, svc string) (ServiceLookupResponse, error)

func (*PxGridConsumer) SessionDirectory

func (c *PxGridConsumer) SessionDirectory() SessionDirectory

func (*PxGridConsumer) SystemHealth

func (c *PxGridConsumer) SystemHealth() SystemHealth

func (*PxGridConsumer) TrustSec

func (c *PxGridConsumer) TrustSec() TrustSec

func (*PxGridConsumer) TrustSecConfiguration

func (c *PxGridConsumer) TrustSecConfiguration() TrustSecConfiguration

func (*PxGridConsumer) TrustSecSXP

func (c *PxGridConsumer) TrustSecSXP() TrustSecSXP

type PxGridService

type PxGridService interface {
	Name() string
	Nodes() []ServiceNode
	Lookup(ctx context.Context) error
	UpdateSecrets(ctx context.Context) error
	CheckNodes(ctx context.Context) error
	FindProperty(ctx context.Context, property string, nodePick ...ServiceNodePickerFactory) (any, error)
	FindNodeIndexByName(name string) (int, error)
	On(topicProperty string) Subscriber[any]

	GenericRESTCaller
}

type RESTOptions

type RESTOptions struct {
	// contains filtered or unexported fields
}

type RadiusFailure

type RadiusFailure interface {
	PxGridService

	Rest() RadiusFailureRest

	RadiusFailureSubscriber

	Properties() RadiusFailurePropsProvider
}

func NewPxGridRadiusFailure

func NewPxGridRadiusFailure(ctrl *PxGridConsumer) RadiusFailure

type RadiusFailurePropsProvider

type RadiusFailurePropsProvider interface {
	RestBaseURL() (string, error)
	WSPubsubService() (string, error)
	FailureTopic() (string, error)
}

type RadiusFailureRest added in v0.6.0

type RadiusFailureRest interface {
	GetFailures() CallFinalizer[*[]Failure]
	GetFailureByID(id string) CallFinalizer[*Failure]
}

type RadiusFailureSubscriber

type RadiusFailureSubscriber interface {
	OnFailureTopic() Subscriber[FailureTopicMessage]
}

type RadiusFailureTopic

type RadiusFailureTopic string
const (
	RadiusFailureTopicFailure RadiusFailureTopic = "failureTopic"

	RadiusFailureServiceName = "com.cisco.ise.radius"
)

type Request

type Request struct {
	// contains filtered or unexported fields
}

func (*Request) NoAuth

func (r *Request) NoAuth() *Request

NoAuth disables authentication for the request.

func (*Request) Post

func (r *Request) Post(u string, payload interface{}) (*Response, error)

Post sends a POST request to the specified URL with the given payload.

func (*Request) SetPassword

func (r *Request) SetPassword(password string) *Request

SetPassword sets the password for the request.

func (*Request) SetResult

func (r *Request) SetResult(result interface{}) *Request

func (*Request) SetRootCAs

func (r *Request) SetRootCAs(rootCAs *x509.CertPool) *Request

SetRootCAs sets the root CAs for the request.

func (*Request) SetTLSConfig

func (r *Request) SetTLSConfig(tls *TLSConfig) *Request

SetTLSConfig sets the TLS configuration for the request.

func (*Request) SetUsername

func (r *Request) SetUsername(username string) *Request

SetUsername sets the username for the request.

type Response

type Response struct {
	StatusCode int
	Body       string
	Result     interface{}
}

type SecurityGroup

type SecurityGroup struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Tag         int    `json:"tag"`
	Timestamp   string `json:"timestamp"`
}

type SecurityGroupACL

type SecurityGroupACL struct {
	ID              string `json:"id"`
	IsDeleted       bool   `json:"isDeleted"`
	Name            string `json:"name"`
	Description     string `json:"description"`
	IPVersion       string `json:"ipVersion"`
	ACL             string `json:"acl"`
	ModelledContent any    `json:"modelledContent"`
	GenerationID    string `json:"generationId"`
	Timestamp       string `json:"timestamp"`
}

type SecurityGroupACLTopicMessage

type SecurityGroupACLTopicMessage struct {
	ID              string `json:"id"`
	Name            string `json:"name"`
	Description     string `json:"description"`
	IPVersion       string `json:"ipVersion"`
	ACL             string `json:"acl"`
	ModelledContent any    `json:"modelledContent"`
	GenerationID    string `json:"generationId"`
	IsReadOnly      bool   `json:"isReadOnly"`
	Sequence        int    `json:"sequence"`
	Deleted         bool   `json:"deleted"`
	Timestamp       string `json:"timestamp"`
}

type SecurityGroupTopicMessage

type SecurityGroupTopicMessage struct {
	Sequence      int           `json:"sequence"`
	OperationType OperationType `json:"operation"`
	SecurityGroup SecurityGroup `json:"securityGroup"`
}

type SecurityGroupVNVlanTopicMessage

type SecurityGroupVNVlanTopicMessage any

type ServiceLookupResponse

type ServiceLookupResponse struct {
	Services []ServiceNode `json:"services"`
}

type ServiceNode

type ServiceNode struct {
	Name       string                 `json:"name"`
	NodeName   string                 `json:"nodeName"`
	Properties map[string]interface{} `json:"properties"`
	Secret     string                 `json:"-"`
}

type ServiceNodePicker

type ServiceNodePicker interface {
	PickNode() (*ServiceNode, bool, error)
}

type ServiceNodePickerFactory

type ServiceNodePickerFactory func(ServiceNodeSlice) ServiceNodePicker

func IndexNodePicker

func IndexNodePicker(index ...int) ServiceNodePickerFactory

func NameNodePicker

func NameNodePicker(name ...string) ServiceNodePickerFactory

func OrderedNodePicker

func OrderedNodePicker() ServiceNodePickerFactory

func PredicateNodePicker

func PredicateNodePicker(predicate func(ServiceNode) bool) ServiceNodePickerFactory

func RandomNodePicker

func RandomNodePicker() ServiceNodePickerFactory

type ServiceNodeSlice

type ServiceNodeSlice []ServiceNode

func (ServiceNodeSlice) GetProperty

func (s ServiceNodeSlice) GetProperty(name string) (any, error)

func (ServiceNodeSlice) GetPropertyString

func (s ServiceNodeSlice) GetPropertyString(name string) (string, error)

type Session

type Session struct {
	Timestamp                string       `json:"timestamp"`
	State                    SessionState `json:"state"`
	MacAddress               string       `json:"macAddress"`
	IPAddresses              []string     `json:"ipAddresses"`
	CallingStationID         string       `json:"callingStationId"`
	CalledStationID          string       `json:"calledStationId"`
	AuditSessionID           string       `json:"auditSessionId"`
	UserName                 string       `json:"userName"`
	NasIPAddress             string       `json:"nasIpAddress"`
	NasPortID                string       `json:"nasPortId"`
	NasPortType              string       `json:"nasPortType"`
	NasIdentifier            string       `json:"nasIdentifier"`
	SelectedAuthzProfiles    []string     `json:"selectedAuthzProfiles"`
	PostureStatus            string       `json:"postureStatus"`
	EndpointProfile          string       `json:"endpointProfile"`
	EndpointOperatingSystem  string       `json:"endpointOperatingSystem"`
	CTSSecurityGroup         string       `json:"ctsSecurityGroup"`
	ADNormalizedUser         string       `json:"adNormalizedUser"`
	ADUserDomainName         string       `json:"adUserDomainName"`
	ADHostDomainName         string       `json:"adHostDomainName"`
	ADUserNetBiosName        string       `json:"adUserNetBiosName"`
	ADHostNetBiosName        string       `json:"adHostNetBiosName"`
	ADUserResolvedIdentities string       `json:"adUserResolvedIdentities"`
	ADUserResolvedDNS        string       `json:"adUserResolvedDns"`
	ADHostResolvedIdentities string       `json:"adHostResolvedIdentities"`
	ADHostResolvedDNS        string       `json:"adHostResolvedDns"`
	ADUserSamAccountName     string       `json:"adUserSamAccountName"`
	ADHostSamAccountName     string       `json:"adHostSamAccountName"`
	ADUserQualifiedName      string       `json:"adUserQualifiedName"`
	ADHostQualifiedName      string       `json:"adHostQualifiedName"`
	Providers                []string     `json:"providers"`
	EndpointCheckResult      string       `json:"endpointCheckResult"`
	EndpointCheckTime        string       `json:"endpointCheckTime"`
	IdentitySourcePortStart  string       `json:"identitySourcePortStart"`
	IdentitySourcePortEnd    string       `json:"identitySourcePortEnd"`
	IdentitySourcePortFirst  string       `json:"identitySourcePortFirst"`
	TerminalServerAgentID    string       `json:"terminalServerAgentId"`
	IsMachineAuthentication  string       `json:"isMachineAuthentication"`
	ServiceType              string       `json:"serviceType"`
	TunnelPrivateGroupID     string       `json:"tunnelPrivateGroupId"`
	AirespaceWlanID          string       `json:"airespaceWlanId"`
	NetworkDeviceProfileName string       `json:"networkDeviceProfileName"`
	RadiusFlowType           string       `json:"radiusFlowType"`
	SSID                     string       `json:"ssid"`
	ANCPolicy                string       `json:"ancPolicy"`
	MDMMacAddress            string       `json:"mdmMacAddress"`
	MDMOSVersion             string       `json:"mdmOsVersion"`
	MDMRegistered            bool         `json:"mdmRegistered"`
	MDMCompliant             bool         `json:"mdmCompliant"`
	MDMDiskEncrypted         bool         `json:"mdmDiskEncrypted"`
	MDMJailBroken            bool         `json:"mdmJailBroken"`
	MDMPinLocked             bool         `json:"mdmPinLocked"`
	MDMModel                 string       `json:"mdmModel"`
	MDMManufacturer          string       `json:"mdmManufacturer"`
	MDMIMEI                  string       `json:"mdmImei"`
	MDMMEID                  string       `json:"mdmMeid"`
	MDMUDID                  string       `json:"mdmUdid"`
	MDMSerialNumber          string       `json:"mdmSerialNumber"`
	MDMLocation              string       `json:"mdmLocation"`
	MDMDeviceManager         string       `json:"mdmDeviceManager"`
	MDMLastSyncTime          string       `json:"mdmLastSyncTime"`
	VirtualNetwork           string       `json:"virtualNetwork"`
}

type SessionDirectory

type SessionDirectory interface {
	PxGridService

	Rest() SessionDirectoryRest

	SessionDirectorySubscriber

	Properties() SessionDirectoryPropsProvider
}

func NewPxGridSessionDirectory

func NewPxGridSessionDirectory(ctrl *PxGridConsumer) SessionDirectory

type SessionDirectoryPropsProvider

type SessionDirectoryPropsProvider interface {
	RestBaseURL() (string, error)
	WSPubsubService() (string, error)
	SessionTopic() (string, error)
	SessionTopicAll() (string, error)
	GroupTopic() (string, error)
}

type SessionDirectoryRest added in v0.6.0

type SessionDirectoryRest interface {
	GetSessions(startTimestamp string, filter any) CallFinalizer[*[]Session]
	GetSessionsForRecovery(startTimestamp, endTimestamp string) CallFinalizer[*[]Session]
	GetSessionByIPAddress(ipAddress string) CallFinalizer[*Session]
	GetSessionByMacAddress(macAddress string) CallFinalizer[*Session]
	GetUserGroups(filter any) CallFinalizer[*[]Group]
	GetUserGroupByUserName(userName string) CallFinalizer[*[]Group]
}

type SessionDirectorySubscriber

type SessionDirectorySubscriber interface {
	OnSessionTopic() Subscriber[SessionTopicMessage]
	OnSessionTopicAll() Subscriber[SessionTopicMessage]
	OnGroupTopic() Subscriber[GroupTopicMessage]
}

type SessionDirectoryTopic

type SessionDirectoryTopic string

type SessionState

type SessionState string

type SessionTopicMessage

type SessionTopicMessage struct {
	Sequence int       `json:"sequence"`
	Sessions []Session `json:"sessions"`
}

type Subscriber

type Subscriber[T any] interface {
	WithServiceNodePicker(picker ServiceNodePickerFactory) Subscriber[T]
	WithPubSubNodePicker(picker ServiceNodePickerFactory) Subscriber[T]
	WithExplicitPubSub(pubsub PubSub) Subscriber[T]
	Subscribe(ctx context.Context) (*Subscription[T], error)
}

type Subscription

type Subscription[T any] struct {
	*stomp.Subscription

	C             chan *Message[T]
	PubSubService string
}

func (*Subscription[T]) Read

func (s *Subscription[T]) Read() (T, error)

type SupportedRESTCallDetails

type SupportedRESTCallDetails struct {
	Name   string   `json:"name"`
	Params []string `json:"params"`
}

type SysHealth

type SysHealth struct {
	Timestamp       string  `json:"timestamp"`
	ServerName      string  `json:"serverName"`
	IOWait          float64 `json:"ioWait"`
	CPUUsage        float64 `json:"cpuUsage"`
	MemoryUsage     float64 `json:"memoryUsage"`
	DiskUsageRoot   float64 `json:"diskUsageRoot"`
	DiskUsageOpt    float64 `json:"diskUsageOpt"`
	LoadAverage     float64 `json:"loadAverage"`
	NetworkSent     float64 `json:"networkSent"`
	NetworkReceived float64 `json:"networkReceived"`
}

type SysPerformance

type SysPerformance struct {
	Timestamp     string  `json:"timestamp"`
	ServerName    string  `json:"serverName"`
	RADIUSRate    float64 `json:"radiusRate"`
	RADIUSCount   float64 `json:"radiusCount"`
	RADIUSLatency float64 `json:"radiusLatency"`
}

type SystemHealth

type SystemHealth interface {
	PxGridService

	Rest() SystemHealthRest

	Properties() SystemHealthPropsProvider
}

func NewPxGridSystemHealth

func NewPxGridSystemHealth(ctrl *PxGridConsumer) SystemHealth

type SystemHealthPropsProvider

type SystemHealthPropsProvider interface {
	RestBaseURL() (string, error)
}

type SystemHealthRest added in v0.6.0

type SystemHealthRest interface {
	GetHealths(nodeName string, startTimestamp string) CallFinalizer[*[]SysHealth]
	GetPerformances(nodeName string, startTimestamp string) CallFinalizer[*[]SysPerformance]
}

type TLSConfig

type TLSConfig struct {
	ClientCertificate *tls.Certificate
	InsecureTLS       bool
	CA                *x509.CertPool
}

type TrustSec

type TrustSec interface {
	PxGridService

	TrustSecSubscriber

	Properties() TrustSecPropsProvider
}

func NewPxGridTrustSec

func NewPxGridTrustSec(ctrl *PxGridConsumer) TrustSec

type TrustSecConfigurationPropsProvider

type TrustSecConfigurationPropsProvider interface {
	RestBaseURL() (string, error)
	WSPubsubService() (string, error)
	SecurityGroupTopic() (string, error)
	SecurityGroupACLTopic() (string, error)
	SecurityGroupVNVlanTopic() (string, error)
	VirtualNetworkTopic() (string, error)
	EgressPolicyTopic() (string, error)
}

type TrustSecConfigurationRequestFilter

type TrustSecConfigurationRequestFilter func(*trustSecConfigurationRequestFilter)

func WithEndTimestamp

func WithEndTimestamp(endTimestamp string) TrustSecConfigurationRequestFilter

func WithRecordCount

func WithRecordCount(recordCount int) TrustSecConfigurationRequestFilter

func WithStartIndex

func WithStartIndex(startIndex int) TrustSecConfigurationRequestFilter

func WithStartTimestamp

func WithStartTimestamp(startTimestamp string) TrustSecConfigurationRequestFilter

type TrustSecConfigurationRest added in v0.6.0

type TrustSecConfigurationRest interface {
	GetSecurityGroups(filters ...TrustSecConfigurationRequestFilter) CallFinalizer[*GetSecurityGroupsResponse]
	GetSecurityGroupACLs(filters ...TrustSecConfigurationRequestFilter) CallFinalizer[*GetSecurityGroupACLsResponse]
	GetVirtualNetwork(filters ...TrustSecConfigurationRequestFilter) CallFinalizer[*GetVirtualNetworksResponse]
	GetEgressPolicies(filters ...TrustSecEgressPoliciesRequestFilter) CallFinalizer[*GetEgressPoliciesResponse]
	GetEgressMatrices() CallFinalizer[*[]EgressMatrix]
}

type TrustSecConfigurationSubscriber

type TrustSecConfigurationSubscriber interface {
	OnSecurityGroupTopic() Subscriber[SecurityGroupTopicMessage]
	OnSecurityGroupACLTopic() Subscriber[SecurityGroupACLTopicMessage]
	OnSecurityGroupVNVlanTopic() Subscriber[SecurityGroupVNVlanTopicMessage]
	OnVirtualNetworkTopic() Subscriber[VirtualNetworkTopicMessage]
	OnEgressPolicyTopic() Subscriber[EgressPolicyTopicMessage]
}

type TrustSecConfigurationTopic

type TrustSecConfigurationTopic string
const (
	TrustSecConfigurationTopicSecurityGroup       TrustSecConfigurationTopic = "securityGroupTopic"
	TrustSecConfigurationTopicSecurityGroupACL    TrustSecConfigurationTopic = "securityGroupAclTopic"
	TrustSecConfigurationTopicSecurityGroupVNVlan TrustSecConfigurationTopic = "securityGroupVnVlanTopic"
	TrustSecConfigurationTopicVirtualNetwork      TrustSecConfigurationTopic = "virtualnetworkTopic"
	TrustSecConfigurationTopicEgressPolicy        TrustSecConfigurationTopic = "egressPolicyTopic"

	TrustSecConfigurationServiceName = "com.cisco.ise.config.trustsec"
)

type TrustSecEgressPoliciesRequestFilter

type TrustSecEgressPoliciesRequestFilter func(*trustSecEgressPoliciesRequestFilter)

func WithEgressPolicyEndTimestamp

func WithEgressPolicyEndTimestamp(endTimestamp string) TrustSecEgressPoliciesRequestFilter

func WithEgressPolicyMatrixID

func WithEgressPolicyMatrixID(matrixID string) TrustSecEgressPoliciesRequestFilter

func WithEgressPolicyRecordCount

func WithEgressPolicyRecordCount(recordCount int) TrustSecEgressPoliciesRequestFilter

func WithEgressPolicyStartIndex

func WithEgressPolicyStartIndex(startIndex int) TrustSecEgressPoliciesRequestFilter

func WithEgressPolicyStartTimestamp

func WithEgressPolicyStartTimestamp(startTimestamp string) TrustSecEgressPoliciesRequestFilter

type TrustSecPropsProvider

type TrustSecPropsProvider interface {
	WSPubsubService() (string, error)
	PolicyDownloadTopic() (string, error)
}

type TrustSecSXP

type TrustSecSXP interface {
	PxGridService

	Rest() TrustSecSXPRest

	TrustSecSXPSubscriber

	Properties() TrustSecSXPPropsProvider
}

func NewPxGridTrustSecSXP

func NewPxGridTrustSecSXP(ctrl *PxGridConsumer) TrustSecSXP

type TrustSecSXPBinding

type TrustSecSXPBinding struct {
	Tag          string `json:"tag"`
	IPPrefix     string `json:"ipPrefix"`
	Source       string `json:"source"`
	PeerSequence string `json:"peerSequence"`
	VPN          string `json:"vpn"`
}

type TrustSecSXPBindingTopicMessage

type TrustSecSXPBindingTopicMessage struct {
	OperationType OperationType      `json:"operation"`
	Binding       TrustSecSXPBinding `json:"binding"`
}

type TrustSecSXPPropsProvider

type TrustSecSXPPropsProvider interface {
	RestBaseURL() (string, error)
	WSPubsubService() (string, error)
	BindingTopic() (string, error)
}

type TrustSecSXPRest added in v0.6.0

type TrustSecSXPRest interface {
	GetBindings(filter any) CallFinalizer[*[]TrustSecSXPBinding]
}

type TrustSecSXPSubscriber

type TrustSecSXPSubscriber interface {
	OnBindingTopic() Subscriber[TrustSecSXPBindingTopicMessage]
}

type TrustSecSXPTopic

type TrustSecSXPTopic string
const (
	TrustSecSXPTopicBinding TrustSecSXPTopic = "bindingTopic"

	TrustSecSXPServiceName = "com.cisco.ise.sxp"
)

type TrustSecSubscriber

type TrustSecSubscriber interface {
	OnPolicyDownloadTopic() Subscriber[PolicyDownloadTopicMessage]
}

type TrustSecTopic

type TrustSecTopic string

type VirtualNetwork

type VirtualNetwork struct {
	ID                   string `json:"id"`
	Name                 string `json:"name"`
	AdditionalAttributes string `json:"additionalAttributes"`
	Timestamp            string `json:"timestamp"`
}

type VirtualNetworkTopicMessage

type VirtualNetworkTopicMessage struct {
	ID                   string `json:"id"`
	Name                 string `json:"name"`
	AdditionalAttributes string `json:"additionalAttributes"`
	Sequence             int    `json:"sequence"`
	Deleted              bool   `json:"deleted"`
	Timestamp            string `json:"timestamp"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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