Commit graph

11400 commits

Author SHA1 Message Date
Isaiah Becker-Mayer 99914cf059 Fix clipboard permissions apparent inconsistency (#1509) 2023-01-12 18:02:51 +00:00
Gabriel Corado d73c54f79f
feat(issue_template): add azure sql server to testplan (#20123) 2023-01-12 17:51:46 +00:00
Steven Martin a4e80bc458
Provides output for windows_desktop and kube tokens type (#19979) 2023-01-12 17:40:17 +00:00
Vitor Enes f32a27ca17
Optimize PostJSONWithFallback (#20077)
This commit optimizes `PostJSONWithFallback` by not requiring it to
parse the endpoint (to determine if the host is loopback) if HTTP
fallback is not allowed in the first place.
2023-01-12 13:58:11 +00:00
Tiago Silva fea5b84f81
Disables kubeconfig update on tsh login when --kube-cluster is empty (#19694)
This PR disables the update of kubeconfig when `tsh login` does not have the `--kube-cluster` flag.

The new behavior will update the kubeconfig only if the user provided a non-empty value in  `--kube-cluster`.

This PR also introduces a mechanism to restore the current context on `tsh logout`. On `tsh login --kube-cluster=<cluster>` or `tsh kube login <cluster>`, Teleport updates the selected context - if it's not from Teleport - to add an extension whose key is: `selected_context`. Once `tsh logout` is called and the active context was a Teleport cluster, we restore the current context to the cluster that has the `selected_context` key in extensions.

Fixes #9718
2023-01-12 12:00:07 +00:00
Krzysztof Skrzętnicki 888e3db928
Add missing assignment of GCPServiceAccounts, lost in merge. (#20120) 2023-01-12 11:18:29 +00:00
Trent Clarke 777c15450e
Fixes code scanning issue 231 (#20119)
Fixes Code Scanning Alert #231 (logging of sensitive information). 

See: https://github.com/gravitational/teleport/security/code-scanning/231
2023-01-12 08:28:33 +00:00
fheinecke bbb652bf25
Added binary signing for darwin tarballs (#18719)
Added binary signing for darwin tarballs
2023-01-12 04:58:50 +00:00
Andrew Burke b6123d21a0
RFD - Azure join method (#19172)
This RFD describes a new join method for Teleport nodes running on Azure virtual machines. It is essentially an Azure version of EC2/IAM join.
2023-01-12 00:24:26 +00:00
Sam Freiberg edb3eade70
Trim error messages on UserLogin events (#20017)
rim error messages on UserLogin events to prevent omitting audit events due to size
2023-01-11 23:13:13 +00:00
Alan Parra 62dbe3ecfd
Add trusted device to the events.UserMetadata proto (#20079)
Add the trusted device to UserMetadata, thus enabling audit logs to contain the
device in use.

gravitational/teleport.e#514
2023-01-11 22:12:24 +00:00
Alan Parra ba1282df62
Improve UserMetadata audit logging (#20081)
Improve UserMetadata audit logging by using `tlsca.Identity.GetUserMetadata()`
more consistently in audit logs.

There are still a handful of logs that don't include the data above for lack of
context (in the general sense and in the Go context sense), but many more
entries now call back to identity in some way.

Related to gravitational/teleport.e#514.
2023-01-11 21:03:17 +00:00
Przemko Robakowski 9ecfca3c73
Add non_ad_hosts to windows desktop service config (#19806)
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
Co-authored-by: Isaiah Becker-Mayer <isaiah@goteleport.com>
2023-01-11 20:44:19 +00:00
Hugo Shaka ab51a9b5ea
helm: support dnsConfig in teleport-kube-agent chart (#20096)
Adds support for `dnsConfig` and `dnsPolicy` configuration in the `teleport-kube-agent` chart.
2023-01-11 19:57:20 +00:00
Alan Parra 3552a08953
Add device mode to RoleOptions (#20014)
Add the DeviceTrustMode field to RoleOptions, so it lands in RoleSpecV6.

The field is not yet used, but it's added now in preparation for the
corresponding feature.

gravitational/teleport.e#514
2023-01-11 19:39:43 +00:00
Yassine Bounekhla 25177ab6ba Revert "Use sessionStorage for Authentication Bearer Token (#1275)" (#1505) 2023-01-11 14:17:04 -05:00
Nic Klaassen 283b1641e0
feat: add login rule service proto definition (#20047) 2023-01-11 19:01:20 +00:00
Hugo Shaka 4ca4b54075
Deploy split proxy/auth with helm chart (#18857)
This commit refactors the `teleport-cluster` Helm chart to deploy separately proxy and auth pods.
It allows users to pass raw teleport configuration to the deployed Teleport nodes.
Finally, it removes the `custom` chart mode as the mode was broken by the split. A new `scratch` mode has been introduced.

See [the corresponding RFD](https://github.com/gravitational/teleport/pull/18274) describing the design.
2023-01-11 17:50:35 +00:00
Michelle Bergquist 9b23ff6aaf capture additional prehog events (#1466) 2023-01-11 10:48:19 -07:00
rosstimothy 3aa295c87c
Convert usages of types.NewRoleV3 to types.NewRole (#19793)
Closes #14345
2023-01-11 16:58:22 +00:00
Krzysztof Skrzętnicki c481eb5396
Changes from make grpc and make grpc-teleterm missing from master (#20070)
* Changes from `make grpc`.

* Changes from `make grpc-teleterm`.
2023-01-11 16:44:36 +00:00
Krzysztof Skrzętnicki e053cba973
GCP CLI support: tsh and tctl changes (#19790) 2023-01-11 16:33:38 +00:00
Hugo Shaka c5dfffcdc2
RFD 0096: Helm chart revamp (#18274) 2023-01-11 16:09:26 +00:00
Krzysztof Skrzętnicki 4c7c660036
GCP CLI support: server-side request handler (#19789)
* Also: minor changes to the Azure handler, harmonizing the timeout handling with the implementation found in the GCP one.
2023-01-11 15:50:20 +00:00
rosstimothy 29d2636229
Stablize RemoteConnCleanup (#20048)
* Stablize RemoteConnCleanup

Alters `RemoteConnCleanup` to rely less on `BlockUntil` by artificially
adjusting the last heartbeat manually in the test. Additionally, the
tests in `localsite_test` no longer call `native.PreComputeKey` by
injecitng an uninitialized `certificateCache` into the localsite
constructor since it is not used for the tests. The logger is now
also initialized for all tests within the `reversetunnel` package.

Closes #19827
2023-01-11 15:14:56 +00:00
Alan Parra 71e0ac95e6
chore: Bump Go to 1.19.5 (#20060)
Update Go to the latest patch.

Bumps api/go.mod to 1.19 as well, as it seems to be lagging.
2023-01-11 14:54:26 +00:00
Krzysztof Skrzętnicki 0490ecd94e
GCP CLI support: auth changes (#19788) 2023-01-11 14:21:02 +00:00
Krzysztof Skrzętnicki 73cc189b0e
GCP CLI support: CA changes (#19787) 2023-01-11 13:58:14 +00:00
Steven Martin 31b8f15717
Update config example to turn off ssh, proxy, auth and use teleport start example (#19978) 2023-01-11 13:43:44 +00:00
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
Yassine Bounekhla 5df7ae9176 Refactor clusters service (#1501)
* refactor clusters service
* remove unused import
2023-01-10 16:12:52 -07: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 53da3a19c4 Connect: Collect usage events (#1451) 2023-01-10 18:29:23 +01:00
Grzegorz Zdunek 584e96efe0
Report Connect usage events (#19564) 2023-01-10 18:17:21 +01:00
matheus 1604aae4ab Add downloads page (#1452) 2023-01-10 14:11:16 -03: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