service

package
v0.0.0-...-5c79d48 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 144 Imported by: 0

Documentation

Overview

Package service implements teleport running service, takes care of initialization, cleanup and shutdown procedures

Index

Constants

View Source
const (
	// AuthIdentityEvent is generated when the Auth Servers identity has been
	// initialized in the backend.
	AuthIdentityEvent = "AuthIdentity"

	// InstanceIdentityEvent is generated by the supervisor when the instance-level
	// identity has been registered with the Auth server.
	InstanceIdentityEvent = "InstanceIdentity"

	// ProxyIdentityEvent is generated by the supervisor when the proxy's
	// identity has been registered with the Auth Server.
	ProxyIdentityEvent = "ProxyIdentity"

	// SSHIdentityEvent is generated when node's identity has been registered
	// with the Auth Server.
	SSHIdentityEvent = "SSHIdentity"

	// KubeIdentityEvent is generated by the supervisor when the kubernetes
	// service's identity has been registered with the Auth Server.
	KubeIdentityEvent = "KubeIdentity"

	// AppsIdentityEvent is generated when the identity of the application proxy
	// service has been registered with the Auth Server.
	AppsIdentityEvent = "AppsIdentity"

	// DatabasesIdentityEvent is generated when the identity of the database
	// proxy service has been registered with the auth server.
	DatabasesIdentityEvent = "DatabasesIdentity"

	// WindowsDesktopIdentityEvent is generated by the supervisor when the
	// windows desktop service's identity has been registered with the Auth
	// Server.
	WindowsDesktopIdentityEvent = "WindowsDesktopIdentity"

	// DiscoveryIdentityEvent is generated when the identity of the
	DiscoveryIdentityEvent = "DiscoveryIdentityEvent"

	// AuthTLSReady is generated when the Auth Server has initialized the
	// TLS Mutual Auth endpoint and is ready to start accepting connections.
	AuthTLSReady = "AuthTLSReady"

	// ProxyWebServerReady is generated when the proxy has initialized the web
	// server and is ready to start accepting connections.
	ProxyWebServerReady = "ProxyWebServerReady"

	// ProxyReverseTunnelReady is generated when the proxy has initialized the
	// reverse tunnel server and is ready to start accepting connections.
	ProxyReverseTunnelReady = "ProxyReverseTunnelReady"

	// DebugAppReady is generated when the debugging application has been started
	// and is ready to serve requests.
	DebugAppReady = "DebugAppReady"

	// ProxyAgentPoolReady is generated when the proxy has initialized the
	// remote cluster watcher (to spawn reverse tunnels) and is ready to start
	// accepting connections.
	ProxyAgentPoolReady = "ProxyAgentPoolReady"

	// ProxySSHReady is generated when the proxy has initialized a SSH server
	// and is ready to start accepting connections.
	ProxySSHReady = "ProxySSHReady"

	// NodeSSHReady is generated when the Teleport node has initialized a SSH server
	// and is ready to start accepting SSH connections.
	NodeSSHReady = "NodeReady"

	// KubernetesReady is generated when the kubernetes service has been initialized.
	KubernetesReady = "KubernetesReady"

	// AppsReady is generated when the Teleport app proxy service is ready to
	// start accepting connections.
	AppsReady = "AppsReady"

	// DatabasesReady is generated when the Teleport database proxy service
	// is ready to start accepting connections.
	DatabasesReady = "DatabasesReady"

	// MetricsReady is generated when the Teleport metrics service is ready to
	// start accepting connections.
	MetricsReady = "MetricsReady"

	// WindowsDesktopReady is generated when the Teleport windows desktop
	// service is ready to start accepting connections.
	WindowsDesktopReady = "WindowsDesktopReady"

	// TracingReady is generated when the Teleport tracing service is ready to
	// start exporting spans.
	TracingReady = "TracingReady"

	// InstanceReady is generated when the teleport instance control handle has
	// been set up.
	InstanceReady = "InstanceReady"

	// DiscoveryReady is generated when the Teleport discovery service
	// is ready to start accepting connections.
	DiscoveryReady = "DiscoveryReady"

	// TeleportExitEvent is generated when the Teleport process begins closing
	// all listening sockets and exiting.
	TeleportExitEvent = "TeleportExit"

	// TeleportReloadEvent is generated to trigger in-process teleport
	// service reload - all servers and clients will be re-created
	// in a graceful way.
	TeleportReloadEvent = "TeleportReload"

	// TeleportPhaseChangeEvent is generated to indidate that teleport
	// CA rotation phase has been updated, used in tests
	TeleportPhaseChangeEvent = "TeleportPhaseChange"

	// TeleportReadyEvent is generated to signal that all teleport
	// internal components have started successfully.
	TeleportReadyEvent = "TeleportReady"

	// ServiceExitedWithErrorEvent is emitted whenever a service
	// has exited with an error, the payload includes the error
	ServiceExitedWithErrorEvent = "ServiceExitedWithError"

	// TeleportDegradedEvent is emitted whenever a service is operating in a
	// degraded manner.
	TeleportDegradedEvent = "TeleportDegraded"

	// TeleportOKEvent is emitted whenever a service is operating normally.
	TeleportOKEvent = "TeleportOKEvent"
)

