-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Security review notes for followup #461
Comments
Is this referring to a specific bit of code?
Couldn't tell you. This is part of the generated protobuf code. It'd be reasonable to regen this and see if the unsafe bits have disappeared. It'd also be willing to open up an issue for deprecation in the next release, removal in the release after.
Yeah, welcome to the fun edge cases in Rust allocation. If an allocation fails the entire program panics. We should document a limit to this value and check the user's input, emit a warning if the value is too large.
Depends on what cernan is shipping of course, but, yeah. I guess it is. The wiki should be amended. I'm open to suggestions for alternative behavior. My main thinking when I wrote this was that it's easy to screw up the operation of cernan by fiddling with those files. We never implemented checksums or recovery for queue files, on account of there not being a call for them at the time of implementation. Weak area, generally. Oh, you're talking about scripts here. Well, both are probably unsafe. If you craft a special purpose queue file for, say, the kafka sink you can get cernan to ship whatever you want. Same deal for scripts.
IIRC all of these have been fuzzed. Cernan should be broken up into sub-crates and fuzz targets implemented for the sources so we can get this audit cycle going for each release. My recollection is that malformed inputs are detected, logged in self-telemetry and dropped.
Ahm fer it.
None of the sources auth, the few sinks that have auth credentials are, iirc, not wired up to authenticate. IP whitelisting and/or presence in a blessed subnet was Good Enough. Obvious issues there. |
Re auth, I filed #466 to track. I think we're now tracking all the outstanding issues and it should be safe to close this master review bug. |
Rad, sounds good. Closed. |
Hi @blt, as requested I'm including security review notes here. (I'm not particularly Rust-savvy at the moment, so some of this may not be interesting in reality.) PTAL and assess if there's anything worth following up on.
Various “unsafe” usages in Rust code: https://github.com/postmates/cernan/search?q=unsafe&unscoped_q=unsafe
cernan/src/protocols/prometheus.rs
Line 2988 in b770703
AFAIK, this is unused in the code base and is a candidate for deprecation. The Prometheus source currently only supports Prom's text protocol compressed with gzip."
cernan/src/config.rs
Line 821 in e63c6e6
“By default cernan will put its on-disk queues into TMPDIR. While this is acceptable for testing and development this is not desirable for production deployments.”
https://github.com/postmates/cernan/wiki/Configuration#Scripts-Directory
For SourcesNative: “The payload must be length prefixed, the length being an unsigned, network-ordered 32 bit integer.”
Similar with SourcesStatsd -- how is malformed input handled? If we can hit any of the code marked unsafe then things get interesting & there is potential for memory corruption / RCE.
https://github.com/postmates/cernan/wiki/SinksElasticSearch
How does cernan authenticate to any of the sinks (or sources for that matter)?
Sorry if the formatting makes that a bit hard to digest. Let me know if you have any questions on any of this.
The text was updated successfully, but these errors were encountered: