Restrict tableau_auth.json to 0600 on POSIX
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- authentication, cli, security
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 52
- Forks
- 17
- Merge medio
- 5 d 20 h
- PR fusionados (30 d)
- 2
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de tableau/tabcmd
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
feat: publish missing --description flag from tabcmd ClassicPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
feat: creategroup missing --role flag from tabcmd ClassicPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Todos los issues de tableau/tabcmd
Issues similares
-
bug difficulty:2 good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
MakazhanAlpamys/Soup#1865 ·
Los mantenedores suelen responder en 1 día
-
area: agents area: docs good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
openapi/gknowledge#23 ·
-
useless-suppression reported for deprecated-* messages that should be exemptPosiblemente ocupada @adityasinha-ghub la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
pylint-dev/pylint#11656 ·
Los mantenedores suelen responder en 1 día
-
area:provisioning effort:S priority:P2 provider:local-libvirt risk:daytime-only status:in-progress type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
randomparity/kdive#3203 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
get() for StrEnumPosiblemente ocupada @FeJo5952 la tomó hoy. Abiertogood first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
collective/icalendar#1921 · 1 comentario ·
Los mantenedores suelen responder en 1 día