Restrict tableau_auth.json to 0600 on POSIX
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- authentication, cli, security
Direzione di ricerca
Start at Session._save_file and inspect how ~/tableau_auth.json is written and updated. Verify fresh and repeated tabcmd login flows on POSIX, checking that stat -c '%a' reports 600; also exercise a chmod failure to confirm login still succeeds and the debug message is emitted.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
~/tableau_auth.json is written by Session._save_file with the process umask (typically 0022 on Linux/macOS), leaving it world-readable. The file holds a valid Tableau auth_token plus site_id, user_id, server_url, and optionally a personal_access_token value; anyone with local read on the user's home dir can impersonate them until the token expires.
Historically this was largely dead weight because tabcmd 2 did not reuse the saved token (see #463). Now that #463 makes the token load-bearing across invocations, restricting the file's permissions is worth doing.
Proposed minimal fix (POSIX only)
In Session._save_file, after json.dump(...), call os.chmod(file_path, 0o600) on POSIX. Log a debug (not warning) line if chmod raises, since the write itself already succeeded and losing the tightening is not fatal.
def _save_file(self, data: Dict[str, Any]) -> None:
file_path = self._get_file_path()
with open(str(file_path), "w") as f:
json.dump(data, f)
if os.name == "posix":
try:
os.chmod(file_path, 0o600)
except OSError as e:
self.logger.debug(
"Could not restrict {} to 0600 ({})".format(file_path, type(e).__name__)
)
Explicitly out of scope for this issue
- Windows ACLs. The default ACL on
%USERPROFILE%already restricts to the current user; a Windows-specific ACL step needs pywin32 wiring, a Windows-only test fixture, and belongs in a separate change. - OS keyring migration. Storing the token in Windows Credential Manager / macOS Keychain / Secret Service is the right long-term direction but is a larger change that deserves its own design and migration path.
Verification
Author does not currently have a POSIX dev environment for this fix; testing on at least one Linux distribution before merge is a hard requirement. Suggested pre-merge checks:
- Fresh
tabcmd login, thenstat -c '%a' ~/tableau_auth.jsonreports600. - Update flow: overwrite existing file, permissions remain
600. - Chmod failure path: mount the home dir read-only or run under a filesystem that refuses chmod; confirm login still succeeds and the debug line fires.
Related
- #463 — the fix that made saved-token reuse actually load-bearing.
- Lingua principale
- Python
- Stelle
- 52
- Fork
- 17
- Merge medio
- 5g 20h
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun 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 tableau/tabcmd
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
feat: publish missing --description flag from tabcmd ClassicForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
feat: creategroup missing --role flag from tabcmd ClassicForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Tutte le issue di tableau/tabcmd
Issue simili
-
md/asciidoc/csv: an explicit `encoding="utf-8"` keeps a leading BOM, the auto-detect path drops itAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
docling-project/docling#4846 ·
I maintainer di solito rispondono entro 1 giorno
-
area/sessions comp/dashboard comp/desktop comp/gateway comp/tui duplicate P2 sweeper:risk-session-state type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NousResearch/hermes-agent#138914 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bot-triaged module: activation checkpointing module: inductor oncall: pt2 triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
[oblt-aw][autodoc] Update PR Actions Detective E2E prerequisites and fix dashboard-format table typoApertadocumentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
elastic/oblt-aw#2382 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno