Documentation ¶
Overview ¶
Gravitational Teleport is a modern SSH server for remotely accessing clusters of Linux servers via SSH or HTTPS. It is intended to be used instead of sshd.
Teleport enables teams to easily adopt the best SSH practices like:
- No need to distribute keys: Teleport uses certificate-based access with automatic expiration time.
- Enforcement of 2nd factor authentication.
- Cluster introspection: every Teleport node becomes a part of a cluster and is visible on the Web UI.
- Record and replay SSH sessions for knowledge sharing and auditing purposes.
- Collaboratively troubleshoot issues through session sharing.
- Connect to clusters located behind firewalls without direct Internet access via SSH bastions.
- Ability to integrate SSH credentials with your organization identities via OAuth (Google Apps, Github).
- Keep the full audit log of all SSH sessions within a cluster.
Teleport web site:
https://gravitational.com/teleport/
Teleport on Github:
https://github.com/gravitational/teleport
Index ¶
Constants ¶
const ( // SSHAuthSock is the environment variable pointing to the // Unix socket the SSH agent is running on. SSHAuthSock = "SSH_AUTH_SOCK" // SSHAgentPID is the environment variable pointing to the agent // process ID SSHAgentPID = "SSH_AGENT_PID" // SSHTeleportUser is the current Teleport user that is logged in. SSHTeleportUser = "SSH_TELEPORT_USER" // SSHSessionWebproxyAddr is the address the web proxy. SSHSessionWebproxyAddr = "SSH_SESSION_WEBPROXY_ADDR" // SSHTeleportClusterName is the name of the cluster this node belongs to. SSHTeleportClusterName = "SSH_TELEPORT_CLUSTER_NAME" // SSHTeleportHostUUID is the UUID of the host. SSHTeleportHostUUID = "SSH_TELEPORT_HOST_UUID" // SSHSessionID is the UUID of the current session. SSHSessionID = "SSH_SESSION_ID" )
const ( // HTTPSProxy is an environment variable pointing to a HTTPS proxy. HTTPSProxy = "HTTPS_PROXY" // HTTPProxy is an environment variable pointing to a HTTP proxy. HTTPProxy = "HTTP_PROXY" // NoProxy is an environment variable matching the cases // when HTTPS_PROXY or HTTP_PROXY is ignored NoProxy = "NO_PROXY" )
const ( // TOTPValidityPeriod is the number of seconds a TOTP token is valid. TOTPValidityPeriod uint = 30 // TOTPSkew adds that many periods before and after to the validity window. TOTPSkew uint = 1 )
const ( // ComponentAuthority is a TLS and an SSH certificate authority ComponentAuthority = "ca" // ComponentProcess is a main control process ComponentProcess = "proc" // ComponentReverseTunnelServer is reverse tunnel server // that together with agent establish a bi-directional SSH revers tunnel // to bypass firewall restrictions ComponentReverseTunnelServer = "proxy:server" // ComponentReverseTunnel is reverse tunnel agent // that together with server establish a bi-directional SSH revers tunnel // to bypass firewall restrictions ComponentReverseTunnelAgent = "proxy:agent" // ComponentKube is a kubernetes proxy ComponentKube = "proxy:kube" // ComponentAuth is the cluster CA node (auth server API) ComponentAuth = "auth" // ComponentNode is SSH node (SSH server serving requests) ComponentNode = "node" // ComponentNode is SSH node (SSH server serving requests) ComponentForwardingNode = "node:forward" // ComponentProxy is SSH proxy (SSH server forwarding connections) ComponentProxy = "proxy" // ComponentDiagnostic is a diagnostic service ComponentDiagnostic = "diag" // ComponentClient is a client ComponentClient = "client" // ComponentTunClient is a tunnel client ComponentTunClient = "client:tunnel" // ComponentCachingClient is a caching auth client ComponentCachingClient = "client:cache" // ComponentSubsystemProxy is the proxy subsystem. ComponentSubsystemProxy = "subsystem:proxy" // ComponentLocalTerm is a terminal on a regular SSH node. ComponentLocalTerm = "term:local" // ComponentRemoteTerm is a terminal on a forwarding SSH node. ComponentRemoteTerm = "term:remote" // ComponentRemoteSubsystem is subsystem on a forwarding SSH node. ComponentRemoteSubsystem = "subsystem:remote" // ComponentAuditLog is audit log component ComponentAuditLog = "audit" // ComponentKeyAgent is an agent that has loaded the sessions keys and // certificates for a user connected to a proxy. ComponentKeyAgent = "keyagent" // ComponentKeyStore is all sessions keys and certificates a user has on disk // for all proxies. ComponentKeyStore = "keystore" // ComponentConnectProxy is the HTTP CONNECT proxy used to tunnel connection. ComponentConnectProxy = "http:proxy" // ComponentKeyGen is the public/private keypair generator. ComponentKeyGen = "keygen" // ComponentSession is an active session. ComponentSession = "session" // ComponentDynamoDB represents dynamodb clients ComponentDynamoDB = "dynamodb" // Component pluggable authentication module (PAM) ComponentPAM = "pam" // ComponentUpload is a session recording upload server ComponentUpload = "upload" // ComponentWeb is a web server ComponentWeb = "web" // ComponentWebsocket is websocket server that the web client connects to. ComponentWebsocket = "websocket" // ComponentRBAC is role-based access control. ComponentRBAC = "rbac" // DebugEnvVar tells tests to use verbose debug output DebugEnvVar = "DEBUG" // VerboseLogEnvVar forces all logs to be verbose (down to DEBUG level) VerboseLogsEnvVar = "TELEPORT_DEBUG" // DefaultTerminalWidth defines the default width of a server-side allocated // pseudo TTY DefaultTerminalWidth = 80 // DefaultTerminalHeight defines the default height of a server-side allocated // pseudo TTY DefaultTerminalHeight = 25 // SafeTerminalType is the fall-back TTY type to fall back to (when $TERM // is not defined) SafeTerminalType = "xterm" // ConnectorOIDC means connector type OIDC ConnectorOIDC = "oidc" // ConnectorSAML means connector type SAML ConnectorSAML = "saml" // ConnectorGithub means connector type Github ConnectorGithub = "github" // DataDirParameterName is the name of the data dir configuration parameter passed // to all backends during initialization DataDirParameterName = "data_dir" // SSH request type to keep the connection alive. A client and a server keep // pining each other with it: KeepAliveReqType = "keepalive@openssh.com" // RecordingProxyReqType is the name of a global request which returns if // the proxy is recording sessions or not. RecordingProxyReqType = "recording-proxy@teleport.com" // OTP means One-time Password Algorithm for Two-Factor Authentication. OTP = "otp" // TOTP means Time-based One-time Password Algorithm. for Two-Factor Authentication. TOTP = "totp" // HOTP means HMAC-based One-time Password Algorithm.for Two-Factor Authentication. HOTP = "hotp" // U2F means Universal 2nd Factor.for Two-Factor Authentication. U2F = "u2f" // OFF means no second factor.for Two-Factor Authentication. OFF = "off" // Local means authentication will happen locally within the Teleport cluster. Local = "local" // OIDC means authentication will happen remotely using an OIDC connector. OIDC = ConnectorOIDC // SAML means authentication will happen remotely using a SAML connector. SAML = ConnectorSAML // Github means authentication will happen remotely using a Github connector. Github = ConnectorGithub // JSON means JSON serialization format JSON = "json" // LinuxAdminGID is the ID of the standard adm group on linux LinuxAdminGID = 4 // LinuxOS is the GOOS constant used for Linux. LinuxOS = "linux" // WindowsOS is the GOOS constant used for Microsoft Windows. WindowsOS = "windows" // DarwinOS is the GOOS constant for Apple macOS/darwin. DarwinOS = "darwin" // by the owner and group DirMaskSharedGroup = 0770 // FileMaskOwnerOnly is the file mask that allows read write access // to owers only FileMaskOwnerOnly = 0600 // On means mode is on On = "on" // Off means mode is off Off = "off" // SchemeS3 is S3 file scheme, means upload or download to S3 like object // storage SchemeS3 = "s3" // SchemeFile is a local disk file storage SchemeFile = "file" // LogsDir is a log subdirectory for events and logs LogsDir = "log" // Syslog is a mode for syslog logging Syslog = "syslog" // HumanDateFormat is a human readable date formatting HumanDateFormat = "Jan _2 15:04 UTC" // HumanDateFormatSeconds is a human readable date formatting with seconds HumanDateFormatSeconds = "Jan _2 15:04:05 UTC" // HumanDateFormatMilli is a human readable date formatting with milliseconds HumanDateFormatMilli = "Jan _2 15:04:05.000 UTC" )
const ( // AuthorizedKeys are public keys that check against User CAs. AuthorizedKeys = "authorized_keys" // KnownHosts are public keys that check against Host CAs. KnownHosts = "known_hosts" )
const ( // CertExtensionPermitAgentForwarding allows agent forwarding for certificate CertExtensionPermitAgentForwarding = "permit-agent-forwarding" // CertExtensionPermitPTY allows user to request PTY CertExtensionPermitPTY = "permit-pty" // CertExtensionPermitPortForwarding allows user to request port forwarding CertExtensionPermitPortForwarding = "permit-port-forwarding" // CertExtensionTeleportRoles is used to propagate teleport roles CertExtensionTeleportRoles = "teleport-roles" )
const ( // NetIQ is an identity provider. NetIQ = "netiq" // ADFS is Microsoft Active Directory Federation Services ADFS = "adfs" )
const ( // RemoteCommandSuccess is returned when a command has successfully executed. RemoteCommandSuccess = 0 // RemoteCommandFailure is returned when a command has failed to execute and // we don't have another status code for it. RemoteCommandFailure = 255 )
const ( // CertificateFormatOldSSH is used to make Teleport interoperate with older // versions of OpenSSH. CertificateFormatOldSSH = "oldssh" // CertificateFormatStandard is used for normal Teleport operation without any // compatibility modes. CertificateFormatStandard = "standard" // CertificateFormatUnspecified is used to check if the format was specified // or not. CertificateFormatUnspecified = "" // DurationNever is human friendly shortcut that is interpreted as a Duration of 0 DurationNever = "never" )
const ( // TraitInternalPrefix is the role variable prefix that indicates it's for // local accounts. TraitInternalPrefix = "internal" // TraitLogins is the name the role variable used to store // allowed logins. TraitLogins = "logins" // TraitKubeGroups is the name the role variable used to store // allowed kubernetes groups TraitKubeGroups = "kubernetes_groups" // TraitInternalLoginsVariable is the variable used to store allowed // logins for local accounts. TraitInternalLoginsVariable = "{{internal.logins}}" // TraitInternalKubeGroupsVariable is the variable used to store allowed // kubernetes groups for local accounts. TraitInternalKubeGroupsVariable = "{{internal.kubernetes_groups}}" )
const ( // RemoteClusterStatusOffline indicates that cluster is considered as // offline, since it has missed a series of heartbeats RemoteClusterStatusOffline = "offline" // RemoteClusterStatusOnline indicates that cluster is sending heartbeats // at expected interval RemoteClusterStatusOnline = "online" )
const ( // PrivateDirMode is a mode for private directories PrivateDirMode = 0700 )SharedDirMode = 0750
const ( // EnvKubeConfig is environment variable for kubeconfig EnvKubeConfig = "KUBECONFIG" // KubeConfigDir is a default directory where k8s stores its user local config KubeConfigDir = ".kube" // KubeConfigFile is a default filename where k8s stores its user local config KubeConfigFile = "config" // EnvHome is home environment variable EnvHome = "HOME" // EnvUserProfile is the home directory environment variable on Windows. EnvUserProfile = "USERPROFILE" // KubeServiceAddr is an address for kubernetes endpoint service KubeServiceAddr = "kubernetes.default.svc.cluster.local:443" // KubeCAPath is a hardcode of mounted CA inside every pod of K8s KubeCAPath = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" // KubeKindCSR is a certificate signing requests KubeKindCSR = "CertificateSigningRequest" // KubeKindPod is a kubernetes pod KubeKindPod = "Pod" // KubeMetadataNameSelector is a selector for name metadata in API requests KubeMetadataNameSelector = "metadata.name" // KubeMetadataLabelSelector is a selector for label KubeMetadataLabelSelector = "metadata.label" // KubeRunTests turns on kubernetes tests KubeRunTests = "TEST_KUBE" // KubeSystemMasters is a name of the builtin kubernets group for master nodes KubeSystemMasters = "system:masters" // UsageKubeOnly specifies certificate usage metadata // that limits certificate to be only used for kubernetes proxying UsageKubeOnly = "usage:kube" )
const ( // OpenBrowserLinux is the command used to open a web browser on Linux. OpenBrowserLinux = "sensible-browser" // OpenBrowserDarwin is the command used to open a web browser on macOS/Darwin. OpenBrowserDarwin = "open" // OpenBrowserWindows is the command used to open a web browser on Windows. OpenBrowserWindows = "rundll32.exe" )
const APIDomain = "teleport.cluster.local"
APIDomain is a default domain name for Auth server API
const AdminRoleName = "admin"
DefaultRole is the name of the default admin role for all local users if another role is not explicitly assigned (Enterprise only).
const DefaultImplicitRole = "default-implicit-role"
DefaultImplicitRole is implicit role that gets added to all service.RoleSet objects.
const ForeverTTL time.Duration = 0
ForeverTTL means that object TTL will not expire unless deleted
const MaxEnvironmentFileLines = 1000
MaxEnvironmentFileLines is the maximum number of lines in a environment file.
const Root = "root"
Root is *nix system administrator account name.
const SCP = "scp"
SCP is Secure Copy.
const ( // SessionEvent is sent by servers to clients when an audit event occurs on // the session. SessionEvent = "x-teleport-event" )
const ( // UseOfClosedNetworkConnection is a special string some parts of // go standard lib are using that is the only way to identify some errors UseOfClosedNetworkConnection = "use of closed network connection" )
const (
Version = "3.0.1"
)
const WebAPIVersion = "v1"
WebAPIVersion is a current webapi version
Variables ¶
var Gitref string
Gitref variable is automatically set to the output of git-describe during the build process
Functions ¶
Types ¶
type Role ¶
type Role string
Role identifies the role of an SSH connection. Unlike "user roles" introduced as part of RBAC in Teleport 1.4+ these are built-in roles used for different Teleport components when connecting to each other.
const ( // RoleAuth is for teleport auth server (authority, authentication and authorization) RoleAuth Role = "Auth" // RoleWeb is for web access users RoleWeb Role = "Web" // RoleNode is a role for SSH node in the cluster RoleNode Role = "Node" // RoleProxy is a role for SSH proxy in the cluster RoleProxy Role = "Proxy" // RoleAdmin is admin role RoleAdmin Role = "Admin" // RoleProvisionToken is a role for nodes authenticated using provisioning tokens RoleProvisionToken Role = "ProvisionToken" // RoleTrustedCluster is a role needed for tokens used to add trusted clusters. RoleTrustedCluster Role = "Trusted_cluster" // RoleSignup is for first time signing up users RoleSignup Role = "Signup" // RoleNop is used for actions that already using external authz mechanisms // e.g. tokens or passwords RoleNop Role = "Nop" // RoleRemoteProxy is a role for remote SSH proxy in the cluster RoleRemoteProxy Role = "RemoteProxy" )
const LegacyClusterTokenType Role = "Trustedcluster"
this constant exists for backwards compatibility reasons, needed to upgrade to 2.3
func (*Role) Check ¶
Check checks if this a a valid role value, returns nil if it's ok, false otherwise
type Roles ¶
type Roles []Role
func ParseRoles ¶
ParseRoles takes a comma-separated list of roles and returns a slice of roles, or an error if parsing failed
func (Roles) StringSlice ¶
Slice returns roles as string slice
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
integration package tests Teleport on a high level creating clusters of servers in memory, connecting them together and connecting to them
|
integration package tests Teleport on a high level creating clusters of servers in memory, connecting them together and connecting to them |
asciitable
Package asciitable implements a simple ASCII table formatter for printing tabular values into a text terminal.
|
Package asciitable implements a simple ASCII table formatter for printing tabular values into a text terminal. |
auth
Package auth implements certificate signing authority and access control server Authority server is composed of several parts:
|
Package auth implements certificate signing authority and access control server Authority server is composed of several parts: |
backend/boltbk
Package boltbk implements BoltDB backed backend for standalone instances This is a legacy backend which only exists for backward compatibility purposes
|
Package boltbk implements BoltDB backed backend for standalone instances This is a legacy backend which only exists for backward compatibility purposes |
backend/dir
dir package implements backend.Backend interface using the filesystem.
|
dir package implements backend.Backend interface using the filesystem. |
backend/dynamo
Package dynamodbDynamoDBBackend implements DynamoDB storage backend for Teleport auth service, similar to etcd backend.
|
Package dynamodbDynamoDBBackend implements DynamoDB storage backend for Teleport auth service, similar to etcd backend. |
backend/etcdbk
Package etcdbk implements Etcd powered backend
|
Package etcdbk implements Etcd powered backend |
backend/test
Package test contains a backend acceptance test suite that is backend implementation independent each backend will use the suite to test itself
|
Package test contains a backend acceptance test suite that is backend implementation independent each backend will use the suite to test itself |
config
Package 'config' provides facilities for configuring Teleport daemons including
|
Package 'config' provides facilities for configuring Teleport daemons including |
defaults
Package defaults contains default constants set in various parts of teleport codebase
|
Package defaults contains default constants set in various parts of teleport codebase |
events
Package events implements the audit log interface events.IAuditLog using filesystem backend.
|
Package events implements the audit log interface events.IAuditLog using filesystem backend. |
httplib
Package httplib implements common utility functions for writing classic HTTP handlers
|
Package httplib implements common utility functions for writing classic HTTP handlers |
kube
package kube contains subpackages with utility functions and proxies to intercept and authenticate Kubernetes API traffic
|
package kube contains subpackages with utility functions and proxies to intercept and authenticate Kubernetes API traffic |
limiter
Package limiter implements connection and rate limiters for teleport
|
Package limiter implements connection and rate limiters for teleport |
modules
package modules allows external packages override certain behavioral aspects of teleport
|
package modules allows external packages override certain behavioral aspects of teleport |
multiplexer
package multiplexer implements SSH and TLS multiplexing on the same listener
|
package multiplexer implements SSH and TLS multiplexing on the same listener |
pam
Package pam implements a subset of Pluggable Authentication Modules (PAM).
|
Package pam implements a subset of Pluggable Authentication Modules (PAM). |
reversetunnel
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.
|
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. |
service
Package service implements teleport running service, takes care of initialization, cleanup and shutdown procedures
|
Package service implements teleport running service, takes care of initialization, cleanup and shutdown procedures |
services
Package services implements statefule services provided by teleport, like certificate authority management, user and web sessions, events and logs.
|
Package services implements statefule services provided by teleport, like certificate authority management, user and web sessions, events and logs. |
services/local
Package local implements services interfaces using abstract key value backend provided by lib/backend, what makes it possible for teleport to run using boltdb or etcd
|
Package local implements services interfaces using abstract key value backend provided by lib/backend, what makes it possible for teleport to run using boltdb or etcd |
session
Package session is used for bookeeping of SSH interactive sessions that happen in realtime across the teleport cluster
|
Package session is used for bookeeping of SSH interactive sessions that happen in realtime across the teleport cluster |
srv/regular
Package regular implements SSH server that supports multiplexing tunneling, SSH connections proxying and only supports Key based auth
|
Package regular implements SSH server that supports multiplexing tunneling, SSH connections proxying and only supports Key based auth |
sshca
Package sshca specifies interfaces for SSH certificate authorities
|
Package sshca specifies interfaces for SSH certificate authorities |
sshutils/scp
Package scp handles file uploads and downloads via scp command
|
Package scp handles file uploads and downloads via scp command |
tlsca
Package tlsca provides internal TLS certificate authority used for mutual TLS authentication with the auth server and internal teleport components and external clients
|
Package tlsca provides internal TLS certificate authority used for mutual TLS authentication with the auth server and internal teleport components and external clients |
web
Package web implements web proxy handler that provides web interface to view and connect to teleport nodes
|
Package web implements web proxy handler that provides web interface to view and connect to teleport nodes |
tool
|
|