stratis-storage / stratisd

Easy to use local storage management for Linux.
https://stratis-storage.github.io
Mozilla Public License 2.0
793 stars 56 forks source link

Do verification on the stratisd side for Clevis configs to avoid hanging #3613

Closed jbaublitz closed 3 months ago

jbaublitz commented 3 months ago

Related to latchset/clevis#241

jbaublitz commented 3 months ago

That is arguably already possible in other parts of the code given that we take a similar recursive approach when parsing Clevis tokens from disk to provide the reconstructed config to the user over the D-Bus. How would you recommend approaching preventing this in both cases? Adding a parameter to limit the number of recursions we can reach?

mulkieran commented 3 months ago

That is arguably already possible in other parts of the code given that we take a similar recursive approach when parsing Clevis tokens from disk to provide the reconstructed config to the user over the D-Bus. How would you recommend approaching preventing this in both cases? Adding a parameter to limit the number of recursions we can reach?

Until now, we weren't recursively exploring the config, we were essentially passing it directly through to Clevis. But now that we're recursively exploring something that is sent over the D-Bus, I think that the additional caution is warranted. I'm not sure if parsing the Clevis tokens from disk is analogous, but it may well be.

A recursion limit would be fine, I think.

jbaublitz commented 3 months ago

I've added the recursion limit.

packit-as-a-service[bot] commented 3 months ago

Cockpit tests failed for commit 524efe0024c2ddfea0f4288a9eafecbc5e2b7a42. @martinpitt, @jelly, @mvollmer please check.

jbaublitz commented 3 months ago

@martinpitt Is this a known issue with cockpit? It seems to be affecting all new PRs with stratisd. @mulkieran believes this is not a problem in our master branch.