hoststore

package
v1.33.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	UI   = Source("UI")
	SCAN = Source("SCAN")
)

Source constants

View Source
const (
	SSH = Scheme("SSH")
	RDP = Scheme("RDP")
	VNC = Scheme("VNC")
	WEB = Scheme("WEB")
	DB  = Scheme("DB")
)

Scheme constants, all supported protocols

View Source
const (
	DBProtocolPostgres    = HostServiceDBProtocol("postgres")
	DBProtocolMySQL       = HostServiceDBProtocol("mysql")
	DBProtocolPassthrough = HostServiceDBProtocol("passthrough")
	DBProtocolTLS         = HostServiceDBProtocol("tls")
)

DB protocols constants, all supported protocols

View Source
const (
	DBCertificateValidationEnabled  = HostServiceDBCertificateValidation("ENABLED")
	DBCertificateValidationDisabled = HostServiceDBCertificateValidation("DISABLED")
)

DBCertificateValidation Constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address string

Address is fully qualified domain names, IPv4 or IPv6 addresses of the host

type DBService added in v1.30.0

type DBService struct {
	MaxBytesUpload   int64 `json:"max_bytes_upload"`
	MaxBytesDownload int64 `json:"max_bytes_download"`
}

type DefaultServiceOptions added in v0.6.0

type DefaultServiceOptions struct {
	SSH SSHService `json:"ssh"`
	RDP RDPService `json:"rdp"`
	Web WebService `json:"web"`
	VNC VNCService `json:"vnc"`
	DB  DBService  `json:"db"`
}

DefaultServiceOptions default service options

type Host

type Host struct {
	ID                      string                   `json:"id,omitempty"`
	AccessGroupID           string                   `json:"access_group_id,omitempty"`
	ExternalID              string                   `json:"external_id,omitempty"`
	InstanceID              string                   `json:"instance_id,omitempty"`
	SourceID                string                   `json:"source_id,omitempty"`
	Name                    string                   `json:"common_name,omitempty"`
	ContactAdress           string                   `json:"contact_address,omitempty"`
	CloudProvider           string                   `json:"cloud_provider,omitempty"`
	CloudProviderRegion     string                   `json:"cloud_provider_region,omitempty"`
	Created                 string                   `json:"created,omitempty"`
	Updated                 string                   `json:"updated,omitempty"`
	UpdatedBy               string                   `json:"updated_by,omitempty"`
	DistinguishedName       string                   `json:"distinguished_name,omitempty"`
	Organization            string                   `json:"organization,omitempty"`
	OrganizationUnit        string                   `json:"organizational_unit,omitempty"`
	Zone                    string                   `json:"zone,omitempty"`
	HostType                string                   `json:"host_type,omitempty"`
	HostClassification      string                   `json:"host_classification,omitempty"`
	Comment                 string                   `json:"comment,omitempty"`
	Disabled                string                   `json:"disabled,omitempty"`
	Deployable              bool                     `json:"deployable,omitempty"`
	Tofu                    bool                     `json:"tofu,omitempty"`
	StandAlone              bool                     `json:"stand_alone_host,omitempty"`
	Audit                   bool                     `json:"audit_enabled,omitempty"`
	Scope                   []string                 `json:"scope,omitempty"`
	Tags                    []string                 `json:"tags,omitempty"`
	Addresses               []Address                `json:"addresses,omitempty"`
	Services                []Service                `json:"services,omitempty"`
	Principals              []Principal              `json:"principals,omitempty"`
	PublicKeys              []SSHPublicKey           `json:"ssh_host_public_keys,omitempty"`
	Status                  []Status                 `json:"status,omitempty"`
	SessionRecordingOptions *SessionRecordingOptions `json:"session_recording_options,omitempty"`
}

Host defines PrivX target

type HostDisabledRequest added in v0.6.0

type HostDisabledRequest struct {
	Disabled bool `json:"disabled"`
}

