Skip to content

feat(tools): implement ENABLE_VAULT_OPERATIONS to gate mutating tools - #126

Open
artfaal wants to merge 1 commit into
hashicorp:mainfrom
artfaal:pr/enable-vault-operations
Open

feat(tools): implement ENABLE_VAULT_OPERATIONS to gate mutating tools#126
artfaal wants to merge 1 commit into
hashicorp:mainfrom
artfaal:pr/enable-vault-operations

Conversation

@artfaal

@artfaal artfaal commented Jul 10, 2026

Copy link
Copy Markdown

Problem

The security model docs recommend setting ENABLE_VAULT_OPERATIONS=false "if write access isn't needed", but the variable is not implemented — InitTools registers every tool unconditionally, so a read-only deployment still exposes write_secret, delete_secret, create_mount, delete_mount and the PKI-write tools.

Change

Implement the documented flag. Mutating tools (write/delete/create + PKI enable/issue) register only when ENABLE_VAULT_OPERATIONS=true. Default is read-only: list_mounts, list_secrets, read_secret, plus PKI reads.

Why it matters

Operators with read-only use cases can now actually restrict the tool surface, matching what the security-model documentation already promises.

Implements the documented but previously unimplemented ENABLE_VAULT_OPERATIONS
env var. All tools were registered unconditionally, so a read-only deployment
still exposed write_secret/delete_secret/create_mount and PKI-write tools.
Now mutating tools register only when ENABLE_VAULT_OPERATIONS=true; default is
read-only (list/read for KV, mounts and PKI).
@artfaal
artfaal requested a review from a team as a code owner July 10, 2026 11:49
@hashicorp-cla-app

Copy link
Copy Markdown

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


Max Solovev seems not to be a GitHub user.
You need a GitHub account to be able to sign the CLA.
If you have already a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

1 similar comment
@hashicorp-cla-app

Copy link
Copy Markdown

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


Max Solovev seems not to be a GitHub user.
You need a GitHub account to be able to sign the CLA.
If you have already a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

artfaal pushed a commit to artfaal/vault-mcp-server that referenced this pull request Jul 21, 2026
Что в форке: два патча поверх upstream main (метаданные KV v2 в read_secret,
рабочий ENABLE_VAULT_OPERATIONS с read-only дефолтом), ссылки на upstream
PR hashicorp#125/hashicorp#126, сборка образа через release-default в Nexus (тег 0.2.0-jd-ro1)
и деплой на gvm25. В штатный README добавлен указатель на README-JD.
artfaal pushed a commit to artfaal/vault-mcp-server that referenced this pull request Aug 4, 2026
Контрибьютить в hashicorp дорого по бюрократии — решение принято, план
«примет upstream — свернём форк» больше не действует. Ветки pr/* остаются
как способ держать патч отдельно от JD-специфики, PR hashicorp#125 и hashicorp#126 висят
с прежнего захода.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant