Page MenuHomePhabricator

Make installer grant only needed rights to db user
Open, LowPublic

Description

Currently, if the installer creates a user, it does

GRANT ALL PRIVILEGES ON $dbAllTables TO $name;

Instead we should:

  • Create separate users for $wgDBAdminUser and $wgDBUser

For the normal user we should grant only

  • DELETE
  • SELECT
  • INSERT
  • UPDATE
  • REPLICATION CLIENT

For the DBAdminUser we should grant the normal one's plus:

  • ALTER
  • CREATE
  • DROP
  • INDEX
  • LOCK TABLES
  • REFERENCES (forward compatibility)
  • TRIGGER (forward compatibility)

[I'm not 100% sure this list is enough]

Note: Doing this may cause compat issues with some extensions (e.g. SMW, Cargo) maybe.

See also https://www.mediawiki.org/w/index.php?title=Topic:Uc949fv6nue6suiq&topic_showPostId=ucbqknoxgxzox8k1#flow-post-ucbqknoxgxzox8k1

Additionally, https://www.mediawiki.org/wiki/Manual:Installing_MediaWiki#MariaDB/MySQL would need to be updated.

Event Timeline

@Bawolff Thanks a lot for creating this task and providing details.

Semantic MediaWiki additionally needs CREATE TEMPORARY TABLES for the admin user. Moreover it [[ https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/2968 | will support $wgDBAdminUser ]] starting with version 3.0.0.

Vvjjkkii renamed this task from Make installer grant only needed rights to db user to vudaaaaaaa.Jul 1 2018, 1:13 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot raised the priority of this task from High to Needs Triage.Jul 3 2018, 1:55 AM