Commit Graph
33 Commits
Author SHA1 Message Date
Justinas Stankevičius bb4994e214 Add configuration options for hosted plugin runtime (#22320)
* Add Plugins feature flag

* Add config for plugins runtime

* Allow reading OAuth secrets from files

* Rename Plugins to HostedPlugins

Make it clear that this is separate from the upcoming
self-hosted, standalone plugins that will be part of the Teleport
binary.

* Only allow to read client credentials from files
2023-03-09 11:59:38 +00:00
Matheus f48d7f3c4f Add recovery codes flag to modules and web config (#19046)
* Add recovery codes feature to modules and web config
* Add EnableRecoveryCodes to Modules interface
2022-12-06 18:07:33 +00:00
Lisa Kim ef92182ef4 [reopen] Handle private key policy errors for the web UI (#17928)
- When user registers or resets, when running into
policy errors, we don't send back an error, but instead
a 200 (to indicate user has successfully registered/resetted)
and a flag to determine if policy was enabled
- Send back policy configurations for cluster config,
this will allow the web UI login page to just display
redirection messages without login attempts
- For role configured policy, login attempts will be
required and a specific error will be returned so that
the UI can then better redirect the user
2022-10-31 23:18:54 +00:00
Jakub Nyckowski 0ee91f6c37 Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
Brian Joerger ce20b20753 PIV login enforcement (#15874)
Add private key policy enforcement.

  - Add private key policy cert extensions and enforcement.

  - Add private key policy settings and attestation logic.

  - Wire attestation request through login endpoints.

  - Store attestation data for reissue requests.

  - Add private key policy discovery and logic.

  - Relogin on hardware key policy errors.

  - Include integration with Teleport Connect.
2022-09-30 23:27:48 +00:00
Yassine Bounekhla 09633dd47f Remove license feature flags for Moderated Sessions, Resource Access Requests, Machine ID (#16585) 2022-09-30 21:46:25 +00:00
Alan Parra a75fcc21d8 Update golangci-lint to 1.49.0 (#16507)
Update metalinter, fix a few lint warnings and replace deprecated linters.

`deadcode`, `structcheck` and `varcheck` are abandoned and now replaced by [`unused`][1].

Since 1.19, `go fmt` reformats godocs according to https://go.dev/doc/comment. I've done a bulk-reformatting of the codebase to keep the linter happy. Backporting is mostly harmless (the exception being `lib/services/role_test.go`, that for some reason breaks the _old_ linter using the new format).

[1]: https://golangci-lint.run/usage/linters/

* Bump golangci-lint version
* Replace abandoned linters
* Fix bodyclose on lib/auth/github.com
* Fix bodyclose on lib/kube/proxy/streamproto/proto_test.go
* Fix bodyclose on lib/srv/alpnproxy/proxy_test.go
* Fix bodyclose on lib/web/conn_upgrade_test.go
* Silence staticcheck on lib/kube/proxy/forwarder_test.go
* Silence staticcheck on lib/utils/certs_test.go
* Address BuildNameToCertificate deprecation warnings
* Run `go fmt ./...`
* Run `go fmt ./...` on api/
* Ignore formatting in role_test.go
* Remove redundant initializers in lib/srv/uacc/
* Update e/
2022-09-19 22:38:59 +00:00
Tim Buckley 207332d170 Add Machine ID enterprise license enforcement (#13914)
* Add Machine ID enterprise license enforcement

This adds two checks to Machine ID for license enforcement: one on
initial bot create, and another on join.

* Use modules.SetTestModules(); fix failing test
2022-06-29 16:27:18 +00:00
Nic Klaassen 7f3944b2e5 Add MachineID and Resource Access Requests license features (#13392) 2022-06-15 17:58:50 -07:00
Joel 8b00efedaa Add Moderated Sessions licensing (#11388) 2022-03-28 18:38:56 +00:00
Jim Bishopp 22e043c430 Add TestModules (#10369)
Allows tests to set fake values to be returned from modules.GetModules()
2022-02-15 21:54:40 +00:00
Isaiah Becker-Mayer bc11f2dfe6 Adds Desktops to license (#9576)
* Adds Desktops to license

* adds newline
2022-01-06 18:43:47 +00:00
Nic Klaassen 99cc8eb5ef Require enterprise license for HSM support (#8370) 2021-09-27 10:40:47 -07:00
Brian Joerger 9b8b9d6d0c rollback - Upgrade api version. (#7751) 2021-07-30 15:34:19 -07:00
Brian Joerger c040aca4c1 Upgrade api version. (#7609) 2021-07-28 13:51:21 -07:00
Brian Joerger 917df5ad02 gRPC conversions - Auth Preference (#7220) 2021-06-18 12:30:56 -05:00
Andrej Tokarčík a92dcc3df4 Introduce modules.ValidateResource for Cloud-specific validation (#7092) 2021-06-07 10:31:55 -07:00
Trent Clarke 4284fc3586 Forbids use of --insecure in FIPS mode (#6191)
Forbids the use of the `--insecure` mode when FIPS mode is enabled in teleport
Disables the `--insecure` tsh command line option when built with FIPS support

See-Also: #5073
2021-05-14 09:22:46 +10:00
Brian Joerger 5e9ea1c7e1 Add Features and PublicAddrs to PingResponse (#5742) 2021-03-10 18:15:40 -08:00
Sasha Klizhentas 013f9680c9 OSS RBAC
Implements RFD #7

https://github.com/gravitational/teleport/blob/master/rfd/0007-rbac-oss.md

OSS users can use roles. Some FedRamp related role options
are limited to enterprise.

All users are migrated to a new role "ossuser".

This role is a limited access role downgrading all users
from OSS role "admin".

All trusted clusters are mapped to "ossuser" as well.

Github connector maps teams to generated roles.

For transition period, format `tctl users add alice` works
alongside with `tctl users add alice --roles=admin`, but prints
a warning.
2021-02-17 17:04:03 -08:00
a-palchikov c7f494b3eb Test flakes: make tests reentrant (#5343)
* Make tests reentrant.
* Address review comments
* Bump e to release
2021-02-03 13:49:28 +01:00
Russell Jones bf0d76da84 Added support for admin user and token management.
Updated default admin rule in Enterprise to include KindUser: RW and
KindToken: RW permissions to allow admins to perform user and token
management.
2020-11-05 10:49:59 -08:00
Gus Luxton a2c8576a48 Update version output format (#4178) 2020-08-10 17:11:17 -03:00
Andrew Lytvynov 483153b4ec Plumb github username to TraitsFromLogins
This lets TraitsFromLogins to use that username for extra traits. No
changes in community edition, this will be used in enterprise.
2020-07-01 18:17:46 +00:00
Andrew Lytvynov 2dc8690e9a Add --k8s-users flag to tctl users add
This allows users to be provided with k8s usernames, in addition to
groups. Default this flag to local login, same as for SSH logins.
2020-04-24 16:23:18 +00:00
Andrew Lytvynov 3f9b14b5f7 Add internal.kubernetes_users to kubernetes_users on admin role
With OSS version and without using the github connector (only local
auth), logged in user won't have any `kubernetes_groups`. Without
usernames too, user can login but can't use kubectl.
2020-04-24 16:23:18 +00:00
Alexander Klizhentas 73ecb48232 Adds support for kubernetes_users, extend interpolation (#3404) (#3418)
This commit fixes #3369, refs #3374

It adds support for kuberenetes_users section in roles,
allowing Teleport proxy to impersonate user identities.

It also extends variable interpolation syntax by adding
suffix and prefix to variables and function `email.local`:

Example:

```yaml
kind: role
version: v3
metadata:
  name: admin
spec:
  allow:
    # extract email local part from the email claim
    logins: ['{{email.local(external.email)}}']

    # impersonate a kubernetes user with IAM prefix
    kubernetes_users: ['IAM#{{external.email}}']

  # the deny section uses the identical format as the 'allow' section.
  # the deny rules always override allow rules.
  deny: {}
```

Some notes on email.local behavior:

* This is the only function supported in the template variables for now
* In case if the email.local will encounter invalid email address,
it will interpolate to empty value, will be removed from resulting
output.

Changes in impersonation behavior:

* By default, if no kubernetes_users is set, which is a majority of cases,
  user will impersonate themselves, which is the backwards-compatible behavior.

* As long as at least one `kubernetes_users` is set, the forwarder will start
  limiting the list of users allowed by the client to impersonate.

* If the users' role set does not include actual user name, it will be rejected,
  otherwise there will be no way to exclude the user from the list).

* If the `kuberentes_users` role set includes only one user
  (quite frequently that's the real intent), teleport will default to it,
  otherwise it will refuse to select.

  This will enable the use case when `kubernetes_users` has just one field to
  link the user identity with the IAM role, for example `IAM#{{external.email}}`

* Previous versions of the forwarding proxy were denying all external
impersonation headers, this commit allows 'Impesrsonate-User' and
'Impersonate-Group' header values that are allowed by role set.

* Previous versions of the forwarding proxy ignored 'Deny' section of the roles
when applied to impersonation, this commit fixes that - roles with deny
kubernetes_users and kubernetes_groups section will not allow
impersonation of those users and groups.
2020-03-07 16:32:37 -08:00
Russell Jones 09241c635e Added support for FedRAMP/FIPS 140-2.
Added "--fips" flag to "teleport start" command which can start
Enterprise in FedRAMP/FIPS 140-2 mode.

In FIPS mode, Teleport configures the TLS and SSH servers with FIPS
compliant cryptographic algorithms. In FIPS mode, if non-compliant
algorithms are chosen, Teleport will fail to start. In addition,
Teleport checks if the binary was compiled against an approved
cryptographic module (BoringCrypto) and fails to start if it was not.
If a client, like tsh, tries to use non-FIPS encryption, like NaCl,
those requests are also rejected.
2019-05-07 12:51:02 -07:00
Russell Jones 4cc1437b5e Add Go version to output of version subcommand. 2018-10-16 14:14:29 -07:00
Sasha Klizhentas dce45f1c4d Additional licensing hooks 2018-08-10 11:12:05 -07:00
Sasha Klizhentas 43cb9559a5 Add OSS support for kubernetes groups
* Add k8s-groups flag for tctl users add
* Add kubernetes_groups field in github connector
2018-08-06 17:21:21 -07:00
Roman Tkachenko c0cf7df7c9 Github connector 2017-12-14 13:41:38 -08:00
Roman Tkachenko 96a249de14 Rename plugins to modules 2017-10-16 16:55:39 -07:00