Commit graph

15738 commits

Author SHA1 Message Date
teleport-post-release-automation[bot] 562834af79
[auto] Update AMI IDs for 14.1.5 (#34696)
Co-authored-by: GitHub <noreply@github.com>
2023-11-17 07:14:36 +00:00
Trent Clarke 0b5bd680e8
Prohibit the Okta service from resetting user passwords (#34690)
* Prohibit the Okta service from resetting user passwords

There are no circumstances where the Okta service should be resetting
a user password, so creating a reset token is strictly prohibited.

Includes some test refactoring to re-use the general Okta user CRUD test
machinery to test this change.

Special thanks to @tigrato for spotting this.

* Test that okta may not create a bot user
2023-11-17 04:09:50 +00:00
Brian Joerger c810585414
Update RFD 131 - Short list of admin actions (#34674)
* Update Admin actions RFD with a short list of endpoints.

* update backwards compatibility section.

* Add missing role endpoints.
2023-11-17 00:35:20 +00:00
fheinecke 95209ea0cf
Minor license typo fix (#34683)
* Minor license typo fix

* Additional license typo fixes

* build-test-compat.sh
2023-11-16 23:29:44 +00:00
Trent Clarke 840345caca
Make types.User implement ResourceWithLabels (#34654)
* Make `types.User` implement `ResourceWithLabels`

Embeds the `ResourceWithLabels` interface into `types.User` in order
to allow the Okta sync service re-use our existing reconciliation
tooling with User resources.

Also adds the appropriate methods to `types.UserV2` so that it still
implements the expanded `types.User` interface.

* spelling fixes
2023-11-16 22:16:01 +00:00
Brian Joerger 48dc80cf15
MFA for admin actions: Add server side check (#33676)
* Add method to check MFA challenge response for admin actions.

* Add tests.

* Move AuthorizeAdminAction to authz package.

Add ValidateMFAAuthResponse as a dependency for the authorizer.

Update tests to include a mock ValidateMFAAuthResponse method.

* Resolve comments.
2023-11-16 21:30:24 +00:00
Michael Wilson 2dbb2b4d4b
Access list app in plugin ceases to run when endpoints not implemented. (#34669)
When access list endpoints are not implemented, the access list app in the
access plugins will cease to run. This could happen if the integration is
being run against an open source server.
2023-11-16 20:39:31 +00:00
Jakub Nyckowski 4efd593f88
Update e ref (#34673) 2023-11-16 20:37:22 +00:00
fheinecke 79c35dda81
Fixed tag builds using commit instead of tag ref (#34668) 2023-11-16 18:59:54 +00:00
Forrest 047b6ccda7
improve test cov for auth caches (#33939) 2023-11-16 18:42:58 +00:00
Jakub Nyckowski af817583ad
Proxy TAG requests through Auth (#34642)
* Proxy TAG requests through Auth

* Integrate Access Graph feature and optimize services

This commit entails the integration of the Access Graph feature into the existing service configuration. This feature is manifested through an 'IsEnabled' method that checks the state of the access graph. Additionally, the auth service logic now includes a flag for enabling access graph. The services have been further optimized with adjustments geared towards improving performance and readability of the code.

* Move TAG enabled flag from proxy to user setting/auth context

* Swap a pointer to AccessGraph config with a value.

* Add 'TestNewAccessGraph' function to 'useracl_test.go' file.

The function 'TestNewAccessGraph' has been added to run tests checking the configuration of Access Graph. Furthermore, a small change is made for the 'KindAccessGraph' comment in 'constants.go' to provide more accurate information.

* Implement Access Graph feature across various files

The Access Graph feature has been incorporated in 'module.go', 'authservice.proto', 'auth.go', and 'plugin.go' files. A method 'EnableAccessGraph' is also introduced in 'module.go' to allow the usage of this feature. Descriptions of Access Graph have been adjusted across files to explicitly state the feature's enablement.

* Fix tests

* Remove unused access graph feature code

This commit removes all references and uses of the access graph feature from the codebase. It also updates corresponding tests to reflect this removal. It also adds EnableAccessGraph() method to testing module to fix test compilation.
2023-11-16 18:08:37 +00:00
Zac Bergquist 3d69ad9c03
Prevent AKS discovery from panicking if group claim is missing (#34609)
Looks like we were depending on the golang-jwt library to catch
this case rather than checking explicitly, and an update to the
library broke us.

Fixes #34514
2023-11-16 17:35:37 +00:00
Evan Freed 3af6d9c1a2
bump cloud version to 14.1.3 (#34604)
Signed-off-by: Evan Freed <evan.freed@goteleport.com>
2023-11-16 15:37:34 +00:00
Michael Wilson f1c3fae146
Add Slack access list reminders. (#34461)
* Add Slack access list reminders.

Access list review reminders will now be sent to owners via Slack every week
until the access list is reviewed. Some small modifications were made to the
access list application to support partial success. Additionally, some changes
were made to the way access applications are instantiated to maintain
compatibility with enterprise.

* Tweak error returns, debug statements.

* Notify once per day after the next audit date has passed, remove access list name from slack notifications.

* Fix for day notifications.
2023-11-16 15:34:45 +00:00
Alan Parra 40dc2e9c6c
Collect device data concurrently on Linux (#34602)
* Read DMI files concurrently

* Refactor DMI logic into its own method

* Collect device data concurrently on Linux

* Drop the mutex on DMIInfoFromFS, simplify
2023-11-16 14:20:57 +00:00
Joel b65e7f3b7e
update e to include TAG changes (#34653) 2023-11-16 14:03:40 +00:00
Alan Parra e92d0bffff
Add the os_id field to device messages (#34588)
* Add the os_id field to device messages

* Update generated protos

* Add os_id field conversions

* Collect os_id on Linux devices

* Fix Linux tests
2023-11-16 13:05:47 +00:00
Krzysztof Skrzętnicki 5d4f5da9e7
Reduce TestDatabaseServerAutoDisconnect flakiness (#34060)
* Reduce TestDatabaseServerAutoDisconnect flakyness

* Emit event after actual disconnection.

* Add EmitterContext instead of ad-hoc context.

* Add missing EmitterContext.

* Address review feedback
2023-11-16 12:59:18 +00:00
Zac Bergquist d18538123d
Expand the width of SSH tabs in the web UI (#34608)
- Increase the maximum width from 200px to 450px
- Prevent the tab from automatically growing to its max width

Closes #3859
2023-11-16 08:55:30 +00:00
Anton Miniailo a4be12fbcf
Reorganize service config test fields (#34208)
* Reorganize process config test fields

* Move PollingPeriod back from Testing field

* Fix comment text

Co-authored-by: Nic Klaassen <nic@goteleport.com>

---------

Co-authored-by: Nic Klaassen <nic@goteleport.com>
2023-11-16 05:29:07 +00:00
fheinecke 2dd1abbf58
Added release server publishing retry (#34605)
* Added release server publishing retry

* dronegen: Run auto_publish 10 times (from 3) in a loop

Change the drone generation to use a loop to run the `auto_publish`
relcli command instead of listing them one-by-one and loop 10 times
instead of 3. The loop will terminate the first time `relcli` succeeds.

The loop has an `|| false` at the end to ensure the loop command fails
if all invocations of `relcli` fail. With `set -e`, even though the exit
status of the loop is non-zero, the shell seems to continue. With the
`|| false` at the end, it makes it exit on failure. I'm not sure exactly
how drone runs the commands so this may not be necessary but it seems
safer.

e.g.

    set -e
    for i in $(seq 10); do false && break; done
    echo hello

This will echo "hello" even though all invocations inside the loop
failed.

    set -e
    for i in $(seq 10); do false && break; done || false
    echo hello

This will not echo "hello" - `set -e` causes an exit before that command
due to the `|| false`.

---------

Co-authored-by: Cam Hutchison <camh@goteleport.com>
2023-11-16 01:40:33 +00:00
Forrest 9536add038
variable rate instance heartbeats (#33871) 2023-11-16 01:36:15 +00:00
Nic Klaassen c3c62d3281
feat: enable External Cloud Audit backend (#34606)
* feat: watcher for cluster ExternalCloudAudit configuration

* feat: enable External Cloud Audit feature

This commit enables the External Cloud Audit (BYOBucket) feature with a
fully functional backend by setting up the Athena and S3 audit
components with the right AWS configurations and resource locations.

* respond to code review

* close watcher to fix test

* fix aws config generation

* fix IsUsed for tests
2023-11-16 00:53:27 +00:00
Zac Bergquist 6ea1d8a5b3
Update test plan with OS compatibility checks (#32679)
We've had issues on macOS where we've unintentionally bumped the
minimum supported OS version. This check is intended to catch
these issues and ensure that the versions in our public docs
remain accurate.
2023-11-15 23:29:01 +00:00
dependabot[bot] 73dfac9fa9
Bump go.mongodb.org/mongo-driver from 1.13.0-prerelease.0.20230726045955-5ee10b94cc66 to 1.13.0 (#34497)
* Bump go.mongodb.org/mongo-driver

Bumps [go.mongodb.org/mongo-driver](https://github.com/mongodb/mongo-go-driver) from 1.13.0-prerelease.0.20230726045955-5ee10b94cc66 to 1.13.0.
- [Release notes](https://github.com/mongodb/mongo-go-driver/releases)
- [Commits](https://github.com/mongodb/mongo-go-driver/commits/v1.13.0)

---
updated-dependencies:
- dependency-name: go.mongodb.org/mongo-driver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* mongodb: Handle deprecated parsing logic

Because we want to support older mongo DB versions we need to continue to support parsing these now deprecated message types.

* Apply PR feedback and update to handle remaining deprecated fields

* update MongoDB test server to expect OpMsg instead of OpQuery for MongoAtlas

* deflake attempt 1

* bump test default max message size due to switch to OP_MSG

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Jensen <mike.jensen@goteleport.com>
Co-authored-by: STeve Huang <xin.huang@goteleport.com>
2023-11-15 22:10:06 +00:00
Paul Gottschling 0a9291a46c
Clarify the relationship between Kubernetes docs (#34412)
Closes #19192

Add introductory language to the Helm Deployments and Kubernetes Access
section introductions to clarify the relationship of these docs sections
to one another. The intention is to help newcomers to Teleport
understand when they need to read the Kubernetes Access docs and when
it is more appropriate to the read the Helm Deployments docs.
2023-11-15 21:00:35 +00:00
Anton Miniailo c979952058
Fix PROXY protocol handling of dedicated kube listener with TLS routing (#34317)
* Fix PROXY protocol handling of dedicated kube listener with TLS routing

* Improve test by checking both addresses in multiplexed mode
2023-11-15 20:36:23 +00:00
Mike Jensen d0f2b4406b
Prevent .tsh/environment values from overloading prior set values (#34277)
* Prevent `.tsh/environment` values from overloading prior set values

It's not possible to have duplicate environment values within an environment.  And in fact the last value in the string slice will be preserved.  Prior to this change that allows users to possibly change any environment values through the use of the `.tsh/environment` file.  This is within user level control, where other environment value sources originate from a more protected location (for example the PAM configuration).

Prior to this change that allows users to possibly change any environment passed configuration through the use of the `.tsh/environment` file.

This change makes it so that the administrative set values will be preferred, and any duplicate records will be ignored.

* Apply PR feedback

* Only exclude duplicate environment values sourced from .tsh/environment

This change updates `SafeEnv` to be allow the caller to select if the value should be checked for duplicates.
We then leverage this to avoid this check when sourced from a trusted source.  But then exclude potential duplicates when sourced from .tsh/environment file or the local environment.
2023-11-15 16:49:50 +00:00
Gus Luxton 8ecb9734eb
docs: Mark AWS GSLB deployment as Enterprise only (#34621)
It requires/references proxy peering, so shouldn't be offered to OSS users.
2023-11-15 16:16:57 +00:00
matheus b9d1d8eb41
Add ExternalCloudAudit permissions to user context ACL (#34289)
* Add ExternalCloudAudit permissions to user context ACL

* Add missing acl to test
2023-11-15 15:47:09 +00:00
STeve (Xin) Huang 7f3c58df1f
Add default database support for PostgreSQL Auto-user provisioning (#34420)
* Added "defaultDatabase" support for Postgres auto-user provisioning

* update doc
2023-11-15 15:26:10 +00:00
Michael Wilson 590435c1e2
Allow user locks to affect access list membership. (#34354)
* Allow locks to deny access to access lists.

Access list membership will now be impacted by active user locks. If a user
is locked, they will not be considered a part of an access list. This, in turn
will be used for things like Okta assignments to ensure that Okta access can be
rescinded while a lock is active.

* Access list membership checker is its own struct now.

* Rebase and fix tests.
2023-11-15 15:24:07 +00:00
Zac Bergquist f8c5164bbb
Fix incorrect permissions for X11 Unix socket (#34613)
We were passing decimal 1777 instead of octal.

Closes #24819
2023-11-15 14:27:09 +00:00
Bernard Kim 49329041c6
Reword aws-oidc deploy service components (#34279)
* Reword aws-oidc deploy service for more consistency

* Update lib/integrations/awsoidc/deployservice_update.go

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

* Capitalize AWS OIDC

---------

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2023-11-15 01:49:25 +00:00
Trent Clarke f5b548ee72
Grant the Okta service the right to write Users (#33630)
* Grant the Okta service the right to write Users

In preparation for the Okta service syncing user accounts, this patch grants the Okta
service the right to create/update/delete users, in addition to the existing read
permission.

* Restricts User RBAC operations on the built-in Okta role

* Address review comments

 - Consolidates update checking into a single function
 - Adds implementation for new user service

* remove unused code

* Refactor Okta access and tests

* Fix merge detritus

* Doc updates

* Hopefully last pass

* Linter appeasement

* Consilidated checks

* Update auth_with_roles_okta_rbac_test.go

docs
2023-11-15 01:25:43 +00:00
rosstimothy c91d92ec50
Update e (#34601) 2023-11-14 22:07:44 +00:00
Nic Klaassen ad9191e0d8
feat: cached auto-refreshing AWS credentials for BYOBucket (#34380)
This commit implements a "Configurator" for the BYOBucket feature that
provides AWS credentials that can be used by the v1 or v2 AWS SDKs for
Go.
These credentials are generated via an AWS OIDC integration: auth signs
a JWT and we swap that with AWS STS for AWS credentials.
It also reports whether or not the BYOB feature `IsUsed()` currently,
and provides access to the current cluster ExternalCloudAudit spec.

This looks a bit weird because of a chicken-egg problem where the audit
log must be set up before the auth server can be created, but the auth
server must be created to provide the OIDC signing facilities.
This will be more clear in following PRs.
2023-11-14 20:16:14 +00:00
Nic Klaassen ce5de4c4a2
fix!: respect deny rules for access requests (#34438)
Access Request follow their own set of RBAC rules.
Usually, none of the typical create/read/list/delete verbs are required
in any user's roles.
Access is handled via custom rules based on the allow.request, deny.request,
allow.review_requests, and deny.review_requests role fields.

The create/read/list/delete verbs commonly used for other resources are
usually all or nothing (barring `where` expressions), but a more nuanced
set of rules apply to access requests. E.g. users should always be
allowed to see access requests that they created or are allowed to
review, without being allowed to see other access requests in the
cluster.

This seemed mostly logical once you thought about it long enough, but
one detail that has been lacking so far is that explicit deny rules in
the user's roles have no effect at all, even though explicit allow rules
grant god-mode access to create or view any access requests in the
cluster.

Even with the following role, you could still create and view
access requests:

```yaml
kind: role
version: v6
metadata:
  name: example
spec:
  allow:
    request:
      roles: ["*"]
    review_requests:
      roles: ["*"]
  deny:
    rules:
      - resources: ["access_request"]
        verbs: ["create", "read", "list"]
```

This commit makes any explicit deny rules actually take effect.

Fixes https://github.com/gravitational/customer-sensitive-requests/issues/103

changelog: Respect explicit deny rules for Access Requests.
2023-11-14 20:15:35 +00:00
Steven Martin 716d8b8573
docs: correct fips image name reference (#34593) 2023-11-14 19:51:06 +00:00
Alan Parra d2b03ac04b
chore: Update e/ reference (#34586)
Update e/ to the latest commits.
2023-11-14 19:47:49 +00:00
Paul Schisa 7135486f5c
Update fido2.go (#34529) 2023-11-14 17:55:53 +00:00
Brian Joerger 04d9f741f6
Fix piv slot overridden by server settings. (#34349) 2023-11-14 17:47:09 +00:00
Nic Klaassen c92fe24f7a
fix: correct IAM policies for BYOB (#34484)
This commit fixes the IAM policies generated by the oneoff
externalcloudaudit bootstrap command based on manual testing, and brings
them more in line with the original RFD
https://github.com/gravitational/cloud/blob/master/rfd/0077-Bring-your-own-bucket.md
2023-11-14 17:38:10 +00:00
Jakub Nyckowski a09bf71b8d
Add TAG UI (#34570)
* Add TAG UI

* Add missing license

* Remove elkjs
2023-11-14 16:49:42 +00:00
Paul Gottschling cf96c55a09
Link to the Usage/Billing page in the FAQ (#34427)
Ensure that users who start to learn about usage reporting and billing
from the FAQ know that there is a dedicated page for this information.
2023-11-14 15:50:26 +00:00
Alan Parra 7008dc1fc2
Implement Linux support for device enroll and authn (#34557)
* Close streams on errors

* Rename fake_windows_device.go to fake_tpm_device.go

* Test enroll/authn ceremonies against Linux

* Allow Linux devices to enroll and authenticate

* Implement Linux TPM methods

* Attempt attestation without the event log on failures
2023-11-14 14:23:30 +00:00
Alan Parra d1449cf7f2
chore: Bump Buf to v1.28.0 (#34539)
Update to the latest version.

* https://github.com/bufbuild/buf/releases/tag/v1.28.0
2023-11-14 13:35:26 +00:00
Alan Parra 9db7a1bf96
Implement device data collection for Linux (#34467)
* Rename others.go to device_others.go

* Move various functions to tpm_common.go

* Read device collected data on Linux

* Add the mode param to native.CollectDeviceData

* Add the mode param to collectDeviceData

* Run escalated `tsh device dmi-info`

* Write cached DMI info

* Read cached DMI info

* Avoid asset tags with spaces on them

* nit: Use deviceStateFolderName without a dot on Linux

* Test various data collection scenarios

* Fix macOS/Windows typo
2023-11-14 13:13:22 +00:00
Alex McGrath 1861fb5792
Support ClusterNetworkingConfig and AuthPreference in --apply-on-startup (#34524)
* support ClusterNetworkingConfig and AuthPreference in --apply-on-startup

* update init_test.go and docs
2023-11-14 11:12:52 +00:00
Tiago Silva 5ba372f53e
Add TAG query usage event (#34386)
This PR adds the boilerplate code so we can emmit usage events for TAG
queries

Part of https://github.com/gravitational/access-graph/issues/185

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>
2023-11-14 02:31:30 +00:00