SlideShare a Scribd company logo
1 of 20
Principal Member ofTechnical Staff
MySQL
March 05, 2020
Rahul Sisondia
Multiple DB accounts for an app
The following is intended to outline our general product direction. It is intended for information purposes
only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code,
or functionality, and should not be relied upon in making purchasing decisions. The development, release,
timing, and pricing of any features or functionality described for Oracle’s products may change and
remains at the sole discretion of Oracle Corporation.
Safe harbor statement
Copyright © 2020, Oracle and/or its affiliates2
Copyright © 2020, Oracle and/or its affiliates3
4
3
2
1
Asses vulnerability
Users categorization
Overview
Program agenda
Prevention
Copyright © 2020, Oracle and/or its affiliates4
DB users
Copyright © 2020, Oracle and/or its affiliates | Confidential: Internal/Restricted/Highly Restricted4
Instance admins
Applications
App admins
Copyright © 2020, Oracle and/or its affiliates5
Authorization
Dynamic privileges
• Defined by Server, component or
plugin at run rime
• Administrative operations
- BACKUP_ADMIN, AUDIT_ADMIN
Static privileges
• Built into the server
• Database Operations
- SELECT, INSERT, UPDATE
• Administrative operations
- CREATE USER, PROCESS
• Grant privileges to user
- GRANT SELECT, INSERT ON *.* TO foo_user;
- GRANT SELECT ON db.table TO bar_user;
• Revoke Privileges
- REVOKE SELECT, INSERT ON *.* FROM foo_user;
- REVOKE SELECT ON db.table FROM bar_user;
Copyright © 2020, Oracle and/or its affiliates6
Privilege you need to create users ?
CREATE USER
Do not have this privilege
Privileged User Non- privileged User
Copyright © 2020, Oracle and/or its affiliates7
Privileged or Non-privileged users
Copyright © 2020, Oracle and/or its affiliates | Confidential: Internal/Restricted/Highly Restricted7
Applications
Instance admins
Privileged
Non-Privileged
Privileged
App admins
Copyright © 2020, Oracle and/or its affiliates8
Application App Users
App user accounts management
DB Users
Micro Services
Privileged user Non privileged user
app.user
Copyright © 2020, Oracle and/or its affiliates9
Applications App Users
App user accounts management
DB Users
Privileged user Non privileged user
Copyright © 2020, Oracle and/or its affiliates10
Privilege escalation !
Copyright © 2020, Oracle and/or its affiliates | Confidential: Internal/Restricted/Highly Restricted10
Root user
App admins
Copyright © 2020, Oracle and/or its affiliates11
SYSTEM_USER privilege
- Allows maintaining separation of duty better
DBAs managing instances and NOT data
E.g. Uptime, Backup, High Level Security
DBAs managing data
Users with access to part of data
SYSTEM_USER
ALTER USER root@localhost IDENTIFIED BY ‘voodoo’;
System Users
- Granted at least ‘SYSTEM_USER’ privilege, but
not the CREATE USER privilege.
Power Users
- Granted at least ‘CREATE USER’ and
‘SYSTEM_USER’ privilege.
Privileged Users
- Granted at least ‘CREATE USER’ privilege, but
not the ‘SYSTEM_USER’ privilege.
Non-privileged Users
- Neither ‘SYSTEM_USER’ nor ‘CREATE USER’
privilege, but may be granted other privileges.
Copyright © 2020, Oracle and/or its affiliates12
Power Users
Copyright © 2020, Oracle and/or its affiliates13
DB users
DB Users
Non-privileged
users
Privileged
users
Regular
Users
Power UsersSystem Users
Copyright © 2020, Oracle and/or its affiliates14
Is that sufficient ?
Do not have either of the
two privileges
Privileged User Non- privileged User
CREATE USER
INSERT | UPDATE on mysql
schema
OR
Copyright © 2020, Oracle and/or its affiliates | Confidential: Internal/Restricted/Highly Restricted15
Partial Revokes
• Allows creating exception to global grants (Everything except ‘this’ and ‘that’)
• Execute GRANT at global level followed by REVOKE at schema level
GRANT INSERT ON *.* TO `foo_admin`;
REVOKE INSERT ON `mysql`.* FROM `foo_admin`;
Copyright © 2020, Oracle and/or its affiliates16
• Segregate the users as power users and regular users.
• Principle of least privileges.
• Revoke access to mysql schema from privileged users
Prevention Policy !
Copyright © 2020, Oracle and/or its affiliates17
Applications App Users
Multiple app admins can be used
DB Users
Privileged user Non privileged user
Copyright © 2020, Oracle and/or its affiliates18
Thank you
Copyright © 2020, Oracle and/or its affiliates19
Questions
Better access control of administrators

