943 Commits
Author SHA1 Message Date
Joel 48077e168f Fix firestore (#8181) 2021-09-14 11:32:53 +02:00
Lisa Kim 6c1a5b7b87 Implement Account Recovery Codes (#8034)
* Add dice-ware library to create the recovery codes
* Add new recovery code "generated" and "used" events
* Implement create, upsert, and get recovery codes
* Create ChangeUserAuthentication grpc endpoint that is essentially a rework
  of ChangePasswordWithToken that returns both a web session and
  recovery codes (if user meets requirement)
* Add custom rate limit for grpc endpoint for ChangeUserAuthentication

* This commit also includes unused methods related to verifying recovery
  code and recovery attempts that isn't utilized until later PRs
2021-08-26 17:29:08 -07:00
Alan Parra c401bb7cf7 Implement WebAuthn login (#8009)
Add the necessary logic to perform WebAuthn logins/authentication, including
both necessary steps (named "Begin" and "Finish" after the Duo Labs
API/reference implementation).

Note that the login logic is not yet wired to Teleport, that is to come in a
future PR.

Part of the WebAuthn Support[1] work.

[1] https://github.com/gravitational/teleport/pull/7808

* Vendor duo-labs/webauthn and fxamacker/cbor/v2
* Implement the first step of login
* Implement the second step of login
* Add WebAuthn support for mock U2F devices
* Add tests for the complete login flow
* Be explicit about the default attestation value
* Refactor "appid" into a constant
* Add missing license headers
2021-08-26 10:50:59 -07:00
Roman Tkachenko 060750bc88 Vendor our logrus fork to fix data race (#7940) 2021-08-17 12:58:20 -07:00
Andrej Tokarčík f97b7c09d3 Reject cert generation requests for locked-out users/hosts (#7746) 2021-08-12 19:52:13 +02:00
Brian Joerger 9b8b9d6d0c rollback - Upgrade api version. (#7751) 2021-07-30 15:34:19 -07:00
Nic Klaassen 185e5fda35 Add hsmKeyStore implementation (#7614) 2021-07-29 13:08:01 -07:00
Brian Joerger c040aca4c1 Upgrade api version. (#7609) 2021-07-28 13:51:21 -07:00
Russell Jones 45f8954c5b Fixed vendoring issue. 2021-07-14 14:41:34 -07:00
Eugene Yakubovich c83d028d92 libbpfgo has been moved out of tracee
libbpfgo is now a standalone project and thus
requires Teleport to vendor less code.
2021-07-14 11:56:59 -07:00
Roman Tkachenko efc3973f78 Better handling of database access IAM errors (#7525) 2021-07-14 09:13:39 -07:00
Roman Tkachenko 6b9726f961 Add MongoDB database access support (#7213) 2021-06-21 22:54:05 -07:00
Andrew LytvynovandAndrej Tokarčík 41d0e1f557 grpc: call trail.ToGRPC from gRPC interceptors (#7217)
* grpc: call trail.ToGRPC from gRPC interceptors

The reduces the boilerplate a bit in the gRPC handlers and ensures you
won't forget the conversion.

* Update lib/auth/grpcserver.go

Co-authored-by: Andrej Tokarčík <[email protected]>

Co-authored-by: Andrej Tokarčík <[email protected]>
2021-06-10 15:05:56 -07:00
Russell Jones 3043809051 Updated vendoring of tracee/libbpfgo.
Updated vendoring of  github.com/aquasecurity/tracee/libbpfgo to point
to 242d721b using the following command:

CGO_LDFLAGS=-lbpf \
  go get -u -v github.com/aquasecurity/tracee/libbpfgo@242d721b
2021-05-28 15:25:23 -07:00
Eugene Yakubovich 585c33232b Move from BCC to libbpf with CO-RE. 2021-05-28 15:25:23 -07:00
Russell Jones 66f3aab036 Fixed IBM Cloud AppID SSO integration.
IBM Cloud AppID SSO returns strings as well as integers in JWT headers.
Updated version of our go-oidc fork which handles string and integer
values in JWT headers.
2021-05-20 18:45:26 -07:00
Brian Joerger f533872a25 Upgrade api's trace dependency to 1.1.15 (#6341) 2021-05-03 16:27:51 -07:00
a-palchikov d301da5a39 Embed webassets natively into teleport instead of attaching to the binary (#5935)
Switch to go1.16. Use embed package to embed webassets instead of ad-hoc attaching to binary
2021-03-26 17:37:52 -07:00
Roman Tkachenko 8739417729 Add Postgres Cloud SQL support (#5941) 2021-03-22 09:38:05 -07:00
Roman Tkachenko b2ff4df8fa Fix app access websockets support (#6072) 2021-03-22 08:56:44 -07:00
Andrew Lytvynov efc99a068c Update Go dependencies
Several dependencies can't be updated due to breakages (etcd and grpc
for example).

Also updated ttlmap usage since their API changed.
2021-02-23 18:04:55 -08:00
Brian Joerger 427bafe7b2 API Go module (#5449) 2021-02-22 16:20:43 -08:00
Roman Tkachenko e235dfa35a Update go-mysql to fix performance issue (#5554) 2021-02-11 17:31:56 -08:00
Roman Tkachenko 81e1102250 Add MySQL support for database access (#5453) 2021-02-10 11:08:13 -08:00
Andrew Lytvynov 491a298b1a mfa: replace u2f-host with github.com/flynn/u2f (#5477)
This change removes the need for users to manually install u2f-host.
It also enables us to do U2F authentication with multiple devices.
2021-02-04 11:10:00 -08:00
Andrew Lytvynov e3ee42a775 Upgrade go-sqlite3 (#5436)
After a recent local C compiler upgrade, I started getting these
warnings when building teleport:

```
\# github.com/mattn/go-sqlite3
sqlite3-binding.c: In function 'sqlite3SelectNew':
sqlite3-binding.c:123303:10: warning: function may return address of local variable [-Wreturn-local-addr]
123303 |   return pNew;
       |          ^~~~
sqlite3-binding.c:123263:10: note: declared here
123263 |   Select standin;
       |          ^~~~~~~
```

Upgrading to the latest version clears those.
Here's the full changelog: https://github.com/mattn/go-sqlite3/compare/v1.10.0...v1.14.6
2021-01-29 12:15:14 -08:00
Roman Tkachenko 8e1865464b Database access (#5005) 2021-01-14 18:21:38 -08:00
a-palchikov 6684c37103 Use fake clock consistently in units tests. (#5263)
Use fake clock consistently in units tests.
2021-01-12 12:10:00 +01:00
a-palchikovandAndrew Lytvynov 54ee98f529 Upgrade github.com/gravitataional/trace to v1.1.13 (#5187)
* Upgrade github.com/gravitataional/trace to v1.1.12

We were a few versions behind. In particular this versions lets us use
stdlib's `errors.Is/As` to inspect errors.

* Bump trace to 1.1.13

Co-authored-by: Andrew Lytvynov <[email protected]>
2020-12-23 11:30:15 +01:00
Andrew Lytvynov 05c73c9372 Upgrade gosaml2 library to v0.6.0 (#5118)
See https://github.com/russellhaering/gosaml2/security/advisories/GHSA-xhqq-x44f-9fgg
2020-12-14 11:34:20 -08:00
a-palchikov c94e5042c7 Server data race (#4790)
* Add logger attributes to be able to propagate logger from tests for identifying tests
* Add test case for Server's DeepCopy.
* Update test to using the testing package directly. Update dependency after upstream PR.
2020-12-09 16:46:33 +01:00
a-palchikov 7c87576a8b flaky tests: consistent logging (#4849)
* Update logrus package to fix data races
* Introduce a logger that uses the test context to log the messages so they are output if a test fails for improved trouble-shooting.
* Revert introduction of test logger - simply leave logger configuration at debug level outputting to stderr during tests.
* Run integration test for e as well
* Use make with a cap and append to only copy the relevant roles.
* Address review comments
* Update integration test suite to use test-local logger that would only output logs iff a specific test has failed - no logs from other test cases will be output.
* Revert changes to InitLoggerForTests API
* Create a new logger instance when applying defaults or merging with file service configuration
* Introduce a local logger interface to be able to test file configuration merge.
* Fix kube integration tests w.r.t log
* Move goroutine profile dump into a separate func to handle parameters consistently for all invocations
2020-12-07 15:35:15 +01:00
76d07d10cf Bump Go to 1.15.3 (#4811)
* Bump Go to 1.15.5

* Downgraded Go version to 1.15.3.

* Sign .drone.yml

Co-authored-by: Russell Jones <[email protected]>
Co-authored-by: Gus Luxton <[email protected]>
2020-11-16 18:36:17 +00:00
Russell Jones e94e4b5147 Updated vendoring of AWS SDK.
Vendored github.com/aws/aws-sdk-go/aws/applicationautoscaling.
2020-11-03 17:46:34 -08:00
Russell Jones a175e21c97 Vendored gopkg.in/square/go-jose.v2/jwt. 2020-11-03 14:32:13 -08:00
jane (quin) 888d6f5d9a updated HDR histogram vendor (#4461) 2020-10-07 17:13:18 -07:00
Andrew Lytvynov cfb7839c08 Update vendored k8s dependencies 2020-09-29 21:04:02 +00:00
Andrew Lytvynov 8aacdc1b0f Update github.com/russellhaering/goxmldsig to v1.1.0
See https://github.com/russellhaering/goxmldsig/security/advisories/GHSA-q547-gmf8-8jr7
2020-09-29 17:51:50 +00:00
Sasha Klizhentas d160507430 Session streaming
This commit introduces GRPC API for streaming sessions.

It adds structured events and sync streaming
that avoids storing events on disk.

You can find design in rfd/0002-streaming.md RFD.
2020-09-28 23:08:56 -07:00
Andrew Lytvynov 3587cca784 Always collect metrics about top backend requests (#4282)
* Always collect metrics about top backend requests

Previously, it was only done in debug mode. This makes some tabs in
`tctl top` empty, when auth server is not in debug mode.

* backend: use an LRU cache for top requests in Reporter

This LRU cache tracks the most frequent recent backend keys. All keys in
this cache map to existing labels in the requests metric. Any evicted
keys are also deleted from the metric.

This will keep an upper limit on our memory usage while still always
reporting the most active keys.
2020-09-16 20:33:19 +00:00
Andrew Lytvynov 9c041361f9 Vendor testing dependencies
- github.com/stretctr/testify
- github.com/google/go-cmp
2020-08-28 00:28:45 +00:00
Andrew Lytvynov ad59af2220 Re-vendor dependencies with go mod
This is a result of "go mod vendor".
You'll notice that some versions have changed. This is due to the
transient module dependencies that dep wasn't aware of.

For example:
- Gopkg.lock imported cloud.google.com/go v0.41.0 and
  github.com/fsouza/fake-gcs-server v1.11.6
- github.com/fsouza/fake-gcs-server v1.11.6 has a go.mod file that
  depends on cloud.google.com/go v0.43.3:
  https://github.com/fsouza/fake-gcs-server/blob/v1.11.6/go.mod#L4
- therefore, "go mod vendor" bumped cloud.google.com/go to v.0.43.3

Same transient dependency version bumps got applied to some other
modules.

A few are also removed via "go mod tidy".
2020-07-17 16:09:23 +00:00
Andrew Lytvynov f8d1f0bcba Create initial go.mod
This go.mod uses the exact versions of dependencies from existing
Gopkg.lock.
2020-07-17 16:09:23 +00:00