Commit Graph
12109 Commits
Author SHA1 Message Date
STeve (Xin) Huang 3a0ab15f4a Support App access behind load balancer (#22565)
* Support App access behind load balancer

* revert unecessary change

* fix lint

* Fix UT

* minor refactor
2023-03-14 13:47:41 +00:00
Justinas Stankevičius c056efe974 Hosted plugins: add plugin management UI prerequisites (#22831)
* Add GetType() to Plugin

* Add Plugins feature flag to web

* Run prettier

* Update e_imports.go with slack plugin subpackage

Respective enterprise changes imports a new subpackage,
which pulls new dependencies.
2023-03-14 12:44:22 +00:00
Grzegorz Zdunek dab301b182 Add testplan items for Connect config (#22873)
* Add testplan items for Connect config

* Rename "three dots" to "More Options"
2023-03-14 10:04:16 +00:00
Rafał Cieślak ffaa34390e Log Connect version on startup (#22966)
When users send us logs, we have to ask them which version they're using
anyway as we don't currently save this information anywhere in the logs.
2023-03-14 09:50:02 +00:00
Edoardo Spadolini acdf61d931 usagereporter: Use the batched event ingest RPC (#22739)
* Sync prehog/v1alpha/teleport.proto

* Use the new SubmitEvents rpc

* Remove leftover file

* Warn against changing usageReporterMaxBatchSize
2023-03-14 08:58:03 +00:00
Grzegorz ZdunekandRafał Cieślak af9e0ed438 Connect: Add "Open Config File" item to menu (#22730)
* Expose `openConfigFile` IPC

* Add "Open Config File" to `NavigationMenu`

* Make `NavigationMenu` more concise

* Remove unused imports

* Call "three dots" menu "More Options" to make it easier to refer to in the docs

* Show a notification with a config file path

* Render the icon component only in `NavigationItem`

* Render the separator only with access request items

* Use just `separator` string instead of an object

* Render `StyledListItem` as a button

* Shorten the notification

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>

---------

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
2023-03-14 07:45:07 +00:00
Sakshyam Shah ca61963543 devices icon to be used for device trust management menu (side navigation) (#22970) 2023-03-14 04:21:23 +00:00
Trent Clarke a3c70378aa Fix OCI promotion (#22867)
Removes unnecessary workflow arguments from the Drone workflow
invocation. Refactors some of the `dronegen` generators to make
this easier to express insife `dronegen`
2023-03-14 01:45:23 +00:00
Michael Wilson 144992b67f Fix locks not propagating in cache. (#23010)
The locks were not being properly upserted to the cache after the collections
refactor. This was due to a typo when writing the `upsert` logic for the locks
collection.
2023-03-14 00:26:35 +00:00
Russell Jones 2416103738 Added basic etcd scaling information (#23008) 2023-03-14 00:20:01 +00:00
Russell Jones 4a964d3fdd Added information on fetching agent version. (#23006) 2023-03-13 23:01:52 +00:00
Brian Joerger 51a511bcaf Headless Login: add headless authentication resource watcher (#22699)
* Add headless authentication resource watcher.

* Handle OpInit event and Watcher errors.
2023-03-13 19:44:25 +00:00
Paul Gottschling 71d7015c63 Update the docs style guide (#22498)
* Update the docs style guide

- Add the instruction not the recreate content where unnecessary to the
  "How-to guides" section in addition to the "Getting started" section,
  since this was intended to apply to both kinds of guides.
- Change the requirement to include a video with Getting Started guides
  to a suggestion, matching our current practices.
- Add instructions to use technically precise language.

* Partially respond to PR feedback

* Respond to PR feedback
2023-03-13 19:06:00 +00:00
rosstimothy 84562ffc49 Adds the following sections to the RFD template: (#22993)
#### Proto Specification
 - This ensures that all api changes are reviewed during the
   design and not in a subsequent PR. This is also more closely
   aligns with the design process we force on interview candidates.
#### Backward Compatibility
 - Forces RFD authors to consider how there changes will interact
   with older clusters and clients. Any migration steps should be
   called out directly in the RFD so that when the feature is rolled
   out there are no surprises.
#### Test Plan
 - Causes the authors to think about what quality assurance measures
   need to be in place to catch regressions before they happen. The
   same testing should also occur prior to the initial release that
   the feature will land in if said release isn't a major release.
2023-03-13 19:03:23 +00:00
Rafał Cieślak a5fa148070 Fix unresponsive terminal in Connect on Windows Server 2019 (#22971)
* Update node-pty to 0.11.0-beta29

* Do not use ConPTY
2023-03-13 17:23:36 +00:00
Rafał Cieślak 328c4e8c7d Fix uncaught exception handling in Connect's shared process (#22962)
* Fix uncaught exception handling in Connect's shared process

Without this patch, an uncaught exception being thrown would result in
the following error due to how binding methods to class instances works:

C:\Users\rav\AppData\Local\Programs\teleport-connect\resources\app.asar\
build\app\dist\main\sharedProcess.js:73614
    this.getLogger().error(message, ...args);
         ^

TypeError: this.getLogger is not a function
    at process.error (C:\Users\rav\AppData\Local\Programs\teleport-connect\
       resources\app.asar\build\app\dist\main\sharedProcess.js:73614:10)
    at process.emit (node:events:513:28)
    at process._fatalException (node:internal/process/execution:167:25)

* Log the origin of the uncaught exception
2023-03-13 16:54:13 +00:00
matheus d6133ff69f Hide upgrade-related alerts from dashboards (#22967)
* Filter version alerts out of the alerts list

* Use constants to alert names

* Update test

* Addres code review comment

* Use afterEach to undo cfg change
2023-03-13 16:41:51 +00:00
Paul Gottschling 5ba910b38f Provide more context in the docs intro page (#22517)
* Provide more context in the docs intro page

Closes #22469

The current docs landing page does not include enough context for new
readers. After the general description of Teleport, the rest of the
landing page is series of links, with little guidance for what a new
user should do first (or what an intermediate user should do after
completing the initial setup steps).

This change takes a more narrative approach to the landing page,
briefly describing the content of each top-level docs section and
putting it in context with the rest of the docs. This also helps users
find the right top-level docs section for their needs, since otherwise
the only way to do this is to visit each section.

This change is also more opinionated about which guide new users should
begin with. It recommends the guide to getting started with Teleport
Cloud, since this doesn't require setting up a Teleport cluster and
helps a user register a resource quickly.

The landing page links to the introduction page of each top-level docs
section. If a section does not have an introduction page, this change
adds one.

* Respond to zmb3 feedback

Reorder list items

* Linter fixes

* Respond to alexfornuto PR feedback
2023-03-13 16:16:38 +00:00
Jakub NyckowskiandVictor Sokolov cbb556a05e Change git merge-base method (#22974)
Signed-off-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>
Co-authored-by: Victor Sokolov <gzigzigzeo@gmail.com>
2023-03-13 16:14:50 +00:00
Jeff Pihach 1513294b7b Add CreatedBy and CreatedOn fields to locks. (#22667)
* Add CreatedBy and CreatedOn fields to locks.

* Move the setting of the CreatedBy and CreatedOn for locks to the server instead of the client.

* Add tests for the tctl resource lock import and for the tctl lock create command.

* Use clockwork for time in lock creation tests.

* Make fake clock optional and use the golang 0 date.

* Change CreatedOn to CreatedAt.

* Allow a custom time to be passed through as a fake clock.

* Actually accept a fake clock with useFakeClock.

* Pass Clock through as a configuration value when initializing Teleport for the tests.

* Test cleanup

* Set CreatedBy and CreatedAt values in test mocks.

* Fix failing test from enabling clock passthrough to auth.
2023-03-13 16:14:24 +00:00
matheus b0fb10ae4e Hide download center when not on dashboards and prevent license gRPC endpoint from being called (#22965)
* Hide download center when not on dashboards

* Prevent getLicense gRPC call on cloud
2023-03-13 16:03:23 +00:00
Grzegorz ZdunekandRafał Cieślak 17ff6d6a8f Connect: Show config file errors (#22728)
* Add a function that returns error that might happen during loading the file

* Return validation and file loading errors from `ConfigService`

* Discard file storage updates when the file was not loaded correctly

* Do not show usage reporting dialog when the file was not loaded correctly

* Make title of notifications a little bit smaller, so longer titles do not look weird

* Get rid of sync fs functions wherever possible in file storage

* Move error handling code to `createFileStorage`

* Improve `getConfigError` comment

* Rename `discardUpdatesWhenLoadingFileFailed` to `discardUpdatesOnLoadError`

* Fix the error message in `notifyAboutConfigErrors`

* Revert "Make title of notifications a little bit smaller, so longer titles do not look weird"

* Make `writeSync` async too

* Return `unknown` from `FileStorage.get`

* Add a TODO comment about createFileStorage type

* Add "the" to "Using default config instead"

* Remove `toString()`

---------

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
2023-03-13 15:52:01 +00:00
1f1775bb07 Batched Dependabot updates (#22961)
* Bump libc from 0.2.139 to 0.2.140

Bumps [libc](https://github.com/rust-lang/libc) from 0.2.139 to 0.2.140.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.139...0.2.140)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Bump k8s.io/klog/v2 from 2.90.0 to 2.90.1

Bumps [k8s.io/klog/v2](https://github.com/kubernetes/klog) from 2.90.0 to 2.90.1.
- [Release notes](https://github.com/kubernetes/klog/releases)
- [Changelog](https://github.com/kubernetes/klog/blob/main/RELEASE.md)
- [Commits](https://github.com/kubernetes/klog/compare/v2.90.0...v2.90.1)

---
updated-dependencies:
- dependency-name: k8s.io/klog/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Bump github.com/googleapis/gax-go/v2 from 2.7.0 to 2.7.1

Bumps [github.com/googleapis/gax-go/v2](https://github.com/googleapis/gax-go) from 2.7.0 to 2.7.1.
- [Release notes](https://github.com/googleapis/gax-go/releases)
- [Commits](https://github.com/googleapis/gax-go/compare/v2.7.0...v2.7.1)

---
updated-dependencies:
- dependency-name: github.com/googleapis/gax-go/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp

Bumps [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp](https://github.com/open-telemetry/opentelemetry-go) from 1.13.0 to 1.14.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.13.0...v1.14.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Bump google.golang.org/protobuf from 1.28.1 to 1.29.0

Bumps [google.golang.org/protobuf](https://github.com/protocolbuffers/protobuf-go) from 1.28.1 to 1.29.0.
- [Release notes](https://github.com/protocolbuffers/protobuf-go/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf-go/blob/master/release.bash)
- [Commits](https://github.com/protocolbuffers/protobuf-go/compare/v1.28.1...v1.29.0)

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Bump github.com/prometheus/common from 0.40.0 to 0.42.0

Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.40.0 to 0.42.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.40.0...v0.42.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Bump github.com/jackc/pgx/v4 from 4.18.0 to 4.18.1

Bumps [github.com/jackc/pgx/v4](https://github.com/jackc/pgx) from 4.18.0 to 4.18.1.
- [Release notes](https://github.com/jackc/pgx/releases)
- [Changelog](https://github.com/jackc/pgx/blob/v4.18.1/CHANGELOG.md)
- [Commits](https://github.com/jackc/pgx/compare/v4.18.0...v4.18.1)

---
updated-dependencies:
- dependency-name: github.com/jackc/pgx/v4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Bump google.golang.org/protobuf from 1.28.1 to 1.29.0 in /api

Bumps [google.golang.org/protobuf](https://github.com/protocolbuffers/protobuf-go) from 1.28.1 to 1.29.0.
- [Release notes](https://github.com/protocolbuffers/protobuf-go/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf-go/blob/master/release.bash)
- [Commits](https://github.com/protocolbuffers/protobuf-go/compare/v1.28.1...v1.29.0)

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Bump github.com/russellhaering/gosaml2 from 0.9.0 to 0.9.1 in /api

Bumps [github.com/russellhaering/gosaml2](https://github.com/russellhaering/gosaml2) from 0.9.0 to 0.9.1.
- [Release notes](https://github.com/russellhaering/gosaml2/releases)
- [Commits](https://github.com/russellhaering/gosaml2/compare/v0.9.0...v0.9.1)

---
updated-dependencies:
- dependency-name: github.com/russellhaering/gosaml2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Update generated protos

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alan Parra <alan.parra@goteleport.com>
2023-03-13 15:45:25 +00:00
dependabot[bot] ea97de19de Bump k8s.io/component-base from 0.26.1 to 0.26.2 (#22956)
Bumps [k8s.io/component-base](https://github.com/kubernetes/component-base) from 0.26.1 to 0.26.2.
- [Release notes](https://github.com/kubernetes/component-base/releases)
- [Commits](https://github.com/kubernetes/component-base/compare/v0.26.1...v0.26.2)

---
updated-dependencies:
- dependency-name: k8s.io/component-base
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-13 14:18:57 +00:00
dependabot[bot] 0aadb863b2 Bump k8s.io/apiserver from 0.26.1 to 0.26.2 (#22958)
Bumps [k8s.io/apiserver](https://github.com/kubernetes/apiserver) from 0.26.1 to 0.26.2.
- [Release notes](https://github.com/kubernetes/apiserver/releases)
- [Commits](https://github.com/kubernetes/apiserver/compare/v0.26.1...v0.26.2)

---
updated-dependencies:
- dependency-name: k8s.io/apiserver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-13 14:18:54 +00:00
dependabot[bot] c3265b2320 Bump github.com/russellhaering/gosaml2 from 0.9.0 to 0.9.1 (#22950)
Bumps [github.com/russellhaering/gosaml2](https://github.com/russellhaering/gosaml2) from 0.9.0 to 0.9.1.
- [Release notes](https://github.com/russellhaering/gosaml2/releases)
- [Commits](https://github.com/russellhaering/gosaml2/compare/v0.9.0...v0.9.1)

---
updated-dependencies:
- dependency-name: github.com/russellhaering/gosaml2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-13 14:18:49 +00:00
Edoardo Spadolini 86fb66ceaa Fix usagereporter tests (#22963)
This fixes a data race in TestUsageReporterErrorReenqueue and a deadlock
in TestUsageReporterTimeSubmit.
2023-03-13 13:23:24 +00:00
Tiago Silva 674a3a1ec1 Removes deprecated KindKubeService objects (#22663)
This PR removes the `types.KindKubeService` objects that were
deprecated in Teleport 11.

Teleport 12 removed the double heartbeat and for Teleport 13 we can
safely drop the support of the old hearbeat based on `types.Server`
objects.

Clients older than Teleport 12 connecting to a Teleport 13 server will
fail since they cannot heartbeat using the old mechanism.
2023-03-13 10:55:39 +00:00
Vitor EnesandEdoardo Spadolini b6de0c2f4b RFD 108 - Agent Census (update) (#22872)
* RFD 108 - Agent Census (update)

* Mention macOS agent

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* Add release versions

---------

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
2023-03-13 10:37:27 +00:00
Zac Bergquist b8bf90b898 docs: include a separate page for OSS access requests (#22613)
OSS Teleport supports access requests in a very limited fashion.
Make this clear by adding a separate page that covers the supported OSS
features.

Closes #4818
Closes #13175
Closes #14889
Closes #15979
Closes #22587
2023-03-11 00:05:29 +00:00
Steven Martin d28bf7e902 Remove docs reference and video that users can approve/deny within PagerDuty (#22880)
* Remove docs reference and video that users can approve/deny within PagerDuty

* Remove unused pagerduty doc videos
2023-03-10 23:28:46 +00:00
Tiago Silva 6161969add Fix panic when AuditWriter fails on moderated sessions (#22869)
An assignment before checking the error was replacing the session event
emitter with a `nil` value which eventually panic when the caller
function tries to close the session.
2023-03-10 21:20:47 +00:00
Brian Joerger e299369fd5 Headless Login: protobuf service (#22750)
* Add Headless Authn proto server.

* Add Headless Authn proto client.

* Resolve comments.
2023-03-10 19:42:17 +00:00
Brian Joerger 424606ef35 Headless Login: proxy server changes (#22734)
* * Add proper context handling to auth.AuthenticateUser.

 * Move PublicKey field to AuthenticateUserRequest where it can be used
   for actual authentication.

 * Use a simple switch statement in /webapi/ssh/certs logic to switch
   between password, otp, and eventually headless login.

* Add Headless flow to /webapi/ssh/certs login enpdoint.

* Add 3 minute callback timeout.
2023-03-10 19:25:08 +00:00
Lisa Kim bc6e0d9fe5 Web-Discover: Add support for connection testers with per-session MFA enabled (#22529)
* Define new endpoints and request fields

- Add MFA response field for test connection reqs
- Define new types for checking if MFA is required

* Implement logic to check if MFA is required

* Add MFA dialog to test connectors

Adds a new function field for ReAuthenticate dialog
that just returns the MFA response

* Update storybook

* Change json field names as a result of backend CR

* Address CRs

* Address CR 2
2023-03-10 19:02:58 +00:00
Michael Wilson 9f1cb7b834 Add a getter for the backend in auth.GRPCServer. (#22902)
The `GRPCServer` now has a `GetBackend` method that can be used by auth plugins
to retrieve the backend during plugin registration.
2023-03-10 18:34:59 +00:00
rosstimothy a8568adb82 Make the NodeWatcher more robust (#22877)
Prior to the NodeWatcher being successfully initialized, or when
it became stale any calls to `GetNodes` would return no data or
stale data. This behavior results in the problems described in
#22672.

The NodeWatcher will now fallback to pulling data from the cache
in the event that it has no data or stale data when callers attempt
to retrieve nodes. This should reduce the time that it takes the
a new Proxy or a Proxy with intermittent connectivity issues to
Auth be able to route to nodes.

The impact of this change should be noticeable in tests that
create a Proxy and several Nodes and then immediately try to
open a session on the Nodes.

Closes #22672
2023-03-10 18:34:17 +00:00
Michael Wilson 404faa6b52 Remove the permissions alias. (#22904)
Now that the authorizer has been moved to the `authz` package, the
permissions alias has been removed. Additionally, the `contextKey` in
`permissions.go` has been unexported.
2023-03-10 18:34:11 +00:00
rosstimothy c2fc9a9375 Add idle connection timeouts to http clients and servers (#22885)
Sets `http.Server.IdleTimeout` and `http.Client.IdleConnTimeout`
on clients and servers which didn't have them set. A default of
360s was chosen to be on par with the default of an NLB without
being identical.

This was added as another safety measure to prevent leaking any
idle connections indefinitely as seen in #22757.

`apidefaults.DefaultDialTimeout` was also renamed to
`apidefaults.DefaultIOTimeout` to better reflect its usage.
2023-03-10 16:47:06 +00:00
Alan Parra 1787ae657d chore: Bump gci and golangci-lint (#22881)
* chore: Bump gci to v0.9.1

* chore: Bump golangci-lint to v1.51.2
2023-03-10 15:35:47 +00:00
rosstimothy fa3bb9ac59 Ensure that the webclient closes connections (#22832)
The `http.Client.Transport` created in `newWebClient` wraps a
chain of `http.RoundTripper` over an underlying `http.Transport`.
Since we cannot guarantee that each `http.RoundTipper` has a
`CloseIdleConnections` method the usage of
`defer clt.CloseIdleConnections()` does not guarantee that the http
connections created during Find/Ping/etc are closed.

To prevent leaking connections implementations of `http.RoundTripper`
have added a `CloseIdleConnections` method added that forwards the
request on to the wrapped interface. The `otelhttp.Transport` does
not implement this method either so care has been taken to wrap it
in a `http.RoundTripper` which will call the root transport in
`enforceCloseIdleConnections`. An upstream issue has been filed
with otelhttp: https://github.com/open-telemetry/opentelemetry-go-contrib/issues/3543
to get the method added to their `Transport` implementation.

This wasn't noticed prior to upgrading to go1.20 becuase prior to
[this](https://github.com/golang/go/commit/4e7e7ae1406c70d9cc0809ec11105a55a60a0b70)
commit the `ReadHeaderTimeout` set on the Proxy web api http.Server
would cause the connection to appear idle and get terminated by the
server.

`TestWebClientClosesIdleConnections` was added to capture the leak
in connections as reported in #22757 and prevent any regressions.
2023-03-10 15:21:16 +00:00
Steven Martin a2a6527deb Return Public Web Port in TLS mode for postgres when listen addr specified. (#22058)
* Checks if the mode is TLS and does not use postgres listen port for postgres connection

* Remove log statement and update comment
2023-03-10 15:09:48 +00:00
rosstimothy 95d6d0fee1 Migrate GetCertAuthority to gRPC (#22624)
The HTTP client created by `auth.NewClient` has an idle timeout of
30s and each instance periodically gets cert authorities in
`TeleportProcess.syncRotationStateCycle`. If there has been no
activity when the ticker expires then the request will result in a
brand new connection to Auth to be established. This can cause a
spikes in open file descriptors on the Proxy when there are a large
number of instances connected via a tunnel.

To prevent periodic dialing when retrieving cert authorities the
endpoint has been migrated to the new Trust gRPC service. For now
only the get endpoint has been migrated but the rest of the CRUD
operations for cert authorities should be migrated from the HTTP
api to the gRPC service as well.
2023-03-10 14:32:34 +00:00
8e05bcbb1b Export CRL and Database CA in DER format (#22578)
* feat(tctl): auth export type db der

* feat(tctl): add "crl" command to export revocation lists

* Apply suggestions from code review

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

* chore(tctl): change command description

* Apply suggestions from code review

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

* feat(auth): enable role admin to call generate crl

---------

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
Co-authored-by: Marek Smoliński <marek@goteleport.com>
2023-03-10 14:30:07 +00:00
Vitor EnesandEdoardo Spadolini 6a1d1aedc3 Emit new AgentMetadataEvent (#22068)
* Emit new `AgentMetadataEvent`

Part of https://github.com/gravitational/cloud/issues/3550.

This commits adds a new `UpstreamInventoryAgentMetadata` that is sent
from a Teleport agent to an auth server.
Once received, it is transformed into an `AgentMetadataEvent` and sent
to PreHog.

Most `UpstreamInventoryAgentMetadata` fields are intentionally kept as
empty in this PR. Follow up PRs will be opened with the mechanisms
required to fill them (as described in #21337).

* server_id -> host_id

* compute OS and host architecture

* Compute OS version and container runtime

* Close stream if agent receives an agent metadata message

* cmd -> exec ; file -> read

* implement fetchOSVersion for linux

* Remove unused import

* Add note about `agentMetadataCh`

* Allow commands with args

* Remove parseFun abstraction

* fetch glibc version

* fetch container orchestrator

* Fix lint

* Fix TODO

* Add note about glibc version

* cmd -> command

* fetch cloud environment

* fetch install methods

* GLibCVersion -> GlibcVersion

* Use `http.NewRequestWithContext`

* Add missing comment

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* GLibCVersion -> GlibcVersion

* Fix lint

* Fix helm unit tests

* Add missing comments

* 5 second timeout on http requests

* Spawn gorountine that fetches metadata on each new stream

* Use `defaults.HTTPClient()`

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* Add missing import

* Handle error

* Revert "Spawn gorountine that fetches metadata on each new stream"

This reverts commit fe4f2790be.

* Send agent metadata to auth server once per stream

* Improve note about agentMetadataDone

* Don't process command output & file content on the agent

Since agents cannot be trusted, regex validation and sanitization should
happen in PreHog anyways. So this commit removes such logic in favor of
moving it to PreHog.

* Fix lint

* Trim space

* Move handling of `AgentMetadataEvent` to `handleControlStream`

* Use cached hello message

* Move metadata files to lib/inventory/metadata

* make sending of agent metadata more self contained

* Minimize diff

* Send all system roles to PreHog

* Remove unused import

* Add parsing of command output / file content back

* Usage reporter refactor

* Usage reporter refactor

* Add missing handling of inventory agent metadata msg

* Fix ICS usage reporter

* Improve comments

* Add cached `metadata.Get*` methods

* Use systemctl status instead of is-active

* Add `Metadata` struct

* return pointer in `FetchMetadata`

* Pass context to `GetMetadata`

* metadataFetchConfig -> fetchConfig

* GetMetadata -> Get

* Add note about `Get` result

* Ensure install methods are non-nil

* Exit `metadata.Get` if context is closed

* Replace sync.Once with atomic.Bool.Swap

* Initialize channel

* Fix lint

* Fix lint

* Make `metadata.Get` return an error instead of bool

* Allow multiple true/false values for env vars

* Use `strings.Cut`

* Use /etc/os-release ID instead of NAME

* Improve `autoEmitMetadata`

* Use `gnu_get_libc_version`

* Ubuntu -> ubuntu

* Use GOARCH

* gofmt

* Move import C up

* Variables may include quotes

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* Default values for ID and VERSION_ID

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* Blank lines are permitted

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* Anonymize host id

---------

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
2023-03-10 12:45:29 +00:00
Grzegorz Zdunek f061f9da00 Connect: Provide prehog address for prod env (#22546)
* Provide prehog address for prod env

* Use Connect specific endpoints
2023-03-10 12:01:38 +00:00
Grzegorz Zdunek 2a2b08dbfd Use 13px font size in a Notification (#22842) 2023-03-10 10:08:15 +00:00
Rafał Cieślak f43297f56a Connect: Remove leftovers from resource cache removal (#22772)
* Connect: Remove leftovers from resource cache removal

* GetAll* RPCs were used in the resource cache and are no longer used.
* ListApps was pretty much never actually used as we didn't ever list apps
  in Connect.
* ClusterContext.state.searchValue ceased to be used after we moved to
  fetching resources from the backend.

* Remove remaining leftovers from tshd client mock

* Remove unused imports
2023-03-10 10:05:18 +00:00
Brian Joerger daba903459 Fix TestDiagnoseSSHConnection to be less strict on the exact unknown user error message, which may vary between OS's. (#22855) 2023-03-10 02:23:42 +00:00
Michael Wilson 39a2161411 Update e ref. (#22836)
Update the e reference to migrate the SAML IdP signing service to using the
authz package.
2023-03-10 00:37:23 +00:00