Restricted user rights for cluster
ArneTR opened this issue · 0 comments
ArneTR commented
We need to alter the tests to use a specific test user with restriced rights.
CREATE USER client WITH PASSWORD 'YOUR_PASSWORD';
REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA public FROM client;
GRANT SELECT(id, name, uri, filename, branch, commit_hash, categories, machine_id, job_id, start_measurement, end_measurement, measurement_config, machine_specs, machine_id, usage_scenario, created_at, invalid_run, phases, logs, failed) on TABLE runs TO client;
GRANT INSERT ON TABLE runs TO client;
GRANT UPDATE(start_measurement, end_measurement, phases, logs, machine_id, machine_specs, measurement_config, usage_scenario, gmt_hash, invalid_run, failed) ON TABLE runs TO client;
GRANT SELECT, INSERT, UPDATE ON TABLE machines TO client;
GRANT INSERT on TABLE optimizations to client;
GRANT USAGE, SELECT ON SEQUENCE optimizations_id_seq TO client;
GRANT SELECT on TABLE optimizations to client;
GRANT SELECT on TABLE categories to client;
GRANT SELECT on TABLE notes to client;
GRANT SELECT on TABLE network_intercepts to client;
GRANT SELECT,INSERT,DELETE ON TABLE jobs TO client;
GRANT USAGE, SELECT ON SEQUENCE jobs_id_seq TO client;
GRANT UPDATE(state) ON TABLE jobs TO client;
GRANT SELECT,INSERT ON TABLE client_status TO client;
GRANT USAGE, SELECT ON SEQUENCE client_status_id_seq TO client;
GRANT SELECT(id) ON TABLE network_intercepts TO client;
GRANT INSERT ON TABLE network_intercepts TO client;
GRANT USAGE, SELECT ON SEQUENCE network_intercepts_id_seq TO client;
GRANT SELECT, INSERT ON TABLE measurements TO client;
GRANT USAGE, SELECT ON SEQUENCE stats_id_seq TO client;
GRANT INSERT ON TABLE notes TO client;
GRANT USAGE, SELECT ON SEQUENCE notes_id_seq TO client;
GRANT SELECT,INSERT ON TABLE phase_stats TO client;
GRANT USAGE, SELECT ON SEQUENCE phase_stats_id_seq TO client;