File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -164,13 +164,20 @@ createdb --encoding=UTF8 --template=template0 contactdb
164164psql -f /usr/share/intelmq-certbund-contact/sql/initdb.sql contactdb
165165```
166166
167- A database user with the right to select the data in the Contact DB
167+ A database user ( ` intelmq ` ) with the right to select the data in the Contact DB
168168must be created. This is the account, which will be used in the bot's
169169configuration for accessing the database.
170170
171+ Also, a database user (` fody ` ) with write permissions on the tables
172+ must be created. This account can be used for the fody backend
173+ configuration (` /etc/intelmq/contactdb_server.conf ` ) and the RIPE
174+ Update Script.
175+
171176``` bash
172177createuser intelmq --pwprompt
173- psql -c " GRANT SELECT ON ALL TABLES IN SCHEMA public TO intelmq;" contactdb
178+ psql -c " GRANT contactdb_ro TO intelmq;" contactdb
179+ createuser fody --pwprompt
180+ psql -c " GRANT contactdb_rw TO intelmq;" contactdb
174181```
175182
176183#### Adding default email tags
Original file line number Diff line number Diff line change 11BEGIN ;
22
3+ CREATE ROLE IF NOT EXISTS contactdb_owner
4+ NOLOGIN NOSUPERUSER NOINHERIT NOCREATEDB CREATEROLE;
5+ CREATE ROLE IF NOT EXISTS contactdb_ro
6+ NOLOGIN NOSUPERUSER NOINHERIT NOCREATEDB CREATEROLE;
7+ CREATE ROLE IF NOT EXISTS contactdb_rw
8+ NOLOGIN NOSUPERUSER NOINHERIT NOCREATEDB CREATEROLE;
9+
10+ SET ROLE contactdb_owner;
11+
312/*
413 Template table containing with elements for automatic tables
514 */
@@ -485,4 +494,11 @@ CREATE TABLE IF NOT EXISTS audit_log (
485494 " after" JSONB
486495);
487496
497+ GRANT SELECT , INSERT, UPDATE , DELETE ON ALL TABLES IN SCHEMA public TO contactdb_rw;
498+ GRANT USAGE ON ALL SEQUENCES IN SCHEMA public TO contactdb_rw;
499+ GRANT SELECT ON ALL TABLES IN SCHEMA public TO contactdb_ro;
500+
501+ GRANT contactdb_ro TO intelmq;
502+ GRANT contactdb_rw TO fody;
503+
488504COMMIT ;
You can’t perform that action at this time.
0 commit comments