1 / 28

DBMS : Database Security and Authorization

Chapter 6. DBMS : Database Security and Authorization. SUCHADA PUNNOI Dept. of Computer Science & Information Technology http :// computer . pcru . ac . th / suchada/. Database Security and Authorization ความปลอดภัยของฐานข้อมูล และการกำหนดสิทธิ. ความปลอดภัยของข้อมูล ( security ).

Download Presentation

DBMS : Database Security and Authorization

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 6 DBMS : Database Security and Authorization SUCHADA PUNNOI Dept. of Computer Science & Information Technology http://computer.pcru.ac.th/suchada/

  2. Database Security and Authorizationความปลอดภัยของฐานข้อมูล และการกำหนดสิทธิ

  3. ความปลอดภัยของข้อมูล(security)ความปลอดภัยของข้อมูล(security) • การป้องกันข้อมูลจากผู้ไม่มีสิทธิในการประมวลผลหรือปฏิบัติการการกับข้อมูลเข้ามากระทำการต่างๆ เกินสิทธิที่สามารถกระทำได้

  4. Introduction to Database Security Issues • ชนิดของความปลอดภัยของข้อมูล (Types of Security) • ด้านกฎหมายและจริยธรรม (Legal and ethical issues) • สิทธิที่สามารถเข้ามาใช้งาน information • นโยบาย (Policy issues)ระดับรัฐบาล หรือ สถาบัน • ระบบ (System) • ระดับกายภาพH/W, • ระดับOS • ระดับDBMS • ในบางองค์กรมีการกำหนดความปลอดภัยหลายระดับรวมถึงจัดกลุ่มของ data และกลุ่มของผู้ใช้ที่จะเข้ามาใช้งานข้อมูล

  5. การคุกคามฐานข้อมูล (Threats to Database) • การคุกคามฐานข้อมูลนำไปสู่การสูญหายหรือการเสื่อมต่อไปนี้ integrity, availability, และ confidentially. • การสูญเสียความคงสภาพ (Loss of integrity) • การสูญเสียสภาพพร้อมใช้งาน (Loss of availability) • การสูญเสียความเป็นส่วนตัว (Loss of confidentially)

  6. การสูญเสียความคงสภาพ (Loss of integrity) • Integrity เป็นความต้องการให้ข้อมูลหรือinformation ถูกปกป้องจากเปลี่ยนแปลง(Modification) ที่ไม่ถูกต้อง/ไม่เหมาะสม • Modification of data ประกอบด้วย • การสร้าง (Creation) , การเพิ่ม (Insertion) , การแก้ไข (Modification), การลบ (Deletion), การเปลี่ยนสถานะของข้อมูล (Change the status of data) • Integrity จะสูญเสียไปถ้าผู้ไม่มีสิทธิ (unauthorized) ทำการเปลี่ยนแปลงข้อมูลไม่ว่าจะเป็นไปโดยตั้งใจหรืออุบัติเหตุก็ตาม • และหากมีการใช้งานข้อมูลในระบบที่มีปัญหา (contaminated system)หรือ corrupt data ต่อไป จะนำไปสู่ผลลัพธ์ • ความไม่ถูกต้อง (inaccuracy)และนำไปสู่การตัดสิทธิใจที่ผิดพลาดได้(erroneous decision)

  7. การสูญเสียสภาพพร้อมใช้งาน (Loss of availability) • สภาพพร้อมใช้งานของฐานข้อมูล คือการมีข้อมูลพร้อมสำหรับผู้ใช้หรือโปรแกรมที่มีสิทธิในการใช้งานโดยชอบ(legitimate right) สามารถเรียกใช้งานได้

  8. การสูญเสียความเป็นส่วนตัว (Loss of confidentially) • Database confidentially หมายถึง การป้องกันการเปิดเผยข้อมูล ต่อผู้ที่ไม่มีสิทธิเข้ามาใช้งาน (unauthorized). • ผู้ที่ไม่มีสิทธิสามารถสามารถทำให้เกิดการสูญเสียความเป็นส่วนตัว

  9. ทำอย่างไรถึงจะป้องกันฐานข้อมูล(How to protect database) • การป้องกัน • ควบคุมการเข้าถึงข้อมูล (Access control) ควบคุมอนุมาน (Inference control) ควบคุมการไหล (Flow control) การเข้ารหัสลับ (Encryption)

  10. ในระบบผู้ใช้หลายคนระบบจัดการฐานข้อมูลจะมี “database security and authorization subsystem” ทำหน้าที่ในการป้องกันผู้ไม่มีสิทธิเข้ามาใช้งานฐานข้อมูล ซึ่ง database security mechanism มี 2 ประเภทคือ • Discretionary security mechanisms • Mandatory security mechanisms

  11. Database security mechanisms • Discretionary security mechanisms • เป็นการกำหนดให้สิทธิกับผู้ใช้ในการใช้งาน (Grant privilege to users) ประกอบด้วย • สามารถเข้าถึงแฟ้มข้อมูล ระเบียนหรือเขตข้อมูลที่กำหนดในโหมดที่กำหนด (insert, read, delete, update) ได้ • Mandatory security mechanisms • เป็นแนวทางที่ใช้การกำหนดระดับการใช้งาน โดยมีการจัดแบ่งกลุ่มของข้อมูลและกลุ่มผู้ใช้ข้อมูลตามระดับสิทธิ • ขึ้นกับนโยบายขององค์กร • Example • นโยบายที่อนุญาตให้ผู้ใช้แต่ละกลุ่มสามารถเห็นข้อมูลเฉพาะในกลุ่มของตนเอง • Role-based security

  12. Database security and the DBA • ในระบบจัดการฐานข้อมูล DBA จะมี DBA account • ถูกเรียกว่า “system” หรือ “superuser” account • มีความสามารถหรือสิทธิมากกว่า regular database accounts และ users. • DBA privilege commands ประกอบด้วยคำสั่งต่อไปนี้ • ให้สิทธิ (grantingprivilege)และยกเลิกสิทธิ (revoking privilege)แก่ individual accounts, users หรือกลุ่มของผู้ใช้ user groups • ทำงานต่อไปนี้ • สร้าง Account creation • กำหนดสิทธิ (Privilege granting) • เรียกสิทธิที่ให้ไปคือ (Privilege revocation) • กำหนดระดับความปลอดภัย (Security level assignment) • DBA รับผิดชอบเรื่องของ ความปลอดภัยของระบบฐานข้อมูลทั้งหมด

  13. Access Protection, User accounts, and Database Audits • เมื่อผู้ใช้ต้องการใช้งานฐานข้อมูล(access database) • DBA สร้างuser account และกำหนด password • เมื่อuser loginเข้าใช้งาน DBMS โดยใส่user accountและpassword • DBMS ตรวจสอบว่า account และ password valid หรือไม่ • หาก user มีสิทธิใช้งาน DBMS อนุญาตให้เข้าใช้งานได้ • DBMS เก็บข้อมูล accounts และ passwords โดยมีการเข้ารหัส (encrypted)ตารางที่เก็บAccount and Password. ตารางนี้ถูกดูแลโดย DBMS. • เมื่อ create new user, ข้อมูลถูกบันทึกในตารางดังกล่าว • เมื่อ account ถูกยกเลิก,รายการดังกล่าวจะถูกลบไป

  14. Keep track of operation • BDMS เก็บtrack of operations ที่เกิดขึ้นในฐานข้อมูล(database) • Create login session เมื่อ user log in • เก็บ track of sequence of database interactions จากเวลาตั้งแต่มีการ logging จนถึงเวลาที่มีการ logging out • เมื่อ user log in, DBMS ทำการบันทึก user’s account และ terminal • ทุกปฏิบัติการที่เกิดขึ้นจาก terminal ที่ถูกสั่งโดย user’s account ดังกล่าวจนกระทั่ง log off • บันทึกtrack ของการupdate • หากฐานข้อมูลมีปัญหา DBA สามารถหา user ทีทำให้เกิดปัญหาได้

  15. System log • เก็บปฏิบัติการที่เกิดขึ้นในsystem log • System log ประกอบด้วย แต่ละปฏิบัติการที่เกิดขึ้นกับฐานข้อมูลที่เป็นต้องใช้ในการ recovery หากเกิด transaction failure หรือ system crash ขึ้น • หากมีการพยายามกระทำการที่ไม่ถูกต้องกับฐานข้อมูล, ต้องมีการตรวจสอบการใช้งาน(database audit), ซึ่งในส่วนนี้ประกอบด้วย reviewing the log เพื่อดู all accesses และปฏิบัติการที่เกิดขึ้นกับฐานข้อมูลในช่วงเวลาดังกล่าว • หากมีการตรวจพบผู้ไม่มีสิทธิกระทำการกับฐานข้อมูล DBA สามารถตรวจสอบได้determine the account user • Database audits มีความสำคัญสำหรับ sensitive database ที่มีการ update โดยหลาย transaction และ หลาย users. Audit trail คือ database log ที่ใช้เพื่อจุดประสงค์ในการเรื่องความปลอดภัยของข้อมูล

  16. Example :dba_audit_trail Name Null? Type ----------------------------------------- -------- ------------- OS_USERNAME VARCHAR2(255) USERNAME VARCHAR2(30) USERHOST VARCHAR2(128) TERMINAL VARCHAR2(255) TIMESTAMP NOT NULL DATE OWNER VARCHAR2(30) OBJ_NAME VARCHAR2(128) ACTION NOT NULL NUMBER ACTION_NAME VARCHAR2(27) NEW_OWNER VARCHAR2(30) NEW_NAME VARCHAR2(128) OBJ_PRIVILEGE VARCHAR2(16) SYS_PRIVILEGE VARCHAR2(40) ADMIN_OPTION VARCHAR2(1) GRANTEE VARCHAR2(30) AUDIT_OPTION VARCHAR2(40) SES_ACTIONS VARCHAR2(19) LOGOFF_TIME DATE LOGOFF_LREAD NUMBER LOGOFF_PREAD NUMBER LOGOFF_LWRITE NUMBER LOGOFF_DLOCK VARCHAR2(40) COMMENT_TEXT VARCHAR2(4000 SESSIONID NOT NULL NUMBER ENTRYID NOT NULL NUMBER STATEMENTID NOT NULL NUMBER RETURNCODE NOT NULL NUMBER PRIV_USED VARCHAR2(40)

  17. Discretionary Access control Based on Granting and Revoking Privilege • ชนิดของ Discretionary Privilege • ระดับผู้ใช้ (Account level): DBA กำหนดสิทธิ(privilege) ในการใช้งานให้กับแต่ละ account • ระดับข้อมูล (Relation level): DBA/owner สามารถกำหนด privileges ในการเข้าถึงข้อมูลสำหรับแต่ละ relation หรือ view ในฐานข้อมูล

  18. Account level • Create user User_name identified by Password; • Grant privilege/role to User_name; ตัวอย่างเช่น • Create user A identified by A; • Grant connect, resource to A; • Create user B identified by B; • Grant DBA to B; (with grant option)

  19. Relation level • A: Create table (A เป็นเจ้าของตาราง:Owner) • A: สามารถกำหนดสิทธิ (grant privilege)ในการใช้งาน Table ที่ A สร้างให้กับ user อื่นๆได้ • Grant อาจเป็นแบบ grant with grant option

  20. SQL • SELECT privilege on R: ให้ account มีสิทธิในการ เรียกใช้ (retrieval privilege) • MODIFY privileges on R: ให้ account มีสิทธิในการแก้ไขระเบียน R ได้ (ไม่ว่าจะเป็น Update, Delete, insert Privilege) • REFERENCES privileges on R: ให้ account สามารถอ้างอิง relation R เมื่อมีการกำหนด integrity constraintsซึ่ง privilege สามารถระบุในระดับ attribute ของ R ได้ • **Remark: create view, account จะต้องมีสิทธิในการเรียกใช้งาน (select privilege)ทุกๆ relations ที่เกี่ยวข้องใน view definition

  21. กำหนด Privilege โดยใช้ VIEW • วิธีการที่กำหนดสิทธิ users ในการ manipulate ข้อมูล • ถ้า user A ต้องการให้ user B สามารถ retrieve เฉพาะบาง fieldของ relation R (ซึ่งถูกสร้างโดยA) • สามารถทำโดยให้ A ทำการสร้าง viewVจาก R โดยวิวดังกล่าวประกอบด้วย attributes ที่ต้องการให้เห็นเท่านั้น • ทำการgrant SELECT on V ให้กับผู้ใช้ B

  22. View • Create View View_name as select as select tab1.col, tab2.col, … from table1 tab1, table2 tab2 where condition Syntax for create view by SQL (oracle)

  23. Grant privilege • Grant operation on Table/View to User with grant option • Example • GRANT select ON emp to tori; • GRANT select ON empcom to nokwith grant option; • GRANT update on emp (salary) to tori; • GRANT all on emp to nok with grant option;

  24. example • Tori : Grant select on student to Hana; • Hana: Select * from Tori.student; • Tori : Grant select, update on student to kawa with grant option; • Kawa: Grant select on student to Nara with grant option; • Question: Can Nara grant her privilege to others? • If No, why? • If yes, what privilege nara can grant to other users?

  25. Syntax for create view by SQL (oracle) CREATE VIEW View_name AS SELECT col1,col2,…,coln FROM table1,…,tablenWHERE condition; EXAMPLE DEPT (DEPTNO, DNAME, LOC) EMP (EMPNO, ENAME, JOB, MGR, SAL, COMM, DEPTNO) CREATE VIEW EMPCOM AS Select Empno , Ename, Sal, Comm, E.DeptNo, Dname FROM EMP E, DEPT D WHERE E.DeptNo = D.DeptNo and Comm > 0; EMPCOM EMPCOM (Empno , Ename, Sal, Comm, DeptNo, Dname) View

  26. Revoking Privileges • จุดประสงค์เพื่อยกเลิกสิทธิในการใช้งาน • REVOKE operation on table/view/object from USER • Example • REVOKE select on EMP from tori; • REVOKE select on EMPCOM from tori;

  27. Propagation of Privileges using the Grant Option • User A create table R (A is owner of R) • GRANT • User A grants Privilege on R to User B with grant option (หมายความว่า B สามารถ grant สิทธิที่สามารถทำกับ R ให้กับผู้ใช้อื่นได้). • User B ให้สิทธิ grant privilege กับ User C with grant option • ความหมายคือ privilege on R สามารถส่งต่อให้กับ accounts อื่นโดยที่ owner ของ R ไม่จำเป็นต้องทราบ • REVOKE • ถ้า A revoke privilege on R จาก B. • ทุกๆ privilege ที่ B ให้กับผู้อื่นควรต้องถูกเรียกกับคืนอัตโนมัติ โดย system. • User ได้รับ privilege จาก sources ต่างๆ มากกว่า หนึ่ง • A2 และ A3 ให้สิทธิ UPDATE on R แก่ A4 • ถ้า A2 ขอสิทธิดังกล่าวคืนจาก A4 • A4 ยังคงมีสิทธิในการใช้งาน(grant จากA2) • ถ้า A3 ขอสิทธิคืนจาก A4 นั่นคือ A4 สูญเสียสิทธิทุกประการในการใช้งาน R

  28. F A Q Thank You !

More Related