Replies: 7 comments 5 replies
-
It would be necessary, at the very least to know what httpd and nfs configurations you are starting with. We changed them some over time, so a pointer to the one you have installed on your system would be good. Secondarily a description of exactly what you want to achieve with HTTPD as an NFS client is also needed. Does not need to delve into proprietary details, just what you expect to happen in general when Http is in the mix. |
Beta Was this translation helpful? Give feedback.
-
TLDR: I may have this working. See last paragraph. I'm building my web server atop Fedora 35 and have joined the host to my FreeIPA domain. One goal is to serve HTML content from remote storage that has been mounted with gssproxy-0.8.4-4.fc35.x86_64 to the rescue! It provides /etc/gssproxy/99-nfs-client.conf:
That matches exactly (nice!) what I find at https://github.com/gssapi/gssproxy/blob/main/docs/NFS.md#keytab-based-client-initiation and all makes reasonably good sense to me, so I left this alone. I restarted httpd, gssproxy and sssd thinking that should cover everything and found it to work nicely. The other goal I want to achieve is Kerberos authentication of the user accessing the same httpd service, say for something private. I took https://github.com/gssapi/gssproxy/blob/main/docs/Apache.md to be perfect for that. So I now have the following config for httpd:
and I couple that with the other steps for adding the service principal, getting the keytab, starting httpd with
I restart the same services again, and it all works perfectly. That was a surprise because that's not how it went the first time and I think my attempts at correcting it only made things worse or me more confused. I've rebooted the server and it still works as expected. Maybe much of my problems were only in how I tested. I eventually did gain a new distinct impression that when getting a new keytab from the KDC I must also do a new kinit to renew myself as a client before testing access to services secured with those keytabs. If that is indeed true, perhaps that's where I messed up. |
Beta Was this translation helpful? Give feedback.
-
I would appreciate a review of my keytabs to ensure I didn't do something stupid & insecure. These have been sanitized of specifics.
|
Beta Was this translation helpful? Give feedback.
-
So you elected to create a principal named apache@ for file access, that is an acceptable solution to allow the httpd process access to the NFS share. Similarly for the http.keytab. the host/fqdn principal can be considred the "machine key", and it is used by the SSH daemons to authenticate incoming users. It should not be randomly distributed to other services. And access permissions to keytabs containing those keys should be strictly reseved to system components (ssh, gssproxy, root user). HTH. |
Beta Was this translation helpful? Give feedback.
-
Ah yes, the user principle for the file access was another piece I forgot to mention. I honestly can't say why I had so much trouble now, but things are always easier once you've actually seen the thing work. I am most appreciative of the security implications as that really helps my understanding of Kerberos in practice. Thank you so much! |
Beta Was this translation helpful? Give feedback.
-
I'm afraid my reported success has stopped. gssproxy behaves well to authorize me as Kerberos user to httpd but I am no longer to access files served by httpd when they are mounted with
I think I caught the problem in the gssproxy logs, however:
The part that catches my eye is that it's matching on the service However.... I can take that line back out, restart the services and still access the
|
Beta Was this translation helpful? Give feedback.
-
Ok, I can imagine how that might create issues. I've revised as you suggested and so far so good. Would it make sense to update the example documentation to steer others away from my mistake? |
Beta Was this translation helpful? Give feedback.
-
The docs do a good job of covering these two use cases independently but I'm struggling to figure out how to achieve both at once. I thought I had it once, but couldn't get back there and think it may have been a fluke of caching or not everything having been restarted. Whenever I get what looks like a good clean test, it seems gssproxy will either only use one of the configs or complain that they have duplicate match rules. I tried to merge the two configs into a monolithic thing I don't quite understand, but it didn't work either.
I don't have any of my configs or logs to show here because I've tried so many combinations. I figure this can't be terribly uncommon so thought I'd ask to see what others have gotten to work. Also, given this is a security mech, I don't really want to do something that works but is insecure. I would greatly appreciate any insight and/or guidance!
Beta Was this translation helpful? Give feedback.
All reactions