Skip to content

Commit

Permalink
Use the minimum privileges needed
Browse files Browse the repository at this point in the history
Fixes #291
  • Loading branch information
sahilm committed Jun 25, 2024
1 parent a080ca8 commit 44e3dcb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions compose/bootstrap.sql
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
use mysql;

create role if not exists R_DO_IT_ALL;
grant all on *.* to R_DO_IT_ALL;
create user if not exists msandbox@'%' identified with caching_sha2_password by 'msandbox';

grant R_DO_IT_ALL to msandbox@'%' ;
set default role R_DO_IT_ALL to msandbox@'%';


create role if not exists R_MIGRATOR;
grant alter, create, delete, drop, index, insert, lock tables, select, trigger, update on *.* to R_MIGRATOR;
create role if not exists R_REPLICATION;
grant REPLICATION SLAVE, REPLICATION CLIENT on *.* to R_REPLICATION;
create role if not exists R_THROTTLER;
grant SELECT on performance_schema.replication_applier_status_by_worker to R_THROTTLER;
grant SELECT on performance_schema.replication_connection_status to R_THROTTLER;


create user if not exists msandbox@'%' identified with caching_sha2_password by 'msandbox';
grant R_MIGRATOR, R_REPLICATION to msandbox@'%' ;
set default role R_MIGRATOR, R_REPLICATION to msandbox@'%';

create user if not exists rsandbox@'%' identified with caching_sha2_password by 'rsandbox';
grant R_REPLICATION, R_THROTTLER to rsandbox@'%';
set default role R_REPLICATION, R_THROTTLER to rsandbox@'%';
Expand Down

0 comments on commit 44e3dcb

Please sign in to comment.