Created
August 22, 2018 10:39
-
-
Save tiran/af7c21882e1732227455a13c3b8ff380 to your computer and use it in GitHub Desktop.
NitroHSM support for Dogtag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* polkit rule to allow 'pkiuser' to access NitroHSM PCSC interface | |
* | |
* file name: /etc/polkit-1/rules.d/99-pkiuser-pcsc.rules | |
* | |
* Resources: | |
* - https://access.redhat.com/blogs/766093/posts/1976313 | |
* - https://raymii.org/s/articles/Get_Started_With_The_Nitrokey_HSM.html | |
* | |
* Installation: | |
* # dnf install opensc pcsc-lite pcsc-tools | |
* # cp 99-pkiuser-pcsc.rules /etc/polkit-1/rules.d/99-pkiuser-pcsc.rules | |
* | |
* Verify access to NitroHSM. | |
* # pcsc_scan | |
* # sudo -u pkiuser -- opensc-tool --list-readers | |
* # sudo -u pkiuser -- pkcs11-tool --list-slots | |
* | |
* Reset NitroHSM (WARNING: deletes all objects) | |
* # sc-hsm-tool --initialize --so-pin 3537363231383830 --pin 1234567 | |
* | |
* Install FreeIPA: | |
* # ipa-server-install --hsm-enable --hsm-libfile=/usr/lib64/opensc-pkcs11.so --hsm-modulename=nitrohsm --token-name='UserPIN (SmartCard-HSM)' --token-password=1234567 | |
* | |
*/ | |
polkit.addRule(function(action, subject) { | |
if (action.id == "org.debian.pcsc-lite.access_pcsc" && | |
subject.user == "pkiuser") { | |
return polkit.Result.YES; | |
} | |
}); | |
polkit.addRule(function(action, subject) { | |
if (action.id == "org.debian.pcsc-lite.access_card" && | |
action.lookup("reader").startsWith("Nitrokey Nitrokey HSM") && | |
subject.user == "pkiuser") { | |
return polkit.Result.YES; | |
} | |
}); |
@type4ranjan -- can you share your override file and output?
Please share the information on either a new gist or better as an upstream ticket on https://pagure.io/freeipa
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right Alexander. I tried with SafeNet Luna HSM with --pki-config-override and some other tweaks but failed.
Hoping to see HSM support in 4.8 release.