Variables

View Source
var (
	ListenerAuth       = ListenerType(teleport.ComponentAuth)
	ListenerNodeSSH    = ListenerType(teleport.ComponentNode)
	ListenerProxySSH   = ListenerType(teleport.Component(teleport.ComponentProxy, "ssh"))
	ListenerDiagnostic = ListenerType(teleport.ComponentDiagnostic)
	ListenerProxyKube  = ListenerType(teleport.Component(teleport.ComponentProxy, "kube"))
	ListenerKube       = ListenerType(teleport.ComponentKube)
	// Proxy can use the same listener for tunnels and web interface
	// (multiplexing the requests).
	ListenerProxyTunnelAndWeb = ListenerType(teleport.Component(teleport.ComponentProxy, "tunnel", "web"))
	ListenerProxyWeb          = ListenerType(teleport.Component(teleport.ComponentProxy, "web"))
	ListenerProxyTunnel       = ListenerType(teleport.Component(teleport.ComponentProxy, "tunnel"))
	ListenerProxyMySQL        = ListenerType(teleport.Component(teleport.ComponentProxy, "mysql"))
	ListenerProxyPostgres     = ListenerType(teleport.Component(teleport.ComponentProxy, "postgres"))
	ListenerProxyMongo        = ListenerType(teleport.Component(teleport.ComponentProxy, "mongo"))
	ListenerProxyPeer         = ListenerType(teleport.Component(teleport.ComponentProxy, "peer"))
	ListenerMetrics           = ListenerType(teleport.ComponentMetrics)
	ListenerWindowsDesktop    = ListenerType(teleport.ComponentWindowsDesktop)
)
View Source
var ErrTeleportExited = &trace.CompareFailedError{Message: "teleport process has shutdown"}

ErrTeleportExited means that teleport has exited

View Source
var ErrTeleportReloading = &trace.CompareFailedError{Message: "teleport process is reloading"}

ErrTeleportReloading is returned when signal waiter exits because the teleport process has initiaded shutdown

Functions

func Run

func Run(ctx context.Context, cfg servicecfg.Config, newTeleport NewProcess) error

Run starts teleport processes, waits for signals and handles internal process reloads.

Types

type AWSOIDCDeployServiceUpdater

type AWSOIDCDeployServiceUpdater struct {
	AWSOIDCDeployServiceUpdaterConfig
}

AWSOIDCDeployServiceUpdater periodically updates AWS OIDC deploy service

func NewDeployServiceUpdater

func NewDeployServiceUpdater(config AWSOIDCDeployServiceUpdaterConfig) (*AWSOIDCDeployServiceUpdater, error)

NewAWSOIDCDeployServiceUpdater returns a new AWSOIDCDeployServiceUpdater

