open-vault/builtin/logical/ssh
Ben Roberts d710f8e8dc
Evaluate ssh validprincipals user template before splitting (#16622)
The SSH secrets engine previously split the `validPrincipals` field
on comma, then if user templating is enabled, evaluated the
templates on each substring. This meant the identity template was only
ever allowed to return a single principal. There are use cases
where it would be helpful for identity metadata to contain a list
of valid principals and for the identity template to be able to inject
all of those as valid principals.

This change inverts the order of processing. First the template
is evaluated, and then the resulting string is split on commas.
This allows the identity template to return a single comma-separated
string with multiple permitted principals.

There is a potential security implication here, that if a user is
allowed to update their own identity metadata, they may be able to
elevate privileges where previously this was not possible.

Fixes #11038
2022-10-13 17:34:36 -05:00
..
cmd/ssh Update to api 1.0.1 and sdk 0.1.8 2019-04-15 14:10:07 -04:00
backend.go SSH secrets engine - Enabled creation of key pairs (CA Mode) (#15561) 2022-06-10 09:48:19 -04:00
backend_test.go Evaluate ssh validprincipals user template before splitting (#16622) 2022-10-13 17:34:36 -05:00
communicator.go builtin: deprecate errwrap.Wrapf() throughout (#11430) 2021-04-22 11:20:59 -04:00
linux_install_script.go Use locking to avoid parallel script execution (#4358) 2018-04-23 18:04:22 -04:00
path_config_ca.go Revert "MFA (#14049)" (#14135) 2022-02-17 13:17:59 -07:00
path_config_ca_test.go not_before_duration added to SSH (#15250) 2022-05-12 08:50:40 -04:00
path_config_zeroaddress.go Migrate to sdk/internalshared libs in go-secure-stdlib (#12090) 2021-07-15 20:17:31 -04:00
path_creds_create.go builtin: deprecate errwrap.Wrapf() throughout (#11430) 2021-04-22 11:20:59 -04:00
path_fetch.go Switch to go modules (#6585) 2019-04-13 03:44:06 -04:00
path_issue.go ssh: Do not convert errors into logical.ErrorResponse in issue path (#15929) 2022-06-10 11:21:29 -04:00
path_issue_sign.go Evaluate ssh validprincipals user template before splitting (#16622) 2022-10-13 17:34:36 -05:00
path_keys.go Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
path_lookup.go Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
path_roles.go fix bug with allowed_users_template and add allowed_domains_template for SSH role (#16056) 2022-08-16 14:59:29 -05:00
path_sign.go ssh: Do not convert errors into logical.ErrorResponse in issue path (#15929) 2022-06-10 11:21:29 -04:00
path_verify.go Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
secret_dynamic_key.go builtin: deprecate errwrap.Wrapf() throughout (#11430) 2021-04-22 11:20:59 -04:00
secret_otp.go Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
util.go refactor: replace strings.Replace with strings.ReplaceAll (#15392) 2022-08-03 15:22:48 -04:00