HostDisabledRequest host disabled request definition

type HostSearchObject added in v0.6.0

type HostSearchObject struct {
	ID                    string   `json:"id,omitempty"`
	Keywords              string   `json:"keywords,omitempty"`
	ExternalID            string   `json:"external_id,omitempty"`
	InstanceID            string   `json:"instance_id,omitempty"`
	SourceID              string   `json:"source_id,omitempty"`
	Disabled              string   `json:"disabled,omitempty"`
	Deployable            bool     `json:"deployable,omitempty"`
	IgnoreDisabledSources bool     `json:"ignore_disabled_sources,omitempty"`
	Port                  []int    `json:"port,omitempty"`
	CommonName            []string `json:"common_name,omitempty"`
	Organization          []string `json:"organization,omitempty"`
	OrganizationalUnit    []string `json:"organizational_unit,omitempty"`
	Address               []string `json:"address,omitempty"`
	Service               []string `json:"service,omitempty"`
	Zone                  []string `json:"zone,omitempty"`
	HostType              []string `json:"host_type,omitempty"`
	HostClassification    []string `json:"host_classification,omitempty"`
	Role                  []string `json:"role,omitempty"`
	Scope                 []string `json:"scope,omitempty"`
	Tags                  []string `json:"tags,omitempty"`
	AccessGroupIDs        []string `json:"access_group_ids,omitempty"`
	CloudProviders        []string `json:"cloud_providers,omitempty"`
	CloudProviderRegions  []string `json:"cloud_provider_regions,omitempty"`
	Statuses              []string `json:"statuses,omitempty"`
	DistinguishedName     []string `json:"distinguished_name,omitempty"`
}

HostSearchObject host search object definition

type HostServiceDBCertificateValidation added in v1.30.0

type HostServiceDBCertificateValidation string

DBCertificateValidation of HostServiceDBParameters objects

type HostServiceDBParameters added in v1.30.0

type HostServiceDBParameters struct {
	Protocol                   HostServiceDBProtocol              `json:"protocol"`
	TLSCertificateValidation   HostServiceDBCertificateValidation `json:"tls_certificate_validation"`
	TLSCertificateTrustAnchors string                             `json:"tls_certificate_trust_anchors"`
	AuditSkipBytes             int64                              `json:"audit_skip_bytes"`
}

type HostServiceDBProtocol added in v1.30.0

type HostServiceDBProtocol string

DB protocols allowed by the host

type HostStore

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

HostStore is a role-store client instance.

func New

func New(api restapi.Connector) *HostStore

New creates a new host-store client instance See http://apispecs.ssh.com/#swagger-ui-4 for details about api

func (*HostStore) CreateHost added in v0.6.0

func (store *HostStore) CreateHost(host Host) (string, error)

CreateHost create a host to host store

func (*HostStore) DeleteHost added in v0.6.0

func (store *HostStore) DeleteHost(hostID string) error

DeleteHost delete a host

func (*HostStore) Host added in v0.6.0

func (store *HostStore) Host(hostID string) (*Host, error)

Host returns existing single host

func (*HostStore) HostTags added in v0.6.0

func (store *HostStore) HostTags(offset, limit int, sortdir, query string) ([]string, error)

HostTags returns host tags

func (*HostStore) Hosts added in v0.6.0

func (store *HostStore) Hosts(offset, limit int, sortkey, sortdir, filter string) ([]Host, error)

Hosts returns existing hosts

func (*HostStore) ResolveHost added in v0.6.0

func (store *HostStore) ResolveHost(service Service) (*Host, error)

ResolveHost resolve service and address to a single host in host store

func (*HostStore) SearchHost added in v0.6.0

func (store *HostStore) SearchHost(sortkey, sortdir, filter string, offset, limit int, searchObject *HostSearchObject) ([]Host, error)

SearchHost search for existing hosts