func (*AWSOIDCDeployServiceUpdater) Run

Run periodically updates the AWS OIDC deploy service

type AWSOIDCDeployServiceUpdaterConfig

type AWSOIDCDeployServiceUpdaterConfig struct {
	// Log is the logger
	Log *logrus.Entry
	// AuthClient is the auth api client
	AuthClient *auth.Client
	// Clock is the local clock
	Clock clockwork.Clock
	// TeleportClusterName specifies the teleport cluster name
	TeleportClusterName string
	// TeleportClusterVersion specifies the teleport cluster version
	TeleportClusterVersion string
	// UpgradeChannel is the channel that serves the version used by the updater.
	UpgradeChannel *automaticupgrades.Channel
}

AWSOIDCDeployServiceUpdaterConfig specifies updater configs

func (*AWSOIDCDeployServiceUpdaterConfig) CheckAndSetDefaults

func (cfg *AWSOIDCDeployServiceUpdaterConfig) CheckAndSetDefaults() error

CheckAndSetDefaults checks and sets default config values.

type CertReloader

type CertReloader struct {
	*log.Entry
	// contains filtered or unexported fields
}

CertReloader periodically reloads a list of cert key-pair paths. This allows new certificates to be used without a full reload of Teleport.

func NewCertReloader

func NewCertReloader(cfg CertReloaderConfig) *CertReloader

NewCertReloader initializes a new certificate reloader.

func (*CertReloader) GetCertificate

func (c *CertReloader) GetCertificate(clientHello *tls.ClientHelloInfo) (*tls.Certificate, error)

GetCertificate is compatible with tls.Config.GetCertificate, allowing the CertReloader to be a source of certificates for a TLS listener. Certificate selection logic is the same as getCertificate in crypto/tls: https://github.com/golang/go/tree/f64c2a2ce5dc859315047184e310879dcf747d53/src/crypto/tls/common.go#L1075-L1117

func (*CertReloader) Run

func (c *CertReloader) Run(ctx context.Context) error

Run tries to load certificates and then spawns the certificate reloader.

type CertReloaderConfig

type CertReloaderConfig struct {
	// KeyPairs are the key and certificate pairs that the proxy will load.
	KeyPairs []servicecfg.KeyPairPath
	// KeyPairsReloadInterval is the interval between attempts to reload
	// x509 key pairs. If set to 0, then periodic reloading is disabled.
	KeyPairsReloadInterval time.Duration
}

CertReloaderConfig contains the configuration of the certificate reloader.

type Connector

type Connector struct {
	// ClientIdentity is the identity to be used in internal cluster
	// clients to the auth service.
	ClientIdentity *auth.Identity

	// ServerIdentity is the identity to be used in servers - serving SSH
	// and x509 certificates to clients.
	ServerIdentity *auth.Identity

	// Client is authenticated client with credentials from ClientIdentity.
	Client *auth.Client

	// ReusedClient, if true, indicates that the client reference is owned by
	// a different connector and should not be closed.
	ReusedClient bool
}

Connector has all resources process needs to connect to other parts of the cluster: client and identity.

func (*Connector) Close

func (c *Connector) Close() error

Close closes resources associated with connector

func (*Connector) TunnelProxyResolver

func (c *Connector) TunnelProxyResolver() reversetunnelclient.Resolver

TunnelProxyResolver if non-nil, indicates that the client is connected to the Auth Server through the reverse SSH tunnel proxy

func (*Connector) UseTunnel

func (c *Connector) UseTunnel() bool

UseTunnel indicates if the client is connected directly to the Auth Server (false) or through the proxy (true).

type Event

type Event struct {
	Name    string
	Payload interface{}
}

Event is a special service event that can be generated by various goroutines in the supervisor

func (*Event) String

func (e *Event) String() string

type EventMapping

type EventMapping struct {
	// In is the incoming event sequence.
	In []string
	// Out is the outbound event to generate.
	Out string
}

