Store .sorry and .oldshell outside of user dir

Aperta
#156 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python, shell
Ambito
cli, security

Direzione di ricerca

Look for the script that writes to ~/.sorry and ~/.oldshell, likely in a Python or shell script within the repository. Understand the current user directory handling and identify a secure, controlled directory (e.g., /var/run/ocf or a dedicated temporary location). Check for existing configuration or environment variables that define storage paths. Ensure the new location is root-controlled and permissions are set correctly to prevent symlink attacks.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

We currently store the sorry reason and old shell in the ~/.sorry and ~/.oldshell files respectively of the sorried user. This is a dangerous practice, because:

  • If the user had something valuable in the ~/.sorry file, we overwrite it.
  • If the user had an existing ~/.oldshell file, we lose the info about the old shell.
  • Worst of all, ~/.sorry could be a symlink created by an attacker to point to important system files. In that case, we would just overwrite those files. (And the scary thing is the script, running as root, actually has permissions to do this.)

We should store this information elsewhere, preferably in a directory that only we control.

Lingua principale
Python
Stelle
9
Fork
17
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ocf/utils

Tutte le issue di ocf/utils

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.