Modularize dotsec into lib/*.sh + per-engagement secret auto-generation#1
Merged
Conversation
…without exegol container)
… SC2155, SC1090/91)
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
bin/dotsecmonolith into 7 sourcedlib/*.shmodules (ui, core, secrets, proxy, exegol, dashboard, engagement);bin/dotsecis now an ~80-line router. Iso-functional — function bodies moved verbatim, two dead functions dropped (__require_tmux,__tmux_spawn_session).lib/secrets.shauto-generates per-engagement secrets ondotsec new, idempotently:.env.secrets(chmod 600):DOTSEC_SESSION_SECRET,DOTSEC_API_TOKEN,MITMWEB_PASSkeys/proxy/certs/dotsec secrets <target>(masked status) anddotsec rotate <target> [all|token|mitmweb|ssh|ca](confirmation for destructive types).cmd_new,cmd_load(sourced through the command-substitution guard), andproxy_up(readsMITMWEB_PASS, legacy.web-passfallback)..gitignorenow excludesmitmproxy/certs/+mitmproxy/flows/(prevents committing the private CA key); strict permissions; secrets never printed in clear (exceptMITMWEB_PASSat proxy launch, as before).set -efoot-guns, incl. a pre-existing one in__dotsec_load_globalthat aborteddotsecon any host without an exegol container..shellcheckrc), newmake test/make linttargets and a CI lint job.Test Plan
make lint— shellcheck clean acrossbin/+lib/make test— 23/23 bats tests passmain)dotsec secrets/rotateexercised on a temp workspace; perms stay 600/700 after every rotate path; CA key confirmed never committed to historydotsec new, proxy up, browser) — requires Docker/Exegol host