EventMapping maps a sequence of incoming events and if triggered, generates an out event.

func (EventMapping) String

func (e EventMapping) String() string

String returns user-friendly representation of the mapping.

type ExitEventPayload

type ExitEventPayload struct {
	// Service is the service that exited
	Service Service
	// Error is the error of the service exit
	Error error
}

ExitEventPayload contains information about service name, and service error if it exited with error

type Func

type Func func() error

Func is a service function

type KeyPair

type KeyPair struct {
	// PrivateKey is a private key in PEM format
	PrivateKey []byte
	// PublicSSHKey is a public key in SSH format
	PublicSSHKey []byte
	// PublicTLSKey is a public key in X509 format
	PublicTLSKey []byte
}

KeyPair is a private/public key pair

type ListenerType

type ListenerType string

ListenerType identifies different registered listeners in process.registeredListeners.

type LocalService

type LocalService struct {
	// Function is a function to call
	Function Func
	// ServiceName is a service name
	ServiceName string
	// Critical is set to true
	// when the service is critical and program can't continue
	// without it
	Critical bool
}

LocalService is a locally defined service

func (*LocalService) IsCritical

func (l *LocalService) IsCritical() bool

IsCritical returns true if the service is critical and program can't continue without it

func (*LocalService) Name

func (l *LocalService) Name() string

Name returns unique service name

func (*LocalService) Serve

func (l *LocalService) Serve() error

Serve starts the function

func (*LocalService) String

func (l *LocalService) String() string

String returns user-friendly service name

type LocalSupervisor

type LocalSupervisor struct {
	sync.Mutex
	// contains filtered or unexported fields
}

LocalSupervisor is a Teleport's implementation of the Supervisor interface.

func (*LocalSupervisor) BroadcastEvent

func (s *LocalSupervisor) BroadcastEvent(event Event)

BroadcastEvent generates event and broadcasts it to all subscribed parties.

func (*LocalSupervisor) ExitContext

func (s *LocalSupervisor) ExitContext() context.Context

ExitContext returns context that will be closed when a hard TeleportExitEvent is broadcasted.

func (*LocalSupervisor) GracefulExitContext

func (s *LocalSupervisor) GracefulExitContext() context.Context

GracefulExitContext returns context that will be closed when a hard or graceful TeleportExitEvent is broadcasted.

func (*LocalSupervisor) ListenForEvents

func (s *LocalSupervisor) ListenForEvents(ctx context.Context, name string, eventC chan<- Event)

func (*LocalSupervisor) Register

func (s *LocalSupervisor) Register(srv Service)

func (*LocalSupervisor) RegisterCriticalFunc

func (s *LocalSupervisor) RegisterCriticalFunc(name string, fn Func)

RegisterCriticalFunc creates a critical service from function spec and registers it within the system, if this service exits with error, the process shuts down.

func (*LocalSupervisor) RegisterEventMapping

func (s *LocalSupervisor) RegisterEventMapping(m EventMapping)

RegisterEventMapping registers event mapping - when the sequence in the event mapping triggers, the outbound event will be generated.

func (*LocalSupervisor) RegisterFunc

func (s *LocalSupervisor) RegisterFunc(name string, fn Func)

RegisterFunc creates a service from function spec and registers it within the system

func (*LocalSupervisor) ReloadContext

func (s *LocalSupervisor) ReloadContext() context.Context

ReloadContext returns context that will be closed when TeleportReloadEvent is broadcasted.

func (*LocalSupervisor) RemoveService

func (s *LocalSupervisor) RemoveService(srv Service) error

RemoveService removes service from supervisor tracking list

func (*LocalSupervisor) Run

func (s *LocalSupervisor) Run() error

func (*LocalSupervisor) ServiceCount

func (s *LocalSupervisor) ServiceCount() int

ServiceCount returns the number of registered and actively running services

func (*LocalSupervisor) Services

func (s *LocalSupervisor) Services() []string

func (*LocalSupervisor) Start

