Skip to content

Commit 63508cc

Browse files
committed
rgw: eliminate vault token perm for group read
Typically, the HashiCorp Vault token is refreshed by another process, such as the Vault Agent. This process needs ownership of the file to write the new token. Since Ceph primarily runs with its own user, it cannot access the token file unless it has group read permissions. This requires either assigning the correct group to the file by the Vault Agent or ensuring Ceph is part of the appropriate group. By eliminating the restriction on group read permissions, this can be achievable. Fixes: https://tracker.ceph.com/issues/66121 Signed-off-by: Seena Fallah <[email protected]>
1 parent fd7b38b commit 63508cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rgw/rgw_kms.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ class VaultSecretEngine: public SecretEngine {
221221
return -ENOENT;
222222
}
223223

224-
if (token_st.st_mode & (S_IRWXG | S_IRWXO)) {
224+
if (token_st.st_mode & (S_IWGRP | S_IXGRP | S_IRWXO)) {
225225
ldpp_dout(dpp, 0) << "ERROR: Vault token file '" << token_file << "' permissions are "
226-
<< "too open, it must not be accessible by other users" << dendl;
226+
<< "too open, the maximum allowed is 0740" << dendl;
227227
return -EACCES;
228228
}
229229

@@ -257,7 +257,7 @@ class VaultSecretEngine: public SecretEngine {
257257
int res;
258258
string vault_token = "";
259259
if (RGW_SSE_KMS_VAULT_AUTH_TOKEN == kctx.auth()){
260-
ldpp_dout(dpp, 0) << "Loading Vault Token from filesystem" << dendl;
260+
ldpp_dout(dpp, 20) << "Loading Vault Token from filesystem" << dendl;
261261
res = load_token_from_file(dpp, &vault_token);
262262
if (res < 0){
263263
return res;

0 commit comments

Comments
 (0)