More Related Content

What's hot

Presentation- on OIM
Presentation- on OIMPresentation- on OIM
Presentation- on OIM
Tamim Khan
 
Identity management11gr2launch finalv2
Identity management11gr2launch finalv2Identity management11gr2launch finalv2
Identity management11gr2launch finalv2
OracleIDM
 
Overview of Oracle Identity Management - Customer Presentation
Overview of Oracle Identity Management - Customer PresentationOverview of Oracle Identity Management - Customer Presentation
Overview of Oracle Identity Management - Customer Presentation
Delivery Centric
 

What's hot (20)

Oim Poc1.0
Oim Poc1.0Oim Poc1.0
Oim Poc1.0
 
Exchange Manager
Exchange ManagerExchange Manager
Exchange Manager
 
Password Manager
Password ManagerPassword Manager
Password Manager
 
Presentation- on OIM
Presentation- on OIMPresentation- on OIM
Presentation- on OIM
 
eMAS Indentity and Access Management
eMAS Indentity and Access ManagementeMAS Indentity and Access Management
eMAS Indentity and Access Management
 
Identity management11gr2launch finalv2
Identity management11gr2launch finalv2Identity management11gr2launch finalv2
Identity management11gr2launch finalv2
 
Dell Password Manager Introduction
Dell Password Manager IntroductionDell Password Manager Introduction
Dell Password Manager Introduction
 
Oracle Identity & Access Management
Oracle Identity & Access ManagementOracle Identity & Access Management
Oracle Identity & Access Management
 
Authorization Services
Authorization ServicesAuthorization Services
Authorization Services
 
Dell Password Manager Architecture - Components
Dell Password Manager Architecture - ComponentsDell Password Manager Architecture - Components
Dell Password Manager Architecture - Components
 
Con8823 access management for the internet of things-final
Con8823   access management for the internet of things-finalCon8823   access management for the internet of things-final
Con8823 access management for the internet of things-final
 
Hitachi ID Identity Express™ - Corporate Edition
Hitachi ID Identity Express™ - Corporate EditionHitachi ID Identity Express™ - Corporate Edition
Hitachi ID Identity Express™ - Corporate Edition
 
Sharepoint Admin
Sharepoint AdminSharepoint Admin
Sharepoint Admin
 
White Paper : Powerful Health Care Information system
White Paper : Powerful Health Care Information systemWhite Paper : Powerful Health Care Information system
White Paper : Powerful Health Care Information system
 
Role based access control - RBAC
Role based access control - RBACRole based access control - RBAC
Role based access control - RBAC
 
Oracle Identity Governance Technical Overview - 11gR2PS3
Oracle Identity Governance Technical Overview - 11gR2PS3Oracle Identity Governance Technical Overview - 11gR2PS3
Oracle Identity Governance Technical Overview - 11gR2PS3
 
Overview of Oracle Identity Management - Customer Presentation
Overview of Oracle Identity Management - Customer PresentationOverview of Oracle Identity Management - Customer Presentation
Overview of Oracle Identity Management - Customer Presentation
 
Federation Services
Federation ServicesFederation Services
Federation Services
 
Sim-webcast-part1-1aa
Sim-webcast-part1-1aaSim-webcast-part1-1aa
Sim-webcast-part1-1aa
 
Vm ware view manager training in hyderabad
Vm ware view manager training in hyderabadVm ware view manager training in hyderabad
Vm ware view manager training in hyderabad
 

Similar to Better access control of administrators