func (s *LocalSupervisor) Start() error

func (*LocalSupervisor) Wait

func (s *LocalSupervisor) Wait() error

func (*LocalSupervisor) WaitForEvent

func (s *LocalSupervisor) WaitForEvent(ctx context.Context, name string) (Event, error)

func (*LocalSupervisor) WaitForEventTimeout

func (s *LocalSupervisor) WaitForEventTimeout(timeout time.Duration, name string) (Event, error)

type NewProcess

type NewProcess func(cfg *servicecfg.Config) (Process, error)

NewProcess is a function that creates new teleport from config

type Process

type Process interface {
	// Closer closes all resources used by the process
	io.Closer
	// Start starts the process in a non-blocking way
	Start() error
	// WaitForSignals waits for and handles system process signals.
	WaitForSignals(context.Context) error
	// ExportFileDescriptors exports service listeners
	// file descriptors used by the process.
	ExportFileDescriptors() ([]*servicecfg.FileDescriptor, error)
	// Shutdown starts graceful shutdown of the process,
	// blocks until all resources are freed and go-routines are
	// shut down.
	Shutdown(context.Context)
	// WaitForEvent waits for one event with the specified name (returns the
	// latest such event if at least one has been broadcasted already, ignoring
	// the context). Returns an error if the context is canceled before an event
	// is received.
	WaitForEvent(ctx context.Context, name string) (Event, error)
	// WaitWithContext waits for the service to stop. This is a blocking
	// function.
	WaitWithContext(ctx context.Context)
}

Process is a interface for processes

type Service

type Service interface {
	// Serve starts the function
	Serve() error
	// String returns user-friendly description of service
	String() string
	// Name returns service name
	Name() string
	// IsCritical returns true if the service is critical
	// and program can't continue without it
	IsCritical() bool
}

Service is a running teleport service function

type Supervisor

type Supervisor interface {
	// Register adds the service to the pool, if supervisor is in
	// the started state, the service will be started immediately
	// otherwise, it will be started after Start() has been called
	Register(srv Service)

	// RegisterFunc creates a service from function spec and registers
	// it within the system
	RegisterFunc(name string, fn Func)

	// RegisterCriticalFunc creates a critical service from function spec and registers
	// it within the system, if this service exits with error,
	// the process shuts down.
	RegisterCriticalFunc(name string, fn Func)

	// ServiceCount returns the number of registered and actively running
	// services
	ServiceCount() int

	// Start starts all unstarted services
	Start() error

	// Wait waits until all services exit
	Wait() error

	// Run starts and waits for the service to complete
	// it's a combinatioin Start() and Wait()
	Run() error

	// Services returns list of running services
	Services() []string

	// BroadcastEvent generates event and broadcasts it to all
	// subscribed parties.
	BroadcastEvent(Event)

	// WaitForEvent waits for one event with the specified name (returns the
	// latest such event if at least one has been broadcasted already, ignoring
	// the context). Returns an error if the context is canceled before an event
	// is received.
	WaitForEvent(ctx context.Context, name string) (Event, error)

	// WaitForEventTimeout waits for one event with the specified name (returns the
	// latest such event if at least one has been broadcasted already). Returns
	// an error if the timeout triggers before an event is received.
	WaitForEventTimeout(timeout time.Duration, name string) (Event, error)

	// ListenForEvents arranges for eventC to receive events with the specified
	// name; if the event was already broadcasted, eventC will receive the latest
	// value immediately. The broadcasting will stop when the context is done.
	ListenForEvents(ctx context.Context, name string, eventC chan<- Event)

	// RegisterEventMapping registers event mapping -
	// when the sequence in the event mapping triggers, the
	// outbound event will be generated.
	RegisterEventMapping(EventMapping)

	// ExitContext returns context that will be closed when
	// a hard TeleportExitEvent is broadcasted.
	ExitContext() context.Context

	// GracefulExitContext returns context that will be closed when
	// a graceful or hard TeleportExitEvent is broadcast.
	GracefulExitContext() context.Context

	// ReloadContext returns context that will be closed when
	// TeleportReloadEvent is broadcasted.
	ReloadContext() context.Context
}

