Repository navigation
rgw: Verify key id before sending to Barbican - #65010
Conversation
`request_key_from_barbican` is called with a raw user-defined key id. To prevent issues like path injection match against a UUID4 regex first. Add this check close to the Barbican calls, as other KMS backends have other key format definitions. Barbican secret ids are defined as "uuid" and matched against Python's UUID 4 parser. Signed-off-by: Marcel Lauhoff <[email protected]> On-behalf-of: SAP [email protected]
| optional_yield y, | ||
| std::string& actual_key) { | ||
| if (!validate_barbican_key_id(key_id)) { | ||
| return -EINVAL; |
There was a problem hiding this comment.
This could also very well be ENOENT (-> 404 NoSuchKey).
The difference becomes more relevant with github.com//pull/61256 where ENOKEY is treated as permanent error (longer negative cache entry by default) and ENOENT as transient (shorter default cache entry).
Ideally we would not cache validation errors at all to prevent an attacker to fill the cache with negative entries.
|
jenkins test make check |
|
jenkins test make check arm64 |
|
jenkins test api |
|
jenkins test make check |
|
jenkins test make check |
|
jenkins test make check arm64 |
|
jenkins test make check arm64 |
|
jenkins test make check |
|
Would a backport of this fix to Squid and Tentacle be welcome? If so, I can open the corresponding PRs. |
Very much so! |
Cool. Could you help me out with setting https://tracker.ceph.com/issues/73484 into the right status to do the backporting process? |
request_key_from_barbicanis called with a raw user-defined key id. To prevent issues like path injection match against a UUID4 regex first. Add this check close to the Barbican calls, as other KMS backends have other key format definitions.Barbican secret ids are defined as "uuid" and matched against Python's UUID 4 parser.
Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job Definition