Repository navigation
fix(cli): implement ./install.sh config --harden flag - #77
Merged
Merged
Conversation
- Add harden_existing_configs() in lpt_installer/configs.py to tighten chmod 0600 on existing config files and 0700 on logs/ and data/ without copying missing *.example templates or validating unrelated tools. - Wire --harden into ./install.sh config, clarify doctor's suggestion to './install.sh config --harden', and document the flag in docs/CONFIGURATION.md and docs/TROUBLESHOOTING.md. - Add unit test covering --harden and --harden --dry-run (227/227 passing).
🛡️⚡ TunnelSentinel Code ReviewVerdict: Latest commit: Executive Summary
Edge-Case & State-Transition Verification
Empirical Test Results
Verdict
Review history
|
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.
Summary of Changes
Fixes
./install.sh config --hardenreferenced by./install.sh doctorwhen group/world-readable config files are detected:lpt_installer/configs.py: addedharden_existing_configs()to enforce0o600on existing config files (config.ini,Magma/magma_config.ini,feeConfig.json,wallets.json) and0o700onlogs//data/without copying missing*.exampletemplates or running full 19-tool validation.lpt_installer/cli.py: added--hardentoconfigsubcommand (supports--dry-runand--json).lpt_installer/env.py,docs/CONFIGURATION.md,docs/TROUBLESHOOTING.md: updateddoctorremediation hint (./install.sh config --harden) and docs.tests/test_lpt_installer.py: added regression testtest_cli_config_harden_tightens_existing_without_copying_templates.Verification
.venv/bin/pytest tests/ -v --cov=... --cov-fail-under=35: 227 passed..venv/bin/pytest tests/test_lpt_installer.py tests/test_ca_trust_hardening.py --cov=lpt_installer --cov-fail-under=85: 16 passed.greptile-guard), so this PR is verified via GitHub Actions CI + TunnelSentinel.