




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、央又译又数据库安全PaulMorrisonAmericaPART1“为什么要确保数据库服务安全呢?任何人都不能访问-这是一个非军事区的保护防火墙”,当我们被建议使用一个带有安全检查机制的装置时,这是通常的反应。事实上,在防护一个组织的信息方面,数据库的安全是至高无上的,因为它可能会间接接触比我们意识到的更广泛的用户。这是两篇研究数据库安全文章中的第一篇。在这篇文章中我们将讨论一般数据库安全概念和和比较普遍的问题。在下篇文章,我们将把焦点放在特定的MicrosoftSQL和Oracle的安全关注上。近来数据库安全已成为一个热门话题。随着越来越多的人关注计算机安全,我们发现,防火墙和网络服务器比以
2、前都更加安全化了(虽然这并不等于说现在不再有许多不安全的网络存在)。因此,重点是加大对技术的考虑力度,譬如以更细腻的审查态度对待数据库。一般安全意识在我们讨论有关数据库安全问题之前,确保底层操作系统和支撑技术的安全是审慎而且必要的。如果一个vanilla操作系统无法为数据库提供一个稳妥可靠的安全基础,花费太多努力去确保数据库安全是不值得的。当安装操作系统时,有许多好的文献资料可以参考。经常遇到的一个普遍问题,就是作为网络服务器托管Internet(orIntranet)的同一服务器上数据库的应用。虽然这可能节省的购买一个单独的服务器费用,但这严重影响了安全问题。如果这是确定的,当数据库开放地连
3、接到互联网这种情况被证实了。最近的一个例子,我记得是一个Apache网络服务器系统服务组织在互联网上提供的,与Oracle数据库在互联网上提供有关端口1521。在调查这个问题时进一步被发现,访问该Oracle服务器是没有服务器加以制止之类的保护措施的(包括缺乏密码)。从互联网发展前景看,这个数据库是不被推崇的,但默认设置的使用以及粗糙的安全措施,使服务器更加脆弱。上面提到的问题并不是严格地数据库问题,还可以被归类为构建机制和防火墙保护问题,但最终它确是数据库,这是毫不妥协的。安全方面的考虑从面向网络的各部分来看而被迫作出的。你不能依靠任何他人或任何别的事以保护你的数据库安全。由于SQL和Ora
4、cle开发的漏洞给攻击工具一个得以使用的空间。我在最近为客户做的一项安全评估中偶然发现一个数据库安全方面的有趣的是。我们正在进行对使用一个数据库后端(SQL)以存放客户端的细节的企业内部应用软件的测试。安全审查过程进展顺利,访问控制基于Windows认证。只有通过认证的Windows用户能够看到属于他们的数据。这个应用软件本身好像对输入要求进行处理,拒绝直接进入资料库的所有尝试。之后我们在工作的办公室偶然发现一个该应用软件的备份。这个媒体装有SQL数据库的备份,这是我们重新存储到笔记本电脑上的。所有安全控制均到那些原先并未恢复数据库的位置上,而且我们能够在适当的位置无任何限制地浏览完整的数据库
5、,以保护敏感的数据。这可能像是一种妥协的系统安全的方式,但确实是重要的。往往并不是采取直接的方法攻击一个目标,并且最终结果是相同的;系统妥协。数据库备份可以存储在服务器上,从而有利于间接地访问数据。以上问题有一个简单的办法来解决。在SQL2000可以为备份设定使用密码保护。如果备份使用了密码保护,当创建密码时就必须使用密码。这是一种有效而且不太复杂的方法阻止备份数据的简单捕获。然而这意味着密码必须记住!当前趋势在IT安全方面有许多当前趋势,这些中的不少都与数据库安全联系起来。数据库安全方面的焦点正吸引着攻击者的注意力。由于SQL和Oracle开发的漏洞给攻击工具一个得以使用的空间。这些工具的出
6、现提高了赌注,我们已经看到,攻击主要是针对服务器暴露到互联网的特定数据库端口。贯穿安全业的一个普遍问题是应用软件安全,特别是定制的Web应用程序。随着Web应用程序的功能变得越来越复杂,它带来了应用程序编码方面的安全漏洞的更大的潜在威胁。为了满足应用软件的功能性要求,后端数据存储通常被用来安排网页内容的格式。这就需要更复杂的后端数据编码。开发者使用不同风格的代码开发,其中一部分没有安全意识,这也许是开发错误的源头。SQL注入就是当前IT安全业的一个热门话题。随着愈来愈多的以期缩短时间的开发数据库的方式和手段的出现,目前在技术安全论坛中,争论是很平常的。SQL注入是一个容易让人误导的术语,因为该
7、概念也适用于其他的数据库,包括Oracle,DB2和Sybase系统。什么是SQL注入?SQL注入的是软件开发人员所不希望出现的与资料库使用代码或指令发送手段的交流方法。这是发现在Web应用软件最常见的形式。任何用户输入应用软件所不允许的内容是攻击的一个常见来源。在座很多朋友已经看到了当访问网站时通常的错误消息框,而且往往显示用户输入没有得到正确处理。一旦出现这种类型的错误,攻击者将把焦点放在更具体的输入字符串上。具体的与安全有关的编码技术在使用组织时应加入编码标准。由于这种类型的脆弱性所造成的损害,可以很深刻的,尽管这会取决于该应用软件与数据库关联的特权级别。如果该软件以管理者类型权限访问数
8、据,然后恶意运行命令也会是这一级别的访问权限,此时系统妥协是不可避免的。还有这个问题类似于操作系统的安全规则,在那里,项目应该以最低的权限运行,而且这是必要的。如果是正常的用户访问,然后启用这个限制。同样的问题,SQL的安全也不完全是一个数据库的问题。特定的数据库命令或要求,不应该允许通过应用层。这是可以通过安全码的方式加以预防的。这是一个场外话题,但应该被应用的一些基本步骤的详细设计是有必要的。第一步,在获取任何申请时须验证和控制用户输入。可能的情况下,严格的类型应被设定以控制具体数据(例如,期望得到数值数据,字符串类型数据等),并在可能实现的情况下,如果数据是以字符型为基础的,需要禁止特定
9、的非字母数字字符。如果这是不能实现的,应该做出争取使用替代字符的考虑(例如,使用单引号,这在SQL命令中时通常被使用的)。在使用您的组织时具体的与安全有关的编码技术应加入编码标准。如果所有开发商都使用相同的基线标准,特定具体的安全措施,这将大大减少SQL注入妥协的风险。能够使用的另一种简单的方法,是清除数据库中不再需要的所有程序。这些限制了数据库中不再需要的或者多于过剩的被恶意利用的程度。这类似于消除操作系统内不需要的服务程序,是一种常见的安全实践。总结总之,我已做出的以上的大多数观点是安全概念的一般意识,并没有具体到某个数据库。然而,所有这些确实应用于数据库,而且如果这些基本的安全措施被应用
10、,你的数据库安全属性将大大改善。在下一篇关于数据库的安全的文章中,将侧重于具体的SQL和Oracle安全问题,有为DBAs和开发商提供的详细例子和意见。PART2这是第二篇文章,审查了数据库的安全。在上篇文章我们讨论了一般数据库安全概念和共同面临的问题。在这篇文章我们将集中于特定的MicrosoftSQL和Oracle的安全问题,同样重要的是缓解这些问题的解决方案。数据库安全与一般IT安全问题有许多相似之处,都有一些简单的安全措施和步骤,容易实施,从而大大提高安全性。虽然这些看起来像普通常识,但是令人惊讶的是,我们都看到有多少次,常见的安全措施没有落实以至于造成的安全风险。用户账户和密码安全在
11、IT安全方面的一个首要基本规则,便是“确保你有一个可靠的密码”。在此声明,我已假定首先一个密码已被设定,虽然这种情况往往并非如此。在去年的文章中,我略微谈到了关于一般安全意识的问题,但我认为再次强调这个问题是有必要的,而且至关重要。就像操作系统,人们关注的焦点是内部数据库的账号安全,其目的在于管理账户。在SQL内,这将成为SA账号,在Oracle内,这可以是SYSDBA或者是Oracle账户。SQLSA服务账户将“SA”作为密码,这是很常见的,或者更糟糕的是一个空白密码,这同样很普遍。这类密码连最基本的安全规则都懒于限制。用户在自己的域账户上将不允许有一个空白密码,所以为什么宝贵的系统资源,例
12、如数据库容许被毫无保障。举例来说,一个空白的“SA”密码,使含有客户端软件任何用户(如微软的查询分析器或企业经理人去“管理”SQLServer和数据库)。数据库被用来作为Web应用软件的后端,缺乏密码控制,将导致敏感资料的全盘妥协。随着系统级访问数据库,使得不仅要执行查询到数据库,创建/修改/删除表等,而且也要执行被称为存储程序的内容。摘自:保罗莫里森数据库安全.萨姆斯出版社出版,2002附:英文原文DatabaseSecurityPaulMorrisonAmericaPART1“WhydoIneedtosecuremydatabaseserver?Noonecanaccessit一itsin
13、aDMZprotectedbythefirewall!”Thisisoftentheresponsewhenitisrecommendedthatsuchdevicesareincludedwithinasecurityhealthcheck.Infact,databasesecurityisparamountindefendinganorganizationsinformation,asitmaybeindirectlyexposedtoawideraudiencethanrealized.Thisisthefirstoftwoarticlesthatwillexaminedatabases
14、ecurity.Inthisarticlewewilldiscussgeneraldatabasesecurityconceptsandcommonproblems.InthenextarticlewewillfocusonspecificMicrosoftSQLandOraclesecurityconcerns.Databasesecurityhasbecomeahottopicinrecenttimes.Withmoreandmorepeoplebecomingincreasinglyconcernedwithcomputersecurity,wearefindingthatfirewal
15、lsandWebserversarebeingsecuredmorethanever(thoughthisdoesnotmeanthattherearenotstillalargenumberofinsecurenetworksoutthere).Assuch,thefocusisexpandingtoconsidertechnologiessuchasdatabaseswithamorecriticaleye.CommonensesecurityBeforewediscusstheissuesrelatingtodatabasesecurityitisprudenttohigh-lightt
16、henecessitytosecuretheunderlyingoperatingsystemandsupportingtechnologies.Itisnotworthspendingalotofeffortsecuringadatabaseifavanillaoperatingsystemisfailingtoprovideasecurebasisforthehardeningofthedata-base.Therearealargenumberofexcellentdocumentsinthepublicdomaindetailingmeasuresthatshouldbeemploye
17、dwheninstallingvariousoperatingsystems.OnecommonproblemthatisoftenencounteredistheexistenceofadatabaseonthesameserverasawebserverhostinganInternet(orIntranet)facingapplication.Whilstthismaysavethecostofpurchasingaseparateserver,itdoesseriouslyaffectthesecurityofthesolution.Wherethisisidentified,itis
18、oftenthecasethatthedatabaseisopenlyconnectedtotheInternet.OnerecentexampleIcanrecallisanApacheWebserverservinganorganizationsInternetoffering,withanOracledatabaseavailableontheInternetonport1521.WheninvestigatingthisissuefurtheritwasdiscoveredthataccesstotheOracleserverwasnotprotected(includinglacko
19、fpasswords),whichallowedtheservertobestopped.ThedatabasewasnotrequiredfromanInternetfacingperspective,buttheuseofdefaultsettingsandcarelesssecuritymeasuresrenderedtheservervulnerable.Thepointsmentionedabovearenotstrictlydatabaseissues,andcouldbeclassifiedasarchitecturalandfirewallprotectionissuesals
20、o,butultimatelyitisthedatabasethatiscompromised.Securityconsiderationshavetobemadefromallpartsofapublicfacingnetwork.Youcannotrelyonsomeoneorsomethingelsewithinyourorganizationprotectingyourdatabasefromexposure.AttacktoolsarenowavailableforexploitingweaknessesinSQLandOracleIcameacrossoneinterestinga
21、spectofdatabasesecurityrecentlywhilecarryingoutasecurityreviewforaclient.Wewereperformingatestagainstanintranetapplication,whichusedadatabasebackend(SQL)tostoreclientdetails.Thesecurityreviewwasproceedingwell,withaccesscontrolsbeingbasedonWindowsauthentication.OnlyauthenticatedWindowsuserswereableto
22、seedatabelongingtothem.Theapplicationitselfseemedtobehandlinginputrequests,rejectingallattemptstoaccessthedata-basedirectly.Wethenhappenedtocomeacrossabackupoftheapplicationintheofficeinwhichwewereworking.ThismediacontainedabackupoftheSQLdatabase,whichwerestoredontoourlaptop.Allsecuritycontrolswhich
23、wereinplaceoriginallywerenotrestoredwiththedatabaseandwewereabletobrowsethecompletedatabase,withnorestrictionsinplacetoprotectthesensitivedata.Thismayseemlikeacontrivedwayofcompromisingthesecurityofthesystem,butdoeshighlightanimportantpoint.Itisoftennotthedirectapproachthatistakentoattackatarget,and
24、ultimatelytheendpointisthesame;systemcompromise.Abackupcopyofthedatabasemaybestoredontheserver,andthusfacilitatesaccesstothedataindirectly.Thereisasimplesolutiontotheproblemidentifiedabove.SQL2000canbeconfiguredtousepasswordprotectionforbackups.Ifthebackupiscreatedwithpasswordprotection,thispassword
25、mustbeusedwhenrestoringthepassword.Thisisaneffectiveanduncomplicatedmethodofstoppingsimplecaptureofbackupdata.Itdoeshowevermeanthatthepasswordmustberemembered!CurrenttrendsThereareanumberofcurrenttrendsinITsecurity,withanumberofthesebeinglinkedtodatabasesecurity.Thefocusondatabasesecurityisnowattrac
26、tingtheattentionoftheattackers.AttacktoolsarenowavailableforexploitingweaknessesinSQLandOracle.TheemergenceofthesetoolshasraisedthestakesandwehaveseenfocusedattacksagainstspecificdatabaseportsonserversexposedtotheInternet.Onecommonthemerunningthroughthesecurityindustryisthefocusonapplicationsecurity
27、,andinparticularbespokeWebapplications.WithhefunctionalityofWebapplicationsbecomingmoreandmorecomplex,itbringsthepotentialformoresecurityweaknessesinbespokeapplicationcode.Inordertofulfillthefunctionalityofapplications,thebackenddatastoresarecommonlybeingusedtoformatthecontentofWebpages.Thisrequires
28、morecomplexcodingattheapplicationend.Withdevelopersusingdifferentstylesincodedevelopment,someofwhicharenotassecurityconsciousasother,thiscanbethesourceofexploitableerrors.SQLinjectionisonesuchhottopicwithintheITsecurityindustryatthemoment.Discussionsarenowcommonplaceamongtechnicalsecurityforums,with
29、moreandmorewaysandmeansofexploitingdatabasescomingtolightallthetime.SQLinjectionisamisleadingterm,astheconceptappliestootherdatabases,includingOracle,DB2andSybase.WhatisSQLInjection?SQLInjectionissimplythemethodofcommunicationwithadatabaseusingcodeorcommandssentviaamethodorapplicationnotintendedbyth
30、edeveloper.ThemostcommonformofthisisfoundinWebapplications.Anyuserinputthatishandledbytheapplicationisacommonsourceofattack.OnesimpleexampleofmishandlingofuserinputishighlightedinFigure1.Manyofyouwillhaveseenthiscommonerrormessagewhenaccessingwebsites,andoftenindicatesthattheuserinputhasnotbeencorre
31、ctlyhandled.Ongettingthistypeoferror,anattackerwillfocusinwithmorespecificinputstrings.Specificsecurity-relatedcodingtechniquesshouldbeaddedtocodingstandardinusewithinyourorganization.Thedamagedonebythistypeofvulnerabilitycanbefarreaching,thoughthisdependsonthelevelofprivilegestheapplicationhasinrel
32、ationtothedatabase.Iftheapplicationisaccessingdatawithfulladministratortypeprivileges,thenmaliciouslyruncommandswillalsopickupthislevelofaccess,andsystemcompromiseisinevitable.Againthisissueisanalogoustooperatingsystemsecurityprinciples,whereprogramsshouldonlyberunwiththeminimumofpermissionsthatisre
33、quired.Ifnormaluseraccessisacceptable,thenapplythisrestriction.AgaintheproblemofSQLsecurityisnottotallyadatabaseissue.Specificdatabasecommandorrequestsshouldnotbeallowedtopassthroughtheapplicationlayer.Thiscanbepreventedbyemployinga“securecoding”approach.Againthisisveeringoff-topic,butitisworthdetai
34、lingafewbasicstepsthatshouldbeemployed.Thefirststepinsecuringanyapplicationshouldbethevalidationandcontrolofuserinput.Stricttypingshouldbeusedwherepossibletocontrolspecificdata(e.g.ifnumericdataisexpected),andwherestringbaseddataisrequired,specificnonalphanumericcharactersshouldbeprohibitedwhereposs
35、ible.Wherethiscannotbeperformed,considerationshouldbemadetotryandsubstitutecharacters(forexampletheuseofsinglequotes,whicharecommonlyusedinSQLcommands).Specificsecurity-relatedcodingtechniquesshouldbeaddedtocodingstandardinusewithinyourorganization.Ifalldevelopersareusingthesamebaselinestandards,wit
36、hspecificsecuritymeasures,thiswillreducetheriskofSQLinjectioncompromises.Anothersimplemethodthatcanbeemployedistoremoveallprocedureswithinthedatabasethatarenotrequired.Thisrestrictstheextentthatunwantedorsuperfluousaspectsofthedatabasecouldbemaliciouslyused.Thisisanalogoustoremovingunwantedserviceso
37、nanoperatingsystem,whichiscommonsecuritypractice.OverallInconclusion,mostofthepointsIhavemadeabovearecommonsensesecurityconcepts,andarenotspecifictodatabases.HoweverallofthesepointsDOapplytodatabasesandifthesebasicsecuritymeasuresareemployed,thesecurityofyourdatabasewillbegreatlyimproved.PART2Thenex
38、tarticleondatabasesecuritywillfocusonspecificSQLandOraclesecurityproblems,withdetailedexamplesandadviceforDBAanddevelopers.TherearealotofsimilaritiesbetweendatabasesecurityandgeneralITsecurity,withgenericsimplesecuritystepsandmeasuresthatcanbe(andshouldbe)easilyimplementedtodramaticallyimprovesecurity.Whilethesemayseemlikecommonsense,itissurprisinghowmanytimeswehaveseenthatcommonsecuritymeasuresarenotimplementedandsocauseasecuri
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 桂林师范高等专科学校《西方行政学说史》2023-2024学年第一学期期末试卷
- 河北科技工程职业技术大学《建筑制图与》2023-2024学年第二学期期末试卷
- 广东新安职业技术学院《植言物语植物景观赏析》2023-2024学年第二学期期末试卷
- 中国石油大学(华东)《建筑设计Ⅱ》2023-2024学年第二学期期末试卷
- 福州英华职业学院《兽医免疫学》2023-2024学年第二学期期末试卷
- 2024年秋八年级历史上册 第五单元 从国共合作到国共对峙 第16课 毛泽东开辟井冈山道路教学设计 新人教版
- 山东女子学院《应用开发》2023-2024学年第二学期期末试卷
- 医生外出培训汇报
- 铺面租赁合同范本
- 参展产品合同范本
- 区域新能源集控中心建设方案
- 英语四线三格Word版
- 行政公文写作-决定(应用文写作课件)
- 自身免疫性肝病的诊治进展
- DB35∕323-2018 厦门市大气污染物排放标准
- 管道沟槽开挖专项施工方案
- 小学英语-He is playing the suona,but the phone rings.教学课件设计
- 部编版七年级下册道法期中试卷1
- 12J12 天津市建筑标准设计图集(2012版)无障碍设施
- 妊娠合并HIV感染孕产妇入院后处理流程
- 百年战争简史
评论
0/150
提交评论