Commit graph

87 commits

Author SHA1 Message Date
Gus Luxton 5564855b87
Fix kubeconfig generator script and tidy up odd mention of 'jenkins' (#2771) 2019-06-12 18:08:04 -03:00
Alexander Klizhentas 511d777de2 Update default inage in values.yaml for helm chart 2019-05-23 13:40:03 -07:00
Russell Jones 0e3e4a1e62 Do not emit events in mirror mode.
Update mirror mode (for both the memory and SQLite backends) to no
longer emit events when an element expires. This allows caches to handle
update/delete logic themselves.

This fixes an issue where services.ProxyWatcher was not getting updates
to the list of proxies.
2019-05-21 09:58:43 -07:00
Jessynt 387e7e283d fix: OSTYPE command not found (#2590) 2019-04-23 16:01:33 -07:00
Alexander Klizhentas 92e5bf5081
Fixes in DynamoDB event polling (#2661)
* Add resest for buffers to close watchers
and reset buffer the state.
* Add reconnect logic to DynamoDB
* Add tests for cache watchers, make sure
the errors of the cache internal watcher propagate to
external watchers.
2019-04-17 18:52:09 -07:00
Gus Luxton 9dc033f54b
Various extra fixes for Teleport Demo environments (#2647)
* Create wildcard DNS record for the main cluster as well as single A record so we can use Kubernetes forwarding to remote clusters via proxy properly
* Automatically delete created Cloudflare DNS records via pre-delete hook when the chart is deleted to keep the zone tidy
* Don't explicitly print Cloudflare API credentials in debug mode (they're logged along with the curl commands anyway)
* Add a function to handle Cloudflare API calls rather than copy/pasting code
2019-04-11 17:38:54 +01:00
Gus Luxton d328296b04
Reproducible Teleport demo environments in Kubernetes (#2585)
* Initial commit with split Helm chart for proxy/auth and node elements
* Many, many changes to add all required features
* Remove cert-manager and nginx-ingress
* Update TTL
* Add build-essential and python-dev to cloudflare-agent Docker build and set exit on error
* Add --force-upgrade flag to Tiller for potentially different Helm versions
* Enable Letsencrypt by default
* Overhaul naming to allow better multi-tenancy on k8s clusters
* Add NOTES.txt to provide cluster usage instructions
* Make the use of trusted clusters entirely optional
* Actually make the use of trusted clusters entirely optional this time
* Update .gitignore
* Update whitespace formatting in NOTES.txt
* Enable Letsencrypt by default
* Move secrets to git submodule
* Fix README typo and add secrets to .gitignore
* Update documentation
* Add some extra details to NOTES.txt
* Address PR comments plus update all references to Teleport 3.1.4 -> 3.1.7
* Make Cloudflare TTL optional (use Cloudflare's auto value when it's not provided)
* - Explicitly add admin role to clusters with use of kubernetes_groups
- Fix use of claims_to_roles so it can be specified in values.yaml
- Improve Minikube/NodePort support
- Replace use of containerPort with service port for LoadBalancer objects
* Update secrets in submodule to use Kubernetes-enabled license
* Add admin role script to containers
* Ignore all secrets files
* Update k8s RBAC to fix proxy functionality, also create 'clusteradmin' and 'admin' roles in Teleport to split permissions
* Update default version to 3.1.8
* Add k8s cluster roles and bindings to allow use of CSR APIs and limited permission scope
* Restrict admin role from seeing/updating auth_connectors
* Fix whitespace and naming bug
* Change from using k8s CSR API to impersonation API
* Update from kubectl 1.12.4 -> 1.12.5 for security fix
* Updated build scripts to use Docker cache properly, also using version tags for all containers now to keep things tidier
* Use docker build --pull rather than manual pull, also remove unused TELEPORT_VERSION arguments
2019-04-09 14:09:25 +01:00
Daniel Aquino e260c440a8 helm-chart: allow custom tls-web secret names 2019-04-03 10:16:05 -07:00
Daniel Aquino 9322b7b63f helm-chart: disable service account automount 2019-04-03 10:15:55 -07:00
Brendan Germain 1e44be361b expose deployment update strategy 2019-04-01 17:48:22 -07:00
Brendan Germain ea17f9c2be add externalTrafficPolicy to helm service 2019-03-21 13:19:40 -07:00
Sasha Klizhentas aefe8860c1 Kubernetes proxy to use impersonation API
This commit switches Teleport proxy to use impersonation
API instead of the CSR API.

This allows Teleport to work on EKS clusters, GKE and all
other CNCF compabitble clusters.

This commit updates helm chart RBAC as well.

It introduces extra configuration flag to proxy_service
configuration parameter:

```yaml
proxy_service:
   # kubeconfig_file is used for scenarios
   # when Teleport Proxy is deployed outside
   # of the kubernetes cluster
   kubeconfig_file: /path/to/kube/config
```

It deprecates similar flag in auth_service:

```yaml
auth_service:
   # DEPRECATED. THIS FLAG IS IGNORED
   kubeconfig_file: /path/to/kube/config
```
2019-03-18 15:46:49 -07:00
Gus Luxton 689bb5b4f8
Change cluster validation method from using CA cert to CA pin hash (#2602)
* Change cluster validation method from using CA cert stored in SSM to CA pin hash stored in SSM - also fixes issues with proxy/node being unable to join the cluster if the cluster name is reused. Split builds into local 'debug' versions and separate production/marketplace versions with different names
2019-03-14 12:11:16 +00:00
Gus Luxton e3f229b443 Update region line 2019-03-07 17:07:57 +00:00
Gus Luxton fa26cd894f
Updates to copy license correctly when using Terraform (#2591)
* Fixes for Terraform documentation and license
* Update Makefile and README
* Makefile formatting fixes
* Add build timestamps back into Jenkins
* Add BuildTimestamp into user tags
* Add region to modify-image-attribute command
* Add owner ID into list command
2019-03-07 16:05:07 +00:00
Gus Luxton 1265d4cf63
Single AMI changes for Amazon Marketplace (#2486)
* Add single AMI build/setup
* Add ACM support to Terraform and Letsencrypt support to single AMI
* Finish Letsencrypt support for Single AMI, also add ACM to Single AMI and tidy up Terraform versioning
* Fix Letsencrypt cert acquistion, reduce startup timers from 5 minutes to 3 minutes, tweaks for ACM/non-ACM in Terraform
* Remove AWS-based license from Enterprise AMI to convert to BYOL
* Tidy up - move Cloudformation into a separate subdirectory and remove old Terraform code
* Updated TIG stack to latest versions and tested
* Tidy up CloudFormation builds and improve instructions
* Fix VPC variable name
2019-01-29 18:26:32 +00:00
Brendan Germain 34f7a1f3d8 update helm chart pvc name to match deployment/pv (#2466) 2019-01-05 13:24:12 -08:00
Brendan Germain 53d2e4ddd4 add persistence to helm chart (#2465) 2019-01-04 11:29:09 -08:00
Alexander Babai f52de7678e Helm - Make license optional (#2451)
Make license optional, bump chart version.
2018-12-29 12:14:14 -08:00
Sasha Klizhentas f40df845db Events and GRPC API
This commit introduces several key changes to
Teleport backend and API infrastructure
in order to achieve scalability improvements
on 10K+ node deployments.

Events and plain keyspace
--------------------------

New backend interface supports events,
pagination and range queries
and moves away from buckets to
plain keyspace, what better aligns
with DynamoDB and Etcd featuring similar
interfaces.

All backend implementations are
exposing Events API, allowing
multiple subscribers to consume the same
event stream and avoid polling database.

Replacing BoltDB, Dir with SQLite
-------------------------------

BoltDB backend does not support
having two processes access the database at the
same time. This prevented Teleport
using BoltDB backend to be live reloaded.

SQLite supports reads/writes by multiple
processes and makes Dir backend obsolete
as SQLite is more efficient on larger collections,
supports transactions and can detect data
corruption.

Teleport automatically migrates data from
Bolt and Dir backends into SQLite.

GRPC API and protobuf resources
-------------------------------

GRPC API has been introduced for
the auth server. The auth server now serves both GRPC
and JSON-HTTP API on the same TLS socket and uses
the same client certificate authentication.

All future API methods should use GRPC and HTTP-JSON
API is considered obsolete.

In addition to that some resources like
Server and CertificateAuthority are now
generated from protobuf service specifications in
a way that is fully backward compatible with
original JSON spec and schema, so the same resource
can be encoded and decoded from JSON, YAML
and protobuf.

All models should be refactored
into new proto specification over time.

Streaming presence service
--------------------------

In order to cut bandwidth, nodes
are sending full updates only when changes
to labels or spec have occured, otherwise
new light-weight GRPC keep alive updates are sent
over to the presence service, reducing
bandwidth usage on multi-node deployments.

In addition to that nodes are no longer polling
auth server for certificate authority rotation
updates, instead they subscribe to event updates
to detect updates as soon as they happen.

This is a new API, so the errors are inevitable,
that's why polling is still done, but
on a way slower rate.
2018-12-10 17:20:24 -08:00
cove 3a2a0c6768 test state before getting public IP (#2336) 2018-12-05 15:23:56 +00:00
Abraham Ingersoll 26cbf51452
Update certbot depepdency, incl requests lib
details within https://github.com/aws/aws-cli/issues/3678, closes #2339
2018-11-15 12:12:01 -08:00
Russell Jones 31d7d36bfe Make get-kubeconfig.sh cross platform. 2018-11-13 18:13:10 -08:00
Ev Kontsevoy 7f5e93cf87 Added an example script for retreiving a GKE certificate 2018-10-30 13:09:51 -07:00
Sasha Klizhentas 410c33b7d9 Add clustered etcd docker-compose example 2018-08-27 13:54:41 -07:00
Brendan Germain 59810b2f0b add proxytunnel as a default service to helm chart 2018-08-16 08:47:26 -07:00
Sasha Klizhentas 1f3b4e2c96 Kubernetes configuration, fetch proxy settings.
This commit moves proxy kubernetes configuration
to a separate nested block to provide more fine
grained settings:

```yaml
auth:
  kubernetes_ca_cert_path: /tmp/custom-ca
proxy:
  enabled: yes
  kubernetes:
    enabled: yes
    public_addr: [custom.example.com:port]
    api_addr: kuberentes.example.com:443
    listen_addr: localhost:3026
```

1. Kubernetes config section is explicitly enabled
and disabled. It is disabled by default.

2. Public address in kubernetes section
is propagated to tsh profile

The other part of the commit updates Ping
endpoint to send proxy configuration back to
the client, including kubernetes public address
and ssh listen address.

Clients updates profile accordingly to configuration
received from the proxy.
2018-08-06 11:57:36 -07:00
Ev Kontsevoy b2c12066a0 Updated getting started experience for systemd users
- Modified the default teleport.service to start without
  /etc/teleport.yaml
- Updated REAMDE for systemd unit
- Updated ./install script
2018-07-19 18:04:14 -07:00
Sasha Klizhentas f3488a6c76 Fix helm template typos 2018-07-18 17:23:56 -07:00
Yusuke KUOKA eac92edd20 Idiomatic helm chart for Teleport
This is a helm chart for Teleport that conforms to [helm chart best practices](https://docs.helm.sh/chart_best_practices/) and various conventions seen in the official charts repository, so that it becomes easy-to-use and flexible enough to support many deployment scenarios.

Features:

- Locally testable on minikube
- Chart values for flexible configuration, instead of sourcing the raw teleport.yaml contained in the chart
- Automatically rolling-update the pods on configuration change according to the helm best practices
- Service and deplyment ports more finely configurable
- Customizable service and ingress for exposing the proxy to the private network or the internet
  - Use service annotatinos for integration with e.g. [external-dns](https://github.com/kubernetes-incubator/external-dns)
  - Use ingress for integration with e.g.[aws-alb-ingress-controller](https://github.com/kubernetes-sigs/aws-alb-ingress-controller)
- Configurable pod annotations. Uesful for IAM integration with kube2iam/kiam for example.
- Customizable pod assignment for security and availability
2018-07-06 09:35:10 -07:00
Sasha Klizhentas cece4be212 Initial implementation of Kubernetes support
This issue updates #1986.

This is intial, experimental implementation that will
be updated with tests and edge cases prior to production 2.7.0 release.

Teleport proxy adds support for Kubernetes API protocol.
Auth server uses Kubernetes API to receive certificates
issued by Kubernetes CA.

Proxy intercepts and forwards API requests to the Kubernetes
API server and captures live session traffic, making
recordings available in the audit log.

Tsh login now updates kubeconfig configuration to use
Teleport as a proxy server.
2018-06-03 12:55:13 -07:00
Gus Luxton 8f69bc7546
Use full pathnames in tctl execution (#1972) 2018-05-25 13:29:31 -03:00
Sasha Klizhentas b9813e3c76 Switch Terraform to Dynamo
This commit replaces EFS with S3 for audit logging,
and switches to DynamoDB for events storage.

It also updates Terraform and AWS provider
2018-05-14 18:12:57 -07:00
Russell Jones c4b3089247
Update saml-connector.yaml 2018-04-19 18:09:30 -07:00
Ev Kontsevoy 1d315e518c Updated "graceful restarts" section 2018-03-11 20:18:51 -07:00
Sasha Klizhentas ebe3c1a9c1 Fix several issues with audit events.
1. Fixes several cosmetic issues with logs:

Fixes #1690, fixes #1687

2. Fixes deadlocks that were revealed during stress
testing on slow encrypted EFS system.

The following deadlock scenario was happening:

Goroutine 1:

t1. auditlock.Lock <- success
t3. diskSessionLogger.Lock <- blocked

Gorotuine 2:

t2. diskSessionLogger.Lock <- success
t4. auditLock.Lock  <- blocked

3. Update ansible upgrade scripts
to support custom binary upgrades.

4. Fix docker flow by removing deprecated
--gops-addr flag

5. Remove verbose logging lines.

6. Reduce compression efficiency to
reduce large memory load.
2018-02-15 18:28:42 -08:00
Sasha Klizhentas 11672b8493 Terraform improvements.
Fixes #1671

* Add notes about TOS agreements for AMI
* Use specific UID for Teleport instances
* Use encrypted EFS for session storage
* Default scale up auto scaling groups to amount of AZs
* Move dashboard to local file
* Fix dynamo locking bug
* Move PID writing fixing enterprise pid-file
* Add reload method for teleport units
2018-02-14 15:09:56 -08:00
Ev Kontsevoy a09e8c64ea Updated README for go-client (auth server API example) 2018-02-14 10:26:23 -08:00
Sasha Klizhentas 7b1b29be80 Add go-client initial example. 2018-02-13 18:55:24 -08:00
Sasha Klizhentas a180d405ab Add sample teleport upgrade procedure 2018-02-06 15:11:02 -08:00
Sasha Klizhentas bb9b00e451 Cache recently accessed items.
Introduce cache for items that were accessed
by proxies and nodes within 2 second window to reduce
load on database under high load.
2018-01-31 16:35:18 -08:00
Sasha Klizhentas f84e9e0fe1 Add monitoring stack.
Demo monitoring stack sets up example monitoring
infrastructure:

* All nodes, auth servers and proxies
  run telegraf alongside them, polling prometheus
  diagnostic endpoints.

* Telegraf sends the data to InfluxDB database

* Grafana sets up cluster health dashboard
watching key teleport metrics - numbers of goroutines,
number of active sessions, file descriptors and so on.
2018-01-25 13:22:43 -08:00
Sasha Klizhentas 6138f2c93a Improvements for AWS support deployments
* Fix IAM instance profiles assignments for proxy and nodes
* Add support for auth server certificate verification done by
  nodes and proxies joining the cluster.
* Fix out of order events returned by auth servers in HA mode.

In HA mode, auth server could return events out of order
in case if they were sent to multiple auth servers what confused
the user interface expecting events sorted.

This commit fixes the problem by sorting events returned
by function SearchEvents.
2018-01-23 19:41:54 -08:00
Sasha Klizhentas 324c5c95af Initial reference AWS deployment
This is MVP for HA deployment of Teleport on AWS

* Using terraform
* EFS for audit log storage
* Proxies and auth servers in auto scaling group
* NLB for frontends
* Letsencrypt
2018-01-22 13:49:28 -08:00
Sasha Klizhentas 43c2515f8c address code review comments 2017-11-13 10:10:04 -08:00
Sasha Klizhentas f2549155fd Update DynamoDB backend
* Add support for TTL
* Add support for Batch reads
* Update default values
* Use batch reads to retrieve nodes
2017-11-10 12:20:18 -08:00
Ev Kontsevoy af302a7d53 PR edits 2017-09-14 11:58:08 -07:00
Ev Kontsevoy 1231e75b25 Documentation edits
Some users noticed that 'display' field is not well-documented for the
connectors.

I also noticed that some defaults are not sensible (like "google" as the
provider)
2017-09-14 11:35:38 -07:00
Ev Kontsevoy 2f7200b112 Another typo! 2017-09-13 18:41:44 -07:00
Ev Kontsevoy 23bd85a27e Typo 2017-09-13 18:41:11 -07:00