Commit graph

13981 commits

Author SHA1 Message Date
Yassine Bounekhla f43edbf242
add semicolon (#29088) 2023-07-14 15:05:55 +00:00
Hugo Shaka 2077868d08
assist: support recording non-interactive forwarded sessions (#28677)
* assist: support recording non-interactive forwarded sessions

* assist: add integration tests for assist command recording on agentless

This also fixes a bugged openssh integration test check.

* Mock OpenAI API in integration tests.

Also fixes the OpenAI mock handler that was not supporting the "/v1/*"
routes used in some web/ tests.

* Docstrings + adressing again a feedback that got lost during a rebase

* restore signer function signature

* Address Jakub's feedback + diverse improvements

- improve comments
- simpler file creation
- more efficient rsa key generation
- use assert instead of require in other goroutines
- only save env vars if they are Teleport-related
- move more logic into newTestCredentials for readability

* Update lib/srv/forward/sshserver.go

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

* Add a timeout in the ssh handler coroutine

---------

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2023-07-14 15:03:57 +00:00
Steven Martin 8efa003e72
tsh recordings export session-id desc update (#29111)
* tsh recordings export session-id desc

The description of the session id is incorrect.

* verbiage update

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

---------

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2023-07-14 14:54:04 +00:00
Alex McGrath a1f6641135
Document --port and --login in tsh config (#29060)
* document --port and --login in tsh config

* comment
2023-07-14 13:42:17 +00:00
Alan Parra 99a11a5a67
chore: Bump libudev-zero to 1.0.3 (#29076)
Update to the latest patch.

* https://github.com/illiliti/libudev-zero/releases/tag/1.0.3
2023-07-14 13:36:19 +00:00
Alan Parra c217af6276
chore: Bump Buf to v1.24.0 (#29081)
Update to latest release.

* https://github.com/bufbuild/buf/releases/tag/v1.24.0
2023-07-14 13:35:55 +00:00
Justinas Stankevičius a68f58426c
Add assist fields to configuration reference (#29052) 2023-07-14 10:33:13 +00:00
Trent Clarke 624454eac1
Updates buildbox osslsigncode to 2.6 (#29043)
OpenSSL disabled some legacy algorithms when moving to 3.0. The tool
we use for Windows Code Signing - `osslsigncode` - recently upgraded to
OpenSSL >= 3.0, which broke our Windows Code Sigining path as the
Windows Code Signing certificate certificate depends on at least
one of these legacy algorithms.

The osslsigncode progect has published a release that fixed this issue,
but that release has not made it through to Ubuntu yet; hence we are
manyally downloading and installing the tool from github during the
buildbox image creation.

See-Also: #28722
2023-07-14 09:07:37 +00:00
Tiago Silva 1ce5d86e46
Extend Resource Access Requests to all Kubernetes kinds (#28516)
This PR adds support for resource access requests for the following
Kubernetes kinds:

- KindKubeSecret
- KindKubeConfigmap
- KindKubeNamespace
- KindKubeService
- KindKubeServiceAccount
- KindKubeNode
- KindKubePersistentVolume
- KindKubePersistentVolumeClaim
- KindKubeDeployment
- KindKubeReplicaSet
- KindKubeStatefulset
- KindKubeDaemonSet
- KindKubeClusterRole
- KindKubeRole
- KindKubeClusterRoleBinding
- KindKubeRoleBinding
- KindKubeCronjob
- KindKubeJob
- KindKubeCertificateSigningRequest
- KindKubeIngress

It extends and generalizes existing support of KindKubePod.

Co-authored-by: Brian Joerger <bjoerger@goteleport.com>
2023-07-14 09:04:53 +00:00
Marek Smoliński d4805cc428
Extend DatabaseSessionStart posthog event (#28931) 2023-07-14 07:15:02 +00:00
rosstimothy 6b26d5712a
Fix rough edges with usage script (#29003)
When the script detects throttling it automatically scales the RCU,
however it was allowing the RCU to reach 0 which is an invalid
value. Any subsequent requests with a 0 RCU end up terminating the
script due to errors from the request. The RCU is no capped at a
minimum value of 1 to prevent this.

CredentialsChainVerboseErrors is now set in the aws.Config to provide
more actionable error messages when credentials are not configured
correctly. Users who had authentication issues would previously see
the following:

> 2023/07/11 16:50:25 NoCredentialProviders: no valid providers in chain. Deprecated.
>	For verbose messaging see aws.Config.CredentialsChainVerboseErrors

By setting the config value to true users will now see more detailed output:

> 2023/07/12 10:56:06 NoCredentialProviders: no valid providers in chain
> caused by: EnvAccessKeyNotFound: failed to find credentials in the environment.
> SharedCredsLoad: failed to load profile, .
> EC2RoleRequestError: no EC2 instance role found
> caused by: RequestError: send request failed

The README was also updated to include instructions on how to authenticate
and run the script from outside the Auth server if they so choose.
2023-07-13 23:03:42 +00:00
rosstimothy 32063d315b
Remove session condition from Firestore events query (#29092)
Firestore only allows a single equality operation on queriers.
Reverting to prevent errors when viewing Audit Logs.
2023-07-13 22:56:13 +00:00
Yassine Bounekhla 073064c58e
fix mutualtls textarea (#29034) 2023-07-13 20:52:24 +00:00
Paul Gottschling ff7367f307
Clarify that Team requires Enterprise tctl (#29024)
The current docs refer Team users to download `tctl` from the
Installation page, when they should be installing the Enterprise edition
of `tctl`.
2023-07-13 20:47:34 +00:00
Gus Luxton c811cd9a0f
helm: Add ingress support (#25815)
* helm: Add ingress template

* helm: Add ingress support

With the changes introducing automatic websocket upgrades for TLS routing in Teleport 13, we can finally add support for a Kubernetes ingress.

* Remove unnecessary brackets

* Tidying

* Gating

* Fix lint and schema

* Fix lint examples

* Handle wildcards

* Tidy up wildcard support

* Don't add AWS annotations when using ingress

* Update AWS docs to use Ingress/ALB with ACM

* Automatically listens on 443, make values simpler

* Support ingress.spec overrides

* Enable ingress and set spec.ingressClassName

* Update values schema

* typo

* Whitelist 'healthcheck' for spellcheck

* Address Hugo's comments from code review

* Apply Paul's comments from code review

* Few more docs fixes

* Update teleport-cluster reference

* Add values file and fix lint/tests

* Fix docs lint

* Add proxy_service.trust_x_forwarded_for when ingress is enabled and Teleport version >=14

* Fix semver check for pre-releases

* Indent ingress section correctly

* Address docs feedback from Hugo/Tiago

* Add warning about using tsh with ingress

* Fix lint spelling

* Add instructions for checking AWS LB controller installation

* Whitelist ingressclass in spellcheck

* What a stupid error
2023-07-13 19:59:02 +00:00
Alan Parra 192e623406
chore: Bump Go to 1.20.6 (#29072)
* chore: Bump Go to 1.20.6

* Run `make dronegen`
2023-07-13 19:49:42 +00:00
Steven Martin ed05687271
tsh play error handling (#29050)
* docs: proxy peering out of preview

* checks for tsh play session type

* Check for session type in tsh play file

* lint fix

* mention using tsh recordings export

* comments

* use switch to provide specific checks on session type

* add switch for file play

* lint fix

* output change

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

---------

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2023-07-13 18:39:11 +00:00
Zac Bergquist 33d0b5f659
upload completer: suppress stack trace for access denied errors (#29023)
If the upload completer fails due to a permissions error, emit a
warning indicating that the upload completer will not function
properly, but suppress the stack trace.

Closes #28999
2023-07-13 18:15:57 +00:00
STeve (Xin) Huang e2f3695e48
[docs] add proxy_service.trust_x_forwarded_for option (#28461)
* [docs] add proxy_service.trust_x_forwarded_for option

* review comments

* add not for single ip
2023-07-13 17:13:29 +00:00
STeve (Xin) Huang fa0c42ebcc
[doc] database labels reference (#28825)
* [doc] database labels reference

* Alex's comments
2023-07-13 17:06:58 +00:00
Rafał Cieślak 550551182f
resolveNetworkAddress: Listen for close instead of exit; Fix FailedApp theme (#29046)
* resolveNetworkAddress: Listen for `close` instead of `exit`

* Fix defaultProps of Card

* Add theme to FailedApp
2023-07-13 17:03:13 +00:00
teleport-post-release-automation[bot] 821f1f02bf
[auto] Update AMI IDs for 13.2.1 (#29059)
Co-authored-by: GitHub <noreply@github.com>
2023-07-13 16:27:12 +00:00
Grzegorz Zdunek 76acf10469
Encode URI for sqlite properly (#29049)
* Handle an error from `db.PingContext`

* Pass file path to `URL.Path` directly, so it will handle encoding
2023-07-13 16:17:34 +00:00
Ryan Clark 604db7b1af
[Assist] UI tweaks (#29001)
* Always show the typing dots when Assist is generating a reply

* Make the typing dots smaller and reactive to the theme

* Prevent the message list from scrolling if the user has scrolled up

* Move the landing page & improve the auto scrolling logic

* Improve the boolean logic for showing the footer
2023-07-13 16:09:35 +00:00
Alex McGrath 9c49470e3d
Allow login and port to be specified when using tsh config to generate openssh configs (#28994)
* Include login in tsh config

* Allow custom ports
2023-07-13 16:09:04 +00:00
STeve (Xin) Huang 2c4b4deb95
Clarify API GetDatabases vs GetDatabaseServers (#29026)
* Clarify client.GetDatabases vs client.GetDatabaseServers

* address typos
2023-07-13 15:48:19 +00:00
Nic Klaassen 8affae4027
suppress search events (#29032) 2023-07-13 15:47:14 +00:00
Tiago Silva 83bf63e433
Correct the clock passed to dynamicCredsConfig (#29054)
This PR corrects the clock passed to `dynamicCredsConfig` and used for
generating credentials for dynamic clusters.
2023-07-13 15:15:48 +00:00
Michael Wilson e3fb5c93c6
Introduce AccessList gRPC service and calls. (#28830)
* Introduce AccessList gRPC service and calls.

The AccessList gRPC service has been introduced along with modifications
to the auth client to support it. A few changes have been made to ensure
that packages generated in protobuf map more cleanly to existing patterns.

* Tuning of backend and gRPC calls, correction of tests and comments.

* Regenerate protobuf, update access list client.

* Split up tests, service returns AccessList directly.

* Remove client wrapper, as it can't depend on lib/types.

* Update GRPC.
2023-07-13 14:24:41 +00:00
Hugo Shaka ae8e12356b
assist: fix flaky assist test (#29029)
* assist: fix flaky assist test

* Update lib/web/assistant_test.go
2023-07-13 13:36:06 +00:00
Michael Wilson 61163ce507
Clean up access list protos, add in conversion functions tests. (#28787)
* Clean up access list protos, add in conversion functions tests.

The access list protos have been cleaned up to fit into the existing generated
protos a little more cleanly, and conversion functions have been migrated to
their own packages and tests for them have been added.

* Remove access list test (covered in other PR), run GCI.

* Rebase on master.

* Move internal storage repreesentation of objects into lib.

* Rename trait conversion From/ToProto.

* GCI.

* Reduce stuttering where possible.
2023-07-13 11:08:21 +00:00
Andrew Burke fbba4c2bfa
Upsert ServerInfos from discovery service (#27475)
This change adds the `labelReconciler` to the discovery service, which periodically
reconciles the labels it receives from discovered EC2 instances with the labels of the
corresponding SSH servers stored in the auth server.
2023-07-12 23:56:32 +00:00
rosstimothy f6e9ca269e
Log the value of EventsBufferSize instead of the pointer address (#29031) 2023-07-12 22:11:37 +00:00
Marco André Dinis 4f2d9b066a
DeployService IAM Configure: unescape arguments (#28807)
We were escaping the command arguments with double quotes.
It works with bash4.3+.

However, AWS CloudShell has bash 4.2 which:
>
> zz. When using the pattern substitution word expansion, bash now runs the
>     replacement string through quote removal, since it allows quotes in that
>     string to act as escape characters.  This is not backwards compatible, so
>     it can be disabled by setting the bash compatibility mode to 4.2.

http://tiswww.case.edu/php/chet/bash/CHANGES

When running this script in bash 4.2, the arguments end up being `"xyz"`
instead of `xyz`.
So, errors like this happen:
```
ERROR: operation error STS: GetCallerIdentity, https response error StatusCode: 0, RequestID: , request send failed, Post "https://sts.\"us-east-1\".amazonaws.com/": dial tcp: lookup sts."us-east-1".amazonaws.com: no such host
```

Removing the quotes means it will work on older and newer bash versions:

Demo:

```
> ./bin/teleport integration configure deployservice-iam --cluster=kimlisa.cloud.gravitational.io --name=r0mant --aws-region=us-east-1 --role=r0mant-oidc --task-role=Test+1=2,3.4@5-6_7
2023/07/07 08:04:05 TaskRole: Boundary Policy "Test+1=2,3.4@5-6_7Boundary" created.
2023/07/07 08:04:05 TaskRole: Role "Test+1=2,3.4@5-6_7" created with Boundary "arn:aws:iam::278576220453:policy/Test+1=2,3.4@5-6_7Boundary".
2023/07/07 08:04:05 TaskRole: IAM Policy "Test+1=2,3.4@5-6_7" added to Role "Test+1=2,3.4@5-6_7".
2023/07/07 08:04:05 IntegrationRole: IAM Policy "DeployService" added to Role "r0mant-oidc"
```
2023-07-12 22:11:24 +00:00
Marco André Dinis aa10e89ecb
DeployService: use teleport-ent image for ent clusters (#28932)
* DeployService: use teleport-ent image for ent clusters

* remove const
2023-07-12 22:02:57 +00:00
Noah Stride a5107015f6
Use absolute path in Machine ID generated k8s config (#29009) 2023-07-12 21:35:22 +00:00
Gavin Frazar 2496e37124
update database and kube name validation (#28841)
* update database name validation

* move name validation into DatabaseV3 CheckAndSetDefaults
* replace use of DNS1305 name validation
  * remove 63 char length restriction
  * remove lowercase restriction

* fix failing tests

* update more tests

* update CHANGELOG.md
* explain breaking change to database discovery name validation
2023-07-12 21:24:25 +00:00
Steven Martin a9467c9539
docs: proxy peering out of preview (#29027) 2023-07-12 19:48:42 +00:00
Andrew LeFevre 1e1937e9dc
update e ref (#29018) 2023-07-12 18:56:55 +00:00
Brian Joerger 2f0abf44ff
Ignore SIGQUIT in exec sessions. (#28926) 2023-07-12 18:28:46 +00:00
Roman Tkachenko 640bdebf66
Add changelog script (#29007) 2023-07-12 16:49:10 +00:00
Hugo Shaka b5c11a29a7
fix operator crashing on first startup (#28997) 2023-07-12 15:53:45 +00:00
STeve (Xin) Huang 860931461b
lib/teleterm: Cast strings to uri.ResourceURI as soon as possible (#28908)
* teleterm go use uri.ResourceURI instead of string

* fix build

* review comments
2023-07-12 15:51:45 +00:00
STeve (Xin) Huang 6fed15d13f
Add an option to bootstrap database service to teleport discovery boostrap (#28720)
* Add an option to bootstrap database service access at `tsh discovery boostrap`

* fix var name

* use a TargetService enum
2023-07-12 14:29:30 +00:00
rosstimothy 69b8afa113
Add test that verifies sessions are unaffected by Auth restarts (#28949)
Addresses part of #24096 via a new integration test.

> With HA you should be able to reboot the
> cluster without dropping the connection

The test starts two processes, one running just Auth, another
running SSH+Proxy. An interactive session is created which
periodically executes a command and verifies the output contains
the expected values. The Auth instance is restarted in the
background while the command validation occurs.
2023-07-12 13:16:50 +00:00
Justinas Stankevičius 606870b972
Allow configuring number of parallel execution workers (#28151)
* Allow configuring number of parallel execution workers

* Remove an obsolete command

* Revert test: do not check parallel behavior

* Move worker count field into Assist config

* Replace waitgroup and semaphore with errgroup

* Adjust log message

* Switch ACEW to int32, add additional validation
2023-07-12 12:53:48 +00:00
Rafał Cieślak 4c680b5272
RFD 133 - Connect My Computer (#27815)
* RFD 133 - Connect My Computer

* Add security section

* Add notes on how UI behaves with given version differences

* Add jentfoo to required approvers

Co-authored-by: Mike Jensen <jentfoo@users.noreply.github.com>

* Explain the reason why tools such as systemd are not used

* Extend the lifecycle section with PID monitoring

* Prohibit an unsupported mix of versions

* Mention security concerns earlier

* Link to ideas on reinforcing security in the future

* Do not remove role on agent removal, ensure system username is in role

* Store just a single version of the agent

* Mention using $XDG_CACHE_HOME on Linux

---------

Co-authored-by: Mike Jensen <jentfoo@users.noreply.github.com>
2023-07-12 09:46:49 +00:00
Noah Stride 3ba39bf641
Replace calls of setupAuthContext with newTestTLSServer (#28826) 2023-07-12 09:17:28 +00:00
Cam Hutchison 64b3ccf793
dronegen: Switch linux-based push builds to GitHub (#28805)
* dronegen: Switch linux-based push builds to GitHub

Change the drone pipelines for linux-based push builds to call a GitHub
actions workflow instead of running on drone runners. This includes one
of the builds for Windows which is done in a Linux container.

The old push pipelines that run the build on drone runners is now
removed as it is no longer used.

* ci: Update .drone.yml

This updates the linux-based push pipelines to delegate to github
actions.

* Update e ref for push linux workflows
2023-07-12 05:01:51 +00:00
Zac Bergquist 69da2f60d5
limit desktop discovery to IPv4 addresses (#28676)
Fixes #28635
2023-07-11 23:08:38 +00:00