Commit graph

10206 commits

Author SHA1 Message Date
Krzysztof Skrzętnicki d3a85cedca
GCP CLI support: RBAC changes (#19786) 2023-01-11 12:33:40 +00:00
Krzysztof Skrzętnicki 91032267d6
GCP CLI support: API changes (#19785) 2023-01-11 13:19:32 +01:00
Vitor Enes d72ac18247
Set extra proxy headers in all tsh HTTP requests (#19766)
Before this commit, the `tsh` HTTP requests that had the extra headers
were those that did not use `roundtrip`.
This commit leverages `http.RoundTripper.RoundTrip` to ensure that all
requests have the the extra headers.
2023-01-11 10:29:05 +00:00
Cam Hutchison a2c2f3a092
Update e submodule for device trust and license checking changes (#20054)
This brings in:

* Do not issue device-aware certificates if mode is "off"
  + https://github.com/gravitational/teleport.e/pull/685
* Validate arbitrary-length device trust fields
  + https://github.com/gravitational/teleport.e/pull/686
* license: Disable SAML/OIDC login for expired licenses
  + https://github.com/gravitational/teleport.e/pull/677
2023-01-11 02:07:07 +00:00
Paul Gottschling a2cf2128ce
Fix RFD link in the Directory Sharing guide (#19967)
The current link is incorrect.
2023-01-10 22:35:11 +00:00
Edoardo Spadolini 14640c80de
Fix CertificateInvalidError in formatCertError (#20049) 2023-01-10 19:36:04 +00:00
Jakub Nyckowski 15937ebd68
Pass context to reverse tunnel server (#20003)
Currently, there is no wait to cancel Wait() in the reverse tunnel. This behavior has been exposed by TestTokens test, which caused the tests to timeout.
This change fixes the test and avoids potential server deadlock on close. I'll analyze in parallel what is the root cause of the reverse tunnel hanging on Wait(), but we should have the option to cancel wait anyway.
2023-01-10 19:00:42 +00:00
STeve (Xin) Huang 286b8108b1
AWS Athena ODBC driver support for App Access (#19649) 2023-01-10 18:24:49 +00:00
Michelle Bergquist 0fbe3447dc
capture additional prehog events (#19713) 2023-01-10 17:44:58 +00:00
Grzegorz Zdunek 584e96efe0
Report Connect usage events (#19564) 2023-01-10 18:17:21 +01:00
Hugo Shaka 44f57bf346
Add hidden cli command: wait-no-resolve (#19277)
Part of https://github.com/gravitational/teleport/pull/18274

This commit introduces a new hidden `wait` CLI subcommand:

- `teleport wait no-resolve <domain-name>` resolves a domain name and exits only when no IPs are resolved. This CLI command should be used in the Helm chart, as an init-container, to block proxies from rolling out until all auth pods have been successfully rolled-out.

- `teleport wait duration 30s` has the same behaviour as `sleep 30`. Due to image hardening we won't have `sleep` available, but waiting 30 seconds in a preStop hook is required to ensure a 100% seamless pod rollout on kube-proxy-based clusters.
2023-01-10 16:46:00 +00:00
Vitor Enes 3fd74ae3fd
Periodically reload proxy certificates (#19996)
This commit adds a certificate reloader that periodically reloads proxy
certificates.

Implementation was intentionally kept as simple as possible:
- periodically go through all key pairs and try to load them again
- if any key pair fails to load, then no certificate is updated
- no retry mechanism
- `inotify` is not used

The interval between reloads is configurable by setting
`https_keypairs_reload_interval` to some duration. If not set, or if set
to `0`, then certificates are not reloaded periodically. Thus, this
feature is opt-in and the current behaviour is maintained.
2023-01-10 16:27:40 +00:00
Jakub Nyckowski a611535dce
Unbundle TestAppInvalidateAppSessionsOnLogout (#20027)
The "tets bundling" introduced in TesAppAccess() made TestAppInvalidateAppSessionsOnLogout test very unstable as other tests are modifying the state of the whole suit.
Removing the test from the bundle seems to fix it.
2023-01-10 15:44:46 +00:00
Alan Parra da44b08010
Skip device authentication based on Ping (#19966)
AttemptDeviceLogin, which is the main entry point for device authentication, now
checks the Ping response and skips the attempt entirely if device trust is
disabled.

The main objective is to avoid a needless roundtrip if the feature is disabled,
as one should only pay for what is in use.

There's actual little consequence in attempting the roundtrip, apart from the
added latency on logins, so I've gone with a negative flag ("Disabled" instead
of "Enabled"). The negative is less harmful if, for some reason, it's wrongly
absent (say, because of some future Ping code branch).

gravitational/teleport.e#514
2023-01-10 14:46:48 +00:00
matheus 9eb606829c
Remove RW on license and download from preset editor role (#19997) 2023-01-10 13:14:31 +00:00
Isaiah Becker-Mayer af251b47ab
Change "name" to "sAMAccountName" (#20005)
Previously we were looking up a user's SID by their ldap "name" attribute,
which is their modifiable display name. This commit has us looking them
up by their SAM Account Name, which is their unmodifiable username.
2023-01-09 20:19:28 +00:00
rosstimothy 9bbc1dd17c
Dependency updates (#19995)
* Bump github.com/aws/aws-sdk-go-v2/config from 1.18.7 to 1.18.8

Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.18.7 to 1.18.8.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.18.7...config/v1.18.8)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/aws/aws-sdk-go-v2/service/sts from 1.17.7 to 1.18.0

Bumps [github.com/aws/aws-sdk-go-v2/service/sts](https://github.com/aws/aws-sdk-go-v2) from 1.17.7 to 1.18.0.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.17.7...config/v1.18.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/sts
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/alicebob/miniredis/v2 from 2.23.1 to 2.30.0

Bumps [github.com/alicebob/miniredis/v2](https://github.com/alicebob/miniredis) from 2.23.1 to 2.30.0.
- [Release notes](https://github.com/alicebob/miniredis/releases)
- [Changelog](https://github.com/alicebob/miniredis/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alicebob/miniredis/compare/v2.23.1...v2.30.0)

---
updated-dependencies:
- dependency-name: github.com/alicebob/miniredis/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/aws/aws-sdk-go from 1.44.173 to 1.44.175

Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.173 to 1.44.175.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.173...v1.44.175)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump cloud.google.com/go/container from 1.9.0 to 1.10.0

Bumps [cloud.google.com/go/container](https://github.com/googleapis/google-cloud-go) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/googleapis/google-cloud-go/releases)
- [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/documentai/CHANGES.md)
- [Commits](https://github.com/googleapis/google-cloud-go/compare/dlp/v1.9.0...asset/v1.10.0)

---
updated-dependencies:
- dependency-name: cloud.google.com/go/container
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/aws/aws-sdk-go-v2/credentials from 1.13.7 to 1.13.8

Bumps [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2) from 1.13.7 to 1.13.8.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/mq/v1.13.7...service/mq/v1.13.8)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/credentials
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/Azure/azure-sdk-for-go/sdk/azcore from 1.2.0 to 1.3.0

Bumps [github.com/Azure/azure-sdk-for-go/sdk/azcore](https://github.com/Azure/azure-sdk-for-go) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/Azure/azure-sdk-for-go/releases)
- [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md)
- [Commits](https://github.com/Azure/azure-sdk-for-go/compare/v1.2...sdk/azcore/v1.3.0)

---
updated-dependencies:
- dependency-name: github.com/Azure/azure-sdk-for-go/sdk/azcore
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/schollz/progressbar/v3 from 3.12.2 to 3.13.0

Bumps [github.com/schollz/progressbar/v3](https://github.com/schollz/progressbar) from 3.12.2 to 3.13.0.
- [Release notes](https://github.com/schollz/progressbar/releases)
- [Commits](https://github.com/schollz/progressbar/compare/v3.12.2...v3.13.0)

---
updated-dependencies:
- dependency-name: github.com/schollz/progressbar/v3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* go mod tidy

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-09 19:46:01 +00:00
STeve (Xin) Huang f05ca9c4a0
Optimize types.CertAuthority comparison (#20008) 2023-01-09 19:20:52 +00:00
Gavin Frazar ef43b4cef9
azure mysql and postgresql flex server discovery (#19759)
* Move GCP cloud clients into a separate interface
* Add azure mysql/postgresql flex server support
* Add teleport db configure create support for azure postgres/mysql flex servers
* discover both single and flexi server with 'mysql' and 'postgres' db types.
* go doc gcp interface
* Add is_flexi_server to database Azure config
2023-01-09 18:48:08 +00:00
Gavin Frazar f09544681a
Add is_flexi_server to database Azure proto (#19970) 2023-01-09 18:21:57 +00:00
Tim Buckley b31d6ae53b
Fix bot IAM joining (#19936)
This fixes a small regression in #19044 that broke IAM-based joining
for bots. Bots now have slightly different joining logic, but IAM
joining uses a different entrypoint that wasn't updated to reflect
this.
2023-01-09 18:02:35 +00:00
Rafał Cieślak 4859b04345
Add Connect docs about linking tsh (#19903) 2023-01-09 16:54:42 +00:00
Noah Stride df658c4920
Fix Machine ID Certificate TTL on IAM join (#19999) 2023-01-09 16:41:13 +00:00
Zac Bergquist f67da97c0b
[auto] Update AMI IDs for 11.2.0 (#19972) 2023-01-09 15:53:22 +00:00
Edoardo Spadolini 728946294e
Fix version.go/gitref.go code generation mark (#19989)
This makes version.go compliant with https://golang.org/s/generatedcode
2023-01-09 14:55:00 +00:00
Rafał Cieślak f3ca9851a6
Make Connect's --insecure flag easier to find in docs (#19902) 2023-01-09 11:45:39 +00:00
Rafał Cieślak 50213556db
Use one Buf workspace instead of three (#19774) 2023-01-09 11:31:35 +00:00
Isaiah Becker-Mayer 772d3335df
Minor docs fixes (#19914) 2023-01-06 23:24:25 +00:00
rosstimothy c357272e63
Add Connection Proxy protobuf definitions (#19805)
Add definitions for Connection Proxy RPCs.

ProxyService is fairly isolated from other services, so it is generated using plain protoc-gen-go instead of Gogo.
2023-01-06 16:38:38 -05:00
Sam Freiberg 48b76ce99d
Update e submodule (#19952) 2023-01-06 20:23:38 +00:00
Michael 09d61ccf3f
[auto] Update webassets in teleport/master from webassets/master (#19916) 2023-01-06 19:47:05 +00:00
Michael Wilson d314406c63
Access requests implement ResourceWithLabels. (#19838)
Access requests now implement ResourceWithLabels and a few utility functions
have been added. These are all for making access requests easier to work with
for the new access request watcher introduced in
https://github.com/gravitational/teleport/pull/19626.
2023-01-06 19:36:07 +00:00
Lisa Kim fe1acfc6d3
[Discover] Fix yaml formatting with yaml lists for db join token request (#19939)
* Fix yaml formatting with yaml lists
* Snuck in adding db access checker result 
   with webapi create db endpoint
2023-01-06 18:38:10 +00:00
Isaiah Becker-Mayer f30e5c970c
Adds show_desktop_wallpaper flag, disables Windows wallpaper by default (#19541) 2023-01-06 17:26:15 +00:00
rosstimothy 54b8fce42b
Multiplex Proxy SSH port (#19813) 2023-01-06 11:54:05 -05:00
Gus Luxton 4ba2de8462
docs: Flip sync/async in session recording reference (#19944)
Noticed an incorrect inversion
2023-01-06 16:04:59 +00:00
rosstimothy e99f77b834
Add comments explaining cache backward compatibility (#19925)
When modifying the `types.WatchKind` of `ForRemoteProxy` a series of
steps need to be performed to prevent bricking remote cluster caches.

First, the `cfg.Watches` of `ForOldRemoteProxy` must be replaced
with the current `cfg.Watches` of `ForRemoteProxy`. Next, the
version used by `lib/reversetunnel/srv.go` to determine whether
to use `ForRemoteProxy` or `ForOldRemoteProxy` must be updated
to be the release in which the new resource(s) will exist in.
Once both of these are done, `ForRemoteProxy` may be updated.

Comments are added to `ForRemoteProxy`, `ForOldRemoteProxy`, and
`createRemoteAccessPoint` to help prevent backward incompatible
changes like https://github.com/gravitational/teleport/issues/17211
and https://github.com/gravitational/teleport/issues/19907 from
occurring again in future releases.
2023-01-06 15:25:51 +00:00
Isaiah Becker-Mayer 11a076a289
Fix connections to desktops in leaf clusters where w_d_s is connected via reverse tunnel (#19918) 2023-01-06 14:40:40 +00:00
Brian Joerger 488af75797
Client store generalization (#19420)
- Add a generalized client store made up of a key, profile, and trusted certs store. Each sub store can support different backends (~/.tsh, identity_file, in-memory). 
- Replace custom identity file handling with in-memory client store.
- Fix issues with trusted certs handling.
2023-01-06 01:34:04 +00:00
Zac Bergquist fb850a7d2b
docs: add overview of session recording (#18717)
Co-authored-by: alexfornuto <alex.fornuto@goteleport.com>
Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>
2023-01-05 16:20:26 -07:00
Anton Miniailo cbdec15d05
Fix panic when printing ascii table while running in debugger (#19930)
When running in debugger width was returning as 0, even though there was no error.
This resulted in panic further down the code, because column maxCellLength
ended up to be negative.
2023-01-05 23:02:51 +00:00
Paul Gottschling 800170ba10
Add redirects to the new Audit Events section (#19553)
The changes in #17405 added a section to the docs for guides to
exporting audit events, and moved guides from
`docs/pages/management/guides`, but failed to add redirects. This change
adds the missing redirects.
2023-01-05 22:45:04 +00:00
Alan Parra b84afe0783
Enable device authorization for k8s access (#19923)
Follow up on #19659 by enabling device authorization for k8s access.

All relevant changes and tests are already part of the aforementioned PR, I was
simply holding this out until I could do more thorough manual testing.

Without session MFA:

```shell
$ tsh logout; tsh login
$ kubectl get ns
> ERROR: unauthorized device
> 
> Unable to connect to the server: getting credentials: exec: executable tsh failed with exit code 1

$ ./tsh logout; ./tsh login # tsh signed for device authn
$ kubectl get ns
> NAME                 STATUS   AGE
> default              Active   27h
> kube-node-lease      Active   27h
> kube-public          Active   27h
> kube-system          Active   27h
> local-path-storage   Active   27h
> teleport             Active   126m
```

With session MFA:

```shell
$ tsh logout; tsh login
$ kubectl get ns
> ERROR: rpc error: code = PermissionDenied desc = unauthorized device
>
> Unable to connect to the server: getting credentials: exec: executable tsh failed with exit code 1

$ ./tsh logout; ./tsh login # tsh signed for device authn
$ kubectl get ns
> Tap any security key
*taps*
> NAME                 STATUS   AGE
> default              Active   27h
> kube-node-lease      Active   27h
> kube-public          Active   27h
> kube-system          Active   27h
> local-path-storage   Active   27h
> teleport             Active   122m
```

gravitational/teleport.e#514
2023-01-05 22:29:36 +00:00
Steven Martin 9f233ede61
Update federation data xml warning (#19837)
the federation data xml had a warning to treat as a password.  RAther it should be treated securely like a certificate so the values are loaded correctly.
2023-01-05 22:08:39 +00:00
Noah Stride 503a2731ca
Update documentation for GitHub joining to use actions (#19775)
* Fix Teleport version

* Update GitHub actions guide with new actions and GHES support

* Fix SPAG

* Add note on ommitting -i

* Changes notes order to make things make more sense

* Apply suggestions from code review

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>

* More spag tidying in github actions article and removed some chaff

* Fix SPAG

* Introduce next steps sectionm

* Add missing hyphen

* Move Enterprise instructions to tabbs

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2023-01-05 21:55:04 +00:00
Lisa Kim f488007ce1
[Discover] Database related tweaks (#19824)
* Return db users and names with fetch databases
* Include checking for AWS RDS Resource ID as valid RDS type
2023-01-05 19:16:45 +00:00
Michael 7d78090841
Update webapi/sessions route (#19892) 2023-01-05 12:23:28 -06:00
Tiago Silva 6d98acfc03
Include active access requests into Kube Proxy credentials cache key (#19889)
When users access a cluster, Teleport caches their credentials to avoid generating a new cert key pair each time they run a command on the cluster. If the user's certificate includes an active access request that was later discarded, the Teleport Kubernetes Proxy continues to use the cached credentials - which include the dropped access request - resulting in subsequent requests being denied by Teleport. The problem persists even if the user assumes another access request that grants him access to the cluster.

This situation happens because Kubernetes Proxy stores in a TTL map the user's certificate to avoid generating and signing it each time the user hits the proxy. The lookup in cache happens using a key that includes the `kubeCluster`, `username`, `certificate_expiration`, `kube_users`, and `kube_groups` but does not include the `active_requests`.

This PR adds the `active_requests` into the cache's key to distinguish different certificate requests for the same user.

Fixes #19884
2023-01-05 17:42:44 +00:00
Zac Bergquist 1716a15113
dronegen: remove tdr requirement (#19755)
Since the release of `tsh proxy app` we no longer need a
Teleport-aware Drone CLI and can leverage the standard
drone tool from https://docs.drone.io/cli/install/
2023-01-05 15:46:56 +00:00
rosstimothy 3ebbfdd222
Batch Dependabot PRs (#19745) 2023-01-05 13:13:05 +00:00