Отпремање презентације траје. Молимо да сачекате

Отпремање презентације траје. Молимо да сачекате

MySQL Access Privilege System

Сличне презентације


Презентација на тему: "MySQL Access Privilege System"— Транскрипт презентације:

1 MySQL Access Privilege System
(Sistem za dodeljivanje privilegija pristupa na MySql serveru)

2 Osnovne funkcije „MySql Access Privilege“ sistema
Autentifikacija korisnika koji se povezuje na MySql server sa određene lokacije Povezivanje autentifikovanog korisnika sa privilegijama pristupa i modifikacije na određenu bazu podataka (SELECT, INSERT, UPDATE, DELETE) Mogućnost konekcije za anonimnog korisnika Dodeljivanje privilegija za administrativne operacije na MySql serveru autentifikovanom korisniku

3 Šta ne možemo postići korišćenjem „MySql Access Privilege“ sistema
Ne možemo sprečiti pojedinog korisnika da se konektuje na MySql server Ne možemo dozvoliti korisniku da kreira ili briše pojedine tabele (CREATE TABLE, DROP TABLE), a pri tome zabraniti mu da izbriše celu bazu podataka (DROP DATABASE) Password (šifra) se odnosi na korisnički nalog globalno, i ne može se povezati sa pojedinim objektom (bazom, tabelom, ili rutinom-procedurom)

4 Korisnički interfejs „MySql Access Privilege“ sistema
Sastoji se od MySql naredbi Korisnici CREATE USER ALTER USER DROP USER RENAME USER SET PASSWORD Privilegije GRANT REVOKE SHOW GRANTS

5 Gde su uskladišteni podaci „MySql Access Privilege“ sistema
„mysql“ baza podataka Dolazi sa instalacijom MySql servera Struktura tabela u ovoj bazi podataka može biti promenjena sa instalacijom nove verzije MySql servera Ovo treba proveravati i primeniti „upgrade“ prilikom instalacije nove verzije MySql-a

6 „mysql“ database tabele koje sadrže podatke o dozvolama pristupa
user: User accounts, global privileges db: Database-level privileges tables_priv: Table-level privileges columns_priv: Column-level privileges procs_priv: Stored procedure and function privileges proxies_priv: Proxy-user privileges

7 MySql server učitava u memoriju sadržaj tabela za kontrolu pristupa
Ako se menjaju tabele indirektno korišćenjem  GRANT, REVOKE, SET PASSWORD,  RENAME USER, server „primećuje“ izmene i odmah učitava podatke iz tabela u memoriju Ako se menjaju tabele direktno korišćenjem  INSERT, UPDATE, DELETE, izmene će imati efekta tek nakon restartovanja servera Može se serveru „reći“ da učita tabele preko MySql FLUSH PRIVILEGES naredbe izvršavanjem komande mysqladmin flush-privileges ili  mysqladmin reload 

8 Pluggable Authentication
Kada se korisnik konektuje na MySQL server, server koristi korisničko ime i lokaciju sa koje se korisnik konektuje da pronađe odgovarajući red u sistemskoj mysql.user  Server onda autentifikuje korisnika, tako što pronalazi u tabeli user koje je authentication plugin odgovarajući za korisnika: Ako ne može pronaći taj plugin na serveru, javlja se greška i pokušaj da se korisnik konektuje se odbija Inače, server „poziva“ plugin da autentifikuje korisnika, i plugin „vraća“ serveru status koji indikuje da li je korisnik dao ispravan password, odnosno da li se može dozvoliti konekcija

9 Pluggable Authentication – mogućnosti koje obezbeđuje
Odabir metode za autentifikaciju.  Omogućava DBA osobi da odabere i promeni metodu za authentifikaciju za pojedine MySQL korisničke naloge. External authentication.   Omogućava da se korisnici konektuju na MySQL server sa nalogom čiji se podaci čuvaju na drugom mestu, umesto u mysql.user sistemskim tabelama. Na primer, mogu se kreirati plugin-i koji koriste spoljne metode autentifikacije kao što su PAM, Windows login IDs, itd. „Proxy“ korisnici :  Ako korisnik dobije dozvolu da se konektuje, plugin za autentifikaciju može da vrati serveru korisničko ime drugačije nego ono sa kojim se korisnik konektuje, odnosno da omogući da korisnik dobije privilegije drugog korisnika.

10 Authentication plugins – primeri
Plugin koji obezbeđuju osnovnu „native“ autentifikaciju, baziranu na heširanju šifre korišćenu i pre uvođenja pluggable authentification metoda na MySql server (mysql_native_password plugin) Plugin koji primenjuje autentifikaciju koristeći SHA-256 password heširanje. To je jača enkripcija nego kod „native“ autentifikacije Klijentski plugin koji šalje šifru serveru bez heširanja ili enkripcije. Plugin koji vrši spoljnu autentifikaciju na Windows sistemu, omogućujući MySQL Serveru da korisni „native“ Windows servise da autentifikuju klijentsku konekciju. Korisnici koji su se „logovali“ na Windows mogu se konektovati iz MySQL klijentskih programa na server bazirano na informaciji koju daje njihovo Windows okruženje bez unošenja dodatne šifre 