Oracle - Enterprise Manager 12c Overview
Oracle - Enterprise Manager 12c OverviewOracle - Enterprise Manager 12c Overview
Oracle - Enterprise Manager 12c Overview
Fred Sim
 

Similar to Better access control of administrators (20)

Oracle Enterprise Manager Security A Practitioners Guide
Oracle Enterprise Manager Security A Practitioners GuideOracle Enterprise Manager Security A Practitioners Guide
Oracle Enterprise Manager Security A Practitioners Guide
 
Integrate Oracle Identity Management and Advanced Controls for maximum effici...
Integrate Oracle Identity Management and Advanced Controls for maximum effici...Integrate Oracle Identity Management and Advanced Controls for maximum effici...
Integrate Oracle Identity Management and Advanced Controls for maximum effici...
 
Automating Security Management in PBCS!
Automating Security Management in PBCS!Automating Security Management in PBCS!
Automating Security Management in PBCS!
 
Con8813 securing privileged accounts with an integrated idm solution - final
Con8813 securing privileged accounts with an integrated idm solution - finalCon8813 securing privileged accounts with an integrated idm solution - final
Con8813 securing privileged accounts with an integrated idm solution - final
 
Oracle Enterprise Manager Security: A Practitioners Guide
Oracle Enterprise Manager Security: A Practitioners GuideOracle Enterprise Manager Security: A Practitioners Guide
Oracle Enterprise Manager Security: A Practitioners Guide
 
Oracle Database 11g Security and Compliance Solutions - By Tom Kyte
Oracle Database 11g Security and Compliance Solutions - By Tom KyteOracle Database 11g Security and Compliance Solutions - By Tom Kyte
Oracle Database 11g Security and Compliance Solutions - By Tom Kyte
 
Security Inside Out: Latest Innovations in Oracle Database 12c
Security Inside Out: Latest Innovations in Oracle Database 12cSecurity Inside Out: Latest Innovations in Oracle Database 12c
Security Inside Out: Latest Innovations in Oracle Database 12c
 
Oracle databáze - zkonsolidovat, ochránit a ještě ušetřit! (2. část)
Oracle databáze - zkonsolidovat, ochránit a ještě ušetřit! (2. část)Oracle databáze - zkonsolidovat, ochránit a ještě ušetřit! (2. část)
Oracle databáze - zkonsolidovat, ochránit a ještě ušetřit! (2. část)
 
Oracle - Enterprise Manager 12c Overview
Oracle - Enterprise Manager 12c OverviewOracle - Enterprise Manager 12c Overview
Oracle - Enterprise Manager 12c Overview
 
ODTUG Learn from Home S E R I E S-Automating Security Management in PBCS!
ODTUG Learn from Home S E R I E S-Automating Security Management in PBCS!ODTUG Learn from Home S E R I E S-Automating Security Management in PBCS!
ODTUG Learn from Home S E R I E S-Automating Security Management in PBCS!
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
 
Kscope Not Your Father's Enterprise Manager
Kscope Not Your Father's Enterprise ManagerKscope Not Your Father's Enterprise Manager
Kscope Not Your Father's Enterprise Manager
 
MySQL Group Replication: Handling Network Glitches - Best Practices
MySQL Group Replication: Handling Network Glitches - Best PracticesMySQL Group Replication: Handling Network Glitches - Best Practices
MySQL Group Replication: Handling Network Glitches - Best Practices
 
Advanced Controls access and user security for superusers con8824
Advanced Controls access and user security for superusers con8824Advanced Controls access and user security for superusers con8824
Advanced Controls access and user security for superusers con8824
 
Con8811 converged identity governance for speeding up business and reducing c...
Con8811 converged identity governance for speeding up business and reducing c...Con8811 converged identity governance for speeding up business and reducing c...
Con8811 converged identity governance for speeding up business and reducing c...
 
API Design Principles Essential 
API Design Principles Essential API Design Principles Essential 
API Design Principles Essential 
 
Oracle_ebs_12.2_Admin_guide_for_dba.pptx
Oracle_ebs_12.2_Admin_guide_for_dba.pptxOracle_ebs_12.2_Admin_guide_for_dba.pptx
Oracle_ebs_12.2_Admin_guide_for_dba.pptx
 
