Repository navigation
System init: the clone route in init's refusals names v2 init (#464) - #719
Merged
Merged
Conversation
When init runs from a Python or a checkout the agent's user could change, it refuses and gives the clone route. That hint always said `sudo /usr/bin/python3 -m tracekit init --user <agent-user>`, so after `init --v2` it led to v1 init, and the untrusted-Python hint named the system Python alone, which may have no Tracekit and refuse pip (PEP 668). Both hints now give the clone route with the command of the init that refused: `init --v2 --user <agent-user>` for v2, plus `--experimental-macos` on macOS. Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
The hint cloned the default branch, so following it put unreleased code in the root-owned install. Review of #719. Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
….md does With one fixed folder, the next release's clone failed on the existing directory, and cd-ing into it ran the old release. Final-head review of #719. Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
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.
What
When system init runs from a Python or a source checkout the agent's user could change, it refuses before changing anything and says how to run it instead (
_install_source,tracekit/install.py). Both refusals now give the clone route with the command of the init that refused:--experimental-macosis added on macOS, and v1 init keepsinit --user <agent-user>.Why
init --v2runs the same check, but the hint always named v1 init (init --user <agent-user>, no--v2), so following it ran v1 init instead. The untrusted-Python hint saidsudo /usr/bin/python3 -m tracekit init, which fails on Debian 12 and Ubuntu 23.04+ where the system Python has no Tracekit and refusespip install(PEP 668); from inside a root-owned clone it works on every Python, as doctor's re-init hint already says. These are two of the hints #464 lists.How I ran it
tests/test_system_v2.py::InitRefusals::test_an_untrusted_python_or_checkout_names_v2_inits_commanddrivesinit_system_v2(as root on Linux, mocked) into each refusal. On a clean checkout of main both subtests fail (the hints have no--v2); with this change they pass._install_source("init --v2 --user <agent-user>")prints:the Python running init could be modified by a non-root user (…/python3.11 is not owned by root). Run init with a root-owned Python from a root-owned clone, e.g. sudo git clone https://github.com/Cygnux-Labs/Tracekit /usr/local/src/Tracekit, then cd /usr/local/src/Tracekit && sudo /usr/bin/python3 -m tracekit init --v2 --user <agent-user>make test-ts lint build testpassed: TypeScript 152 passed, 0 failed; pytest 4,876 passed, 394 skipped, 10 xfailed. The system-mode paths themselves run as root only on Linux CI.Left in #464
REINIT) has no--no-hooksfor plugin users (the 11-10 comment);tailer_lostreason (tracekit/signer/service.pyL1747) points at a doctor tailer check that doesn't exist;sudo /usr/bin/python3 -m tracekit init --user <agent-user>(tracekit/install.pymigrate_systemand the v1 doctor checks), as dodocs/doctor.md,docs/signing.md,docs/portability.mdanddocs/evaluation.md;docs/deploy-compose.mdL9 and L80 usesudo tracekit deploy compose.Part of #464.