security/tailscale: pre-auth key not used on first start of a fresh install (regression from 248ef719)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 83/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- backend, networking
Direzione di ricerca
Leggi il template security/tailscale/src/opnsense/service/templates/OPNsense/Tailscale/rc.conf.d e confronta la condizione della chiave di autenticazione con il comportamento descritto quando manca il file tailscaled.state. Riproduci i casi del primo avvio e del riavvio su una nuova installazione, se disponibile. Il lavoro è completato quando la chiave pre-auth viene passata al primo avvio e omessa una volta che lo stato contiene _current-profile.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
- I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md
- I have searched the existing issues, open and closed, and I'm convinced that mine is new.
- The title contains the plugin to which this issue belongs
Describe the bug
On a fresh install, os-tailscale does not log in with the configured pre-auth key on the first start. It only logs in after the service is restarted once.
The cause is the auth-key condition in security/tailscale/src/opnsense/service/templates/OPNsense/Tailscale/rc.conf.d:
if [ -f /var/db/tailscale/tailscaled.state ]; then
if ! grep -q '"_current-profile"' /var/db/tailscale/tailscaled.state; then
tailscaled_up_args_ext="--auth-key=..."
fi
fi
--auth-key is only added when tailscaled.state already exists. On a fresh install that file does not exist yet (tailscaled creates it on its first start), so the first tailscale up runs without a key and the node never authenticates. On the next start the file exists without _current-profile, so the key is added and login works.
The original fix in #5047 (commit 351090da) handled this correctly: it added the key unless the file existed and contained a profile. The follow-up commit 248ef719 ("simplify previous a little") nested the checks, which dropped the "file does not exist" case.
To Reproduce
- Fresh OPNsense install, install os-tailscale.
- VPN > Tailscale > Authentication: set a pre-auth key. Settings: enable.
- Apply / start the service.
tailscale statusshows the node logged out (needs login)./var/db/tailscale/tailscaled.statenow exists.- Restart the service: it now logs in with the same key.
Expected behavior
The node authenticates with the pre-auth key on the first start.
Suggested fix
if [ ! -f /var/db/tailscale/tailscaled.state ] || ! grep -q '"_current-profile"' /var/db/tailscale/tailscaled.state; then
tailscaled_up_args_ext="--auth-key={{ OPNsense.tailscale.authentication.preAuthKey }}"
fi
This keeps the intent of #5047 (no key once authenticated) and also covers the first start.
Additional context
Last version without the bug: the template as of commit 351090da (#5047), before 248ef719. The template on master is unchanged.
Environment
OPNsense 26.7.10 (amd64), os-tailscale 1.4, tailscale 1.104.7.
- Lingua principale
- PHP
- Stelle
- 1.2k
- Fork
- 932
- Merge medio
- 1g 11h
- PR unite (30g)
- 22
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di opnsense/plugins
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
www/squid: configctl proxy stop returns before Squid exits, so stop+start (e.g. Monit restart) failsApertasupport
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
opnsense/plugins#5983 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
net/haproxy: IPv6 literal in real server "Source address" generates an invalid `source` directiveForse già presa @fraenki l’ha presa 6 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
opnsense/plugins#5973 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[dns/ddclient] Support hiding unused standard fields per service (optional_hiding)Forse già presa @bringha1 l’ha presa 9 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di opnsense/plugins
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Automattic/blocks-engine#7881 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
iruzen-dono/workless#117 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
magicsunday/webtrees-docker#285 ·
I maintainer di solito rispondono entro 1 giorno
-
Flaky browser test: AreaHeadersTest 'shows Counting on the way while deferred tab counts load'Apertaarea/tests type/bug when/soon
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
WP-CLI 3.0 fixes the cron lock and core download bugs described in the handbookForse già presa @mayankmajeji l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
WordPress/hosting-handbook#521 ·