Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add namespace field to VaultCAS JSON config #1424

Merged
merged 1 commit into from
Jun 7, 2023

Conversation

spieglt
Copy link
Contributor

@spieglt spieglt commented Jun 7, 2023

Name of feature:

Add optional use of namespaces to VaultCAS

Pain or issue this feature alleviates:

Currently, using step-ca as a Registration Authority downstream from Vault (https://smallstep.com/docs/step-ca/registration-authority-ra-mode/#5-configure-the-ra-server) does not allow for using the namespaces feature of Vault Enterprise. Specifically, proper approle authentication with Vault can't occur because there is no way to include the X-Vault-Namespace header. Vault's API client that step-ca uses includes a function to set the namespace: https://github.com/hashicorp/vault/blob/main/api/client.go#L949-L955. The optional use of this function is all this PR adds.

(Side note: A workaround for tne absence of the header this would be to include the namespace in the path; however, this doesn't work because when the authMountPath field is used, the path is improperly constructed. If the namespace is my/custom/path and ca.json includes "authMountPath": "my/custom/path/approle", step-ca tries to authenticate against https://some-vault-instance.com/v1/auth/my/custom/path/approle/login rather than the correct https://some-vault-instance.com/v1/my/custom/path/auth/approle/login. Because step-ca uses Hashicorp's Vault library, it seems to me that this would be more difficult to fix than my namespace fix provided here.)

Why is this important to the project (if not answered above):

It's important because many companies use Vault Enterprise with namespaces.

Is there documentation on how to use this feature? If so, where?

https://github.com/smallstep/docs/pull/245/files

In what environments or workflows is this feature supported?

This is used when using step-ca in Registration Authority mode with Vault and approle authentication. It's not relevant to nor has impact on anything else.

In what environments or workflows is this feature explicitly NOT supported (if any)?

N/A

Supporting links/other PRs/issues:

https://discord.com/channels/837031272227930163/841249977699401759/1115741417294274612

馃挃Thank you!

@github-actions github-actions bot added the needs triage Waiting for discussion / prioritization by team label Jun 7, 2023
@maraino maraino self-requested a review June 7, 2023 21:12
Copy link
Contributor

@maraino maraino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @spieglt. We don't use Vault internally, so we mainly rely on community support.

@maraino maraino merged commit ccb2483 into smallstep:master Jun 7, 2023
15 checks passed
@spieglt
Copy link
Contributor Author

spieglt commented Jun 8, 2023

@maraino Thank you for looking at it so quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Waiting for discussion / prioritization by team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants