rekor icon indicating copy to clipboard operation
rekor copied to clipboard

Size Limits on all types

Open dlorenc opened this issue 3 years ago • 6 comments

From a discussion with @asraa, we should figure out reasonable size limits for all types and enforce them in type validation.

dlorenc avatar Aug 17 '21 15:08 dlorenc

Can you clarify why the size limit should be type specific?

bobcallaway avatar Aug 18 '21 22:08 bobcallaway

Ah, I think we should set global limits but we might also be able to restrict further by type.

dlorenc avatar Aug 18 '21 22:08 dlorenc

So far I think the max request size set by the proxy (120mb) is probably way too large for most types. Whether rekor should have a smaller artifact size seems likely to be true (at least most types won't hit near this limit, for e.g. the rfc 3161 timestamps should definitely be smaller given that they only contain a hash of the message signed).

Since rekor does do some minimal parsing (for example, parsing public key bytes into x509 certs for sig verification), I'm mostly thinking a tighter request size limit to prevent really long, unnecessary parsing. It doesn't seem necessary to do this for the types that have payload that isn't being parsed in complicated way, e.g. maybe just hashed

asraa avatar Aug 19 '21 13:08 asraa

Since we're taking input as JSON, having a request limit based on the type would require rekor to parse the incoming document in order to get the type to determine the appropriate size limit. The kind and apiVersion elements could be at the end of the document, so its possible we'd have to read in the entire large doc into memory in order to determine the size-specific limit - thus making the limit moot?

bobcallaway avatar Aug 19 '21 14:08 bobcallaway

@dlorenc @bobcallaway Is this done? Do we have limits in place?

haydentherapper avatar Aug 02 '22 21:08 haydentherapper

Was this completed?

haydentherapper avatar Jan 03 '23 04:01 haydentherapper