This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1803995 - [RFE] pcs interface for pacemaker CIB secrets
Summary: [RFE] pcs interface for pacemaker CIB secrets
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pcs
Version: 8.2
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: pre-dev-freeze
: 8.3
Assignee: Tomas Jelinek
QA Contact: cluster-qe
Steven J. Levine
URL:
Whiteboard:
Depends On: 1793860
Blocks: 2127497 2143816
TreeView+ depends on / blocked
 
Reported: 2020-02-17 23:33 UTC by Ken Gaillot
Modified: 2023-12-15 17:21 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of: 1793860
Environment:
Last Closed: 2023-09-22 18:36:16 UTC
Type: Story
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-7604 0 None Migrated None 2023-09-22 18:36:03 UTC
Red Hat Knowledge Base (Solution) 203243 0 None None None 2020-10-30 13:57:39 UTC
Red Hat Knowledge Base (Solution) 5570561 0 None None None 2020-11-11 15:40:42 UTC

Description Ken Gaillot 2020-02-17 23:33:28 UTC
+++ This bug was initially created as a clone of Bug #1793860 +++

Description of problem:
There is no way to store passwords and other values outside the CIB.
In crmsh there is such functionality:

crm resource secret <rsc> set <param> <value>

Version-Release number of selected component (if applicable):
pacemaker-2.0.2-3.el8_1.2.x86_64.rpm

How reproducible:
Always

Steps to Reproduce:

There are no such functionality.

Actual results:
All passwords are in CIB.


Expected results:
To be able to stash in/out any parameter in/out of CIB

--- Additional comment from Ken Gaillot on 2020-02-14 22:57:37 UTC ---

QA: This feature allows users to set sensitive resource parameter values in a separate file outside the pacemaker CIB. The file must be kept in sync across all nodes. Under the hood, it looks like this:

* Sensitive values are replaced with 'lrm://' in the CIB
* The actual value is stored in a plain text file /var/lib/pacemaker/lrm/secrets/<resource-id>/<parameter-name>
* Each secrets file has a corresponding <filename>.sign file with an MD-5 hash of the secret

The user does not manage these directly, but via the cibsecret tool. cibsecret requires that Pacemaker is running on the local node, and that all active nodes are reachable via pssh, pdsh, or ssh. If any nodes are not active when the command is run, "cibsecret sync" must be run later when they are active to keep the secrets in sync.

cibsecret is used like this:

cibsecret set <resource-id> <parameter-name> <value>
-> If you want a parameter to be secret from the beginning, this will create a local secret file and hash file for the given resource parameter, sync the files to all active nodes, then set the parameter value in the CIB to 'lrm://'.

cibsecret get <resource-id> <parameter-name>
-> This shows the local value of the given resource parameter if it is set as a secret.

cibsecret delete <resource-id> <parameter-name>
-> If the given resource parameter is a secret, this removes the parameter from the CIB entirely and removes the secret files.

cibsecret stash <resource-id> <parameter-name>
-> If you have an existing parameter directly in the CIB that you want to convert into a secret, this takes the existing value and does the equivalent of "cibsecret set".

cibsecret unstash <resource-id> <parameter-name>
-> If you have an existing secret parameter that you want to be directly in the CIB again, this puts the secret value directly in the CIB and gets rid of the secret files.

cibsecret sync
-> This synchronizes all secret files from the local node to all other active nodes.

cibsecret check <resource-id> <parameter-name>
-> This compares the value of a secret file with its hash. The hash is mainly intended to discourage manual editing of the secret file, though it could also detect file corruption.

###

pcs will need an interface for the above "cibsecret" commands. To build pacemaker to test, run ./configure with the --with-cibsecrets option.

A twist is that cibsecret currently uses ssh to synchronize files across nodes. pcsd could do this itself more conveniently, but currently cibsecret doesn't offer any way to skip that.

cibsecret is a shell script (tools/cibsecret.in in the source repo), so you can see what it's doing under the hood. E.g. for "set" it first creates the secret file and hash file locally, then syncs them to all nodes, then updates the CIB to use it.

Either pcs could implement all of what cibsecret does directly, or we could add new options to cibsecret to do the steps separately, and pcs could handle just the sync part itself. pcs could also impose more requirements e.g. that all nodes be active unless --force is given. Take a look and let me know what you need; we can do pacemaker changes as part of Bug 1793860 if necessary.

Comment 1 Patrik Hagara 2020-05-15 09:47:24 UTC
Seems this was incorrectly assigned to pacemaker instead of pcs.

Comment 14 Strahil Nikolov 2023-02-22 20:19:00 UTC
Is there any progress?

Comment 15 Tomas Jelinek 2023-02-28 09:55:26 UTC
(In reply to Strahil Nikolov from comment #14)
> Is there any progress?

When designing support for this feature in pcs, we found out that on top of implementing new pcs commands, several existing pcs commands need to be modified. The most complex are 'pcs resource create', 'pcs resource update' and 'pcs resource delete'. Unfortunately, the latter two have not been overhauled to the new pcs architecture yet. Considering their complexity and sub-optimal architecture, which also complicates writing good unit tests for them, we decided to overhaul these commands prior to implementing support for CIB secrets. We start with 'pcs resource update' and will proceed to 'pcs resource delete'. The delete command is more complex and depends on other pcs commands (e.g. mostly constraints related), so it will take some time for it to get done. That being said, adding support for CIB secrets into pcs is still on our TODO list, but it is currently more of a long term goal.

Comment 16 Strahil Nikolov 2023-02-28 12:00:36 UTC
Thanks for the detailed update,the complexity behind the feature is far more clear.

Comment 18 RHEL Program Management 2023-09-22 18:35:37 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 19 RHEL Program Management 2023-09-22 18:36:16 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.


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