Passwortübergabe in Kommandozeile / Password used in command line

Description

Jeder User auf einem Linux-System darf den Befehl ps ausführen, der bei einer schon rudimentären Installation von Okapi folgendes zurückgibt:

20925 ? Sl 0:03 /usr/bin/java -Djava.awt.headless=true -Dstorage=postgres -Dpostgres_host=localhost -Dpostgres_port=5432 -Dpostgres_user=okapi -Dpostgres_password=Kermit -Dpostgres_database=okapi -Dhazelcast.logging.type=slf4j -Dlog4j.configuration=file:///etc/folio/okapi/log4j.properties -Dhost=192.168.0.46 -Dport=9130 -Dport_start=9131 -Dport_end=9230 -DdockerUrl=http://localhost:4243 -Dokapiurl=http://192.168.0.46:9130 -jar /usr/share/folio/okapi/lib/okapi-core-fat.jar dev

Das bedeutet, dass der Server in der Standardinstallation, und darüber hinaus in jeder Konfiguration, die ich heute gefunden habe, das Passwort für die zentrale Datenbank an jeden User auf dem System leakt. Das ist ein grober Sicherheitsverstoß gegen jede Regel im Umgang mit Passwörtern auf einem System.

Vorgeschlagener Lösungsweg:
Java liest direkt eine via Parameter oder hardcoded übergebene Config-Datei ein, die dann das Passwort (und auch den Rest der Parameter, die hier übergeben werden) enthält. Diese Datei kann mit Bordmitteln geschützt werden (chmod 640, chown root:okapi).
Beispiel für ein derartiges Vorgehen: https://minecraft.net/de-de/download/server/
Zusätzlicher Bonus: Man spart sich vollständig das dem Systemd-Dienst nachgeschaltete Starter-Script.

English Translation
Every user on a Linux system is allowed to execute the command ps, which returns the following in an already rudimentary installation of Okapi:

20925? Sl 0:03 / usr / bin / java -Djava.awt.headless = true -Dstorage = postgres -Dpostgres_host = localhost -Dpostgres_port = 5432 -Dpostgres_user = okapi -Dpostgres_password = Kermit -Dpostgres_database = okapi -Dhazelcast.logging.type = slf4j -Dlog4j.configuration = file: ///etc/folio/okapi/log4j.properties -Dhost = 192.168.0.46 -Dport = 9130 -Dport_start = 9131 -Dport_end = 9230 -DdockerUrl = http: // localhost: 4243 -Docapiurl = http://192.168.0.46:9130 -jar /usr/share/folio/okapi/lib/okapi-core-fat.jar dev

This means that in the default installation, as well as in any configuration I found today, the server will leak the password for the central database to every user on the system. This is a gross security breach of any password handling rule on a system.

Proposed solution:
Java directly reads in a config file passed via parameters or hardcoded, which then contains the password (and also the rest of the parameters passed here). This file can be protected with on-board resources (chmod 640, chown root: okapi).
Example of such a procedure: https://minecraft.net/de-de/download/server/
Additional bonus: You completely save yourself the starter script downstream of the Systemd service.
contains

CSP Request Details

None

CSP Rejection Details

None

Potential Workaround

None

Checklist

hide

TestRail: Results

Activity

Show:

Adam Dickmeiss March 13, 2019 at 3:54 PM

Properties can be set in a JSON file (-conf parameter)

Johannes Drexl February 27, 2019 at 6:46 PM

It'd be good practice (or at least very easy to understand for admins) to only give the config directory as parameter, and maybe some Java RE specific options (Xmx; Xms, ...) and otherwise keep the command line as short as possible.
In short: KISS - keep it simple/stupid.

Done

Details

Assignee

Reporter

Priority

Story Points

Sprint

Development Team

Core: Platform

Fix versions

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs
Created February 21, 2019 at 7:22 PM
Updated January 3, 2020 at 2:22 PM
Resolved March 13, 2019 at 3:53 PM
TestRail: Cases
TestRail: Runs

Flag notifications