run super

This commit is contained in:
2025-12-08 18:50:29 +01:00
parent ee282d194d
commit 85bcb598df
13 changed files with 219 additions and 359 deletions

View File

@@ -0,0 +1,17 @@
# This file configures the database connections for PuppetDB.
# It is mounted from the host system via docker-compose.yml.
[database]
classname = org.postgresql.Driver
subprotocol = postgresql
# The subname points to the postgres service defined in docker-compose.
subname = //postgres:5432/openvoxdb
username = openvox
password = StartStart1234
[read-database]
classname = org.postgresql.Driver
subprotocol = postgresql
subname = //postgres:5432/openvoxdb
username = openvox_ro
password = Start1234

View File

@@ -0,0 +1,33 @@
-- Dieses Skript enthält die Logik zur Erstellung eines dedizierten Read-Only-Benutzers
-- und zur Anpassung des Hauptbenutzers.
-- Dieses Skript enthält die Logik zur Erstellung eines dedizierten Read-Only-Benutzers
-- und zur Anpassung des Hauptbenutzers.
-- 1. Erstellen Sie einen neuen Benutzer mit einem sicheren Passwort.
CREATE USER openvox_ro WITH PASSWORD 'Start1234';
-- 2. Entziehen Sie alle Standardberechtigungen für den neuen Benutzer.
ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE ALL ON TABLES FROM openvox_ro;
ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE ALL ON SEQUENCES FROM openvox_ro;
ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE ALL ON FUNCTIONS FROM openvox_ro;
-- 3. Erteilen Sie die erforderlichen Mindestberechtigungen.
-- Erlauben Sie die Verbindung zur Datenbank.
GRANT CONNECT ON DATABASE openvoxdb TO openvox_ro;
-- Erlauben Sie die Nutzung des 'public'-Schemas.
GRANT USAGE ON SCHEMA public TO openvox_ro;
-- Erteilen Sie Lesezugriff (SELECT) auf alle vorhandenen Tabellen.
GRANT SELECT ON ALL TABLES IN SCHEMA public TO openvox_ro;
-- 4. Stellen Sie sicher, dass der Benutzer auch Lesezugriff auf zukünftig erstellte Tabellen hat.
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO openvox_ro;
-- HINWEIS: Der Hauptbenutzer 'openvox' sollte idealerweise kein Superuser sein,
-- nachdem die Initialisierung abgeschlossen ist. Der folgende Befehl würde dies tun,
-- könnte aber zukünftige Schema-Migrationen verhindern oder mit Postgres 18+ zu Fehlern führen.
-- ALTER USER openvox NOSUPERUSER;
COMMIT;

30
config/puppet/puppet.conf Normal file
View File

@@ -0,0 +1,30 @@
[main]
confdir = /etc/puppetlabs/puppet
vardir = /opt/puppetlabs/puppet/cache
logdir = /var/log/puppetlabs/puppet
codedir = /etc/puppetlabs/code
rundir = /var/run/puppetlabs
manage_internal_file_permissions = false
serverport = 8140
# This file can be used to override the default puppet settings.
# See the following links for more details on what settings are available:
# - https://puppet.com/docs/puppet/latest/config_important_settings.html
# - https://puppet.com/docs/puppet/latest/config_about_settings.html
# - https://puppet.com/docs/puppet/latest/config_file_main.html
# - https://puppet.com/docs/puppet/latest/configuration.html
[server]
vardir = /opt/puppetlabs/server/data/puppetserver
logdir = /var/log/puppetlabs/puppetserver
rundir = /var/run/puppetlabs/puppetserver
pidfile = /var/run/puppetlabs/puppetserver/puppetserver.pid
codedir = /etc/puppetlabs/code
environmentpath = /etc/puppetlabs/code/environments
hiera_config = $confdir/hiera.yaml
autosign = true
environment_timeout = 10
storeconfigs_backend = puppetdb
storeconfigs = true
reports = puppetdb
ca_ttl = 157680000
ca_server = puppet
ca_port = 8140