Finding people's use of /usr/bin/Python with the Linux audit framework
utcc.utoronto.ca
utcc.utoronto.ca
While Python2 got removed from the base operating system image, we wanted to uncover weird edge cases of engineers running special builds. We found more than one :)
I think BPF is underused for safe deprecations. It's super useful to prove that an executable is not loaded, or that a method is not called while being traced :)
[1]: https://github.com/javierhonduco/bpf-playground/blob/master/...
Thanks for sharing the use case. Super clever solution.
The roll out was done in phases to ensure that the overhead would not be prohibitive as well as to make sure that it wouldn't cause egregious priority inversions.
Scribe [0] + LogDevice [1] + Scuba [2]. I believe Scribe was open sourced a very long time ago, and LogDevice more recently, but they are both archived now.
- [0]: https://engineering.fb.com/2019/10/07/data-infrastructure/sc...
- [1]: https://logdevice.io/
- [2]: https://research.facebook.com/publications/scuba-diving-into...
Any idea why those projects (Scribe and LogDevice) were mothballed? Did Facebook simply lose interest in maintaining or did other OSS projects enter the mix that proved to be a better fit? Thanks again for sharing.
Yes alternatives(8) points a symbolic link to a name in the alternatives directory, which means that when you custom package's link to /user/bin/python is overwritten it is trivial to restore.
A lot less fragile and resource intensive than using the audit system which the blog post clearly mentions is a bit crusty.
Apparmor is another method that is a bit less expensive if it is in use but obviously doesn't work for containers.
I am pretty sure python2-minimal still triggers update alternatives to support that shared filesystem model.
Putting the named links in /etc allows for local configuration and keeps links DAGs
If you use dpkg-divert, it won't be overwritten in the first place. If you install any package which contains a file or symbolic link with that name, that file will instead be written to the name you specified in your dpkg-divert command. It's the correct way (in Debian-derived distributions) to locally override a file or symbolic link which comes from a package which does not use the alternatives mechanism (which is the case for the python-is-python2 and python-is-python3 packages; AFAIK, they contain a plain symbolic link, instead of using update-alternatives).
Point being is that at least in my opinion, using the audit system is the hard way especially in a container heavy world and due to the system wide performance impacts of open/close system calls.
While there are lots of politics and exceptions with heir(7), those packages should use a link in /usr and not a Host-specific link in a /etc subdirectory.
But yes we mostly agree, my problem was with the audit framework which is fragile and expensive.