Skip to content

Commit dbaa63c

Browse files
committed
FUSEX: allow to configure 'global' key/EosTokens for a mount which can connect with sss (preset a global XrdSecsssENDORSEMENT environemnt) - fixes EOS-6458
You can either set as an endorsement any invented key, which you can then for example reference in a global ACL like k:7fdbc131-6513-416a-8f47-abd5919c1760:rx or you can create an EOS token which brings the ACL and assign this token in the config file under "auth":"sssEndorsement"
1 parent fc0459c commit dbaa63c

File tree

5 files changed

+26
-8
lines changed

5 files changed

+26
-8
lines changed

fusex/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ This
7171
"gsi-first" : 0,
7272
"sss" : 1,
7373
"ssskeytab" : "/etc/eos/fuse.sss.keytab",
74+
"sssEndorsement" : "",
7475
"oauth2" : 1,
7576
"ztn" : 1,
7677
"unix" : 0,
@@ -306,7 +307,7 @@ Use these authentication directives in the config file:
306307
}
307308
```
308309
The mount daemon uses /etc/fuse/fuse.sss.keytab as default keytab when running as a shared mount. The user mount default is $HOME/.eos/fuse.sss.keytab. Unlike Kerberos it is not possible in XRootD to use different keytabs for individual users. If you want to create a 'trusted' mount mapping local users to their local username, you have to create an sss keytab entry for user **anybody** and group **anygroup**. Otherwise you can create an sss keytab for a given application user.
309-
The mount also supports to forward sss endorsements, which are forwarded to the server. These endorsement can be used server-side to define an ACL entry by key e.g. sys.acl="k:9c2bd333-5331-4095-8fcd-28726404742f:rwx". This would provide access to all sss clients having this key in their environment even if the mapped sss user/group wouldn't have access.
310+
The mount also supports to forward sss endorsements, which are forwarded to the server. These endorsement can be used server-side to define an ACL entry by key e.g. sys.acl="k:9c2bd333-5331-4095-8fcd-28726404742f:rwx". This would provide access to all sss clients having this key in their environment even if the mapped sss user/group wouldn't have access. Another type of endorsement can be EosToken, which are read from XrdSecsssENDORSEMENT environemnt variables. You can also configure a mount with a static endorsement using "auth":"sssEndorsement" : zteos:... which will be used by all users on this mount using sss authentication.
310311

311312

312313
Mounting for UNIX gateways

fusex/auth/BoundIdentityProvider.cc

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ BoundIdentityProvider::sssEnvToBoundIdentity(const JailInformation& jail,
221221
std::string endorsement = env.get("XrdSecsssENDORSEMENT");
222222
std::string key = env.get("EOS_FUSE_SECRET");
223223

224+
if (credConfig.sssEndorsement.length()) {
225+
endorsement = credConfig.sssEndorsement;
226+
}
227+
224228
if (key.empty() && credConfig.encryptionKey.length()) {
225229
key = credConfig.encryptionKey;
226230
}
@@ -286,12 +290,11 @@ BoundIdentityProvider::environmentToBoundIdentity(const JailInformation& jail,
286290
return output;
287291
}
288292
}
289-
290293
//----------------------------------------------------------------------------
291294
// Try to use SSS if available.
292295
//----------------------------------------------------------------------------
293296
if (credConfig.use_user_sss && ((!skip_sss) ||
294-
(!env.get("XrdSecsssENDORSEMENT").empty()))) {
297+
(!env.get("XrdSecsssENDORSEMENT").empty() || !credConfig.sssEndorsement.empty()))) {
295298
output = sssEnvToBoundIdentity(jail, env, uid, gid, reconnect, scope);
296299

297300
if (output) {
@@ -342,7 +345,7 @@ BoundIdentityProvider::environmentToBoundIdentity(const JailInformation& jail,
342345
// Try to use SSS if available.
343346
//----------------------------------------------------------------------------
344347
if (credConfig.use_user_sss && (!skip_sss ||
345-
!env.get("XrdSecsssENDORSEMENT").empty())) {
348+
(!env.get("XrdSecsssENDORSEMENT").empty() || !credConfig.sssEndorsement.empty()))) {
346349
output = sssEnvToBoundIdentity(jail, env, uid, gid, reconnect, scope);
347350

348351
if (output) {
@@ -532,8 +535,14 @@ BoundIdentityProvider::defaultPathsToBoundIdentity(const JailInformation& jail,
532535
<< uid)));
533536
// attach secret key and endorsement
534537
defaultEnv.push_back("EOS_FUSE_SECRET=" + pidEnv.get("EOS_FUSE_SECRET"));
535-
defaultEnv.push_back("XrdSecsssENDORSEMENT=" +
536-
pidEnv.get("XrdSecsssENDORSEMENT"));
538+
539+
if (credConfig.sssEndorsement.length()) {
540+
defaultEnv.push_back("XrdSecsssENDROSEMENT=" + credConfig.sssEndorsement);
541+
} else {
542+
defaultEnv.push_back("XrdSecsssENDORSEMENT=" +
543+
pidEnv.get("XrdSecsssENDORSEMENT"));
544+
}
545+
537546
return environmentToBoundIdentity(jail, defaultEnv, uid, gid, reconnect,
538547
subscope, false);
539548
}
@@ -558,8 +567,12 @@ BoundIdentityProvider::globalBindingToBoundIdentity(const JailInformation& jail,
558567
SSTR("Attempting to produce BoundIdentity out of eosfusebind " <<
559568
"global binding for uid=" << uid)));
560569
defaultEnv.push_back("EOS_FUSE_SECRET=" + pidEnv.get("EOS_FUSE_SECRET"));
561-
defaultEnv.push_back("XrdSecsssENDORSEMENT=" +
562-
pidEnv.get("XrdSecsssENDORSEMENT"));
570+
if (credConfig.sssEndorsement.length()) {
571+
defaultEnv.push_back("XrdSecsssENDORSEMENT=" + credConfig.sssEndorsement);
572+
} else {
573+
defaultEnv.push_back("XrdSecsssENDORSEMENT=" +
574+
pidEnv.get("XrdSecsssENDORSEMENT"));
575+
}
563576
return environmentToBoundIdentity(jail, defaultEnv, uid, gid, reconnect,
564577
subscope, true);
565578
}

fusex/auth/CredentialFinder.hh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ public:
8080
bool ignore_containerization;
8181
//! Encryption Key
8282
std::string encryptionKey;
83+
//! Static token
84+
std::string sssEndorsement;
8385
};
8486

8587
//------------------------------------------------------------------------------

fusex/eosxd/eosfuse.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,6 +1144,7 @@ EosFuse::run(int argc, char* argv[], void* userdata)
11441144
root["auth"]["ignore-containerization"].asInt();
11451145
config.auth.use_user_gsiproxy = root["auth"]["gsi"].asInt();
11461146
config.auth.use_user_sss = root["auth"]["sss"].asInt();
1147+
config.auth.sssEndorsement = root["auth"]["sssEndorsement"].asString();
11471148
config.auth.credentialStore = root["auth"]["credential-store"].asString();
11481149
config.auth.encryptionKey = config.encryptionkey;
11491150

fusex/fuse.conf.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"gsi-first" : 0,
5353
"sss" : 1,
5454
"ssskeytab" : "/etc/eos/fuse.sss.keytab",
55+
"sssEndorsement" : "",
5556
"oauth2" : 1,
5657
"unix" : 0,
5758
"environ-deadlock-timeout" : 100,

0 commit comments

Comments
 (0)