Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restricted user rights for cluster #664

Open
ArneTR opened this issue Jan 27, 2024 · 0 comments
Open

Restricted user rights for cluster #664

ArneTR opened this issue Jan 27, 2024 · 0 comments
Assignees

Comments

@ArneTR
Copy link
Member

ArneTR commented Jan 27, 2024

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants