PT2520 Unit 9: Database Security II

Slides:



Advertisements
Similar presentations
IT203 Unit 8: Database Security I Is It Secure? Copyright © 2012 Pearson Education, Inc. Publishing as Prentice HallChapter8.1.
Advertisements

IT203 Unit 9: Database Security II Is It Secure? Copyright © 2012 Pearson Education, Inc. Publishing as Prentice HallChapter8.1.
With Microsoft Access 2010© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
With Microsoft Excel 2010 © 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Excel 2010.
1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. by Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson,
1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. by Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson,
1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. by Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson,
Skills for Success with Microsoft Office 2013 Volume 1
David M. Kroenke and David J. Auer Database Processing: F undamentals, Design, and Implementation Chapter Ten: Managing Databases with SQL Server 2008.
With Microsoft ® Office 2010© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall Process Specifications and Structured Decisions Systems Analysis and Design, 8e Kendall.
With Microsoft Access 2010© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
SQL Views Chapter 3A DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 5 th Edition.
Getting Started Chapter One DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 5 th Edition.
Getting Started with Microsoft SQL Server 2012 Express Edition Appendix A DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 6 th Edition.
Getting Started Chapter One DATABASE CONCEPTS, 7th Edition
By Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson, Linda Lau, Jerri Williams Chapter 10 Using Macros and SQL in Access 1.
Copyright ©2014 Pearson Education, Inc. Chapter 8 Is it Secure? Chapter8.1.
1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. by Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson,
Copyright ©2014 Pearson Education, Inc. Chapter 3 Requirements and Business Rules Chapter3.1.
Getting Started with Oracle Database 11g Release 2 Express Edition Appendix B DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 6 th Edition.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
Getting Started Chapter One DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 6 th Edition.
1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. by Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson,
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Access 2010 by Robert Grauer, Keith.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 1 Committed to Shaping the Next Generation of IT Experts. Chapter 1: Finding Your.
1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. by Mary Anne Poatsy, Keith Mulbery, Lynn Hogan, Amy Rutledge, Cyndi Krebs, Eric.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith.
Chapter 9 Designing Databases Modern Systems Analysis and Design Sixth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. Access Module 1 Workshop 1 The Four Main Database Objects Series Editor Amy Kinser.
1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. Access Module 2 Workshop 4 Accessing, Maintaining, and Presenting Information Series.
1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Access 2010 by Robert Grauer, Keith Mast, Mary Anne Poatsy Chapter.
GO! All In One 2/E By: Shelley Gaskin, Nancy Graviett, Debra Geoghan Chapter 2 Getting Started with Windows 8.1 Copyright © 2015 Pearson Education, Inc.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith.
GO! with Office 2013 Volume 1 By: Shelley Gaskin, Alicia Vargas, and Carolyn McLellan Access Chapter 3 Forms, Filters, and Reports.
Security, Transactions, and Views. About Security As is the case in most shared environments, the DBMS also must implement a security mechanism that allows.
GO! All In One 2/E By: Shelley Gaskin, Nancy Graviett, Debra Geoghan Chapter 13 Creating and Editing Presentations with Microsoft PowerPoint 2013 Copyright.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 14 Using Relational Databases to Provide Object Persistence (Overview) Modern Database.
Chapter Six Competitor Analysis and Sources of Advantage.
Integrating Word, Excel,
7 Copyright © 2005, Oracle. All rights reserved. Managing Undo Data.
Getting Started Chapter One DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 4 th Edition.
Skills for Success with Microsoft Office 2013 Volume 1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. by Kris Townsend, Catherine.
Skills for Success with Microsoft Office 2013 Volume 1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. by Kris Townsend, Catherine.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
David M. Kroenke and David J. Auer Database Processing: F undamentals, Design, and Implementation Chapter Seven: SQL for Database Construction and Application.
© 2012 Pearson Education, Inc. publishing Prentice Hall. Note 9 The Product Life Cycle.
Chapter 3 Requirements and Business Rules Copyright © 2012 Pearson Education, Inc. Publishing as Prentice HallChapter3.1.
© 2012 Pearson Education, Inc. publishing Prentice Hall. Note 18 Generic Strategies—The Value Map.
© 2013 Pearson Education, Inc. Publishing as Prentice Hall1 with Microsoft ® Office for Mac 2011 Common Features Using the Common Features of Microsoft.
GO! with Office 2013 Volume 1 By: Shelley Gaskin, Alicia Vargas, and Carolyn McLellan Excel Chapter 3 Analyzing Data with Pie Charts, Line Charts, and.
© 2012 Pearson Education, Inc. publishing Prentice Hall. Note 16 What is a Marketing Strategy?
Copyright © 2011 Pearson Education Process Specifications and Structured Decisions Systems Analysis and Design, 8e Kendall & Kendall Global Edition 9.
GO! with Office 2013 Volume 1 By: Shelley Gaskin, Alicia Vargas, and Carolyn McLellan PowerPoint Chapter 3 Enhancing a Presentation with Animation, Video,
In this session, you will learn to: Create and manage views Implement a full-text search Implement batches Objectives.
7.5 Using Stored-Procedure and Triggers NAME MATRIC NUM GROUP Muhammad Azwan Bin Khairul Anwar CS2305A Muhammad Faiz Bin Badrol Shah CS2305B.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall Process Specifications and Structured Decisions Systems Analysis and Design, 8e Kendall.
Note 20 Specific Marketing Strategies
Exploring Microsoft Office Access 2007
Database Security.
Functions of a Database Management System
Database Security.
PT2520 Unit 2: Gather Information and Define Requirements
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
PT2520 Unit 5: Physical Design
PT2520 Unit 8: Database Security I
Getting Started Chapter One DATABASE CONCEPTS, 5th Edition
Chapter 2: The Database Development Process
Getting Started Chapter One DATABASE CONCEPTS, 4th Edition
Presentation transcript:

