Documentation ¶
Overview ¶
Package reversetunnel sets up persistent reverse tunnel between remote site and teleport proxy, when site agents dial to teleport proxy's socket and teleport proxy can connect to any server through this tunnel.
Index ¶
Constants ¶
const ( // RemoteSiteStatusOffline indicates that site is considered as // offline, since it has missed a series of heartbeats RemoteSiteStatusOffline = "offline" // RemoteSiteStatusOnline indicates that site is sending heartbeats // at expected interval RemoteSiteStatusOnline = "online" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent is a reverse tunnel agent running as a part of teleport Proxies to establish outbound reverse tunnels to remote proxies
func NewAgent ¶
func NewAgent(addr utils.NetAddr, domainName string, signers []ssh.Signer, clt *auth.TunClient, options ...AgentOption) (*Agent, error)
NewAgent returns a new reverse tunnel agent
type AgentOption ¶
AgentOption specifies parameter that could be passed to Agents
func SetEventLogger ¶
func SetEventLogger(e events.Log) AgentOption
SetEventLogger sets structured logger for the agent
type AgentPool ¶ added in v1.0.0
AgentPool manages the pool of outbound reverse tunnel agents it watches the reverse tunnels entries created by admin and establishes shuts down the tunnels based on records
func NewAgentPool ¶ added in v1.0.0
func NewAgentPool(cfg AgentPoolConfig) (*AgentPool, error)
NewAgentPool returns new isntance of the agent pool
func (*AgentPool) FetchAndSyncAgents ¶ added in v1.0.0
FetchAndSyncAgents executes one time fetch and sync request (used in tests instead of polling)
type AgentPoolConfig ¶ added in v1.0.0
type AgentPoolConfig struct { // Client is client to the auth server this agent connects to recieve // a list of pools Client *auth.TunClient // EventLog is optional event log recording all events EventLog events.Log // HostSigners is a list of host signers this agent presents itself as HostSigners []ssh.Signer // HostUUID is a unique ID of this host HostUUID string }
AgentPoolConfig is a configuration parameters for agent pool
type RemoteSite ¶
type RemoteSite interface { // ConnectToServer allows to SSH into remote teleport server ConnectToServer(addr, user string, auth []ssh.AuthMethod) (*ssh.Client, error) // DialServer dials teleport server and returns connection DialServer(addr string) (net.Conn, error) // Dial dials any address withing reach of remote site's servers Dial(network, addr string) (net.Conn, error) // GetLastConnected returns last time the remote site was seen connected GetLastConnected() time.Time // GetName returns site name (identified by authority domain's name) GetName() string // GetStatus returns status of this site (either offline or connected) GetStatus() string // GetClient returns client connected to remote auth server GetClient() (auth.ClientI, error) }
RemoteSite represents remote teleport site that can be accessed via teleport tunnel or directly by proxy
type Server ¶
type Server interface { // GetSites returns a list of connected remote sites GetSites() []RemoteSite // GetSite returns remote site this node belongs to GetSite(name string) (RemoteSite, error) // FindSimilarSite returns site that matches domain name FindSimilarSite(name string) (RemoteSite, error) // Start starts server Start() error // Wait waits for server to close all outstanding operations Wait() }
Server represents server connected to one or many remote sites
type ServerOption ¶ added in v1.0.0
type ServerOption func(s *server)
ServerOption sets reverse tunnel server options
func DirectSite ¶ added in v1.0.0
func DirectSite(domainName string, clt auth.ClientI) ServerOption
DirectSite instructs server to proxy access to this site not using reverse tunnel
func ServerTimeout ¶ added in v1.0.0
func ServerTimeout(duration time.Duration) ServerOption
ServerTimeout sets server timeout for read and write operations
func SetLimiter ¶ added in v1.0.0
func SetLimiter(limiter *limiter.Limiter) ServerOption