Commit graph

154 commits

Author SHA1 Message Date
Edoardo Spadolini 4feb7d1506
Remove azsessions (#17055) 2022-10-07 09:24:30 +00:00
Alan Parra dbcf17f7cd
Tidy Go modules (#17089)
Dependabot wrongly removes e/ imports when tidying, as it doesn't have access to
it. Add a file to capture such imports and tidy again.
2022-10-05 20:34:23 +00:00
dependabot[bot] b17604ee83
Bump github.com/fsouza/fake-gcs-server from 1.19.5 to 1.40.2 (#16972)
Bumps [github.com/fsouza/fake-gcs-server](https://github.com/fsouza/fake-gcs-server) from 1.19.5 to 1.40.2.
- [Release notes](https://github.com/fsouza/fake-gcs-server/releases)
- [Commits](https://github.com/fsouza/fake-gcs-server/compare/v1.19.5...v1.40.2)

---
updated-dependencies:
- dependency-name: github.com/fsouza/fake-gcs-server
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-05 18:08:10 +00:00
Alan Parra 4d83ec85f7
Bump github.com/aws/ dependencies (#17021)
Combines the following Dependabot PRs:

* https://github.com/gravitational/teleport/pull/17008
* https://github.com/gravitational/teleport/pull/17009
2022-10-05 17:57:44 +00:00
Noah Stride a54de3bb64
GitHub Actions joining (#16938)
* Introduce Github Actions join support

* Go mod tidy

* run goimports on source files

* Address PR comments

* More PR review comments

* Changes to tests based on PR feedback

* Improve error message in github rule validation

* Add support for SHA

* Add short message describing which fields shouldb be included
2022-10-05 10:05:48 +00:00
Zac Bergquist e547957f93
Remove [direct] dependency on go.uber.org/atomic (#17035)
Reintroducing the change from #16884 now that Go 1.19.2 has been
released with the fix.

This reverts the revert from  09de0ba530.
2022-10-05 01:24:46 +00:00
Alan Parra 4615abd757
Tidy modules (#17015)
Tidy Go modules and re-adds a few modules removed by #16971.
2022-10-04 20:30:45 +00:00
dependabot[bot] f14f70b1ee
Bump github.com/aws/aws-sdk-go-v2/config from 1.17.7 to 1.17.8 (#16971)
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.17.7 to 1.17.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.17.7...config/v1.17.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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-04 18:46:14 +00:00
Alan Parra ee5d2df565
Enable automatic updates via Dependabot (#16907)
Let the robots do regular updates for us.

References:
* [Configure dependabot.yml][1]
* [Configure security updates][2]

[1]: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
[2]: https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates#overriding-the-default-behavior-with-a-configuration-file
2022-10-04 14:14:20 +00:00
Zac Bergquist 09de0ba530
Revert "Remove [direct] dependency on go.uber.org/atomic (#16884)" (#16918)
This reverts commit 4f3aa9a3f2.

We're unable to build for 32-bit Linux due to
https://github.com/golang/go/issues/55152,
which looks like it will be fixed with Go 1.19.2 next week.

We'll re-evaluate with the next Go release and reintroduce this change
as soon as we can.
2022-09-30 22:41:45 +00:00
Alan Parra 59bcdf51c5
Update k8s related dependencies (#16909)
Update k8s.io/ and sigs.k8s.io/ modules and drop dependency on k8s.io/utils.
2022-09-30 22:07:05 +00:00
rosstimothy 4f4fac1580
Stop using gosaml2 fork (#16913) 2022-09-30 21:02:59 +00:00
Zac Bergquist 4f3aa9a3f2
Remove [direct] dependency on go.uber.org/atomic (#16884)
Go 1.19's sync/atomic package provides the same functionality
2022-09-30 20:39:05 +00:00
Alan Parra e61da10df2
Update (even more) Go dependencies (#16900)
Do another large batch of dependency updates.

Most updates are around minor versions, so _theoretically_ safe. The following
v0.x updates draw attention:

* cloud.google.com/go/iam (likely safe, as Google is largely trunk-based)
* github.com/Microsoft/go-winio

Notable exceptions are k8s-related modules, which are harder to update for
various reasons.

* Update Go dependencies
* Fix lib/srv/app/aws/endpoints_test.go
2022-09-30 19:22:35 +00:00
Alan Parra 5cda242067
Update various Go dependencies (#16861)
Update various "assorted" dependencies, that either are used throughout
(logging, testing), are mostly algorithmic or otherwise difficult to pinpoint
"ownership".

I've dropped a couple of deprecated/mostly meaningless dependencies. I suspect
`github.com/mitchellh/mapstructure` could be dropped to, but I didn't look
further now.

* Drop dependency on Clever/go-utils
* Drop dependency on github.com/pkg/errors
* Update various Go dependencies
* Use CompareAndSwap instead of CAS (uber/atomic)
* Add a comment after replaced dependencies
2022-09-30 14:01:51 +00:00
STeve (Xin) Huang aabced42dc
Azure Cache for Redis engine support (#16551) 2022-09-29 18:25:53 +00:00
Andrew LeFevre 77f8a4ef10
Switch underlying protocol used for 'tsh scp' to SFTP (#16601)
* switch underlying protocol used for 'tsh scp' to SFTP

* address TODO

* appease linter

* add method to make it easier for other callers to transfer files

* add tests

* print transfer progress with progress bar by default

Also allow a SIGINT to gracefully stop the SFTP connection. This is
necessary  because the progress bar will ignore signals and prevent the
process from exiting.

* address SFTP fork issues

* make tests less flakey

* fix specifying dir for dst not copying files to correct paths

* make tests less flakey (again)

* don't check file access times, often differs when run in CI

* few small fixes from review, simplify Create method now that HTTP FS isn't needed

* create dst files and dirs with src mode

* improved error messages when doing file operations

* expand home dirs in remote paths

* addressed more feedback

* add license to get_home_dir.go

* address minor feedback of tests, add home dir expansion test

* update sftp fork to point to latest commit on master branch

* addressed feedback

* don't cache home dir lookups, only one remote path can ever be used
2022-09-28 16:37:18 +00:00
rosstimothy aee7a38e59
Update github.com/russellhaering/gosaml2 to latest version (#16775)
Our fork is no longer needed now that https://github.com/gravitational/gosaml2/pull/4
has landed upstream https://github.com/russellhaering/gosaml2/pull/91.
2022-09-28 15:53:16 +00:00
Edoardo Spadolini 7778c59dd2
Azure Blob Storage for sessions (#16144)
* Azure Blob Storage for sessions

* Turn fmt constants into functions

* Remove redundant NewHandlerFromURL

* Remove formatted log calls

* Clean up clean up

* Allow nil URL as a no-op in SetFromURL

* Wrap unwrapped errors

* godocs

* trace.Wrap every returned error

* Refactor container creation

* Fix missing error propagation
2022-09-27 11:10:09 +00:00
Alan Parra 3fe648485d
Update golang.org/x/ dependencies in api/ (#16596)
Update crypto and net in api/, plus pull a few commits that just landed.
2022-09-26 22:44:29 +00:00
Alan Parra 8b387b4c2b
Update duo-labs/webauthn to 20220815211337 and use new APIs (#16724)
Update duo-labs/webauthn to latest and adapt/make use of new APIs.

Relevant commits:
- ResidentKey: 048000f85e
- Discoverable login (aka passwordless): 09bc59f777

* Update duo-labs/webauthn to `20220815211337`
* Use the new ResidentKey field
* Use the new passwordless APIs
* Record AppID TODOs for posteriority
2022-09-26 21:28:48 +00:00
Brian Joerger 4c0a6ff5b1
tsh PIV login integration (#15335)
* Add Yubikey PrivateKey implementation for use by Teleport clients.

  - Add yubikey login logic, reusing previously stored private keys.

  - Fix identity file decoding with PIV keys, which sign ecdsa certificates.

  - Add libpcsclite-dev pre-req for building on linux.

  - Remove unnecessary keys.Signer interface and move its functionality to keys.PrivateKey.

  - Move retry and jitter utils to new api/utils/retryutils package.
2022-09-23 19:44:10 +00:00
Alan Parra fe3f9332ee
Update WebAuthn and U2F dependencies (#16572)
Update `duo-labs/webauthn` up to `20220122034320`, which is the latest version
we can get without dipping into dependency hell (`etcd` and `opentelemetry` woes
ensue after [2365c59d9f][1]).

`tstranex` could be dropped for a while now (we moved on to WebAuthn-like
interfaces for mocks). `cfssl` was only imported due to what I assume was an
IDE mishap.

I've elected to keep `fxamacker/cbor`, instead of trying to move to
[webauthncbor][2]. fxamacker is solid, past v0, seems more appropriate for
client-side libs and still backs webauthncbor.

There are no updates for `flynn/hid` and `flynn/u2f`.

Release notes for fxamacker/cbor:
https://github.com/fxamacker/cbor/releases/tag/v2.4.0.

[1]: 2365c59d9f
[2]: https://pkg.go.dev/github.com/duo-labs/webauthn@v0.0.0-20220815211337-00c9fb5711f5/protocol/webauthncbor

* Drop tstranex/u2f dependency
* Drop direct dependency to cloudflare/cfssl
* Update fxamacker/cbor/v2 to v2.4.0
* Update duo-labs/webauthn to 2022-01-22
* Fix: Make sure all credentials are set in the user
* Simplify: Drop now unnecessary AuthenticationSelection copy
2022-09-22 17:08:47 +00:00
rosstimothy b4317d4014
Update observability dependencies (#16497) 2022-09-22 12:59:30 +00:00
Alan Parra 65e0116512
Remove HOTP support (#16579)
While looking up github.com/gokyle/hotp I found some old deprecation warnings
and decided to address them.

* Remove HOTP support
* Update comment on checkOTP
* Remove OTPType
* Remove a few more HOTP references
2022-09-21 17:50:33 +00:00
Alan Parra 88134100cb
Update golang.org/x/ dependencies (#16591)
Update golang.org/x/crypto, exp, mod, net, oauth2, sync, sys, term and tools to
the latest version.

golang.org/x/text is already at the latest version.

* Update golang.org/x/{mod,sync,sys,tools}
* Update golang.org/x/exp
* Update golang.org/x/oauth2
* Update golang.org/x/net
* Update golang.org/x/crypto
* Update golang.org/x/term
2022-09-21 16:51:30 +00:00
rosstimothy 26126ba457
Update gRPC and Protobuf related dependencies (#16496) 2022-09-19 21:12:15 +00:00
Edoardo Spadolini 33c6d82dc3
Azure AD authentication for the Postgres backend (#15757)
* Add Username to sqlbk and don't leak connConfigs

* Azure AD authentication for sqlbk/Postgres

* Add a Postgres Config test

* Cache Azure tokens, document azureBeforeConnect

* Move the config test to sqlbk

* go mod tidy

* go get azcore azidentity
2022-09-15 17:26:12 +00:00
Tiago Silva 31a2e84c31
Kubernetes Exec via Websockets (#15475)
This PR extends the Kubernetes Service to support the WebSocket protocol in Kubernetes Exec calls.
The Websocket protocol is required so that Kubernetes clients like C#, Python, and Javascript can call the `exec` and `attach` methods.

File `remotecommand_websocket.go` was vendored from [kubernetes repo](d5fdf3135e/pkg/kubelet/cri/streaming/remotecommand/websocket.go).

Fixes #15463

Future work:
- Extend support for  `port-forward`
- Extend support for  `cp`
2022-09-09 16:55:11 +00:00
Gavin Frazar a707e88b84
Run go mod tidy (#16215) 2022-09-07 21:26:25 +00:00
rosstimothy f54a8263f3
Update grpc-go (#15926)
Bumps google.golang.org/grpc to v1.49.0 which includes a fix for
https://github.com/grpc/grpc-go/issues/5358 which has been causing
tests to fail.
2022-09-07 14:24:07 +00:00
Anton Miniailo 135735e154
Add serialization of writes to known_hosts file. (#16057) 2022-09-07 01:49:35 -04:00
Jakub Nyckowski 7744f72c6e
Auditd integration (#14948)
Add auditd integration.

Co-authored-by: Nic Klaassen <nic@goteleport.com>
Co-authored-by: Roman Tkachenko <roman@goteleport.com>
2022-09-05 18:28:07 +00:00
Krzysztof Skrzętnicki 44b89c75c0
Elasticsearch support (#15768)
Co-authored-by: Anton Miniailo <anton@goteleport.com>
Co-authored-by: Marek Smoliński <marek@goteleport.com>
2022-09-05 18:58:21 +02:00
STeve (Xin) Huang 29f602a181
Forward flags to "tsh ssh" and "tsh aws" (#16058) 2022-09-02 14:20:06 +00:00
rosstimothy 7b18b71c9b
Update deprecated pty dependency (#15806)
* Update deprecated pty dependency

Replace the deprecated github.com/kr/pty with its replacement
github.com/creack/pty.
2022-08-25 20:40:13 +00:00
Gavin Frazar b79a9783ed
Azure API for DB discovery (#15674)
* Add Azure auto-discovery configuration fields

* Init databases if azure matchers are in config

* Use AzureMatchers in db service

* Use all azure subscriptions/resource groups if omitted in matcher

* Add azure config tests

* Go mod tidy to update dependencies

* Add azure response error conversion

* Check for azure access denied and give a helpful error message

* Add azure subscriptions api

* Add azure mysql/postgresql api and wrappers

* Test generic db server for azure

* Make server properties its own type

* Convert server types manually instead of via json

* Move server list method selection logic out of api client

* Update azure db server tests

* Fixup merge

* Update comments

* Update more comments and remove junk code

* Move all azure api into lib/cloud/azure

* Update state and version checks

* Add mutex to subscription client for caching, just in case

* Update lib/cloud/azure/db_server_test.go

Co-authored-by: Marek Smoliński <marek@goteleport.com>

* Update lib/cloud/azure/subscriptions_test.go

Co-authored-by: Marek Smoliński <marek@goteleport.com>

* Update lib/cloud/azure/db_server_test.go

Co-authored-by: Marek Smoliński <marek@goteleport.com>

* Update lib/cloud/azure/db_server_test.go

Co-authored-by: Marek Smoliński <marek@goteleport.com>

* Update lib/cloud/azure/db_server_test.go

Co-authored-by: Marek Smoliński <marek@goteleport.com>

* Rename azure subscription client and remove sub ID caching

* Add reference links for azure db ports

* Move indirect dep into group

* Wrap all converted azure response errors

* Remove unreachable panic

* Godoc DBServer

* Remove maxPages arg to azure client funcs

* Gofmt

* Spacing between copyright and package

* import order

Co-authored-by: Marek Smoliński <marek@goteleport.com>
2022-08-25 19:15:05 +00:00
Joel 74281c5b08
Fix firestore indexes (#15443) 2022-08-25 15:52:19 +00:00
Edoardo Spadolini 5604fa6c8c
Run go mod tidy (#15711) 2022-08-22 14:58:10 +00:00
Noah Stride 3a853cdfd0
Self signed certificates tsh TTL fixes (#14985)
* start work on self signed tsh fixes

* fix go sum

* Adjust error formatting

* Complete less explicit error checks last

* Adjust PR feedback

* Further PR review

* Support darwin and linux certificate errors
2022-07-28 20:43:40 +00:00
Krzysztof Skrzętnicki 0e9d621b46
Alias support for tsh (#13305)
* aliases are read from global and user configs.
* we prevent Kingpin from terminating `tsh`; we handle parsing errors better.
* added support for `TELEPORT_DEBUG` env variable, changed how logging is initialized.
* debugging aliases is possible via `TELEPORT_DEBUG=1` env variable; `--debug` is ineffective as it comes into play too late.
* if alias definition calls `tsh`, we call the `Run()` function directly instead of spawning fresh `tsh`; this improves the UX.
* alias loops are detected and a proper error is shown.
* all flags are made repeatable; if only one value for a given flag is possible, the last instance of the flag will be effective. 

Co-authored-by: Marek Smoliński <marek@goteleport.com>
2022-07-27 11:14:55 +00:00
Marco Dinis 5effbd8359 Add Teleport operator
This commit adds the Teleport operator. The operator reconciles
TeleportUsers and TeleportRoles Kubernetes resources with Users and
Roles Teleport resources.
2022-07-25 15:27:10 -04:00
Jakub Nyckowski 5f4e586599
Disable MongoDB server selection in tests (#14622) 2022-07-19 17:49:18 +00:00
STeve (Xin) Huang 13abca6638
Optimize tsh db ls performance (#14092) 2022-07-09 20:22:47 +00:00
Andrew LeFevre a150b0c8e1
SFTP server side support (#13491)
add sftp server functionality
2022-07-07 20:08:26 +00:00
David Boslee bb235e15cf
Add missing tunnel metric support when proxy peering is enabled (#14022)
Co-authored-by: Vitor Enes <vitor.duarte@goteleport.com>
2022-07-07 15:07:46 +00:00
Alan Parra e005f6060e
Implement FIDO2 credential picker (#14033)
Add a credential picker to the tsh FIDO2/WebAuthn backend.

The PR pulls a recent patch in our go-libfido2 fork that makes it correctly
return multiple assertions from the authenticator. This allows us to implement
the credential picker for FIDO2, simplify our implementation and provide the
exact same UX that browsers use (always 1-touch for bio, touch->PIN->touch
otherwise).

I've dropped concepts like "optimistic assertions" and "eager PIN prompts" in
favor of a simple, uniform implementation.

Issue #13901.

* Prompt for credentials in LoginPrompt
* Update go-libfido2
* Implement FIDO2 credential picker
* Drop optimistic assertions, only set user if explicit
* Add license to fido2_prompt_test.go
2022-07-01 16:24:26 +00:00
Zac Bergquist 1e021e6db9
Fix dependencies (#13972)
* Don't use k8s utils package

We have our own function to check for the presence of a string
in a []string.

* Fix go.mod's missing 'e' dependencies
2022-06-29 14:08:46 +00:00
Reed Loden 83eb9b2acb
Bump go.mod to use Go 1.18 (#13771)
We're now using Go 1.18 features (native fuzzing in https://github.com/gravitational/teleport/pull/13473),
which means we need to accurately state that we require Go 1.18 in our go.mod.
2022-06-29 02:14:12 +00:00
Eugene Yakubovich 4de14faa13
Bump to libbpfgo v0.2.5 (#12288)
Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>
2022-06-08 05:00:01 +00:00