Docker DB initialization script prints admin password to console

Offen
#371 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
55/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
docker, python, shell
Bereich
devops, security

Rechercherichtung

Beginnen Sie mit docker/scripts/configure.sh und prüfen Sie den Aufruf von paver create. Folgen Sie dann dem aufgerufenen create-Skript GeoHealthCheck/models.py. Führen Sie die Docker-Initialisierung aus und prüfen Sie docker logs ghc_runner; abgeschlossen bedeutet, dass das Admin-Passwort in der Ausgabe fehlt oder redigiert ist, während die Datenbankerstellung weiterhin erfolgreich ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug

The script to create a new database prints the admin password to the console. This is undesirable for security purposes. Often console output (of Docker containers or otherwise) is accumulated in a logging / monitoring system, like the ELK-stack. The offending script is docker/scripts/configure.sh, and specifically the line paver create -u ${ADMIN_NAME} -p ${ADMIN_PWD} -e ${ADMIN_EMAIL}. Here, another Python script is called.

When running docker logs ghc_runner, you'll see the following output:

START /run-runner.sh
Container timezone not modified
Container timezone set to: Europe/Amsterdam
START /configure.sh
Using DB_TYPE=sqlite
Creating SQLite DB tables...
/GeoHealthCheck /
---> pavement.create
python GeoHealthCheck/models.py create admintest admintest <email>
2021-06-29 11:50:59,392 - init - INFO - created GHC App instance #1
Creating database objects
Creating superuser account
/
END /configure.sh
---> pavement.runner_daemon
python GeoHealthCheck/scheduler.py
2021-06-29 11:51:00,309 - init - INFO - created GHC App instance #1

As a minimum, the password (the second occurrence of admintest) should be redacted. Furthermore, one might ask oneself if it is really necessary to log this information.

Vorherrschende Sprache
Python
Sterne
93
Forks
77
Ø Merge
27 Min.
Gemergte PRs (30 T.)
1

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus geopython/GeoHealthCheck

Alle Issues in geopython/GeoHealthCheck

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.