Con9573 managing the oim platform with oracle enterprise manager
Con9573 managing the oim platform with oracle enterprise manager Con9573 managing the oim platform with oracle enterprise manager
Con9573 managing the oim platform with oracle enterprise manager
 
How to configure p6 to present the right experience for each participant - Or...
How to configure p6 to present the right experience for each participant - Or...How to configure p6 to present the right experience for each participant - Or...
How to configure p6 to present the right experience for each participant - Or...
 
Southeast Linuxfest -- MySQL User Admin Tips & Tricks
Southeast Linuxfest -- MySQL User Admin Tips & TricksSoutheast Linuxfest -- MySQL User Admin Tips & Tricks
Southeast Linuxfest -- MySQL User Admin Tips & Tricks
 

Recently uploaded

Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
mbmh111980
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
Alluxio, Inc.
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
Max Lee
 

Recently uploaded (20)

Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
 
Workforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdfWorkforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdf
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
 
Lessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfLessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdf
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
 
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdfThe Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
 
Naer Toolbar Redesign - Usability Research Synthesis
Naer Toolbar Redesign - Usability Research SynthesisNaer Toolbar Redesign - Usability Research Synthesis
Naer Toolbar Redesign - Usability Research Synthesis
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024
 
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf
 
CompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfCompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdf
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
 
Microsoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdfMicrosoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdf
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdf
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
 

Better access control of administrators

  • 1. Principal Member ofTechnical Staff MySQL March 05, 2020 Rahul Sisondia Multiple DB accounts for an app
  • 2. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, timing, and pricing of any features or functionality described for Oracle’s products may change and remains at the sole discretion of Oracle Corporation. Safe harbor statement Copyright © 2020, Oracle and/or its affiliates2
  • 3. Copyright © 2020, Oracle and/or its affiliates3 4 3 2 1 Asses vulnerability Users categorization Overview Program agenda Prevention
  • 4. Copyright © 2020, Oracle and/or its affiliates4 DB users Copyright © 2020, Oracle and/or its affiliates | Confidential: Internal/Restricted/Highly Restricted4 Instance admins Applications App admins
  • 5. Copyright © 2020, Oracle and/or its affiliates5 Authorization Dynamic privileges • Defined by Server, component or plugin at run rime • Administrative operations - BACKUP_ADMIN, AUDIT_ADMIN Static privileges • Built into the server • Database Operations - SELECT, INSERT, UPDATE • Administrative operations - CREATE USER, PROCESS • Grant privileges to user - GRANT SELECT, INSERT ON *.* TO foo_user; - GRANT SELECT ON db.table TO bar_user; • Revoke Privileges - REVOKE SELECT, INSERT ON *.* FROM foo_user; - REVOKE SELECT ON db.table FROM bar_user;
  • 6. Copyright © 2020, Oracle and/or its affiliates6 Privilege you need to create users ? CREATE USER Do not have this privilege Privileged User Non- privileged User
  • 7. Copyright © 2020, Oracle and/or its affiliates7 Privileged or Non-privileged users Copyright © 2020, Oracle and/or its affiliates | Confidential: Internal/Restricted/Highly Restricted7 Applications Instance admins Privileged Non-Privileged Privileged App admins
  • 8. Copyright © 2020, Oracle and/or its affiliates8 Application App Users App user accounts management DB Users Micro Services Privileged user Non privileged user app.user
  • 9. Copyright © 2020, Oracle and/or its affiliates9 Applications App Users App user accounts management DB Users Privileged user Non privileged user
  • 10. Copyright © 2020, Oracle and/or its affiliates10 Privilege escalation ! Copyright © 2020, Oracle and/or its affiliates | Confidential: Internal/Restricted/Highly Restricted10 Root user App admins
  • 11. Copyright © 2020, Oracle and/or its affiliates11 SYSTEM_USER privilege - Allows maintaining separation of duty better DBAs managing instances and NOT data E.g. Uptime, Backup, High Level Security DBAs managing data Users with access to part of data SYSTEM_USER ALTER USER root@localhost IDENTIFIED BY ‘voodoo’;
  • 12. System Users - Granted at least ‘SYSTEM_USER’ privilege, but not the CREATE USER privilege. Power Users - Granted at least ‘CREATE USER’ and ‘SYSTEM_USER’ privilege. Privileged Users - Granted at least ‘CREATE USER’ privilege, but not the ‘SYSTEM_USER’ privilege. Non-privileged Users - Neither ‘SYSTEM_USER’ nor ‘CREATE USER’ privilege, but may be granted other privileges. Copyright © 2020, Oracle and/or its affiliates12 Power Users
  • 13. Copyright © 2020, Oracle and/or its affiliates13 DB users DB Users Non-privileged users Privileged users Regular Users Power UsersSystem Users
  • 14. Copyright © 2020, Oracle and/or its affiliates14 Is that sufficient ? Do not have either of the two privileges Privileged User Non- privileged User CREATE USER INSERT | UPDATE on mysql schema OR
  • 15. Copyright © 2020, Oracle and/or its affiliates | Confidential: Internal/Restricted/Highly Restricted15 Partial Revokes • Allows creating exception to global grants (Everything except ‘this’ and ‘that’) • Execute GRANT at global level followed by REVOKE at schema level GRANT INSERT ON *.* TO `foo_admin`; REVOKE INSERT ON `mysql`.* FROM `foo_admin`;
  • 16. Copyright © 2020, Oracle and/or its affiliates16 • Segregate the users as power users and regular users. • Principle of least privileges. • Revoke access to mysql schema from privileged users Prevention Policy !
  • 17. Copyright © 2020, Oracle and/or its affiliates17 Applications App Users Multiple app admins can be used DB Users Privileged user Non privileged user
  • 18. Copyright © 2020, Oracle and/or its affiliates18 Thank you
  • 19. Copyright © 2020, Oracle and/or its affiliates19 Questions

