资源描述:
《ajax in action security and ajax》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、iTePub.Net-CollectSecurityandAjaxThischaptercovers■TheJavaScriptsecuritymodel■Remotewebservices■Protectingusers’dataontheInternet■ProtectingyourAjaxdatastreams246LicensedtojonathanzhengiTePub.Net-CollectJavaScriptandbrowsersecurity247Sec
2、urityisanincreasinglyimportantconcernforInternetservices.TheWebisinherentlynonsecure,andaddingpropersecuritymeasurestoanAjaxapplicationcanbeastrongdifferentiatorforaproduct.Clearly,ifauser’smoneyisinvolvedinanyway,suchasonlineshoppingorprovidingaservicethat
3、hehaspaidfor,givingdueconsiderationtosecurityisessential.Securityisabigtopicanddeservesitsownbook.ManyofthesecurityissuesthatanAjaxapplicationfacesarethesameasforaclassicalwebapplication.Forthesereasons,we’lllimitourdiscussiontosecurity-relatedconcernsthath
4、aveparticularimplicationsforAjax.First,we’lllookatthesecurityimplicationsofshuntingexecutablescriptsaroundthenetwork,andthestepsthatthebrowservendorshavetakentomakethisasafeexperience.We’llalsoseethestepsthatmaybetakentorelaxthesesafeguards,withtheuser’scom
5、pliance.Second,we’lllookatprotectingauser’sdatawhenitissubmittedtotheserver,allowingausertoworkwithourAjaxservicesconfidently.Finally,we’lldescribewaystosecurethedataservicesthatourAjaxclientsusetopreventthemfrombeingusedille-gitimatelybyexternalentitiesont
6、henetwork.Let’skickoffnowwithalookatthesecurityimplicationsofsendingourclientacrossthenetwork.7.1JavaScriptandbrowsersecurityWhenanAjaxapplicationislaunched,thewebserversendsasetofJavaScriptinstructionstoawebbrowserrunningonadifferentmachine,aboutwhichitkno
7、wsverylittle.Thebrowserproceedstoexecutetheseinstructions.Inlettingtheirwebbrowserdothis,theuserofanAjaxapplicationisplacingasignificantamountoftrustintheapplicationanditsauthors.Thebrowservendorsandstan-dardsbodiesrecognizedthatthistrustwasnotalwaysappropr
8、iate,andhaveputsafeguardsinplacetopreventitfrombeingabused.Inthissection,we’lllookatthesafeguardsandhowtoworkwiththem.We’llthendiscusssituationswheretheconstraintsaren’tappropriateandcanthusberelaxed.T