-
Notifications
You must be signed in to change notification settings - Fork 228
rfc: add initial draft of pcap-cf #1309
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
base: main
Are you sure you want to change the base?
rfc: add initial draft of pcap-cf #1309
Conversation
Co-Authored-By: Claude <[email protected]>
peanball
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments and points of discussion.
General:
- I'm missing the "opt-in" nature and control of the feature and discussion of possible security risks when this feature is enabled overall. The "attacker" in this case is a rouge operator and that might be more of an organizational problem. But the app's operator shouldn't be able to override an org policy, etc.
- Because this is an analog to bosh pcap, maybe we can explain the functionality and one of its main benefits (multiplexing of traffic captured across multiple instances) a bit earlier? Right now it's in the very last sentence of the very last section (before the references). If it's important it should be repeated.
|
Maybe a general note on the opt-in: there were no extensive discussions on what that "opt-in" would look like. In my opinion it should just be the existing SSH access and not a dedicated flag. Mainly because having SSH access already puts you in a position of being able to do a lot and we have this setup as a feature flag on the different levels of CF. |
I see your point. That said, capturing network traffic might show data that is not even stored plain-text in a database that you could gain access to via SSH. So maybe something worth discussing more extensively. For future discussions and votes: My opinion is that network capture is a privilege beyond SSH. |
ameowlia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Would a user be able to see unencrypted traffic contents?
-
What roles would be able to use this comment for a given app?
-
Would this feature always be on, or would there be a foundation wide flag?
-
Could there be a
cf eventto log when this action is taken?
| ```bash | ||
| # Capture HTTP traffic for myapp | ||
| cf pcap myapp --interface eth0 --filter "tcp port 80" --snaplen 1500 | ||
|
|
||
| # Capture specific instance with custom filter | ||
| cf pcap myapp --instance 1 --filter "host database.example.com" | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give some examples of what the output would look like?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, please check again.
|
Some replies to Amelia's questions. @maxmoehl, please correct me if I'm wrong.
If they capture on the interface
This needs to be fleshed out in the RFC a bit. I think it depends on the scenario. In a test org or space a group of developers may want to capture stuff, in a production org maybe only select people after prior approval.
Foundation wide general flag, and ideally additional per org/space/app(?) flag.
That is a good idea, for traceability purposes. |
My current proposal (though I should maybe clarify this a bit more) does not introduce any additional permissions. As long as a user can SSH into the app they will be able to initiate a capture. That includes capturing plain-text traffic.
This is where it gets tricky. Foundational flag we can somehow make work via diego-release, it would need to control whether the binary is injected or not which makes this complicated as the injected binaries right now come via a BOSH package which is not configurable in any way. I would prefer not to add org/space/app flags beyond the SSH one1.
This comes down to the feature just being SSH with a special binary. There won't be any interaction with the CF API beyond SSH, so no special audit log will be written. I will also spend some time today addressing the remaining comments. Footnotes
|
|
I'm concerned about the additional attack surface being introduced. I would highly recommend making this opt-in at the bosh level. As in don't deploy the binary unless a property is being set. For the simple reason that when a CVE is being discovered in the to be created binary an operator can just switch the property to mitigate the security risk. In general it would be good to call out all the security controls that will be put in place around the to be created binary. For example it should probably be mounted from a read only location, be statically linked to prevent dynamic library injection, etc. |
Valid point, however, I'm not sure how to best achieve this. Right now the injection of such binaries is achieved via the various
I'll add that to the RFC: being written in Go it will be statically linked (without CGO), based on how the injection currently works I would copy it into the container instead of mounting it, possibly with a way to prevent that step with a flag. I also have a small correction: it seems like the container does not have |
|
We clarified the open points in the comments above. The assumption was that the container is getting more privileges than before which is not the case. That is why the point with making the binary loaded dynamically is not valid any more. That is why, we decided to start the final comment period during the TOC meeting today with the goal to accept this. |
🚀 link for easy viewing