Monday, 2024-08-12

*** mhen_ is now known as mhen01:12
rajivhi14:28
rajivHi, 15:02
xek#startmeeting barbican15:03
opendevmeetMeeting started Mon Aug 12 15:03:55 2024 UTC and is due to finish in 60 minutes.  The chair is xek. Information about MeetBot at http://wiki.debian.org/MeetBot.15:03
opendevmeetUseful Commands: #action #agreed #help #info #idea #link #topic #startvote.15:03
opendevmeetThe meeting name has been set to 'barbican'15:03
xek#topic Roll Call15:04
xekCourtesy ping for dmendiza[m] ade_lee d34dh0r53 Luzi tosky tobias-urdin jjung mharley lpiwowar15:04
xeko/15:04
d34dh0r53o/15:04
dmendiza[m]🙋‍♂️15:04
xekAs usual our agenda can be found here:15:04
xek#link https://etherpad.openstack.org/p/barbican-weekly-meeting15:04
xekJust the usual topics today15:04
xek#topic Review Past Meeting Action Items15:05
xek#link https://meetings.opendev.org/meetings/barbican/2024/barbican.2024-08-05-15.01.html15:05
xekThere were none15:05
xek#topic Liaison Updates15:05
xekTC Nominations and PTL Nominations start in 15:07
xek2d 8h 37m15:08
xek#link https://governance.openstack.org/election/15:08
xekThat's all I had15:08
rajivHi, i have few questions, if there are no topics on the agenda.15:09
xek#topic Open Discussion15:09
xekrajivgo ahead :)15:09
rajivWhich table is updated with mkek and hmac keys ?15:09
rajivi couldnt find the keys in kek_id or encrypted_data table 15:10
dmendiza[m]Hi rajiv 15:11
dmendiza[m]When using the PKCS#11 backend, you actually have two rounds of encryption15:13
rajivHey Doug, 15:13
xekI would guess this will be in the secrets table?15:13
dmendiza[m]Barbican creates a PKEK, which stands for Project-specific Key Encryption Key15:14
dmendiza[m]The MKEK and HMAC keys are used to encrypt the PKEK, and are not used to encrypt secrets15:14
dmendiza[m]the Secrets themselves are encrypted using the PKEK that belongs to the Project in the context object15:14
rajivthe background is the hsm device went down15:15
dmendiza[m]The details should be stored in kek_meta_dto and kek_meta_extend, although I don't recall off the top of my head which table that is.15:15
rajivwhen i tried to create a new key with same label i had errors15:16
rajivhence i had to update all keys with new kek_id15:17
rajivare these columns or tables ? kek_meta_dto and kek_meta_extend15:17
dmendiza[m]Hmmm....   by "create a new key" do you mean you have a different key than before?  15:17
rajivyes for both scenarios 15:18
dmendiza[m]Updating the Key ID will not work if that's the case15:19
dmendiza[m]OK, so, unless you have a backup of the old key and are able to restore the old key to your HSM then I am afraid all your data is lost15:19
rajivif a new key is created, whats the workflow wrt db ?15:19
dmendiza[m]Encryption and Decryption work with a specific key.  If you encrypt something with key X and then try to decrypt with key Y, you will not be able to.15:19
rajivyes, i learnt this the hard way15:19
dmendiza[m]The best way to move forward is to change the name of your new key15:20
dmendiza[m]and accept that data encrypted with the old key is now lost forever. :(15:20
rajivvery true, i was presuming updating the db with kek_id on the encryption_data table will help, hence i am asking for details.15:21
dmendiza[m]You may be able to trick barbican into using the new key if you updated the DB data, but ultimatley decryption will fail because the old key is not available.15:21
dmendiza[m]e.g.15:22
rajivi created multiple keys on the partition but i see only which is configured but i dont see the new keys15:22
rajivyes, thats my intent to take care if the keys are lost15:23
dmendiza[m]Managing the KEK in the HSM is outside of the scope of Barbican.  You should be able to look at all the keys stored in the HSM using a tool provided by your vendor.15:24
rajivokay, this query dint help "select * from kek_data where plugin_name='barbican.plugin.crypto.p11_crypto.P11CryptoPlugin';"15:25
rajivif i get the id of the new keys in the kek_id table, i can play around with barbican-manage or api to help me15:25
rajivthe id from kek_id table is used in the encrypted_data table where the secrets are encrypted with, hence if i know how barbican fetches or creates the new keys on the db level, i can adapt my scripts accordingly.15:30
rajivi also found CKR_INVALID_SIGNATURE in barbican logs if multiple keys are present on the same partition to which barbican is configured.15:31
rajivlastly, has anyone played around with multiple barbican instances in 1 openstack installation ? i have requirement to support customer per barbican instance in 1 openstack installation15:32
dmendiza[m]Hmm... that is  .... interesting.  Barbican does provide tenant-separation, so having a whole new deployment for a single tenant seems like overkill15:32
dmendiza[m]I have no experience doing that.  The tricky part might be configuring keystone to provide the correct URL in the endpoint list15:33
dmendiza[m]Also, I'm not sure how keystonemiddleware would prevent a valid tenant from using a barbican instance15:34
dmendiza[m]you might need to write your own middleware for that15:34
rajivokay thanks15:34
rajivso to conclude, how to find the table for in which the keys are stored ?15:35
rajivi presume reviewing this https://review.opendev.org/c/openstack/barbican/+/923822 would take longer ?15:35
rajivi looked into https://github.com/openstack/barbican/blob/stable/2023.2/barbican/plugin/crypto/pkcs11.py to understand the DB follow but had no luck, are there any other hints on where to search ?15:36
dmendiza[m]I think this is the DB model you're looking for: https://opendev.org/openstack/barbican/src/branch/master/barbican/model/models.py#L54415:38
rajivi looked into this already ;) as it pointed to kek_data table, this was the basis for my initial conversation15:40
dmendiza[m]Actual secrets are stored here: https://opendev.org/openstack/barbican/src/branch/master/barbican/model/models.py#L503 and should have a reference to the PKEK used 15:40
dmendiza[m]I'm out on PTO the rest of the week, but remind me again next week and I will try to take a deeper look.15:46
rajivokay sure15:47
xekok, let's continue to the last topic :)15:48
xek#topic Bug Review15:48
xekThere were no new bugs reported15:48
xekThat's it for today15:49
xekSee y'all next week!15:49
xek#endmeeting15:49
opendevmeetMeeting ended Mon Aug 12 15:49:09 2024 UTC.  Information about MeetBot at http://wiki.debian.org/MeetBot . (v 0.1.4)15:49
opendevmeetMinutes:        https://meetings.opendev.org/meetings/barbican/2024/barbican.2024-08-12-15.03.html15:49
opendevmeetMinutes (text): https://meetings.opendev.org/meetings/barbican/2024/barbican.2024-08-12-15.03.txt15:49
opendevmeetLog:            https://meetings.opendev.org/meetings/barbican/2024/barbican.2024-08-12-15.03.log.html15:49

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!