Skip to content

fix: isolate service users, env values, webhooks and SSH temps (#231–#234) - #235

Merged
puppe1990 merged 5 commits into
mainfrom
fix/security-231-234
Oct 16, 2026
Merged

puppe1990 merged 5 commits into
mainfrom
fix/security-231-234

Conversation

@puppe1990

Copy link
Copy Markdown
Collaborator

Problema

Quatro falhas de isolamento no painel, abertas em #231–#234:

  • unidades systemd de Node/Rails/Rust/Gleam rodavam como root
  • source do EnvironmentFile avaliava $(), backticks e $HOME no shell
  • webhook GitHub autorizava todos os apps do repo se qualquer segredo validasse
  • stdin/wrapper do SSH nasciam com umask 0022 (legíveis para outros usuários locais)

Mudanças

Testes

  • ownership + hardening nas unidades node/rails/rust/gleam
  • loader Python: $(touch marker) não cria o arquivo; conteúdo quoted no env file
  • dois tenants, mesmo repo, segredos diferentes: assinatura de A não enfileira B
  • permissões 700/600/700 observadas durante o comando; limpeza depois de sucesso e falha

mix precommit 941/0 · mix credo suggest --min-priority higher limpo.

Fixes #231
Fixes #232
Fixes #233
Fixes #234

…unt (#231)

Shared-host units for those runtimes were User=root. Each app now gets the
same cleat-<slug> account Phoenix already uses, with write limited to its
data dir and release tree.
systemd EnvironmentFile is always quoted so spaces and metacharacters stay
data. Migrate, release_command and Rails/Rust runners load that file with
python3 instead of `source`, so `$()`, backticks and `$HOME` are not executed.

Fixes #232
find_repo_apps used any matching secret as authorization for every instance
of the repository. Tenants that register the same repo now only enqueue when
their own secret matches; instances that share a secret still deploy together.

Fixes #233
run_with_stdin created the script and wrapper with File.write/2, so umask
0022 left them world-readable. They now live in a mkdir -m 700 directory
and are opened with mode 0600/0700.

Fixes #234
The #232 runner passes NODE_ENV via python3 --set instead of `export` and
`source`. This assertion was still looking for the old shell snippet.
@puppe1990
puppe1990 merged commit 467aa75 into main Oct 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant