Commit graph

8846 commits

Author SHA1 Message Date
Isaiah Becker-Mayer 361ea8ef3f
Windows Desktop Directory Sharing (#13630)
* `IRP_MJ_CREATE` (#12665)

* `IRP_MJ_QUERY_INFORMATION` (#12717)

* `IRP_MJ_CLOSE` (#12729)

* Refactor rdpdr client (#12750)

* Adding logic for `FILE_SUPERSEDE` (#12829)

* Improve `process_irp_create` (#12830)

* adds return statements that got lost in a merge

* `IRP_MJ_DIRECTORY_CONTROL` (#12870)

* `FileFullDirectoryInformation` (#12908)

* Improve `ClientDriveQueryDirectoryResponse.encode()` (#12912)

* `IRP_MJ_QUERY_VOLUME_INFORMATION` (#13071)

* Fix Shared Directory Request handling when feature is disabled (#13439)

* IRP_MJ_READ, IRP_MJ_WRITE, and IRP_MJ_SET_INFORMATION (#13995)

* Adds constants for sizing calculations (#14051)

Co-authored-by: Łukasz Kozłowski <lukasz.kozlowski@goteleport.com>
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2022-08-04 21:50:02 +00:00
Gabriel Corado ced6276c7b
Use waitForError instead of require.Eventually in SessionRecordingModes integration tests (#15212) 2022-08-04 20:51:34 +00:00
Reed Loden bc4732870d
docs: Add security warning to BPF-based enhanced session recording about known issues (#15191)
Ref gravitational/teleport.e#330
2022-08-04 19:44:12 +00:00
Hugo Hervieux 5528138e54 Fix cert renewal by recovering certbot state (#3610) 2022-08-04 13:35:38 -04:00
Hugo Hervieux b87f47934d Fix bash examples in terraform README 2022-08-04 13:35:38 -04:00
Hugo Hervieux 6630f42e9c Support terraform v1 (#15087) 2022-08-04 13:35:38 -04:00
Forrest Marshall 142333e509 fix peer addr for in-memory control stream 2022-08-04 09:43:31 -07:00
STeve (Xin) Huang 59c67affee
[doc] Remove "tsh db login" from database guides (#14898) 2022-08-04 16:18:53 +00:00
rosstimothy efea7bc43c
RFD 65 Distributed Tracing (#11713) 2022-08-04 15:11:10 +00:00
Tiago Silva 037daad083
Introduce dedicated server type for Kubernetes resources (#14389)
## What

First part of the Kubernetes [Discovery RFD](https://github.com/gravitational/teleport/pull/13376/) to introduce a Kubernetes server per cluster. 

This PR introduces a separate Kubernetes server that uses the already introduced `KubernetesClusterV3`. 

## Compatibility

In previous versions, Kubernetes Clusters were part of regular `ServerV2` resource and this refactoring deprecates the `ServerV2` usage but keeps them for compatibility with previous version.

Everything is backward compatible, so v10 kubernetes agents and trusted clusters can connect fine.

## Next steps

Once this is merged, a new PR will introduce dynamic registration for Kubernetes Clusters discovered through EKS Discovery.
2022-08-04 14:21:11 +00:00
Tobiasz Heller 5485498775
Add custom unmarshal for second_type factor (#15197) 2022-08-04 13:54:02 +02:00
Edoardo Spadolini 54616acce4
Actually use the cache for snowflake sessions (#15085) 2022-08-04 06:35:57 +00:00
Reed Loden bbeb689a15
Bump go.mod in .cloudbuild/scripts and .github/workflows/robot to use Go 1.18 (#13959)
Missed two CI-related go.mod files in #13771, so bumping them to keep everything consistent.
2022-08-04 02:43:29 +00:00
Trent Clarke c024f284b0
Revert "Use high CPU pool for unit & integration (#13875)" (#15113)
Using Custom Pools has double the Google Cloud bill for the month, so
we're reverting to the default pool.

This reverts commit 2f1511be88.
2022-08-04 10:35:26 +10:00
Reed Loden 81e8eac68c
Add linting for terraform changes (#12815)
Use the shared workflow for linting terraform changes.
2022-08-03 21:02:19 +00:00
Zac Bergquist 17eee19bd5
Simplify webassets script (#15100)
Now that we have automation in place for updating the webassets
repo, this script no longer needs to build webassets. Instead,
it just updates the webassets submodule to point at the tip of
whatever branch is specified and opens the Teleport PR.
2022-08-03 20:26:59 +00:00
STeve (Xin) Huang c596dd7d9b
AWS session audit log (#13288) 2022-08-03 19:44:54 +00:00
Roman Tkachenko 9c7d9134e2
[auto] Update AMI IDs for 10.1.2 (#15157) 2022-08-03 18:22:12 +00:00
Edoardo Spadolini 78cab266a2
Don't reset eventID to 0 when out of events in the Postgres backend (#15160) 2022-08-03 17:41:34 +00:00
Hugo Shaka f8be9cb6be
helm: Add support for mounting existing TLS root CA (#13671)
* helm: Add support for mounting existing TLS root CA #12594
* Document per-database CA trust
2022-08-03 16:23:40 +00:00
STeve (Xin) Huang 7d23afed48
[docs] AWS external ID support (#14907) 2022-08-03 15:54:10 +00:00
Joel ebb6682018
Add handshake timeout to RDP connections (#15074) 2022-08-03 15:06:14 +00:00
Joel 70a00007a2
Remove erroneous section (#15131)
This was supposed to be removed in #14416 but was left in due to an unlucky rebase that didn't cause a conflict. This is fixed in the backport #15130.
2022-08-03 14:40:32 +00:00
fheinecke b022fea56b
Added YUM implementation of OS package build tool (#14203)
* Added YUM implementation of OS package build tool

* Addressed PR comments

* Added YUM migrations

* Added curl to YUM dependencies

* Changed pipelines to use golang:1.18.4-bullseye for Go

* Implemented proper repo downloading logic

* Fixed other merge conflicts

* Added artifacts cleanup

* Removed delete on s3 sync

* Added RPM migrations

* v8 migrations

* Partial v8 migration

* Migration remainder

* Reduced requested resources

* Updated resource limits per step

* Added k8s stage resource limits to drone

* Fixed format issue

* Removed resource requests

* Added `depends_on` support to dronegen

* v8.3 migrations

* Fixed parallelism

* Removed migration parallelism

* Fixed RPM base arch lookup

* v6 and v7 YUM migration

* Fixed missing ISA

* Updated repo file path

* Added logging

* Removed vars from repo file

* v8.3 migration first batch

* v8.3 migration second batch

* v9.0 migration

* v9.1 migration

* v9.2 migration

* v9.3 first migration

* v9.3 second migration

* v10.0 migration

* Removed migrations

* Disabled shell linting non-issues

* Fixed linter problem

* More linter fixes
2022-08-02 21:32:59 +00:00
Paul Gottschling 7332ac90a9
Add calls to action for Teleport Cloud (#14900)
Fixes #14517

- Add a partial that briefly explains the value of Teleport Cloud for
  use in guides that Teleport Cloud renders unnecessary. The partial
  includes a signup link with the "source=docs" param so we can gauge
  the effectiveness of these calls to action.
- Add the partial to guides for setting up and managing the Auth/Proxy
  Services.
2022-08-02 20:14:38 +00:00
Alan Parra ca476c4861
Fix the behavior of tsh mfa add --allow-passwordless (#15013)
The `--allow-passwordless` flag was ignored when set, which makes tsh do
non-passwordless registrations. This causes all sorts of confusing behavior.

I'm taking the chance to also add some additional logging to webauthncli.

* Correctly use the value of --allow-passwordless
* Add additional logging to wancli
2022-08-02 19:30:45 +00:00
Reed Loden 5f2f81ac9a
docs: Change "SOC2" to "SOC 2" (#15099)
docs: Change "SOC2" to "SOC 2" to pacify my OCD

A few other minor edits as well, but nothing that changes the meaning of anything.
2022-08-02 17:34:55 +00:00
Roman Tkachenko 32406b0b0a
Add docs for TCP apps access (#14978) 2022-08-02 17:26:27 +00:00
Hugo Shaka 5add07799d
helm: configure dynamoDB autoscaling in teleport-cluster (#13808)
* helm: configure dynamoDB autoscaling in teleport-cluster (#12046)
* Clarify best practices around DynamoDB autoscaling
2022-08-02 15:11:24 +00:00
Noah Stride 071bb116bc
Skip cache during CreateBot RPC (#14899)
* Skip cache during CreateBot RPC

* Adjust calls to use .Service rather than .Identity

* Switch to CreateRole from UpsertRole
2022-08-02 13:39:48 +00:00
rosstimothy e499d0961e
Tag forwarded spans with custom attributes (#14706)
* Tag forwarded spans with custom attributes

Adds a `teleport.forwarded.for` attribute to a resource or 
all spans that are forwarded to the auth server. This allows 
consumers of the spans to identify where the spans are coming 
from and take possible action. In some scenarios it may
be desirable to drop forwarded spans along the collection 
process, by tagging them we can provide a way for those 
consumers to identify them. It also allows for potentially 
identifying a malicious user that may be trying to spam the 
telemetry backend with spans.

Part of #12241
2022-08-02 12:38:23 +00:00
Joel 828ecbc79e
Fix session join requirements documentation (#14416) 2022-08-02 09:50:39 +00:00
Andrew Burke 4653503367
tctl - Add --set flags for every trait (#14552)
This change adds a --set flag to tctl users update for every trait where it wasn't implemented already (Windows logins, Kube users/groups, DB users/names, and AWS role ARNs).
2022-08-01 16:30:43 -07:00
Logan Davis 0a0eb9d1ec
Check manifest before attempting to push docker images (#15093) 2022-08-01 16:19:54 -05:00
Zac Bergquist 2e32065ea6
bot: delete backport branches when a backport is merged (#14068)
The backport workflow runs when any PR is merged to any banch.
Prior to this change, the workflow was a no-op if the target branch
was a release branch.

Update the workflow so that when it runs on merged backports
it deletes the auto-generated backport branch.

Also fixes #12412
2022-08-01 19:47:27 +00:00
Matheus 10af7c58ca
Fix TestTokenGeneration flakiness (#15090)
Move `proxy.authPack` outside of test loop
2022-08-01 18:32:53 +00:00
Paul Gottschling e7f2b5f1de
Move Access Requests guides to Access Controls (#14598)
Reorganize our Access Request guides

Fixes #13696

Most guides to Access Requests are currently not listed on the sidebar,
and the guides that are listed are available for Cloud as well as
Enterprise. This change makes it easier to find our Access Requests
guides by moving them to the Access Controls section and listing all
guides on the sidebar. It adds the "Access Requests" and "Access Request
Plugins" subsections to "Access Controls".

Since the Access Controls section includes one subsection, called
"Guides", this change also renames that subsection--and adds a
descriptive intro paragraph to the section's menu page--in order to
accommodate the Access Requests and Access Request Plugins subsections.

Move some guides into "Access Requests"
2022-08-01 17:44:36 +00:00
Jakub Nyckowski 925351e5be
[OSS-fuzz] Fix FuzzMongoRead (#14807)
Co-authored-by: Marek Smoliński <marek@goteleport.com>
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2022-08-01 15:21:11 +00:00
Paul Gottschling ecdb9dfff7
Edit the Slack access request plugin guide (#14852)
* Edit the Slack access request plugin guide

Fixes #14581

- Flesh out the intro a bit
- Fix the directory name used in the `mv` command in the installation
  step. Also fix the name of the binary generated by the `make` command.
- Add a step to test the installation
- Edit the rbac.mdx and impersonations.mdx partials to provide more
  context and restructure the instructions so users can follow them step
  by step.
- Add context around other existing steps
- Add more comprehensive role mapping instructions. The guide included
  an example role mapping, but did not spell out the general logic of
  the role mapping bheavior, e.g., that the "*" key is required.
- Move the step re: inviting the bot to after the user configures role
  mapping so they know which channels to invite the bot to.
- Add a section on creating roles to enable Access Requests so it is
  eassier to follow this guide linearly. Otherwise, users will need to
  do more work to match the configuration instructions with the
  specifics of their RBAC setup.
- Capitalize "Access Request" in this and other guides, since we're
  adding more emphasis on this as a product.
- Turn the "Audit Log" section into an Admonition and make the
  instructions there more accurate.
- Add context to the "identity-export.mdx" partial. This is a pretty
  confusing part of the Access Request setup process, so I added context
  to explain why different identity file formats are used.

* Apply suggestions from code review

Co-authored-by: Nic Klaassen <nic@goteleport.com>

* Respond to PR review

Co-authored-by: Nic Klaassen <nic@goteleport.com>
2022-08-01 14:44:23 +00:00
Noah Stride af5e2517de
Proxy Protocol support for Proxy SSH listener (#14712)
* Add additional debug logging for instantiation of ssh server conn

* Rough out introducing mux to ssh listener

* Catch errors from multiplexer serve

* Adapt multiplexer to support ProxyHelloSignature

* Adjust logging for ssh conn creation

* Adjust tests to use semantically correct assert/require helpers

* Address PR comments

* Check Client addr is properly propagated in mux test
2022-08-01 14:18:34 +00:00
Marco André Dinis a60d1c0f43
Download mTLS files from Web (#14526)
In the context of Teleport Discover we are trying to ease the usage of Teleport for the user's first interaction.

When adding a new database resource the user must, among other things, generate the mTLS files
Examples:
https://goteleport.com/docs/database-access/guides/postgres-self-hosted/#step-25-create-a-certificatekey-pair
https://goteleport.com/docs/database-access/guides/mysql-self-hosted/#step-24-create-a-certificatekey-pair

This PR aims to reduce this friction: the user should be able to setup the resource without prior setup of local tools (`tsh login`)
We're doing this by providing an endpoint that will return those exact files


Demo
```shell
marco@lenix ~/p/downloadmtls> curl --silent --insecure 'https://127.0.0.1.nip.io:3080/v1/webapi/sites/lenix/sign' --dat
a '{"hostname":"discover.example.com", "ttl":"9999h", "format": "db"}' --header 'Authorization: Bearer 308bf3dd3019ddc4
2cff44a48e028480' --header 'Content-Type: application/json' -OJ
marco@lenix ~/p/downloadmtls> tar -xvf teleport_mTLS_discover.example.com.tar.gz
server.key
server.crt
server.cas
marco@lenix ~/p/downloadmtls> head -1 server.*
==> server.cas <==
-----BEGIN CERTIFICATE-----

==> server.crt <==
-----BEGIN CERTIFICATE-----

==> server.key <==
-----BEGIN RSA PRIVATE KEY-----
```

Fixes https://github.com/gravitational/teleport/issues/14049
2022-08-01 10:14:18 +01:00
Marco André Dinis 89f4d5476a
Create and List Connection Diagnostics (#14781)
In Teleport Discover, we want to improve the UX of adding a resource.
We'll suggest users to test accessing a resource, and give them immediate feedback using the UI.

Note: we'll add this feature to Server Access, later one we'll add other resources.

After adding a server resource, the user will be presented with a command to test the connection:
`tsh ssh --test-id=123 user@host`

Running that command will provide the user feedback right in the UI of whether or not it worked.
If not, a short message will be displayed describing why it didn't work and how the user can solve the problem.

---

To achieve this we'll need a couple of changes:
1. new resource that stores the result of trying to connect to a given resource, so that the UI can ask for it
2. change `tsh ssh` to receive the `--test-id` flag and write the result to a record of this new resource

This PR addresses 1 - new resource.

A new resource is created:
```
Connection Diagnostics
- success (bool)
- message (string)
```

Two new rpc methods:
- create connection diagnostics
- read connection diagnostics

One new HTTP Endpoint:
- read connection diagnostics

Related to
https://github.com/gravitational/teleport/issues/13957
2022-08-01 08:49:35 +01:00
Steven Martin 75f4a87ec3
Update instructions on checking version (#15057) 2022-07-31 16:39:14 +00:00
Logan Davis c6a9fa0767
Fix drone publishing for teleport operator (#15065)
Fix teleport-operator
2022-07-30 01:02:58 +00:00
Zac Bergquist 39c3575f6e
docs: mark resource access requests as in preview (#14333) 2022-07-29 20:59:48 +00:00
Zac Bergquist 560ab638c5
bot: only comment about large PRs once (#15034) 2022-07-29 19:54:45 +00:00
Jeff Pihach 4c2fe9ae09
fix help output for --access-request flag. (#15042) 2022-07-29 19:19:09 +00:00
Edward Dowling 3e8634cfec
Fix chan_shutdown_read issue (#14736) 2022-07-29 18:47:39 +00:00
Edoardo Spadolini 12d2ced3d2
Implicit cache fixes (#14986)
* GetCertAuthority cache bypass fixes

* Bypass the cache for GetUser in WithUserLock

It's is used in places that want the latest version (like registration)

* Actually check the backend in GenerateHostCerts

* Fix windows desktop event parsing and caching

* GetWebSession and GetWebToken shouldn't be cached

Very little would hit those directly, and *auth.ServerWithRoles bypasses
the cache anyway.
2022-07-29 18:18:41 +00:00
Lisa Kim 3a3a0cf8a7
Return nil on success for web UI file tranfers (#15021)
When we download, we write the file contents with the 
`http.ResponseWriter` which is also used to write our 
replies, so it was also writing our success replies.

fixes https://github.com/gravitational/teleport/issues/14557
2022-07-29 17:47:35 +00:00