PT2520 Unit 9: Database Security II Is It Secure? Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Analyzing Security Needs One way to analyze the security needs of a database is to look at the security requirements of each type of database user. You can analyze those needs in terms of specific permissions on tables and objects. Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall Analysis Example Table name SELECT INSERT UPDATE DELETE Constraints Student   Tutor X A public subset of tutor info Course StudentCourse Ethnicity Session X* *Only for own sessions Request RequestNote Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall Threat Analysis Threat analysis involves identifying all the ways a database can be harmed and then finding strategies to mitigate those threats. Databases can also be damaged by accidental actions. Analyzing threats is a complex and ongoing task. Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Threat Analysis Example Role Student Threat Description SELECT See private information of other students INSERT False or inaccurate information in Student table UPDATE False or inaccurate information in the Session table, removing other students from scheduled sessions DELETE   Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall Disaster Recovery Disaster recovery means planning for the worst. Disasters can be manmade, such as an attack by a hacker, or a major mistake by an administrator. Disasters can also be natural. Fires, floods, and earthquakes can destroy data. Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Disaster Recovery Plan A disaster recovery plan is a plan for how to recover data and its availability after various possible disasters. A disaster recovery plan consists of policies and procedures for disaster prevention and recovery. Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall Policies Policies are rules for how to do things. For instance, a business could have a rule that all databases are backed up twice a day. Another policy could be that all backups are kept off-site in some secure place. Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall Procedures Procedures are step-by-step instructions for how to do things. In a disaster plan, procedures are the step-by-step instructions for implementing a policy. Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Backup Procedure Example Maintain four portable hard drives. Each morning, retrieve the two drives with the oldest backup date. Perform a full database backup to one of the drives at 11:00 AM. Backup the log files to the hard drive. Record the current date and time of the backup on the hard disk. Send an employee to deposit the hard drive in a safety deposit box at Westlake Security Co. At closing, around 5:00 PM, do a full backup to the second hard disk. Back up the log files to the hard disk. Record the date and time on the hard disk. Send an employee to deposit the hard drive in a safety deposit box at Westlake Security Co. (Westlake is open until 7 PM.) If Westlake is closed, the employee is to take the disk home and deposit it when he or she drives in to work the next work day. Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall Finding Solutions Implementing effective security measures can be very complex. You can use a mixture of schema roles and permissions. One approach is to build a layer of views and stored procedures to manage all user access. Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall Views Views are essentially stored queries. Ideally, each view corresponds to a particular “view” that a user has of the data. Views can be used to hide the underlying structure of the database. Views are accessed just like tables. Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall Syntax for a View CREATE VIEW <ViewName> AS <Select query> Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall View Example CREATE VIEW vw_Sessions AS SELECT TutorLastName AS [Tutor], StudentKey AS [Student], SessionDateKey AS [Date], SessionTimeKey AS [Time], CourseKey AS [Course] FROM Tutor t INNER JOIN [Session] s ON t.TutorKey=s.TutorKey WHERE SessionDateKey >=GetDate() Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall Stored Procedures Stored procedures consist of one or more SQL commands. They can take parameters from the user. They allow all the commands to be executed as a unit. They allow error checking and validation to help ensure a safe transaction. Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Stored Procedure Syntax CREATE PROC <Procedure Name> <Parameter list> AS <SQL statements> Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Stored Procedure Example CREATE PROCEDURE usp_StudentLogIn @studentKey nchar(10) AS IF EXISTS (SELECT * FROM student WHERE studentKey=@studentKey) BEGIN SELECT studentLastName FROM Student WHERE Studentkey=@studentKey END Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

A Few Stored Procedure Notes The following slides discuss a few of the features of stored procedures, specifically: Parameters Variables If/else and blocks Transactions and try/catch blocks Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall Parameters A parameter is a value passed to the stored procedure from the user. Parameters are listed after the CREATE Statement and before the AS. All parameters start with the @ symbol and must be given a data type: @studentKey nchar(10) Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall Variables Variables are declared after the AS keyword and must be assigned values internally. Variables are declared with the DECLARE keyword. Variables can be assigned values with the SET or SELECT keywords. Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall Variable Examples DECLARE @CourseKey NCHAR(10) SELECT @CourseKey=CourseKey FROM [Session] WHERE SessionDateKey=@SessionDateKey AND SessionTimeKey=@SessionTimeKey DECLARE @CurrentDate Date SET @CurrentDate=GetDate() Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall IF, ELSE, BEGIN, END It is possible to select among possibilities by using the IF and ELSE keywords. IF sets up the condition and what to do if the condition is true. ELSE describes what to do if the condition is false. BEGIN is used to mark the start of an IF or ELSE block. END is used to mark the end of the block. Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall If Example IF EXISTS (SELECT * FROM student WHERE studentKey=@studentKey) BEGIN SELECT studentLastName FROM Student WHERE Studentkey=@studentKey END Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall TRY CATCH TRANS TRY CATCH blocks can be used with transactions to catch any errors. The TRY tests the code for errors. If there are no errors, the statements are committed to the database. If there are errors, the execution will go to the CATCH block and roll back the transaction. Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall TRY CATCH Example BEGIN TRAN BEGIN TRY UPDATE [Session] SET StudentKey=@StudentKey WHERE SessionDateKey=@SessionDateKey AND SessionTimeKey=@SessionTimeKey COMMIT TRAN END TRY BEGIN CATCH ROLLBACK TRAN END CATCH Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall Documentation It is crucial to document the security setup. Authentication types and policies should be spelled out. All roles and schema should be described. All stored procedures and views should be described. Disaster plans and all policies and procedures should be documented and readily available. Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America. Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall