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, remoteDomainName string, clientName string, signers []ssh.Signer, clt *auth.TunClient) (*Agent, error)
NewAgent returns a new reverse tunnel agent Parameters:
addr points to the remote reverse tunnel server remoteDomainName is the domain name of the runnel server, used only for logging clientName is hostid.domain (where 'domain' is local domain name)
type AgentOption ¶
AgentOption specifies parameter that could be passed to Agents
type AgentPool ¶ added in v1.0.0
AgentPool manages the pool of outbound reverse tunnel agents. The agent pool watches the reverse tunnel entries created by the admin and connects/disconnects to added/deleted tunnels.
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 // 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 holds configuration parameters for the 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 within the site network 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(domainName string) (RemoteSite, error) // RemoveSite removes the site with the specified name from the list of connected sites RemoveSite(domainName string) error // Start starts server Start() error // CLose closes server's socket Close() 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