第15章 SQL Server 2008数据库的安全性和完整性管理
- 格式:ppt
- 大小:1.42 MB
- 文档页数:81
Certifications, Compliance, and VulnerabilitiesSQL Server 2008 introduced additional enterprise-class security features and made considerable investments in capabilities that help provide a high level of security and compliance for organizations—built directly into the product. These investments contribute to Microsoft’s Trustworthy Computing initiative that defines the steps necessary to help support secure computing and helps you deploy and maintain a secure environment. Microsoft continuously works to ensure security vulnerabilities are minimal and pursues certifications and tools for SQL Server to help organizations meet security-related policies and regulations.Common Criteria CertifiedCommon Criteria certifications are officially recognized by an international agreement (the CCRA) by 25 countries that signed the agreement, including the United States and Japan. This certification is a third party verification of the extensive security of SQL Serv er 2008 and demonstrates Microsoft’s continued commitment to our customers’ security needs. For more on Common Criteria: /∙SQL Server 2008 Enterprise edition: EAL1+ for 32 and 64bitSQL Server 2008 completed an IT security evaluation at the Basic Assurance Level (EAL1+). This certification isparticularly significant in Japan where it makes SQL Server 2008 eligible for procurement tax discounts as a CCcertified DBMS.∙SQL Server 2008 Enterprise edition: EAL4+ (in progress)SQL Server 2008 is currently in process to complete the EAL4+ security evaluation. The certification officiallystarted in January 2009 and typically takes 18-24 months to complete. The US government requires databasesoftware purchases be CC certified at EAL4+ and recognizes the certification once the process begins.∙Previous certificationsSQL Server 2005 SP1 at EAL1 (32 bit Enterprise Edition)SQL Server 2005 SP2 at EAL4+ and compliant w/NSA DBMS Protection Profile V1.1 (32 bit Enterprise Edition)FIPS 140-2 CompliantFederal Information Processing Standards (FIPS) are recommended or mandated in federal government-operated IT systems in either the United States or Canada. SQL Server 2008 can be configured to run as a FIPS-compliant application when running on an operating system that uses a FIPS-140-2-validated Cryptographic Service Provider or other module that has been validated.Read more on FIPS-140-2: /kb/955720Evaluated for Payment Card Industry (PCI) Data Security Standard (DSS) ComplianceCertified audit firm, Parente Randolph, evaluated SQL Server 2008 for PCI compliance and provides guidance to customers on passing PCI audits. The key to complying with the standards is to ensure that Information Technology professionals maintain a suitable database platform to allow requirements to be met.Read the evaluation: Deploy SQL Server 2008 Based on PCI DSS Standards/lib/pdf/Deploying_SQL_Server_2008_Based_on_PCI_DSS.pdfEvaluated for HIPAA ComplianceHealth Information Portability and Accountability Act (HIPAA) governs health information privacy, security, organizational identifiers, and overall administrative practices. Organizations faced with HIPAA regulations can take advantage of SQL Server 2008 capabilities to help meet database-related compliance requirements.Read the evaluation: Supporting HIPAA Compliance with Microsoft SQL Server 2008/mssql2008hipaaFor more information:SQL Server Compliance Guide: /downloads/details.aspx?FamilyId=6E1021DD-65B9-41C2-8385-438028F5ACC2&displaylang=enSQL Server 2008 Key Security Features1.Transparent Data Encryption (TDE)Implementing encryption in a database traditionally involves complicated applicationchanges such as modifying table schemas, removing functionality, and significant performance degradations. TDE solves these problems by simply encrypting everything without requiring changes to the application.2.All Actions AuditedWith SQL Server 2008 you can create audits that will allow you to analyze the data usage patterns for the data in your database. With SQL Server 2008 you can audit not only changes to data but also which users are reading data. From a security standpoint this will allow you to see when a user who would normally have access to a certain set of data is accessing more than they should and take corrective action if necessary.3.Extensible Key ManagementExtensible key management works with transparent data encryption to separate the encryption key from thedatabase. With the growing demand for regulatory compliance and concern for data privacy, organizations can take advantage of 3rd party Hardware Security Modules (HSM) which store encryption keys on hardware or software modules away from the data for added security.4.Policy-Based ManagementPolicy-Based Management allows DBAs to define a set of policies that can control many different aspects of SQL Server. Policies can be applied to a single server or to groups of servers. Use Policy-Based Management to help manage and detect non-compliance with security polices for data across the enterprise.5.Clustering AuthenticationSQL Server 2008 clustering supports Kerberos authentication on a virtual server. Administrators are able to specify Microsoft Windows–style policies on standard logins so that a consistent policy is applied across all accounts in the domain.6.Surface Area ConfigurationSQL Server 2008 includes the SQL Server Surface Area Configuration Tool, which provides an intuitive graphical user interface (GUI) for configuring the server. Running this tool should be your first task after installing SQL Server. The tool opens with a brief explanation of its purpose, and a link to documentation. It includes a link to configure services and protocols and another to configure other features.7.Off By DefaultTo reduce the SQL Server 2008 surface area to unauthorized access after initial installation, a number of services have been turned off or set for manual start-up so no inadvertent access is granted. Services that are off by default include the Microsoft .NET Framework, Service Broker network connectivity, and HTTP connectivity for Analysis Services.Services that require manual intervention to start include SQL Server Agent, Full Text Search, and IntegrationServices, which can all be reset for automatic start-up.8.Surface Area Reduction and Advanced SecuritySQL Server 2008 provides rich security features to protect data and network resources. It is much easier to achieve a secure installation of the software, because all but the most essential features are either not installed by default or disabled if they are installed. SQL Server provides plenty of tools to configure the server. Its authentication features make it harder to get access to a server running SQL Server by integrating more closely with Windows authentication and protecting against weak or old passwords. Granting and controlling what a user can do when authenticated is far more flexible with granular permissions.SQL Server Vulnerabilities ComparisonMicrosoft, IBM, MySQL, and Oracle regularly report security vulnerabilities (or CVEs) to NIST National Vulnerability Database (/view/vuln/search ). Based on this reported information, the following is a historical representation of database security vulnerabilities reported by Microsoft, IBM, MySQL, and Oracle over the past 8 years.Database features alone should not be assessed to determine “security.” Organizations need to understand howvulnerable their database solution is from attacks —and not just external attacks, according to Forrester (March 2009), 70% of threats come from inside the enterprise. This means it’s no longer safe to assume that a database behind a firewall is protected and vulnerabilities or patching are not of concern.Notes : Update as of 4/20/2010. Vulnerabilities are included for SQL Server 2000 , SQL Server 2005 , SQL Server 2008. Oracle (8i, 9i, 9iR2, 10g,10gR2,11g), IBM DB2 (8.0, 8.1, 8.2, 9.0, 9.5), Query for Oracle was run with vendor name: ‘Oracle’ , and product name: ‘any’ (all database product name variations were queried) . Query for IBM DB2 was run with vendor name: ‘IBM’ , and product name: ‘db2.’ Query for MySQL was run with vendor name: ‘MySQL’, and product name: ‘Any.’ Query for Microsoft was run with vendor name: ‘Microsoft ‘ ; product name: ‘Microsoft SQL Server’; version name: ’Any’This chart counts NIST CVE – Software Flaws (Each CVE might include more than one Oracle vulnerabilities)20406080100120140160200220032004200520062007200820092010SQL Server Oracle DB2MySQL。
sqlserver2008数据库的完整性约束⼀、数据库完整性概述1.数据库的完整性:①数据库的完整性是指数据的正确性和相容性②数据库完整性是防⽌不合语义或不正确的数据进⼊数据库③完整性体现了是否真实地反映现实世界例:学⽣的年龄必须是整数,取值范围为14-29;学⽣的性别只能是男或⼥;学⽣的学号⼀定是唯⼀的;学⽣所在的系必须是学校开设的系;2.DBMS维护数据库完整性的机制:①提供定义完整性约束条件的机制DBMS应提供定义数据库完整性约束条件,并把它们存⼊数据库中。
②提供完整性检查的⽅法检查数据是否满⾜完整性约束条件的机制称为完整性检查。
⼀般在INSERT、UPDATE、DELETE语句执⾏后开始检查。
3.违约处理DBMS若发现⽤户的操作违背了完整性约束条件,就采取⼀定的动作以保证数据的完整性,如拒绝执⾏该操作,或级联执⾏其他操作。
⼆、缺省(默认值)和规则缺省和规则来源于由Sybase开发的S默认值QL Server,在⽼版本的SQL Server或者升级版本中都有缺省和规则的使⽤。
缺省是为列提供数据的⼀种⽅式,如果⽤户进⾏INSERT操作时不为列输⼊数据,则使⽤缺省值。
规则是当⽤户进⾏INSERT或uPDATE操作时,对输⼊列中的数据设定的取值范围,是实现域完整性的⽅式之⼀。
缺省与规则有以下特点:(1)缺省与规则是数据库对象,它们是独⽴于表和列⽽建⽴的。
(2)缺省与规则建⽴后与列或数据类型产⽣关联,列和数据类型就具有了缺省与规则的属性。
(3)缺省与规则定义后,可以重复使⽤,可以绑定到多个列或数据类型上。
(4)缺省与规则不随表同时调⼊内存,当⽤到时才被调⼊内存,这可能会使程序执⾏出现延时。
缺省和规则对象通常只在它所创建的数据库中有效,不是ANSI标准,⼀般不提倡使⽤。
应尽可能使⽤约束,任何可以使⽤缺省与规则的地⽅都有可以使⽤约束。
1. 缺省在SQL Server中,有两种使⽤默认值的⽅法:①在创建表时,指定默认值。
SQL Server 2008 安全性SQL Server身份验证模式Microsoft SQL Server 2008提供了两种对用户进行身份验证的模式,默认模式是Windows身份验证模式,它使用操作系统的身份验证机制对需要访问服务器平局进行身份验证,从而提供了很高的安全级别。
另一种方式是SQL Server和Windows身份验证模式,允许基于Windows的和基于SQL的身份验证。
因此,它又是被称为混合模式。
Windows身份验证模式允许使用存储在本地计算机的安全帐户管理器SAM数据库中的现有帐户,或者,如果该服务器是活动目录域的一个成员,则可以使用Micorsoft Windows活动目录数据库中的帐户。
使用Windows身份验证模式的好处包括允许SQL或数据库管理员使用已经存在的帐户,从而减少管理开销,以及允许他们使用强大的身份验证协议,例如Kerberos或Windows NT LAN Manager(NTLM)。
在Windows身份验证模式中,SQL并不存储或需要访问用于身份验证的密码信息。
Windows身份验证提供程序将负责验证用户的真实性。
混合模式允许创建SQL Server独有的登录名,这些登录名没有相应的Windows或活动目录帐户。
这可以帮助那些不属于您的企业的用户通过身份验证,并获得访问数据库中安全对象的权限。
当使用SQL登录名时,SQL Server将用户名和密码信息存储在master数据库中,它负责对这些平局进行身份验证。
主体主题Principal这个术语用于描述将与SQL Server交互的个人、组和进程。
主题可用的资源取决于他们的位置。
Microsoft SQL Server支持集中不同类型的主题,他们定义在三个不同的级别上:Windows级别、SQL Server级别和数据库级别。
登录名和SQL 以前的版本不同,SQL Server 2008并不自动为[BUILTIN\Administrators]组创建登录名,以免使服务器上具有本地管理权限的任何人都可以登录进该SQL Server。
实验五SQL SERVER 完整性与安全性一、实验目的掌握SQL SERVER数据访问控制策略和技术,SQL SERVER数据库管理系统使用安全帐户认证控制用户对服务器的连接,使用数据库用户和角色等限制用户对数据库的访问。
二、实验内容1.在服务器级别上创建三个以SQL Server身份验证的登录名,登录名称自定。
2.分别为三个登录名在“gongcheng”数据库映射三个数据库用户,数据库用户名为Tom,Mary和John,使这三个登录名可以访问“gongcheng”数据库。
3.授予用户John创建表和视图的权限。
grant create table,create viewto John在“gongcheng”下,安全性—John—属性,选择安全对象,搜索特定对象,选择“gongcheng”表,在权限中选择“创建表”和“创建视图”,如图:即可赋予John“创建表”和“创建视图”的权限。
4.完成以下授权:(1)把对表S的INSERT权力授予用户Tom,并允许他再将此权限授予其他用户。
grant inserton Sto tomwith grant option(2)用户Mary对S,P,J三个表有SELECT和INSERT权力grant select,inserton Sto Marygrant select,inserton Pto Marygrant select,inserton Jto Mary(3)用户Tom对SPJ表有DELETE权力,对QTY字段具有UPDA TE权力。
grant delete,update(qty)on spjto Tom(4)把对用户Tom授予的所有权力收回revoke inserton Sfrom Tom cascaderevoke delete,update(qty)on SPJfrom Tom(5)对用户Mary增加SPJ表的SELECT权力。
grant selecton spjto Mary5.两个同学为一组(自由搭配),在自己的数据库服务器上分别为对方创建一个登录名,并授予一定权力,然后用对方为自己创建的登录名和对方的数据库服务器建立连接,进行登录,对对方的数据库服务器进行操作。
信息工程学院实验报告课程名称:《数据库原理》实验项目名称:数据库的完整性和安全性一、实 验 目 的:(1)掌握数据库约束的概念;(2)熟悉SQL SERVER 的完整性约束技术。
(3)了解SQL SERVER 的违反完整性处理措施。
(4)了解登录账户的管理理念与具体方法。
(5)了解数据库用户的管理的要则。
(6)了解用户权限管理的内涵与方法。
二、实 验 设 备 与 器 件 Win7 +Sql server 2008 三、实 验 内 容 与 步 骤(一)测试完整性运行附录中的SQL 语句,理解SQL 语句中包含的完整性定义。
然后执行下面的SQL 语句,看是否能正常运行,若无法执行,请说明原因。
1.对dept 表进行数据增删改,并检查完整性规则 Dept 已存在的完整性规则如下: dno CHAR(2)PRIMARY KEYdnameV ARCHAR(20) NOT NULL,UNIQUE(1)增加数据INSERT INTO dept V ALUES('D1','计科系');----正常插入INSERT INTO dept V ALUES('D2','电信系');----正常插入INSERT INTO dept V ALUES(NULL,'机械系'); ----违反dno 主键(NOT NULL )规则INSERT INTO dept V ALUES('D2','机械系'); ----违反dno 主键(UNIQUE )INSERT INTO dept V ALUES('D3',NULL); ----违反dname 的NOT NULL 规则INSERT INTO dept V ALUES('D3','计科系'); ----违反dname 的UNIQUE 规则INSERT INTO dept V ALUES('D3','机械系');----正常插入(2)删除数据DELETE FROM dept WHERE dno='D3';----正常删除(3)修改数据UPDA TE dept SET dname='计算机科学系' WHERE dno='D1';----正常修改UPDA TE dept SET dname='电信系' WHERE dno='D1'; ----违反dname的UNIQUE规则UPDA TE dept SET dname=NULL WHERE dno='D1'; 违反dname的UNIQUE规则2.对student表进行数据增删改,并检查完整性规则Student已存在完整性规则如下:sno CHAR(2) PRIMARY KEYsname V ARCHAR(20) NOT NULL,ssex CHAR(2) NOT NULL, CHECK(ssex in('男','女'))sage INT NOT NULL,dno CHAR(2) NOT NULL, FOREIGN KEY REFERENCES dept(dno)ON DELETE CASCADE ON UPDATE CASCADE(1)增加数据INSERT INTO student V ALUES('S1','张刚','男',20,'D1');----正常插入INSERT INTO student V ALUES('S2','李梅','女',21,'D2');----正常插入INSERT INTO student V ALUES('S2','吴敏','男',20,'D1'); ----正常插入INSERT INTO student V ALUES(NULL,'吴敏','男',20,'D1'); ----违反sno 的主键(NOT NULL)规则INSERT INTO student V ALUES('S3','吴敏','男',NULL,'D1'); 违反sage 的主键(NOT NULL)规则INSERT INTO student V ALUES('S3','吴敏','M',20,'D1'); 违反ssex 的CHECK规则INSERT INTO student V ALUES('S3','吴敏','男',20,'D3'); ----正常插入INSERT INTO student V ALUES('S3','吴敏','男',20,'D1');----正常插入(2)删除数据DELETE FROM student WHERE sno='S3'; ----正常删除(3)修改数据UPDA TE student SET sname='赵强',dno='D2' WHERE sno='S1'-----正常修改UPDA TE student SET ssex='F' WHERE sno='S1'; -----违反ssex的CHECK 规则UPDA TE student SET sno='S2' WHERE sno='S1'; -----违反sno的主键(UNIQUE)规则UPDA TE student SET dno='D3' WHERE sno='S1'; 违反dno 的外键规则UPDA TE dept SET dno='D3' WHERE dno='D1';----检查dno的外键ON UPDATE规则,观察运行后效果DELETE FROM dept WHERE dno='D2';----检查dno的外键ON DELETE规则,观察运行后效果(二)使用规则实现数据完整性(1)在查询分析器中,利用命令(CREATE RULE),创建一个关于年龄(sage)约束的规则,将“sage”列的值约束在0~200之间;然后将所创建的规则绑定到“sage”列(提示:用命令Sp_bindrule)。
数据库的安全性、完整性、并发控制和恢复为了保证数据库数据的安全可靠性和正确有效,DBMS必须提供统一的数据保护功能。
数据保护也为数据控制,主要包括数据库的安全性、完整性、并发控制和恢复。
数据库的安全性数据库的安全性是指保护数据库以防止不合法的使用所造成的数据泄露、更改或破坏。
计算机系统都有这个问题,在数据库系统中大量数据集中存放,为许多用户共享,使安全问题更为突出。
在一般的计算机系统中,安全措施是一级一级设置的。
在DB存储这一级可采用密码技术,当物理存储设备失窃后,它起到保密作用.在数据库系统这一级中提供两种控制:用户标识和鉴定,数据存取控制。
在ORACLE多用户数据库系统中,安全机制作下列工作:防止非授权的数据库存取;防止非授权的对模式对象的存取;控制磁盘使用;控制系统资源使用;审计用户动作。
数据库安全可分为二类:系统安全性和数据安全性。
系统安全性是指在系统级控制数据库的存取和使用的机制,包含:有效的用户名/口令的组合;一个用户是否授权可连接数据库;用户对象可用的磁盘空间的数量;用户的资源限制;数据库审计是否是有效的;用户可执行哪些系统操作。
数据安全性是指在对象级控制数据库的存取和使用的机制,包含:哪些用户可存取一指定的模式对象及在对象上允许作哪些操作类型.在ORACLE服务器上提供了一种任意存取控制,是一种基于特权限制信息存取的方法。
用户要存取一对象必须有相应的特权授给该用户。
已授权的用户可任意地可将它授权给其它用户,由于这个原因,这种安全性类型叫做任意型。
ORACLE利用下列机制管理数据库安全性:数据库用户和模式;特权;角色;存储设置和空间份额;资源限制;审计。
数据库的存取控制ORACLE保护信息的方法采用任意存取控制来控制全部用户对命名对象的存取。
用户对对象的存取受特权控制。
一种特权是存取一命名对象的许可,为一种规定格式。
ORACLE使用多种不同的机制管理数据库安全性,其中有两种机制:模式和用户.模式为模式对象的集合,模式对象如表、视图、过程和包等.第一数据库有一组模式。
Sqlserver 2008数据库安全设置方法目录一、服务器身份验证 (1)1.验证登录模式 (1)二、SQL Server服务的运行身份 (1)1.用户身份验 (1)三、sa密码的安全性 (1)1.修改sa的用户名 (1)四、端口相关问题 (2)1.修改端口号 (2)2. 卸载SQL的不安全组件 (2)3. 权限设置 (2)五、数据库安全策略 (3)1.使用安全的密码策略 (3)2.使用安全的帐号策略 (3)3.加强数据库日志的记录 (3)4.管理扩展存储过程……………………………………………………5.使用协议加密 (4)6.不要让人随便探测到你的TCP/IP端口 (4)7.修改TCP/IP使用的端口 (5)8.拒绝来自1434端口的探测 (5)9.对网络连接进行IP限制 (5)数据库安全设置方法一、服务器身份验证MSSQL Server 2008的身份验证模式有两种:一种是Windows 身份验证模式, 另一种是SQL Server和Windows身份验证模式(即混合模式)。
对大多数数据库服务器来说,有SQL Server 身份验证就足够了,只可惜目前的服务器身份验证模式里没有这个选项,所以我们只能选择同时带有SQL Server和Windows身份验证的模式(混合模式)。
但这样就带来了两个问题:1、混合模式里包含了Windows身份验证这个我们所不需要的模式,即设置上的冗余性。
程序的安全性是与冗余性成反比的。
2、所谓Windows身份验证,实际上就是通过当前Windows管理员帐户(通常为Administrator)的登录凭据来登录MSSQL Server。
使用Windows身份验证,会增加Administrator密码被盗的风险。
为解决以上两个问题,我们需要限制混合模式里的Windows身份验证。
方法如下:打开Microsoft SQL Server Management Studio,点击安全性->登录名,将Administrator对应的登录名删除即可。
SQL Server数据库的安全性管理与加密技术在当今的信息时代,保护数据的安全性成为了企业和组织亟需解决的重要问题。
作为一种广泛应用于企业级数据库系统的关系型数据库管理系统,SQL Server数据库的安全性管理与加密技术对于保护敏感数据的安全性至关重要。
SQL Server数据库提供了多种安全性管理和加密技术,以确保数据的机密性、完整性和可用性。
下面将分别就用户访问和权限管理、数据传输加密和数据加密进行详细讲解。
首先,用户访问和权限管理是确保数据库安全的关键措施之一。
SQL Server提供了基于角色的访问控制机制,管理员可以通过定义角色、赋予角色相应的权限,然后将用户分配到角色中来管理用户的访问权限。
此外,SQL Server还支持基于主体的权限管理,主体可以是用户、Windows域用户、应用程序或自定义角色等。
通过强大的权限管理功能,可以精确控制用户对数据库的访问权限,减少未经授权的访问风险。
其次,数据传输加密是保护数据安全的重要手段之一。
SQL Server支持使用SSL(Secure Sockets Layer)协议对数据传输进行加密。
管理员可以通过配置SQL Server证书和SSL协议来确保数据在传输过程中的机密性。
使用SSL加密数据传输可以有效防止数据被窃取、篡改或劫持,保护数据的安全性。
最后,数据加密是最重要和最直接的保护数据安全的技术。
SQL Server提供了多种数据加密功能,包括透明数据加密(TDE)、动态数据掩码(DDM)和始终加密列(Always Encrypted)等。
透明数据加密(TDE)是一种将整个数据库进行加密的技术。
TDE通过在存储层面上对数据库进行加密,从而保证了数据在磁盘上的存储是加密的状态。
只有在查询数据时,才能将数据解密并返回给用户。
这种方法不需要对应用程序进行任何修改,提供了更高级别的安全性。
动态数据掩码(DDM)是一种在应用程序查询数据时对敏感数据进行动态加密和掩码的技术。