Supervisor implements the simple service logic - registering service functions and de-registering the service goroutines

func NewSupervisor

func NewSupervisor(id string, parentLog logrus.FieldLogger) Supervisor

NewSupervisor returns new instance of initialized supervisor

type TeleportProcess

type TeleportProcess struct {
	Clock clockwork.Clock
	sync.Mutex
	Supervisor
	Config *servicecfg.Config

	// PluginsRegistry handles plugin registrations with Teleport services
	PluginRegistry plugin.Registry

	// identities of this process (credentials to auth sever, basically)
	Identities map[types.SystemRole]*auth.Identity

	// TracingProvider is the provider to be used for exporting traces. In the event
	// that tracing is disabled this will be a no-op provider that drops all spans.
	TracingProvider *tracing.Provider

	// SSHD is used to execute commands to update or validate OpenSSH config.
	SSHD openssh.SSHD
	// contains filtered or unexported fields
}

TeleportProcess structure holds the state of the Teleport daemon, controlling execution and configuration of the teleport services: ssh, auth and proxy.

func NewTeleport

func NewTeleport(cfg *servicecfg.Config) (*TeleportProcess, error)

NewTeleport takes the daemon configuration, instantiates all required services and starts them under a supervisor, returning the supervisor object.

func (*TeleportProcess) AuthAddr

func (process *TeleportProcess) AuthAddr() (*utils.NetAddr, error)

AuthAddr returns auth server endpoint, if configured and started.

func (*TeleportProcess) Close

func (process *TeleportProcess) Close() error

Close broadcasts close signals and exits immediately

func (*TeleportProcess) DiagnosticAddr

func (process *TeleportProcess) DiagnosticAddr() (*utils.NetAddr, error)

DiagnosticAddr returns the diagnostic endpoint, if configured and started.

func (*TeleportProcess) ExportFileDescriptors

func (process *TeleportProcess) ExportFileDescriptors() ([]*servicecfg.FileDescriptor, error)

ExportFileDescriptors exports file descriptors to be passed to child process

func (*TeleportProcess) GetAuditLog

func (process *TeleportProcess) GetAuditLog() events.AuditLogSessionStreamer

GetAuditLog returns the process' audit log

func (*TeleportProcess) GetAuthServer

func (process *TeleportProcess) GetAuthServer() *auth.Server

GetAuthServer returns the process' auth server

func (*TeleportProcess) GetBackend

func (process *TeleportProcess) GetBackend() backend.Backend

GetBackend returns the process' backend

func (*TeleportProcess) GetID

func (process *TeleportProcess) GetID() string

GetID returns the process ID.

func (*TeleportProcess) GetIdentity

func (process *TeleportProcess) GetIdentity(role types.SystemRole) (i *auth.Identity, err error)

GetIdentity returns the process identity (credentials to the auth server) for a given teleport Role. A teleport process can have any combination of 3 roles: auth, node, proxy and they have their own identities

func (*TeleportProcess) GetRotation

func (process *TeleportProcess) GetRotation(role types.SystemRole) (*types.Rotation, error)

GetRotation returns the process rotation.

func (*TeleportProcess) NewAsyncEmitter

func (process *TeleportProcess) NewAsyncEmitter(clt apievents.Emitter) (*events.AsyncEmitter, error)

NewAsyncEmitter wraps client and returns emitter that never blocks, logs some events and checks values. It is caller's responsibility to call Close on the emitter once done.

func (*TeleportProcess) NewLocalCache

func (process *TeleportProcess) NewLocalCache(clt auth.ClientI, setupConfig cache.SetupConfigFn, cacheName []string) (*cache.Cache, error)

NewLocalCache returns new instance of access point

func (*TeleportProcess) NodeSSHAddr

func (process *TeleportProcess) NodeSSHAddr() (*utils.NetAddr, error)

