-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/openafsServer: automatic extraction of authentication keys from Kerberos 5 service keytab #337101
base: master
Are you sure you want to change the base?
Conversation
6a780cb
to
3daaa13
Compare
3daaa13
to
f71ba39
Compare
"|/etc/openafs/server/KeyFileExt" | ||
]; | ||
preStart = '' | ||
mkdir -m 0755 -p /var/openafs | ||
${optionalString (netInfo != null) "cp ${netInfo} /var/openafs/netInfo"} | ||
${optionalString useBuCellServDB "cp ${buCellServDB}"} | ||
'' + lib.optionalString (cfg.authentication.keytab != null) '' | ||
rm -f /etc/openafs/server/KeyFileExt | ||
${asetkeyScript} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that asetkeyScript
never calls asetkey
when the configured principal is not in the keytable or the keytable cannot be read. Thus, KeyFileExt
never gets created. Please, make preStart
fail with a descriptive error message in that case.
a06e68e
to
3dc63f1
Compare
I have modified the AWK script to exit with an error if it could not find any key for the given principal. I also took the liberty of retargeting the release notes for 25.05 instead of 24.11. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
3dc63f1
to
64a641b
Compare
Allow users to set a Kerberos 5 keytab from which to automatically extract the authentication keys necessary for AFS operations.
64a641b
to
5827cbd
Compare
Resolved merge conflict on release notes and |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/5030 |
Description of changes
Contemporary OpenAFS cells authenticate both users and servers by relying on an existing Kerberos infrastructure. For legacy and compatibility reasons, OpenAFS servers do not use Kerberos 5 service keytabs directly, but instead rely on an OpenAFS-specific keyring located at
/etc/openafs/server/KeyFileExt
. This keyring must be filled and managed imperatively by way of theasetkey
command.To make matters more complicated,
asetkey
expects the administrator to be aware of the internal numerical encoding used by Kerberos 5 to represent encryption key types, and requires this information to be entered for each key that is added to the keyring viaasetkey add
(see asetkey(8)).This PR introduces an automatic mechanism that, given an ordinary Kerberos 5 keytab, parses it for the AFS service keys (identified by a user-configured principal) and automatically constructs a
KeyFileExt
from these, declaratively and without any further user interaction. The AFS administrator only has to assign the runtime path of the keytab to theservices.openafsServer.authentication.keytab
option and, if needed, indicate the Kerberos 5 principal of the AFS service by setting the value ofservices.openafsServer.authentication.principal
.The legacy behavior is retained by default or by explicitly setting
services.openafsServer.authentication.keytab = null
.This improvement constitutes a further step towards achieving complete AFS automatic deployment, easing the configuration of machines with volatile root partitions, and implementing automated tests.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.