func (*HostStore) ServiceOptions added in v0.6.0

func (store *HostStore) ServiceOptions() (*DefaultServiceOptions, error)

ServiceOptions returns default serivce options

func (*HostStore) UpdateDeployStatus added in v0.6.0

func (store *HostStore) UpdateDeployStatus(hostID string, status bool) error

UpdateDeployStatus update host to be deployable or undeployable

func (*HostStore) UpdateDisabledHostStatus added in v0.6.0

func (store *HostStore) UpdateDisabledHostStatus(hostID string, status bool) error

UpdateDisabledHostStatus enable/disable host

func (*HostStore) UpdateHost added in v0.6.0

func (store *HostStore) UpdateHost(hostID string, host *Host) error

UpdateHost update existing host

type Params added in v0.6.0

type Params struct {
	Offset  int    `json:"offset,omitempty"`
	Limit   int    `json:"limit,omitempty"`
	Sortdir string `json:"sortdir,omitempty"`
	Sortkey string `json:"sortkey,omitempty"`
	Filter  string `json:"filter,omitempty"`
	Query   string `json:"query,omitempty"`
}

Params struct for pagination queries

type Principal

type Principal struct {
	ID             string              `json:"principal"`
	Roles          []rolestore.RoleRef `json:"roles"`
	Source         Source              `json:"source"`
	UseUserAccount bool                `json:"use_user_account"`
	Passphrase     string              `json:"passphrase"`
	Applications   []string            `json:"applications"`
}

Principal of the target host

func NewPrincipal

func NewPrincipal(id string, role ...rolestore.RoleRef) Principal

NewPrincipal creates a corresponding definition from roles

type RDPService added in v0.6.0

type RDPService struct {
	FileTransfer bool `json:"file_transfer"`
	Audio        bool `json:"audio"`
	Clipboard    bool `json:"clipboard"`
}

RDPService default options

type SSHPublicKey added in v0.6.0

type SSHPublicKey struct {
	Key         string `json:"key,omitempty"`
	Fingerprint string `json:"fingerprint,omitempty"`
}

SSHPublicKey host public keys

type SSHService added in v0.6.0

type SSHService struct {
	Shell        bool `json:"shell"`
	FileTransfer bool `json:"file_transfer"`
	Exec         bool `json:"exec"`
	Tunnels      bool `json:"tunnels"`
	Xeleven      bool `json:"x11"`
	Other        bool `json:"other"`
}

SSHService default options

type Scheme

type Scheme string

Scheme of protocols allowed by the host

func (Scheme) Service

func (scheme Scheme) Service(addr Address, port int) Service

Service creates a corresponding service definition

hosts.SSH.Service(...)

type Service

type Service struct {
	Scheme  Scheme                  `json:"service"`
	Address Address                 `json:"address"`
	Port    int                     `json:"port"`
	DB      HostServiceDBParameters `json:"db"`
	Source  Source                  `json:"source"`
}

Service specify the service available on target host

type SessionRecordingOptions added in v1.32.0

type SessionRecordingOptions struct {
	DisableClipboardRecording    bool `json:"disable_clipboard_recording"`
	DisableFileTransferRecording bool `json:"disable_file_transfer_recording"`
}

SessionRecordingOptions optional host options to disable session recording per feature

type Source

type Source string

Source of host objects

type Status added in v0.6.0

type Status struct {
	K string `json:"k,omitempty"`
	V string `json:"v,omitempty"`
}

Status of the secret object

type VNCService added in v1.30.0

type VNCService struct {
	FileTransfer bool `json:"file_transfer"`
	Clipboard    bool `json:"clipboard"`
}

type WebService added in v0.6.0

type WebService struct {
	FileTransfer bool `json:"file_transfer"`
	Audio        bool `json:"audio"`
	Clipboard    bool `json:"clipboard"`
}

WebService default options

Jump to

Keyboard shortcuts

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