Editor's Notes

  1. The talk is divided in following four sections. (1 )We shall refresh our memory with the basics. Types of database users and privileges basics in MySQL. (2) We shall divide the DB users in the logical categories, (3)identify the vulnerability with a certain category of users. (4) We shall learn to prevent such case with better separation of control. In the end we shall bring the pieces together to define an access level policy for such users.   without further ado, lets refresh with the basics
  2. MySQL access control involves two stages when a user connects to the server: Stage 1: The server accepts or rejects the user connection based on user's identity. For instance : user name, host from which the user is connected, password etc. This is authentication. Stage 2:  Once the user connection is established, the server checks each statement user issues to determine whether you have sufficient permissions to perform it. For example, if you try to select rows from a table in a database or drop a table from the database, the server verifies that you have the SELECT permission to for the table. This stage is known authorization and permission checks as authorization.   There are two types of privileges Static and Dynamic. Static privileges are built in to the server. They consists types of permission to do database privileges such as SELECT, INSERT, UPDATE etc. Database privileges apply to a database and to all objects within it. These privileges can be granted for specific schemas, or globally so that they apply to all schemas. There are static administrative privileges as well such as PROCESS, CREATE USER.   Dynamic privileges can be registered and unregistered at runtime. That means server, components or plugins can define their own dynamic privileges. These privileges are global because they are not specific to a particular database.   How do we assign these privileges to the user account. Use the grant statement. Grant statement is also used to assign the roles.   Revoke statement does the opposite of the grant statement. It removes the privileges from the user account.
  3. A quiz. Which privilege do you need to create users in MySQL ? If were paying attention it was mentioned on the previous slide.   As you guessed it right, CREATE USER. It is static privilege. Create user privilege enables the user to do ALTER USER, CREATE ROLE, CREATE USER, DROP ROLE, RENAME USER AND REVOKE ALL. That's quite a few . Besides that if you also have INSERT privilege on mysql schema then also you get the same capabilities. Now for the rest of the talk lets us call the users who have at least either one of the privilege as privileged users and other users as non-privileged users.
  4. We previously learnt about the DB users. Another quiz. Now, try to guess in which category those users will fall.   Ideally administrators should be able to create other users. So they will be privileges users. The role of applications talking to DB is usually restricted to the specific tables or schema. Application admins may also need to manage the DB users. So they could be privileged user. Advanced or sophisticated users interact with the Database. They need not to create the DB.   Not to mention these users might be connected the database directly or through some other applications which could be internal.   But question arise, how does these applications connect to the database ? Lets find out..
  5. Lets say there is an application. The app users data is stored in the mysql.   Now, the question arise how does the application users talk to database? Does application open as many DB connections as many app users ? Does it create only one DB connection or a bunch of DB connections ? There is no one size fit all answer to these questions. It depends upon the use case. The most commonly used strategy is to have a connection pool and reuse the DB connections to fulfil the app user's requirement.   Another question arises. What DB accounts are used by these DB connections ? Usually the app users need access to a specific schema or table. So they need limited access to the database. That means non-privileged DB users. Application may use bunch of non privileged users.   In this case DB is not aware of application specific users hence it onus of access control of app users lies on the application. Application may create a user table in the application schema to store the user name, host and password hashes in it     But you need someone to manage these non-privileged users and their data. Usually there is an application admin for that. https://stackoverflow.com/questions/17475805/application-user-database-user  https://stackoverflow.com/questions/24397002/mysql-application-users-vs-database-users https://stackoverflow.com/questions/24397002/mysql-application-users-vs-database-users
  6. Do database really interact with only one application ? Usually an application consists of multiple services. each service may have it's own non-privileged users to serve. If we zoom in further, there could be multiple applications interacting with the database and each application could have it's own services.   This model works well but do you see any problem ?
  7.   Do you see the problem now ? There is privileged user who can create new user, alter or drop existing users. Why ? Because it has CREATE USER privilege. It means privileged user can promote himself to be root user by altering the root user   If a malicious user gets access to the privileged user he can gain control over the instance. Even not malicious user, a normal app_admin has no business of knowing the information about the instance. So it should be protected. What do we do ?
  8. Enter the system_user privilege in 8.0. release. It allows maintaining the separation of duty better. How ? User with SYSTEM_USER privilege cannot be modified by user that does not have SYSTEM_USER, even if the latter has CREATE USER. We can isolate the users that manage the instance from the users that do not manage the data.
  9.   We already have learnt about the privileged and non-privileged users. Now suppose you created a new user foo and granted SYSTEM_USER privilege to it. So what ? What good is this foo user for ? It is as good as a member of royal family that inherits the kingdom but doesn't know how to rule. It needs other privileges to be assigned. Now it you grant the foo user CREATE USER privilege then it become equivalent of root user. We name such user as power user since It can modify any user present in the instance. While privileged user could modify other privileged users/non-privileged user.
  10. We categorize the users as privileged and non-privileged before. Lets call them both as regular users. Since there were user who existed before SYSTEM_USER privilege was introduced. The users granted only system user privileges, lets call them system_user. They are no use unless they are granted other privileges. If you grant the privileges in addition to system_user then we can imagine them as power users. For instance - Instance admins.
  11. Is this isolation through SYSTEM_USER privilege sufficient ? We have protected the administrators that manages the instances by making them as power user. The regular users cannot modify power users using the DDLs. But what if a regular user has global INSERT or UPDATE privilege ? It can still modify the mysql.user table. Lets see how to plug this loophole.
  12. Partial revokes allows creating exception to global grants. If a user has been granted a global privilege then we can revoke the access of that user at schema levels. For example - There is developer who can query the entire database. The database has a sensitive schema hrdb, we don't want developer to access. We can revoke the access from developer to this schema despite having the global select access. We can restrict the regular users modifying the power user through DMLs using the partial revokes.
  13. We identified the possibility of privilege escalation. It is good to keep the instance admins behind the system_user privilege wall to protect them getting modified by other users using DDL statements.   The Good old principle of least privileges still holds true. Don't over grant privilges to the users.   If you have to grant global DML to some users then use the partial revokes to restrict the access on mysql schema. A good strategy will be to have a role that has access to global access but restrict access to mysql schema.
  14. Since there is mechanism to draw clear boundary between the app_Admins and instance admin. You can manage the DB users in a better manner. You can have multiple app_admins without risking them high jacking the root account.