Apache Tomcat 8 8020Security Considerations.docx
- 文档编号:24222542
- 上传时间:2023-05-25
- 格式:DOCX
- 页数:14
- 大小:25.48KB
Apache Tomcat 8 8020Security Considerations.docx
《Apache Tomcat 8 8020Security Considerations.docx》由会员分享,可在线阅读,更多相关《Apache Tomcat 8 8020Security Considerations.docx(14页珍藏版)》请在冰豆网上搜索。
ApacheTomcat88020SecurityConsiderations
SecurityConsiderations(安全化方面的注意事项)
TableofContents(目录)
∙Introduction(介绍)
∙Non-Tomcatsettings(非tomcat设置)
∙Defaultwebapplications(默认网页应用)
1.General(整体设置)
2.ROOT(根目录)
3.Documentation(文档处理)
4.Examples(样例)
5.Manager(管理器)
6.HostManager(主机管理器)
7.SecuringManagementApplications(安全管理应用)
∙Securitymanager(安全管理器)
∙server.xml
8.General(整体设置)
9.Server(服务器)
10.Listeners(监听)
11.Connectors(连接器)
12.Host(主机)
13.Context(环境)
14.Valves(组件)
15.Realms(领域)
16.Manager(管理器)
∙SystemProperties(系统属性)
∙web.xml
∙General(整体设置)
Introduction(介绍)
Tomcatisconfiguredtobereasonablysecureformostusecasesbydefault.Someenvironmentsmayrequiremore,orless,secureconfigurations.Thispageistoprovideasinglepointofreferenceforconfigurationoptionsthatmayimpactsecurityandtooffersomecommentaryontheexpectedimpactofchangingthoseoptions.TheintentionistoprovidealistofconfigurationoptionsthatshouldbeconsideredwhenassessingthesecurityofaTomcatinstallation.
Tomcat默认的安全配置适用于大多数情况。
在一些环境下可能有更高或者更低的需求,本页是参照可能影响安全的配置选项,提供一些关于更改这些选项所造成影响的预期评注。
目的是提供一个Tomcat安装时需要考虑的一份配置选项列表。
Note:
Readingthispageisnotasubstituteforreadingandunderstandingthedetailedconfigurationdocumentation.Fullerdescriptionsoftheseattributesmaybefoundintherelevantdocumentationpages.
注意:
阅读此页不能替代阅读和详细理解配置文档,这些属性的充分说明可以在相关文档的页面中被发现。
Non-Tomcatsettings(非tomcat设定)
Tomcatconfigurationshouldnotbetheonlylineofdefense.Theothercomponentsinthesystem(operatingsystem,network,database,etc.)shouldalsobesecured.
Tomcat的配置不应该是唯一的一道防线,也应该安全系统(操作系统、网络、数据库等)中的其他组件。
Tomcatshouldnotberunundertherootuser.CreateadedicateduserfortheTomcatprocessandprovidethatuserwiththeminimumnecessarypermissionsfortheoperatingsystem.Forexample,itshouldnotbepossibletologonremotelyusingtheTomcatuser.
Tocat不应该由最高权限用户下运行。
创建专用的用户为Tomcat进程并为该用户提供操作系统的最低必要权限。
例如,它应不可能在使用Tomcat用户远程登录。
Filepermissionsshouldalsobesuitablyrestricted.TakingtheTomcatinstancesattheASFasanexample(whereauto-deploymentisdisabledandwebapplicationsaredeployedasexplodeddirectories),thestandardconfigurationistohaveallTomcatfilesownedbyrootwithgroupTomcatandwhilstownerhasread/writeprivileges,grouponlyhasreadandworldhasnopermissions.Theexceptionsarethelogs,tempandworkdirectorythatareownedbytheTomcatuserratherthanroot.ThismeansthatevenifanattackercompromisestheTomcatprocess,theycan'tchangetheTomcatconfiguration,deploynewwebapplicationsormodifyexistingwebapplications.TheTomcatprocessrunswithaumaskof007tomaintainthesepermissions.
文件权限亦应加以适当限制。
考虑Tomcat实例为例(禁用自动部署,作为爆破目录部署web应用程序)ASF,标准配置是要得与组Tomcat由root用户拥有的所有Tomcat文件和同时所有者具有读/写权限,组仅具有读取和世界上有没有权限。
例外的是日志,由Tomcat用户,而不是根的临时和工作目录。
这意味着即使攻击者危及Tomcat过程,他们不能更改Tomcat配置、部署新的web应用程序或修改现有web应用程序。
由Tomcat进程运行与umask007维护这些权限。
Atthenetworklevel,considerusingafirewalltolimitbothincomingandoutgoingconnectionstoonlythoseconnectionsyouexpecttobepresent.
网络方面考虑使用防火墙来限制你期望的出入站连接。
Defaultwebapplications(默认网页应用)
General(整体设置)
Tomcatshipswithanumberofwebapplicationsthatareenabledbydefault.Vulnerabilitieshavebeendiscoveredintheseapplicationsinthepast.Applicationsthatarenotrequiredshouldberemovedsothesystemwillnotbeatriskifanothervulnerabilityisdiscovered.
Tomcat默认自带一些web应用程序。
在过去发现这些应用程序存在漏洞。
应删除不需要的应用程序。
这样即使另外一些漏洞被发现,系统也不会处于风险之中。
ROOT(根目录)
TheROOTwebapplicationpresentsaverylowsecurityriskbutitdoesincludetheversionofTomcatthatisbeingused.TheROOTwebapplicationshouldnormallyberemovedfromapubliclyaccessibleTomcatinstance,notforsecurityreasons,butsothatamoreappropriatedefaultpageisshowntousers.
底层web应用程序的安全风险极低。
但它包含了Tomcat正在使用得版本。
底层web应用程序通常应该在一个可公开访问的Tomcat实例中被移除,不单只是处于安全因素考虑,也是为了让用户看到更加合适的默认页面。
Documentation(文档)
ThedocumentationwebapplicationpresentsaverylowsecurityriskbutitdoesidentifytheversionofTomcatthatisbeingused.ItshouldnormallyberemovedfromapubliclyaccessibleTomcatinstance.
Web文档应用程序安全风险很低,但它会标识出正在使用的tomcat版本,它通常应该在一个可公开访问的Tomcat实例中删除。
Examples(样例)
Theexampleswebapplicationshouldalwaysberemovedfromanysecuritysensitiveinstallation.Whiletheexampleswebapplicationdoesnotcontainanyknownvulnerabilities,itisknowntocontainfeatures(particularlythecookieexamplesthatdisplaythecontentsofallreceivedandallownewcookiestobeset)thatmaybeusedbyanattackerinconjunctionwithavulnerabilityinanotherapplicationdeployedontheTomcatinstancetoobtainadditionalinformationthatwouldotherwisebeunavailable.
Web示例应用程序总是应该从任何安全敏感的安装中删除。
虽然web示例应用程序中不包含任何一支的安全漏洞,但是它一支含有的功能,比如宣誓所有内容的cookie和允许接收新的cookie设置)可被攻击者从已部署的tomcat里另外一个应用程序中的漏洞来获取额外的信息,否则将不可使用。
Manager(管理器)
TheManagerapplicationallowstheremotedeploymentofwebapplicationsandisfrequentlytargetedbyattackersduetothewidespreaduseofweakpasswordsandpubliclyaccessibleTomcatinstanceswiththeManagerapplicationenabled.TheManagerapplicationisnotaccessiblebydefaultasnousersareconfiguredwiththenecessaryaccess.IftheManagerapplicationisenabledthenguidanceinthesectionSecuringManagementApplicationssectionshouldbefollowed.
应用程序管理器允许部署web应用程序,由于弱密码的广泛使用以及可公开访问tomcat实例与管理器应用程序启用而精彩成为攻击目标。
默认情况下,用户配置具有必要的访问权限,应用程序管理器才可以访问,如果启用了应用管理器,就应该遵循应用管理器这一章节的指导。
HostManager(主机管理)
TheHostManagerapplicationallowsthecreationandmanagementofvirtualhosts-includingtheenablingoftheManagerapplicationforavirtualhost.TheHostManagerapplicationisnotaccessiblebydefaultasnousersareconfiguredwiththenecessaryaccess.IftheHostManagerapplicationisenabledthenguidanceinthesectionSecuringManagementApplicationssectionshouldbefollowed.
主机管理应用程序允许创建和管理虚拟主机-包括启用虚拟主机管理器的应用程序。
在默认状况下,主机管理器的应用程序是不可访问的。
用户需要具有必要的访问权限,如果启用了主机管理,应遵循应用安全管理这一章的指导去运行。
SecuringManagementApplications(安全管理软件)
WhendeployingawebapplicationthatprovidesmanagementfunctionsfortheTomcatinstance,thefollowingguidelinesshouldbefollowed:
在部署时为Tomcat实例提供管理功能的web应用程序,应该遵循下列准则:
Ensurethatanyuserspermittedtoaccessthemanagementapplicationhavestrongpasswords.
DonotremovetheuseoftheLockOutRealmwhichpreventsbruteforceattacksagainstuserpasswords.
UncommenttheRemoteAddrValvein/META-INF/context.xmlwhichlimitsaccesstolocalhost.Ifremoteaccessisrequired,limitittospecificIPaddressesusingthisvalve.
确保允许访问管理应用程序的任何用户设置强密码。
请不要删除使用LockOutRealm,可以防止用户密码的暴力破解。
取消注释中限制对本地主机访问的/META-INF/context.xmlRemoteAddrValve。
如果需要远程访问,则请将其限制到特定的IP地址,使用这种组件。
Securitymanager(安全管理器)
Enablingthesecuritymanagercauseswebapplicationstoberuninasandbox,significantlylimitingawebapplication'sabilitytoperformmaliciousactionssuchascallingSystem.exit(),establishingnetworkconnectionsoraccessingthefilesystemoutsideofthewebapplication'srootandtemporarydirectories.However,itshouldbenotedthattherearesomemaliciousactions,suchastriggeringhighCPUconsumptionviaaninfiniteloop,thatthesecuritymanagercannotprevent.
启用安全管理器令网页应用在沙盒中运行。
这回显著限制了web应用程序的权限,使他们不能执行恶意炒作,如调用system.exit(),建立网络连接或访问web应用程序的根目录和临时目录意外的文件系统中运行的web应用程序。
然而,有一些恶意的操作,比如触发一些循环操作来提高cpu占用率,安全管理器不能防止这种情况发生。
Enablingthesecuritymanagerisusuallydonetolimitthepotentialimpact,shouldanattackerfindawaytocompromiseatrustedwebapplication.Asecuritymanagermayalsobeusedtoreducetherisksofrunninguntrustedwebapplications(e.g.inhostingenvironments)butitshouldbenotedthatthesecuritymanageronlyreducestherisksofrunninguntrustedwebapplications,itdoesnoteliminatethem.Ifrunningmultipleuntrustedwebapplications,itisrecommendedthateachwebapplicationisdeployedtoaseparateTomcatinstance(andideallyseparatehosts)toreducetheabilityofamaliciouswebapplicationimpactingtheavailabilityofotherapplications.
启用安全管理器通常是以限制潜在影响,攻击者会找到某个受信任的web应用程序。
安全管理器可用于减少运行不受信任的web应用程序。
但安全管理器只能降低风险,但不能排除风险,建议每一个web应用程序部署到一个单独的tomcat实例,以减少恶意web应用对其他应用程序的影响。
Tomcatistestedwiththesecuritymanagerenabled;butthemajorityofTomcatusersdonotrunwithasecuritymanager,soTomcatisnotaswelluser-testedinthisconfiguration.Therehavebeen,andcontinuetobe,bugsreportedthataretriggeredbyrunningunderasecuritymanager.
Tomcat的安全管理器测试应该被启用,但绝大多数Tomcat用户并不会运行安全管理器,所以Tomcat。
所以tomcat不适用于用户测试。
Bug提交和报告,都由安全管理器来发布。
Therestrictionsimposedbyasecuritymanagerarelikelytobreakmostapplicationsifthesecuritymanagerisenabled.Thesecuritymanagershouldnotbeusedwithoutextensivetesting.Ideally,theuseofasecuritymanagershouldbeintroducedatthestartofthedevelopmentcycleasitcanbetime-consumingtotrackdownandfixissuescausedbyenablingasecuritymanagerforamatureapplication.
如果启用了安全管理器,安全管理器所做出的限制可能会被大多数应用打破。
在没有进行广泛测试之前,不应该去使用安全管理器。
理想状况下,在开发初期就使用安全管理器,它可以修复并跟踪应用程序因为安全管理器造成的问题。
Enablingthesecuritymanagerchangesthedefaultsforthefollowingsettings:
∙ThedefaultvalueforthedeployXMLattributeoftheHostelementischangedtofalse.
∙启用安全管理器更改为以下设置的默认设置:
主机元素的deployXML属性的默认值更改为false。
∙
server.xml
General
Thedefaultserver.xmlcontainsalargenumberofcomments,includingsomeexamplecomponentdefinitionsthatarecommentedout.Removingthesecommentsmakesitconsiderablyeasiertoreadandcomprehendserver.xml.
Ifacomponenttypeisnotlisted,thentherearenosettingsforthattypethatdirectlyimpactsecurity.
包括被注释掉了一些示例组件定义。
删除这些注释使其变得容易阅读和理解线程。
如果未列出的组件类型,然后没有设置为该类型的安全有直接影响。
Server
Settingtheportattributeto-1disablestheshutdownport.
Ifthesh
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Apache Tomcat 8020 Security Considerations