11 CREATE USER For each account, CREATE USER creates a new row in the mysql.user system table An account when first created has no privileges. To assign privileges, use the GRANT statement When you modify an account, it is a good idea to verify that your changes have the intended effect. To check the privileges for a given account, use the SHOW GRANTS statement. For example, to determine the privileges that are granted to an account with user name and host name values of bob and pc84.example.com, use this statement: SHOW GRANTS FOR

12 CREATE USER – nastavak Example 1: Create an account that uses the default authentication plugin and the given password. Mark the password expired so that the user must choose a new one at the first connection to the server: CREATE USER IDENTIFIED BY 'new_password' PASSWORD EXPIRE INTERVAL 180 DAY;

13 CREATE USER – Authentication plugin
Example 1: Specify the password as cleartext; the default plugin is used: CREATE USER IDENTIFIED BY 'password'; Example 2: Specify the authentication plugin, along with a cleartext password value: CREATE USER IDENTIFIED WITH mysql_native_password BY 'password'; In each case, the password value stored in the account row is the cleartext value 'password' after it has been hashed by the authentication plugin associated with the account.

14 ALTER USER For each affected account, ALTER USER modifies the corresponding mysql.user table row to reflect the properties specified in the statement. Unspecified properties retain their current values. Primer 1: Change an account's password and expire it. As a result, the user must connect with the named password and choose a new one at the next connection: ALTER USER IDENTIFIED BY 'new_password' PASSWORD EXPIRE;

15 DROP USER DROP USER [IF EXISTS] user [, user] ... DROP USER Ako se izostavi host name ili deo korisničkog imena, njegova default vrednost je %

16 RENAME USER RENAME USER old_user TO new_user [, old_user TO new_user] ... RENAME USER TO The RENAME USER statement renames existing MySQL accounts. An error occurs for old accounts that do not exist or new accounts that already exist.

17 GRANT GRANT ALL ON db1.* TO CREATE USER IDENTIFIED BY 'password'; GRANT ALL ON db1.* TO GRANT SELECT ON db2.invoice TO ALTER USER WITH MAX_QUERIES_PER_HOUR 90; The GRANT statement grants privileges to MySQL user accounts.

18 Privilegije (GRANT / REVOKE)
Privilege Meaning and Grantable Levels ALL [PRIVILEGES] Grant all privileges at specified access level except GRANT OPTION and PROXY. ALTER Enable use of ALTER TABLE. Levels: Global, database, table. ALTER ROUTINE Enable stored routines to be altered or dropped. Levels: Global, database, procedure. CREATE Enable database and table creation. Levels: Global, database, table. CREATE ROUTINE Enable stored routine creation. Levels: Global, database. CREATE TABLESPACE Enable tablespaces and log file groups to be created, altered, or dropped. Level: Global. CREATE TEMPORARY TABLES Enable use of CREATE TEMPORARY TABLE. Levels: Global, database. CREATE USER Enable use of CREATE USER, DROP USER, RENAME USER, and REVOKE ALL PRIVILEGES. Level: Global. CREATE VIEW Enable views to be created or altered. Levels: Global, database, table. DELETE Enable use of DELETE. Level: Global, database, table. DROP Enable databases, tables, and views to be dropped. Levels: Global, database, table. EVENT Enable use of events for the Event Scheduler. Levels: Global, database. EXECUTE Enable the user to execute stored routines. Levels: Global, database, table.

19 Privilegije (GRANT / REVOKE) – nastavak
FILE Enable the user to cause the server to read or write files. Level: Global. GRANT OPTION Enable privileges to be granted to or removed from other accounts. Levels: Global, database, table, procedure, proxy. INDEX Enable indexes to be created or dropped. Levels: Global, database, table. INSERT Enable use of INSERT. Levels: Global, database, table, column. LOCK TABLES Enable use of LOCK TABLES on tables for which you have the SELECT privilege. Levels: Global, database. PROCESS Enable the user to see all processes with SHOW PROCESSLIST. Level: Global. PROXY Enable user proxying. Level: From user to user. REFERENCES Enable foreign key creation. Levels: Global, database, table, column. RELOAD Enable use of FLUSH operations. Level: Global. REPLICATION SLAVE Enable replication slaves to read binary log events from the master. Level: Global. SELECT Enable use of SELECT. Levels: Global, database, table, column. SHOW DATABASES Enable SHOW DATABASES to show all databases. Level: Global. SHOW VIEW Enable use of SHOW CREATE VIEW. Levels: Global, database, table. SHUTDOWN Enable use of mysqladmin shutdown. Level: Global. SUPER Enable use of other administrative operations such as CHANGE MASTER TO, KILL, PURGE BINARY LOGS, SET GLOBAL, and mysqladmin debug command. Level: Global. TRIGGER Enable trigger operations. Levels: Global, database, table. UPDATE Enable use of UPDATE. Levels: Global, database, table, column.

20 REVOKE REVOKE priv_type [(column_list)] [, priv_type [(column_list)]] ... ON [object_type] priv_level FROM user [, user] ... REVOKE ALL [PRIVILEGES], GRANT OPTION FROM user [, user] ... REVOKE PROXY ON user FROM user [, user] ... REVOKE INSERT ON *.* FROM


Скинути ppt "MySQL Access Privilege System"

Сличне презентације


Реклама од Google