Repository navigation
Fix/redaction linear - #3
Merged
Merged
Conversation
…ry shape The private-key shape searched lazily for an END from every BEGIN, so text with many BEGINs and no END was rescanned to its end from each one: quadratic in a journal message, a model's answer or an SSH key comment, all of which reach redact() with no length cap (112 KB took 2.9 s, on the service loop or as root). A block with no END now takes the rest of the text: one scan, and a key cut short by a field cap is no longer passed through in clear, which the old shape also did. The JWT shape started at \b, which allows a fresh start after every `-` in one run (`eyJ-eyJ-...`), each scanning to the run's end. It is now anchored at the start of a run, as the KEY= shape is; a JWT glued after a hyphen is no longer cut. The shapes are now named (SHAPES), and redact_test holds a hostile repetition for every name, with a test that the two key sets match. The timing list had grown one fix at a time and covered every shape but these two; a new shape without its measurement now fails the suite.
Four valid authorized_keys files of 3000 keys fit the GLOB read caps but expanded about threefold into key records, past the 1 MiB event limit, so the whole ssh.keys.home observation failed to publish and every home's keys went unread for the day. Crontabs already have a budget for this (_table); the key parser did not. Each file now keeps at most MAX_KEYS_PER_FILE keys, and all files together KEPT_BYTES of JSON, as _table does; what is not kept is counted per file and in all (`dropped`), and the evaluator's keys view carries it. A comment goes through _clean like every other free-text field: redacted from its first REDACT_CHARS and cut to ARGS_CHARS, rather than reaching the collector's redaction whole. The key type is cut to IDENT_CHARS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.