Skip to content

Fix remediation for rule configure_opensc_nss_db#4776

Closed
ggbecker wants to merge 2 commits intoComplianceAsCode:masterfrom
ggbecker:fix-configure_opensc_nss_db
Closed

Fix remediation for rule configure_opensc_nss_db#4776
ggbecker wants to merge 2 commits intoComplianceAsCode:masterfrom
ggbecker:fix-configure_opensc_nss_db

Conversation

@ggbecker
Copy link
Copy Markdown
Member

@ggbecker ggbecker commented Aug 29, 2019

Description:

  • Aims to move away from pkcs11-switch tool as it may not configure the way our OVAL check for this particular rule works. The OVAL check looks for content in file /etc/pki/nssdb/pkcs11.txt which is only modified when using modutil -dbdir sql:/etc/pki/nssdb/ ... (notice the prefix sql:).

  • Also the rule got removed from RHEL8 because in RHEL8 there is no coolkey and it seems to be already configured to use opensc library by default. Update1: source: https://access.redhat.com/articles/4253861 (See sections: Smart cards in Firefox browser or Thunderbird and Register third party PKCS #11 module to p11-kit)

Rationale:

  • Remediation configures database correctly so OVAL check pass.

Additional info:

There are still some uncertainty on how this databases works, but so far they way is proposed it seems to work.

@ggbecker ggbecker added Ansible Ansible remediation update. Bash Bash remediation update. Text labels Aug 29, 2019
@ggbecker ggbecker added this to the 0.1.46 milestone Aug 29, 2019
${PKCSSW} opensc
fi
modutil -delete "CoolKey PKCS #11 Module" -dbdir sql:/etc/pki/nssdb/ -force || true # ignore errors
modutil -add "OpenSC PKCS #11 Module" -dbdir sql:/etc/pki/nssdb/ -libfile opensc-pkcs11.so -force
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might need some kind of condition to test if it is already setup correctly.

pkcs11-switch tool changes the old database format, but our OVAL check
looks for sql database files (/etc/pki/nssdb/pkcs11.txt), so calling
modutil with proper parameters should have the same effect.
@ggbecker ggbecker force-pushed the fix-configure_opensc_nss_db branch from 7b6a2d8 to 56d2559 Compare August 30, 2019 14:42
@yuumasato yuumasato modified the milestones: 0.1.46, 0.1.47 Sep 2, 2019
@yuumasato yuumasato modified the milestones: 0.1.47, 0.1.48 Nov 5, 2019
@yuumasato yuumasato modified the milestones: 0.1.48, 0.1.49 Jan 9, 2020
@yuumasato
Copy link
Copy Markdown
Member

Removing milestone assignment, as this is still in draft.

@yuumasato yuumasato removed this from the 0.1.49 milestone Mar 5, 2020
@openscap-ci
Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@shawndwells
Copy link
Copy Markdown
Member

@ggbecker closing this as abandoned PR. Feel free to re-open if you find the time in the future!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ansible Ansible remediation update. Bash Bash remediation update.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants