Commit Graph
12109 Commits
Author SHA1 Message Date
0db64bbabe Fix Moderated session on leave pause action. (#21366)
* Fix Moderated session on leave pause action.

* Unpause when moderator rejoins session with onLeave=pause

This commite fixes a case when the moderator rejoins a paused session
but Teleport didn't resume the operations and the session was still
locked to everyone.

* Fix panic when re-joining SSH session.

* Update lib/kube/proxy/sess.go

Co-authored-by: Noah Stride <noah.stride@goteleport.com>

* Update lib/kube/proxy/sess.go

Co-authored-by: Noah Stride <noah.stride@goteleport.com>

* Fix typo

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>
Co-authored-by: Noah Stride <noah.stride@goteleport.com>
2023-02-17 14:11:59 +00:00
Krzysztof Skrzętnicki 20d4c79812 App access: rewrite redirects to public app address from leaf cluster. (#21067)
Fixes #8112.
2023-02-17 13:35:23 +00:00
Rafał Cieślak 0cdfa0b0ef Connect: Use SSH server UUID instead of hostname for file transfer (#21913)
* Add ResourceURI.GetServerUUID

* Use server UUID when calling TeleportClient.TransferFiles

* Mark removed FileTransferRequest fields as reserved
2023-02-17 10:24:12 +00:00
Michael WilsonandZac Bergquist 8c615dbf9a SAML IdP access checker. (#21941)
* SAML IdP access checker.

A new SAML IdP access checker has been added. This will allow for the SAML IdP
to determine whether or not a user should have access to the SAML IdP.

* Update lib/services/role.go

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

---------

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2023-02-17 00:34:31 +00:00
02f687308f Refresh Introduction Page (#21261)
* refresh landing page and align messaging

Signed-off-by: Evan Freed <evan.freed@goteleport.com>

* Update docs/pages/index.mdx

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

* Update docs/pages/index.mdx

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

* review comments

Signed-off-by: Evan Freed <evan.freed@goteleport.com>

* indent

Signed-off-by: Evan Freed <evan.freed@goteleport.com>

* Update docs/pages/index.mdx

Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>

* Update docs/pages/index.mdx

Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>

* Update docs/pages/index.mdx

Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>

* add section about connecting

Signed-off-by: Evan Freed <evan.freed@goteleport.com>

* Update docs/pages/index.mdx

Co-authored-by: Alex Fornuto <alex.fornuto@goteleport.com>

---------

Signed-off-by: Evan Freed <evan.freed@goteleport.com>
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>
Co-authored-by: Alex Fornuto <alex.fornuto@goteleport.com>
2023-02-16 20:44:49 +00:00
Michael Wilson cb28f8a918 Expose access point in web handler. (#21925)
The web handler now has its access point exposed. This will allow for using it
for enterprise functionality. In particular, this will allow us to use it for
auth.Middleware for enterprise web plugins.
2023-02-16 19:20:15 +00:00
Jakub NyckowskiandJeff Pihach a5ad9878b6 Add WEBASSETS_SKIP_BUILD to Makefile (#21833)
* Add WEBASSETS_SKIP_BUILD to Makefile

WEBASSETS_SKIP_BUILD allows skipping webassets build for development purposes. Teleport build in that mode displays blank page instead of WebUI, but the build significantly faster.

`make full` - always builds webassets
`make WEBASSETS_SKIP_BUILD=0` - works the same as `full`
`make WEBASSETS_SKIP_BUILD=1` - skips webassets build.

* Copy the root UI index.html file and serve it as it's used to fetch the config in the UI dev server.

---------

Co-authored-by: Jeff Pihach <jeff.pihach@goteleport.com>
2023-02-16 18:32:03 +00:00
Mike Jensen 10bd548162 Switch CodeQL to scheduled (#21883)
We still plan to address this root issue, and are tracking making CodeQl faster so it can be a required PR check: https://github.com/gravitational/SecOps/issues/269

However, until then we need to switch this job to be a scheduled task rather than on every PR and push.  This is partly cost motivated, but also we are already hitting our timeouts.  This PR also increases the analysis timeout so that the daily job can be sure to complete.
2023-02-16 17:30:59 +00:00
Edward Dowling a82b267c87 Add check on apiserver upserUser to ensure all roles on user exist (#21659)
* Add check on apiserver upserUser to ensure all roles on user exist

* Move role check on upsert user to client side

* Move user role checks on upsert to tctl

* Add err to message about missing role
2023-02-16 16:25:14 +00:00
Marco André DinisandPaul Gottschling 2c30c6b556 Docs/TF: Identity as b64 (#21912)
* Docs/TF: Identity as b64

It was not documented but the teleport provider supports loading an
identity file as base64.
https://github.com/gravitational/teleport-plugins/blob/bc85392dc3b03bedcd963709d3ef4bba2af37b2d/terraform/provider/provider.go#L234

* Update docs/pages/reference/terraform-provider.mdx

Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>

---------

Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>
2023-02-16 15:42:57 +00:00
rosstimothy 6e9a3cfcc9 Reduce etcd requests performed by a KeepAlive (#21892)
When performing a KeepAlive the key was first retrieved from
etcd to verify that it existed before updating the item. However,
a Put operation with the `ignore_value` set will return a not
found error if the key does not exist
(https://etcd.io/docs/v3.4/learning/api/#put). So we can safely
remove the get and rely on etcd to prevent updating a key that
does not exist.

Also converts `concurrentqueue.Queue` to be generic over the given
Input and Output of the worker function.
2023-02-16 15:27:39 +00:00
Steven Martin 53038dd773 Update Teleport Enterprise Cloud compare description (#21918) 2023-02-16 15:01:22 +00:00
STeve (Xin) Huang 2115f58fec Align AWS assume-role request duration with cert expiration (#21670)
* Limit AWS access AssumeRole duration

* add info header

* add UT

* minor refactor

* beef up user message
2023-02-16 14:57:12 +00:00
Tobiasz Heller 970dfd3738 Update Go toolchain to 1.20.1 (#21911) 2023-02-16 14:31:44 +00:00
Tiago Silva 6ce42b4ac1 Add minor improvements to lib/kube/proxy (#21885)
This PR resolves the comments pointed out by @jakule during the review
of #21846.
2023-02-16 13:49:20 +00:00
Noah StrideandAlan Parra f3ba5750a8 Make tctl nodes add / tctl tokens add use CreateToken RPC (#21189)
* Start removing generateToken

* Refactor `tokens add` to use `CreateToken` RPC

* Correct deprecation version

* Remove calls to GenerateToken

* Start tests for token crud

* Allow user role rules to be provided wth CreateUserAndRole helper

* Add TestCreateToken to tls_test

* Add TestUpsertToken

* Add GetTokens test

* Add TestGetToken

* Add test for DeleteToken RPC

* Dedupe error assertions

* Add support for emitting trusted cluster token creation events to Create/UpsertToken

* Fix imports

* Change parameter order to appease linter

* Fix broken token expiry test

* Fix token expiry time for TestAuth_RegisterUsingToken

* Remove unnecessary cleanup

* Apply suggestions from code review

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Change test comment from deprecation notice

* `make gprc` after code review changes

* Update lib/auth/tls_test.go

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Update lib/auth/tls_test.go

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Update lib/auth/tls_test.go

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Update lib/auth/tls_test.go

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Rename tests

* Update lib/auth/tls_test.go

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* More test cases for GetTokens

* Improve message on duplicate token

---------

Co-authored-by: Alan Parra <alan.parra@goteleport.com>
2023-02-16 09:36:55 +00:00
rosstimothy 451d13aff8 Disable instance heartbeats by default (#21901)
Instance heartbeats have caused significant etcd instability in
larger clusters. This makes the instance heartbeat a noop unless
the `TELEPORT_UNSTABLE_ENABLE_INSTANCE_HB` is explicitly set.

This allows for us to keep the instance heartbeats to continue to
test and determine the underlying problem without rolling back the
entire feature, while also preventing it from imapcting users.
2023-02-15 22:07:50 +00:00
Marco André Dinis cee1042456 Docs: Remove Jira Custom Field reference (#21824)
The plugin doesn't write into a custom field like the docs suggest.

The plugin uses the `properties` field of the Create Issue request.
That `properties` field is an array of `Key:string Value:string`.
When the issue is updated in JIRA, that's the value we look for to
update the Teleport Access Request.
2023-02-15 22:06:50 +00:00
Justinas Stankevičius 0d9523d973 Relay child exit code in g-build (#21693)
Currently, g-build always exits with a status code of 0 (success),
breaking the expectations in shell scripts or pipelines.
2023-02-15 21:06:03 +00:00
Jonathan Lassoff 2ebdd0c8bf tsh/tctl: Improve error message when using --identity without a proxy or auth server (#21124)
Fixes #19293
The error message "missing parameter hostname" wasn't very clear what hostname
was missing. Fail faster further up the stack and print a better error message
explaining what is happening.

This applies some checks aroung argument parsing while also adding some
belt-and-suspenders validation into `NewClientStoreFromIdentityFile`
2023-02-15 19:43:17 +00:00
Anton MiniailoandNoah Stride 13fad744d6 Adjust clientIP/pinnedIP fields according to IP pinning RFD (#21866)
* Adjust clientIP/pinnedIP fields according to IP pinning RFD

* Improve wording.

Co-authored-by: Noah Stride <noah.stride@goteleport.com>

---------

Co-authored-by: Noah Stride <noah.stride@goteleport.com>
2023-02-15 19:36:19 +00:00
Steven Martin 03184ee32c Include enterprise in tctl prereqs for ent and cloud (#21886)
* Include enterprise for tctl for cloud and ent

* Include enterprise in tctl

* removed enterprise from tsh

* correct labels

* Update commercial-prereqs-tabs.mdx
2023-02-15 19:08:21 +00:00
Tiago Silvaandalexfornuto dc3a0420a4 Add docs references to tsh request search --kind=pod (#21882)
* Add docs references to `tsh request search --kind=pod`

This PR adds references to the new supported command to search for pods
in a Kubernetes Cluster without requiring access to the cluster itself.

* copy edits

* add paul feedback

---------

Co-authored-by: alexfornuto <alex.fornuto@goteleport.com>
2023-02-15 18:12:20 +00:00
Jakub Nyckowski 71176c598b Add enter-root/centos7 to build.assets/makefile (#21834)
Fix enter/centos7 to use centos instead of ubuntu.
2023-02-15 17:50:47 +00:00
Jakub Nyckowski 5f87676303 Fix git installation path - Docker CentOS 7 image (#21884)
My previous PR https://github.com/gravitational/teleport/pull/21660 broke the git installation path, as `git` compiles in the `--prefix` provided during configuration. Using`DESTDIR` with `make install` instead of `--prefix` copies the file in the intermediate container with the correct path.
2023-02-15 17:29:50 +00:00
Jakub NyckowskiandRoman Tkachenko e62ff82183 Unify x86/ARM64 build process (#21660)
* Unify x86/AMD64 build process

Currently, our ARM64 pipeline builds limited subset of Teleport features as none of the 3rd party dependencies (openssh, libbpf etc) are not built on AMR64. This change build all dependencies on AMR64 in the same way as we do on x86.

FIPS changes are not included as we do not support FIPS on ARM64.

* Apply suggestions from code review

Co-authored-by: Roman Tkachenko <roman@goteleport.com>

---------

Co-authored-by: Roman Tkachenko <roman@goteleport.com>
2023-02-15 15:38:59 +00:00
Rafał Cieślak 05d18cc11d Update teleterm README (#21797)
* Update teleterm README

* Remove the Usage section in favor of linking to the docs.
* Mention that the OSS build is broken.
* Remove post-webapps-merge inconsistencies.

* Remove "Gravitational", align teleterm desc with teleport
2023-02-15 14:26:30 +00:00
rosstimothy 3db22e8d42 fix yarn.lock (#21852) 2023-02-15 14:16:43 +00:00
Edoardo Spadolini e3ce1f83c4 Emit usage events for port, kube.request, sftp (#21740)
* Update prehog/teleport.proto

* Add port as a tp.session.start with kind ssh_port

* Emit tp.kube.request events

* update prehog teleport.proto

* Emit tp.sftp usage event
2023-02-15 09:51:43 +00:00
Steven Martin 1b5ae8c9ab Spell fixes on Login Rules (#21853) 2023-02-14 22:47:44 +00:00
e30ebcf023 Allow a tsh aws to proxy any command (#19941)
* Allow a tsh aws user to specify a command to run with the AWS environment variables set

* Update name of the argument per feedback

* Address nits

---------

Co-authored-by: Daniel Ballenger <daniel@otter.ai>
Co-authored-by: Marek Smoliński <marek@goteleport.com>
Co-authored-by: STeve (Xin) Huang <xin.huang@goteleport.com>
2023-02-14 21:44:41 +00:00
Jeff Pihach 8999b65d2f Update role > lock and add missing word." (#21831) 2023-02-14 20:51:53 +00:00
Tiago Silva 263884dab0 Change error response formatting for "/version" endpoint (#21289)
* Change formatting for "/version" endpoint

This PR changes the formatting for "/version" endpoint since Kubernetes
clients do not expect a JSON response on that endpoint.
This PR returns the error message directly into the body without any
formatting so that `kubectl` is able to present the desired error.

```
kubectl version --short
Flag --short has been deprecated, and will be removed in the future. The --short output will become the default.
Client Version: v1.25.4
Kustomize Version: v4.5.7
Error from server (InternalError): an error on the server ("this user cannot request kubernetes access, has no assigned groups or users") has prevented the request from succeeding
```

Fixes #20900

* change message wording

* add validation when generating kube creds

* fix typo
2023-02-14 20:44:54 +00:00
Jeff Pihach 3d3d1fffd1 Update the webapps into teleport merge rfd and set to implemented. (#21838) 2023-02-14 20:19:43 +00:00
Jakub NyckowskiandEdoardo Spadolini cd584fdc70 Make NewlyAdded backport friendly. (#21446)
Current implementation of NewlyAdded() requires to keep different implementation on production branches. New implementation will allow to keep the same source code to be identical on all branches.

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
2023-02-14 19:57:08 +00:00
Roman TkachenkoandVictor Sokolov 6d3b67714a Fix assets sha calculation to make it work equally on all platforms (#21822)
Signed-off-by: Roman Tkachenko <roman@goteleport.com>
Co-authored-by: Victor Sokolov <gzigzigzeo@gmail.com>
2023-02-14 19:17:38 +00:00
Nic Klaassen abc99073d3 docs: login rule docs (#21195) 2023-02-14 18:26:32 +00:00
Noah Stride d6fa9ace5f Remove http-fallback for deprecated ChangePassword RPC (#21801) 2023-02-14 18:05:35 +00:00
Michael Wilson 4b570a55de Add SAML query functions to auth preferences. (#21692)
* Add SAML query functions to auth preferences and role.

Getter functions have been made for the new IdP configuration fields in the
AuthPreferences and RoleOptions.

* Remove role query, as we can access this in the  object.

* Make sure the IdP options section won't hit any nil pointer errors.
2023-02-14 17:31:43 +00:00
Alan Parra 1624d9807a Bump Buf to v1.14.0 (#21802)
Keep up with latest releases.

No format, lint or codegen changes.

* https://github.com/bufbuild/buf/releases/tag/v1.14.0
2023-02-14 17:06:14 +00:00
Roman Tkachenko f57150376f Run reviewers check on (un)labeled PR events (#21814) 2023-02-14 16:56:39 +00:00
Tiago Silva 4bb0f3809c Remove deprecated warning when proxy starts (#21798)
This PR removes a deprecated warning when Teleport proxy starts.
If the cluster is running in multiplex mode the warning is not valid
because Kubernetes Proxy is enabled by default using ALPN proxy
listener.
2023-02-14 16:39:16 +00:00
STeve (Xin) Huang fd98549e45 Skip deleting server heartbeats during in-process restart (#21648)
* Skip deleting server heartbeats during in-process restart

* context.TODO() -> context.Background()

* fix lint
2023-02-14 14:10:31 +00:00
Jakub Nyckowski caddc88262 BPF build fix (#21770)
* BPF build fix

https://github.com/gravitational/teleport/pull/21745 switched CentOS 7 image to the upstream, but I missed a few other places were we're using our fork.
This change fixes all places.

* Add missing FIPS changes

* Update e
2023-02-14 00:34:26 +00:00
Nic Klaassen b0c1c3e8da feat: early feedback for successful security key taps (#21691)
This commit adds a user message ("Detected security key tap") that is
printed at the earliest opportunity after `tsh` succesfully detects a
security key tap.

This solves a problem users have when there is significant latency in
their connection to their teleport proxy, where there may be zero
visible feedback to the user for upwards of 8 seconds after they tap
their security key.
This often causes users to think that the tap was not detected or
failed, and they attempt to tap again.
This can cause the user to accidentally paste a "yubisneeze" into their
terminal, which is not great from a security perspective.

As an API choice here I added a `TouchAcknowledger` returned by they
`PromptTouch` of the `LoginPrompt` interface.
It may seem like a bit of a weird API, but I did it this way so that all
callers of `PromptTouch` are forced to explicitly acknowledge the touch
or explicitly ignore that return value, they cannot simply forget to ack.

This applies to WebAuthn and Passwordless logins from `tsh`, no changes
are made to Connect.
2023-02-13 23:23:38 +00:00
Paul Gottschling 95df3ec2ae Add more info re: AWS credentials to the docs (#20964)
* Add more info re: AWS credentials to the docs

Closes #2781

- Add a partial for how to provide credentials to Teleport's AWS client.
  Since this includes adding environment variables to the file used by
  our systemd service, I also created a partial re: how to configure
  Teleport's systemd service and added these two partials to the
  relevant guides.

- Removed `Admonition`s that link to the docs re: AWS credentials in
  favor of the partial above. (The partial links to the Go SDK for AWS
  docs for situations where users have a specific use case.)

- Remove mentions of the AWS credential-related config settings from the
  Backends reference. The example config snippets don't actually include
  the `access_key` and `secret_key` settings, so these are left over
  from an earlier version of the guide. While you can still add these
  settings to a config file, I thought it would make sense to leave them
  undocumented since using an EC2 instance, environment variables, etc.
  is the recommended approach.

- Split the S3/DynamoDB sections of the Backends reference into
  subsections so the extra authentication info fits a bit better.

* Respond to PR feedback

* Add new partials to the RDS Proxy guide
2023-02-13 22:57:21 +00:00
Jakub Nyckowski 7447984ca4 Update to libbpf 1.0.1 (#21745)
Update to libbpf 1.0.1 and github.com/aquasecurity/libbpfgo v0.4.5-libbpf-1.0.1. As we're building our releases on CentOS 7 anyway we can also switch to mainstream libbpf instead of using our fork.
2023-02-13 21:29:41 +00:00
Tiago Silva 956dfd24dc Remove required cluster name when using tsh kube login --all (#21746)
This PR removes the requirement of providing a cluster name to login
into if the user provides the `--all` flag.

If the user does not provide a cluster, Teleport does not select any
cluster by default.

Fixes #21713
2023-02-13 21:10:56 +00:00
Hugo Shaka 14b336d92a helm: fix proxy and auth config referring to the same subdict (#21760) 2023-02-13 21:02:27 +00:00
Michael WilsonandRoman Tkachenko 383ad7a5de SAML IdP session objects. (#21521)
* SAML IdP session objects.

The upcoming SAML IdP feature requires session storage in the backend. To
support that, the `WebSession` that has been adapted for app sessions and
Snowflake sessions has been adapted for SAML IdP sessions.

The SAML IdP will be encoding the session structure as JSON and packing it
into the new `data` field within the web session.

* Update api/types/session.go

Co-authored-by: Roman Tkachenko <roman@goteleport.com>

* Use specific structure instead of a JSON blob.

* Update the create SAML session request.

* Make SAML session a pointer.

* Add in link to crewjam/saml object.

---------

Co-authored-by: Roman Tkachenko <roman@goteleport.com>
2023-02-13 19:52:33 +00:00