Commit graph

4897 commits

Author SHA1 Message Date
Andrew Lytvynov 0a03d3b70d Ensure that all integration.TeleInstance processes get cleaned up
TeleInstance manages an auth server and a set of proxies/nodes.
TeleInstance.Stop only stops the auth server. A bunch of tests used it
assuming it also cleans up any running nodes.
This has caused a lot of log spam from failing heartbeats and generally
wasted CPU cycles.

Rename it to Stop to StopAuth to make it's purpose more obvious. Add
TeleInstance.StopAll that cleans up everything, suitable for deferring
in tests.
2020-04-17 21:25:47 +00:00
Andrew Lytvynov 2fa77940b8 Make TestWindowChange work on non-standard shells
Some unusual shells like [fish](https://fishshell.com/) don't support
`$(cmd)` nested command syntax.
Print window size as two separate commands separated by newline instead.

Also, scan more of the output, in case the prompt is very long.
2020-04-17 21:25:47 +00:00
Andrew Lytvynov 794b33303d Enable the race detector in integration tests 2020-04-17 20:05:38 +00:00
Andrew Lytvynov 5862262e07 Fix a data race in integration.Terminal
This type uses an inner bytes.Buffer to store terminal output. Terminal
is used by concurrent goroutines as io.ReadWriter, so access to the
buffer needs to be synchronized.
2020-04-17 20:05:38 +00:00
Andrew Lytvynov 4c51cd4f46 Fix a data race in reversetunnel.AgentPool
`AgentPool.Counts` was accessing the agents map without holding the
lock. All access to the map must happen under a lock.
2020-04-17 20:05:38 +00:00
Andrew Lytvynov be8d931877 Fix a data race in utils.SyncBuffer
`SyncBuffer` has a goroutine running `io.Copy` to read from the
underlying pipe. Close stops the pipe, but doesn't wait for the last
chunk of data to be written by `io.Copy` to the buffer.

Both `Bytes` and `String` assume that the buffer received no further
writes after `Close`.

Add explicit synchronization between `io.Copy` goroutine and `Close`.
2020-04-17 20:05:38 +00:00
Andrew Lytvynov d1ea40d074 Enable linters: deadcode,goimports,govet,typecheck
And fix the relevant findings for these linters.

Also, set extra flags for `golangci-lint run` to make sure no findings
are suppressed.
2020-04-17 17:46:51 +00:00
Lisa Kim 9e4f98d0ca
Add u2f section is required in config (#3599) 2020-04-16 17:40:04 -07:00
Lisa Kim c5ca671d67
Emit node hostname as part of session.end event (#3595)
* Test active Session fields are populated
2020-04-16 17:14:47 -07:00
Lisa Kim 1606b30281
Wrap error from u2f library with Trace.BadParameter when registry fails (#3592)
* Removed proxy/auth version mismatch check
2020-04-16 15:32:26 -07:00
Andrew Lytvynov 8c75759b98 Add unit tests for kubeconfig updates
Several tests to confirm correctness of kubeconfig update logic.
Specifically - to make sure existing configuration is not deleted.

`UpdateKubeconfig` was split into two functions because mocking
`*client.TeleportClient` was really difficult.

Fixes #3209
2020-04-16 17:21:02 +00:00
Andrew Lytvynov 12952b4904 Set PDEATHSIG to SIGKILL on child processes after reexec
To execute an SSH command, Teleport re-executes itself and execs the
command from this child process:
  teleport -> teleport exec -> sh -c "user command"

Both parent teleport processes could exit unexpectedly (from SIGKILL or
even connection interruption).

Make sure all child processes get cleaned up and not orphaned to PID 1:
- teleport exec via SIGQUIT to request graceful shutdown
- user command via SIGKILL because it might ignore other signals
2020-04-16 16:56:22 +00:00
Steven Martin c6fe327938
Correct FIPS binary question (#3587)
"Complied" was used instead of "compiled" for the BoringCrypto reference.
2020-04-15 15:46:58 -07:00
Alexey Kontsevoy 3c670d5d58
Merge Teleport V4.3 UI branch to master (#3583)
* Add monorepo

* Add reset/passwd capability for local users (#3287)

* Add UserTokens to allow password resets

* Pass context down through ChangePasswordWithToken

* Rename UserToken to ResetPasswordToken

* Add auto formatting for proto files

* Add common Marshaller interfaces to reset password token

* Allow enterprise "tctl" reuse OSS user methods (#3344)

* Pass localAuthEnabled flag to UI (#3412)

* Added LocalAuthEnabled prop to WebConfigAuthSetting struct in webconfig.go
* Added LocalAuthEnabled state as part of webCfg in  apiserver.go

* update e-refs

* Fix a regression bug after merge

* Update tctl CLI output msgs (#3442)

* Use local user client when resolving user roles

* Update webapps ref

* Add and retrieve fields from Cluster struct (#3476)

* Set Teleport versions for node, auth, proxy init heartbeat
* Add and retrieve fields NodeCount, PublicURL, AuthVersion from Clusters
* Remove debug logging to avoid log pollution when getting public_addr of proxy
* Create helper func GuessProxyHost to get the public_addr of a proxy host
* Refactor newResetPasswordToken to use GuessProxyHost and remove publicUrl func

* Remove webapps submodule

* Add webassets submodule

* Replace webapps sub-module reference with webassets

* Update webassets path in Makefile

* Update webassets

1b11b26 Simplify and clean up Makefile (#62) https://github.com/gravitational/webapps/commit/1b11b26

* Retrieve cluster details for user context (#3515)

* Let GuessProxyHost also return proxy's version
* Unit test GuessProxyHostAndVersion & GetClusterDetails

* Update webassets

4dfef4e Fix build pipeline (#66) https://github.com/gravitational/webapps/commit/4dfef4e

* Update e-ref

* Update webassets

0647568 Fix OSS redirects https://github.com/gravitational/webapps/commit/0647568

* update e-ref

* Update webassets

e0f4189 Address security audit warnings Updates  "minimist" package which is used by 7y old "optimist". https://github.com/gravitational/webapps/commit/e0f4189

* Add new attr to Session struct (#3574)

* Add fields ServerHostname and ServerAddr
* Set these fields on newSession

* Ensure webassets submodule during build

* Update e-ref

* Ensure webassets before running unit-tests

* Update E-ref

Co-authored-by: Lisa Kim <lisa@gravitational.com>
Co-authored-by: Pierre Beaucamp <pierre@gravitational.com>
Co-authored-by: Jenkins <jenkins@gravitational.io>
2020-04-15 15:35:26 -04:00
Andrew Lytvynov 7890b4b7a7 Add local aliases to default host cert principals
Adding following principals:
- `localhost`
- `127.0.0.1`
- `::1`

With these, `tsh` (both `ssh` and `join`) works with a local proxy
without any SSH handshake errors.

Removed the warning from quickstart docs, but keeping `--proxy=grav-00`
since that implies to the reader that proxy is usually remote.

Fixes #2910
2020-04-15 01:23:03 +00:00
Gus Luxton e735c37583 Delete .gitignore 2020-04-15 00:30:33 +00:00
Gus Luxton 4aeb9e07b1 Update .gitignore
Add latest docs symlink to main .gitignore
2020-04-15 00:30:33 +00:00
Gus Luxton 85933d1c19 Create .gitignore
Add latest and latest.yaml to .gitignore
2020-04-15 00:30:33 +00:00
Andrew Lytvynov c39f089b72 Remove recursive latest symlink in docs/
The symlink points to itself, seems like it's leftover from olden days.

Fixes #3575
2020-04-15 00:30:33 +00:00
Lars Lehtonen ffce69d04b tool/teleport/common: fix test permission 2020-04-13 18:00:27 -07:00
Gus Luxton 896dd89971 Formatting 2020-04-13 17:33:44 -07:00
Gus Luxton e2bad167c4 Added updating Helm chart version to Makefile 2020-04-13 17:33:44 -07:00
aelkugia 4950d13a3d Extend comment to discuss FIPS mode - setting local_auth to false 2020-04-13 17:31:54 -07:00
aelkugia c8f3b8f252 Update admin guide config file - 'false' is not a valid authentication type. 2020-04-13 17:31:54 -07:00
Andrew Lytvynov a1ddfd31be Minor architecture docs tweaks
- consistently use "certificate" instead of "public key"
- make diagram in "local users" section match the text (user "sandra"
  doesn't have access to "grav-02")
- de-duplicate docs on session streaming between auth and proxy pages
2020-04-13 17:31:25 -07:00
Andrew Lytvynov fe7e8460e0
Install golangci-lint in the build container (#3564)
Missed in #3563. By default this tool wasn't installed.
Eventually it might make sense to move this to buildbox-base.
2020-04-13 15:58:45 -07:00
Andrew Lytvynov 178ccff32d
[docs] Minor wording cleanup to FIPS (#3567)
Remove a few duplicate sentences and make wording clearer.
2020-04-13 13:00:56 -07:00
Andrew Lytvynov b994920aa8
Add make rules for linting (#3563)
Top-level `make lint` rule that scans everything and a CI-specific rule
for Jenkins.
Currently only enable "unused", since it's reliable. The list will
expand.

Also clean up stragglers that somehow slipped through in #3552.

Updates #3551
2020-04-10 11:37:09 -07:00
Steven Martin 9e32878163
[docs] Update enhanced session recording docs for Amazon 2 Linux (#3560)
Expanded instructions to include installing BCC within a Amazon 2 Linux.  Moved some instruction steps for flow since amazon 2 linux doesn't require building the bcc tools.
2020-04-10 10:33:31 -07:00
Andrew Lytvynov f8661edea3 Clean up dead code across the codebase
Spring cleaning!
A very mechanical cleanup using several linters (unused, deadcode,
structcheck). Build and tests still pass so no behavior should be
affected.
2020-04-09 21:10:12 +00:00
Steven Martin 24029efcfc
Correct Msft azure ad link in docs (#3535)
* Correct Msft azure ad link in docs

MSFT AzureAD link wasn't properly formatted to produce a browser. fixed

* Warning tip on federation document was not in the styling format to render correctly. Fixed.

Co-authored-by: Ben Arent <ben@gravitational.com>
2020-04-09 12:55:20 -04:00
Andrew Lytvynov a1df63533b
Merge pull request #3547 from awly/improve-make-test
Fix build error in examples/go-client
2020-04-09 03:58:02 +00:00
Andrew Lytvynov afe814e724 Ensure make test covers all packages
Selectively listing package paths is error-prone. Use `go list` to get
the complete list instead. Filter out integration tests since they are
slower.

Also, enable the race detector by default. Local `make test` runs should
not skip it.
2020-04-08 17:38:03 -07:00
Andrew Lytvynov 1cd247905c Fix broken build in example Go client code
The API of auth package changed in an incompatible way. Fix the usage.
2020-04-08 17:38:03 -07:00
Gus Luxton 48cc090e8d
[docs] Add tunnel_public_addr (#3548)
We didn't mention `tunnel_public_addr` in the docs for some reason, but it's critical knowledge for anyone setting up behind a load balancer.
2020-04-08 12:59:03 -07:00
Steven Martin 3b0db4c944
Merge pull request #3512 from gravitational/stevenGravy-oidc-debugoutput-patch-2
Correct misspelling in OIDC and SAML debugging
2020-04-07 14:44:12 -04:00
Steven Martin ac5d427b7e
Merge branch 'master' into stevenGravy-oidc-debugoutput-patch-2 2020-04-07 14:13:49 -04:00
Russell Jones c0f7c131cf Update CODEOWNERS 2020-04-07 10:57:56 -07:00
Ari Becker c6641eda71
[docs] Fix incorrect URL to tarball checksum (#3517)
The URL provided in the documentation for the tarball's checksum was
missing a `-`, and resulted in a 404 when actually trying to run the
`curl`. This adds the missing `-` so that the `curl` call will succeed
as expected.

Co-authored-by: Ben Arent <ben@gravitational.com>
2020-04-07 09:35:46 -07:00
Steven Martin bcd7436e26
Merge branch 'master' into stevenGravy-oidc-debugoutput-patch-2 2020-04-07 12:31:01 -04:00
Ben Arent 723ea0cd12
Error in Github.yaml (#3523) 2020-04-07 09:21:20 -07:00
Ben Arent 48e742003d
Relabel Sidebar (#3521)
* Update Sidebar
* Bump Install Version
2020-04-07 09:20:48 -07:00
Steven Martin 09b1a22d32
Merge branch 'master' into stevenGravy-oidc-debugoutput-patch-2 2020-04-06 14:02:47 -04:00
Steven Martin a02519cda3
Microsoft Azure Active Directory SSO Instructions (#3514) 2020-04-06 14:55:40 -03:00
Gus Luxton d34948b9fc
Add warning about table_name vs audit_events_uri (#3511)
As per #2542
2020-04-06 10:59:52 -03:00
Steven Martin c276f0e10b
Correct misspelling in output 2020-04-02 14:54:43 -04:00
Steven Martin 8ca47def00
Correct spelling in oidc debugging 2020-04-02 14:51:06 -04:00
Gus Luxton 9c2f0f89ae
Add mention of node tunnelling to port 3024 (#3509)
Also remove redundant # from port numbers
2020-04-02 09:56:57 -03:00
Forrest Marshall 924fb9cd00 synchronize bpf watch map reads 2020-04-01 11:41:44 -07:00
Russell Jones 8443f7c445
Update CHANGELOG.md 2020-04-01 11:04:05 -07:00