NodeSSHAddr returns the node SSH endpoint, if configured and started.

func (*TeleportProcess) OnExit

func (process *TeleportProcess) OnExit(serviceName string, callback func(interface{}))

OnExit allows individual services to register a callback function which will be called when Teleport Process is asked to exit. Usually services terminate themselves when the callback is called

func (*TeleportProcess) OnHeartbeat

func (process *TeleportProcess) OnHeartbeat(component string) func(err error)

OnHeartbeat generates the default OnHeartbeat callback for the specified component.

func (*TeleportProcess) ProxyKubeAddr

func (process *TeleportProcess) ProxyKubeAddr() (*utils.NetAddr, error)

ProxyKubeAddr returns the proxy kubernetes endpoint, if configured and started.

func (*TeleportProcess) ProxyPeerAddr

func (process *TeleportProcess) ProxyPeerAddr() (*utils.NetAddr, error)

ProxyTunnelAddr returns the proxy peer address, if configured and started.

func (*TeleportProcess) ProxySSHAddr

func (process *TeleportProcess) ProxySSHAddr() (*utils.NetAddr, error)

ProxySSHAddr returns the proxy SSH endpoint, if configured and started.

func (*TeleportProcess) ProxyTunnelAddr

func (process *TeleportProcess) ProxyTunnelAddr() (*utils.NetAddr, error)

ProxyTunnelAddr returns the proxy reverse tunnel endpoint, if configured and started.

func (*TeleportProcess) ProxyWebAddr

func (process *TeleportProcess) ProxyWebAddr() (*utils.NetAddr, error)

ProxyWebAddr returns the proxy web interface endpoint, if configured and started.

func (*TeleportProcess) RegisterWithAuthServer

func (process *TeleportProcess) RegisterWithAuthServer(role types.SystemRole, eventName string)

RegisterWithAuthServer uses one time provisioning token obtained earlier from the server to get a pair of SSH keys signed by Auth server host certificate authority

func (*TeleportProcess) SetExpectedInstanceRole

func (process *TeleportProcess) SetExpectedInstanceRole(role types.SystemRole, eventName string)

SetExpectedInstanceRole marks a given instance role as active, storing the name of its associated identity event.

func (*TeleportProcess) Shutdown

func (process *TeleportProcess) Shutdown(ctx context.Context)

Shutdown launches graceful shutdown process and waits for it to complete

func (*TeleportProcess) SingleProcessModeResolver

func (process *TeleportProcess) SingleProcessModeResolver(mode types.ProxyListenerMode) reversetunnelclient.Resolver

SingleProcessModeResolver returns the reversetunnel.Resolver that should be used when running all components needed within the same process. It's used for development and demo purposes.

func (*TeleportProcess) StartShutdown

func (process *TeleportProcess) StartShutdown(ctx context.Context) context.Context

StartShutdown launches non-blocking graceful shutdown process that signals completion, returns context that will be closed once the shutdown is done

func (*TeleportProcess) WaitForConnector

func (process *TeleportProcess) WaitForConnector(identityEvent string, log logrus.FieldLogger) (*Connector, error)

WaitForConnector is a utility function to wait for an identity event and cast the resulting payload as a *Connector. Returns (nil, nil) when the ExitContext is done, so error checking should happen on the connector rather than the error:

conn, err := process.WaitForConnector("FooIdentity", log)
if conn == nil {
	return trace.Wrap(err)
}

func (*TeleportProcess) WaitForSignals

func (process *TeleportProcess) WaitForSignals(ctx context.Context) error

WaitForSignals waits for system signals and processes them. Should not be called twice by the process.

func (*TeleportProcess) WaitWithContext

func (process *TeleportProcess) WaitWithContext(ctx context.Context)

WaitWithContext waits until all internal services stop.

Directories

Path Synopsis
Package servicecfg contains the runtime configuration for Teleport services
Package servicecfg contains the runtime configuration for Teleport services

Jump to

Keyboard shortcuts

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