Tunnel token out of the systemd unit's ExecStart: EnvironmentFile or --token-file

Open
#3,672 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go, linux
Domain
devops, security

Research direction

Start with scripts/setup-peer.sh and scripts/install-lab-tunnel.sh, which write containarium-tunnel.service, then find the daemon's tunnel command and its existing --token-file support from #3629. Update both unit generation paths to read the token from a file with mode 0600. Done when a test confirms the rendered unit contains no token and the token file is 0600.

Written by the indexing model from the issue text.

Description

model:sonnet runtime:claude security size:S

Finding

The tunnel token is in ExecStart --token ... in containarium-tunnel.service, written by scripts/setup-peer.sh and scripts/install-lab-tunnel.sh. #3654 made the unit 0600, so only root can read it. But the token still appears in the unit's command line, which shows in systemctl cat and process listings for root.

Moving it to a EnvironmentFile (0600) or a --token-file removes it from the unit and the argv.

Acceptance criteria

  • The token is not in ExecStart or the unit file. It is read from an EnvironmentFile or --token-file, and that file is 0600.
  • The daemon's tunnel command accepts the token from the file (reuses the --token-file path from #3629).
  • Test: the rendered unit contains no token; the token file is 0600.

Depends on #3629 (merged): the --token-file flag already exists and is reused here.
Follow-up to #3654.

Dominant language
Go
Stars
296
Forks
38
Avg merge
7h 34m
Merged PRs (30d)
648

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from FootprintAI/Containarium

All issues in FootprintAI/Containarium

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.