Conversation
|
@wkpark Hey - thanks for the additions! I love this approach. If I understand it correctly, we better wait for the linux-usdt repo PR to merge the ARM support PR you opened, am I right? Also, did you test it with the secimport docker container? Thank you! |
I would like to see that PR merged, but the upstream (libstapsdt) hasn't been active for a long time. I don't think it will happen soon, so I think we shouldn't wait for it. Maybe merging this PR first will encourage them.
Regarding Docker, it is not fully tested yet. But since the secimport + stapsdt combination worked so well, I wanted to share the code quickly. I will test Docker further very soon.
Thank you for your great project!! |
- Implement dynamic USDT probe firing in `secure_import` using `stapsdt` to support standard Python binaries without DTrace. - Replace `assert` with explicit `RuntimeError` in `sandbox_helper.py` to prevent security bypass in optimized mode (-O). - Update CLI to detect `WITH_DTRACE` and provide installation guides for `libstapsdt` and `stapsdt`. - Add `tests/test_stapsdt_support.py`
|
rebased. |
- Refactor `secimport/cli.py` to handle `stapsdt` injection without shell quoting issues. - Enable wildcard USDT probe matching in bpftrace for non-DTrace environments. fix fix
Dynamic USDT Support via stapsdt and Security Hardening
Enhanced secimport with dynamic USDT support for standard Python and hardened security against optimized mode bypasses.
Key Technical Changes
for the provider to prevent resource leaks.
changes
secure_importusingstapsdtto support standard Python binaries without DTrace.assertwith explicitRuntimeErrorinsandbox_helper.pyWITH_DTRACEand provide installation guides forlibstapsdtandstapsdt.Add(excluded)tests/test_stapsdt_support.pysupport uv / add PEP 621 [project] to pyproject.toml(excluded)References
Note
I used the Gemini CLI to help with the specific implementation details and drafting this PR description.
See also: linux-usdt/libstapsdt#34
as expected, normal trace.bt will not work.
so I just added some more commits to address this issue.
remain issues
missing_probes configto work with libstapsdtbpftracecommand like as./bpftraceto use local bpftrace version. (we might needs someos.getenv("BPFTRACE_BIN", "bpftrace")or somthing.