EJB的安全性中英文资料外文翻译文献.docx
- 文档编号:27571661
- 上传时间:2023-07-02
- 格式:DOCX
- 页数:23
- 大小:274.81KB
EJB的安全性中英文资料外文翻译文献.docx
《EJB的安全性中英文资料外文翻译文献.docx》由会员分享,可在线阅读,更多相关《EJB的安全性中英文资料外文翻译文献.docx(23页珍藏版)》请在冰豆网上搜索。
EJB的安全性中英文资料外文翻译文献
(文档含英文原文和中文翻译)
EJB的安全性中英文资料外文翻译文献
EJBsecurity
INTRODUCTION
SecuritymanagementisoneoftheimportantservicesthatEJBoffers.Thelow_levelsecurityinfrastructureinEJBisimplementedbythecontainerprovider.Securitypoliciesaresetatdeploymenttimeinordertomakethebeansportableacrossapplications.EJBsecurityboilsdowntowhichuserhaspermissiontocallwhichmethodofabean.UsersaredefinedoutsideEJBinaspecificoperationalenvironment(forexample,ausernamedGurmailKandola,workingonaUNIXmachinewithusernamekandola,isamemberofusergroupengineering,hasaccesspermissiontoaMySQLdatabaseserverandsoon).TotheEJBcode,auserisrepresentedbyaninstanceoftheoftheclassjava.security.principal.Principalsaremappedtosecurityroles,whichdeterminethemethodsaprincipalcanaccess.Theapplicationassemblerdefinesthelogicalsecurityroles,andthedeployermapsthemthemtotheprincipals.Amethodcallfromaclientmaytriggerabean-to-beanchainofcalls,asyousawinthepreviouschapterwhileexploringtransactions.Howdoessecuritypropagatealongthischainofcalls?
HowdothevarousEjBrolessplittheresponsibilityforsettingsecuritypolicies?
Thesequestionspointtosomeoftheimportantissuesthatwewillexploreinthischapter.YourgoalforthischapteristounderstandEJBsecurityandhowthesecurityassignmentsandresponsibilitiesflowfrommethodtomethodandroletorole.Toaccomplishthat,wewillexplorethreeavenues:
declarativeandprogrammaticsecurityinEJB,theflowofresponsibilitiesfromroletoroleindeterminingsecuritypolicy,andtheflowofsecurityidentitywithinasequenceofmethodcalls.
IMPLEMENTINGSECURITYINEJB
ThesecurityinfrastructureinEJBisimplementedbythecontainerprovider,whilethesecuritypoliciesaredeterminedbyotherEJBrolesatdeploymentandruntime.Inthissection,wediscussthesecurityrequirementspresentedbytheEJBarchitectureandhowtheyaremet.First,weintroducethebasicsecurityconceptsthatyouneedtograspinordertocomprehendtherestofthematerialinthischapter.
Understandingbasicsecurityconcepts
TounderstandthedifferentfeaturesofEJBsecurityandhowthecariouspiecesfittogether,youneedtoknowwhatthebasicsecuritytermsmean.First,webrieflyintroducethoseterms.
Authenticationandauthorization
Authenticationauthorizationresenttwolevelsofsecurityonasystem,suchasacomputersystemoranapplicationrunningonacomputer.Authenticationinvolvesshowingyouridinordertogetintothesystem,forexample,yourloginandpassword.Authorizationdetermineswhatyoucanandcannotdoonceyouareinthesystem.Forexample,firstyoulogontoafileserverusingauthentication.Bytypinginyourloginandpassword.Onceyouareloggedin,youfindasetoffilesthatyoucanonlyread,anothersetoffilesthatyoucanreadandchange,andyetanothersetthatyoucannotevenread.Thisistheauthorizationpartofsecurity.InEJB,authorizationmeansthataclientisauthorizedtocallabeanmethod.
Principalsandroles
APrincipalisanentitythatcanbeauthenticatedbyasystem.Itcanbe,forinstance,anenduseroranapplicationtryingtoaccessanotherapplication.InJava,onceanentityisauthenticatedtoasystemitisrepresentedbyaninstanceofjava.security.Principal.InEJB,aPrincipalcanbeassociatedwithonceormoresecruityrolesdefinedbytheapplicationassembler.
Asecruityrolehasasetofpermissionsassignedtoit.APrincipalcanbemappedtotheseroles,andthenthePrincipalwillhavethepermissionattachedtotherole.Inotherwords,asecurityroleisasetofapplicationpermissionsthatcanbeassignedtoauser(oragroupofusers).
Usersandgroups
Auserisarealpersonwithanaccountonasystem.Agroupisacollectionofusers.Eitherauseroragroupcanbemappedtoalogicalsecurityrole.Intheoperationalenvironment,itistheusersandgroupswhousetheapplication,buttheyliveoutsideofEJB.So,inordertogetintotheEJBapplication,theychangeintoPrincipalsandsecurityroles.
AuserofanEJBapplicationlivesinaspecificoperationalenvironmentandenterstheJavaworldasaPrincipal,andthePrincipalaccessestheapplicationbyacquiringoneormorerolesdefinedwithintheEJBarchitecture.
NOTE
TheEJBarchitecturefordistributedandportableenterpriseapplicationshassomeimplicationsastohowEJBsecurityshouldlook.Let’sexplorethisissuenext.
SecutityinEJB
Implementationofsecurityinanysystemgenerallyinvolvestwostages;implementingthesecurityinfrastructureandallowinganadministratortosetandimplementsecuritypoliciesonagivensystem.Keepingthisinmind,notthatthedistributednatureandtheportabilitycharacteristicoftheEJBarchitecturesetthefollowinggoalsforEJBsecurity:
Separatethesecurityinfrastructurefromthebusinesslogicofanapplication,becausethebeanprovider,whoisanexpertinimplementingbusinesslogic,maynotbeasecurityexpert,andsomeotherrolesare.
RememberthatEJBapplicationsshouldbeportableacrossmultipleEJBservers,andthoseserversmaypossiblybeusingdifferentsecuritymechanisms.
Allowsecuritypoliciestobesetatdeploymentratherthanatcodingtimeinordertosupportportability.
TheEJBroleresponsibilitiesthesecurityinfrastructure.Theapplicationassembler,thedeployer,andthesystemadministratorparticipateinsettingsecuritypolicies.TheEJBspecrecommendsthatthebeanprovidershouldneitherimplementsecuritymechanismsnorhard-codethesecuritypoliciesinthebean’sbusinessmethods.
SecurityinEJBisaboutauthorization,forexample,whocanhaveaccesstoacertainbeanmethod.Theclientsofanapplicationexercisecertainsecurityroles,andthepermissiontocallmethodsisassignedtotheroles.
DEFININGTHESECURITYROLES
Itisthedeployer’sresponsibilitytodeploytheapplicationsecurely.Todothiscorrectlythedeployerneedstoknowwhateachbusinessmethoddoesinordertodeterminewhichusercancallit.However,thedeployerisnotexpectedtogointothesourcecode.Sowehaveaproblem.Hereisthesolution:
theapplicationassemblerhelpsthedeployerbyprovidingthesecurityviewofanapplicationinthedeploymentdescriptor.Thesecurityviewcontainsasetoflogicalsecurityrolesandasetofmethodpermissionsforeachsecurityrole.
Thedeploymentdescriptorcontainstwopartshatarerelatedtosecurity:
Theapplicationassemblerisresponsibleforthefollowing:
Definingeachsecurityroleusinga
Definingthe
Definingthe
Asecurityroleappliestoalltheenterprisebeansinthesameejb-jarfile.Listing14.1showstwosecrityrolesdefinedwithinthe
Twosecurityrolesnamedemployeeandhr-directordefinedwithinthe
Listing14.1
Inagiven
Therolenameinthe
NOTE
SecurityinEJBisaboutauthorization,namely,permissionstocallthebeanmethods.Thisisimplementedintwosteps:
grantingmethodpermissionstosecurityrolesandmappingsecurityrolestoPrincipals,whichrepresentusers.
Let’sexaminehowmethodpermissionsaredefinedandgranted.
DEFININGMEHODPERMISSIONS
Afterdefiningthesecurityroles,theapplicationassemblercanassignmethodpermissionstotheroles,thatis,themethodsofabeanthatauserinthatrolecancall.Theassemblercanassignanyofthemethodsexposedinthecomponentandhomeinterfacesofabeantoarole.Wediscussfourdifferenttechniquesforassigningmethodpermissionstoarole.
Grantingpermissiontoallmethods
Byusingthewildcard*,theapplicationassemblercangrantarolepermissiontoallthemethodsinthehomeandcomponentinterfacesofabean.Anexampleisshownhere:
Thiscodemeansthattherolehr–directorhasbeengrantedpermissiontocallallmethodsinthehomeandcomponentinterfacesofthebeansEmployeeRecordBeanandEmployeeProgressBean.Inotherotherwords,abeanclientintheroleofhr-directorcanallanymethodfromtheclientviewsofthebeansEmployeeRecordBeanandEmployeeProgressBean.
Thisisasweepingauthorizationforarolebutnotanultimateone.Theultimateauthorizationwouldbethatanyclientcouldcallanymethodofabeanwithoutbeingcheckedforauthorization,andthatisaccomplishedwiththe
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- EJB 安全性 中英文 资料 外文 翻译 文献