Bug 1625548 - Make softhsm default directory usable for other applications
Summary: Make softhsm default directory usable for other applications
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: softhsm
Version: 34
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Paul Wouters
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-09-05 08:01 UTC by Christian Heimes
Modified: 2023-03-27 04:55 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-08 06:27:41 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FREEIPA-7383 0 None None None 2021-11-29 17:37:37 UTC

Internal Links: 2027452

Description Christian Heimes 2018-09-05 08:01:31 UTC
Description of problem:
The default token directory for softhsm is /var/lib/softhsm/tokens. The permissions, ownership and SELinux context for the directory assumes, that OpenDNSSEC is the sole owner and user of the default location. The directories are only accessible by members of the ods group and the ods user. Further more, its context is named_cached_t:

# ls -laZ /var/lib/softhsm
total 12
drwxr-x---.  3 ods  ods  system_u:object_r:named_cache_t:s0 4096 Sep  5 09:24 .
drwxr-xr-x. 73 root root system_u:object_r:var_lib_t:s0     4096 Sep  5 09:24 ..
drwxrwx--T.  4 ods  ods  system_u:object_r:named_cache_t:s0 4096 Sep  5 09:27 tokens

FreeIPA and Dogtag PKI like to use the default location for testing, too. We are working on HSM support and need a convenient way to test HSM integration. SoftHSM is the easiest approach for us, because it doesn't involve expensive hardware. So far, we have no interest to productize or officially support SoftHSM as key store for Dogtag PKI.

I considered and tried to use SOFTHSM2_CONF env var and ~/.config/softhsm2/softhsm2.conf. The env var doesn't work with Dogtag at the moment. Dogtag can't pass env vars to installer compoments at the moment. The user location doesn't quite work for us, too. The Dogtag NSSDB is accessed by multiple users (root, pkiuser) and systems (pkispawn, Tomcat, FreeIPA installers and management scripts).

I see two options:

1) Change permissions and SELinux context to allow other users to access tokens. This also includes the dynamic token directory. softhsm2-util --init-token creates a directory with 700. The directory name seems to be a dynamic uuid and is not reported as result of --init-token.
2) Improve SoftHSM2 so that path to softhsm2.conf can be passed as PKCS#11 configuration string (e.g. modutil's -string CONFIG_STRING).


Version-Release number of selected component (if applicable):
softhsm-2.3.0-4.fc28.x86_64

Comment 1 Christian Heimes 2018-09-05 11:17:10 UTC
I forgot to mention that certmonger daemon also needs access to softhsm token directory.

For now, this hack seems to do the trick for us:

# usermod -G ods -a pkiuser
# chcon -R -t pki_tomcat_t /var/lib/softhsm
# runuser -u pkiuser -- softhsm2-util --init-token ...
# chcon -R -t pki_tomcat_t /var/lib/softhsm

I guess Fedora needs a dedicated group and SELinux context for softhsm.

Comment 2 Paul Wouters 2018-09-05 16:54:35 UTC
I am fine with converting softhsm to have its own user/group "softhsm" and to have the ods user/group (and other ones you need) added to the softhsm group.

Would that work?

Comment 3 Christian Heimes 2018-09-05 17:39:32 UTC
A dedicated user and group for softhsm would be one step of the solution. We also need a SELinux type for the directory (softhsm_var_t?) and allow the named_exec_t (or whatever its called) to read and write to that context.

Comment 4 Samuel Sieb 2019-03-20 03:33:35 UTC
This is causing me trouble now as well.  I can't start apache because I get an selinux error from nss_pcache trying to access the tokens directory.  I removed mod_nss and then it started.  If my issue should be filed under a different component, then let me know, but it appears to be the same as this.

Comment 5 Ben Cotton 2019-05-02 19:46:19 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Ben Cotton 2019-05-28 23:48:57 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 7 Christian Heimes 2019-05-29 06:13:10 UTC
The issue still affects IPA and our plan to use SoftHSM2 to test HSM support.

Comment 8 Ben Cotton 2020-04-30 21:54:36 UTC
This message is a reminder that Fedora 30 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 30 on 2020-05-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '30'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 30 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 9 Fedora Admin user for bugzilla script actions 2021-04-26 12:38:19 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 10 Fedora Program Management 2021-04-29 15:54:35 UTC
This message is a reminder that Fedora 32 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '32'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 32 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 11 Simo Sorce 2021-04-30 15:58:46 UTC
Christian,
Is this bug still relevant ?

Comment 12 Ben Cotton 2021-05-25 14:59:01 UTC
Fedora 32 changed to end-of-life (EOL) status on 2021-05-25. Fedora 32 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 13 Graham Leggett 2021-11-29 17:36:06 UTC
EPEL has the same bug: https://bugzilla.redhat.com/show_bug.cgi?id=1625548

Comment 14 Ben Cotton 2022-05-12 16:54:41 UTC
This message is a reminder that Fedora Linux 34 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '34'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 34 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 15 Ben Cotton 2022-06-08 06:27:41 UTC
Fedora Linux 34 entered end-of-life (EOL) status on 2022-06-07.

Fedora Linux 34 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.