2010-05-06 41 views
1

在我的應用程序,要求只有某些網頁需要使用SSL進行保護,所以我將其配置JSF SSL哈扎德

security-constraint> 
<display-name>Security Settings</display-name> 
<web-resource-collection> 
    <web-resource-name>SSL Pages</web-resource-name> 
    <description/> 
    <url-pattern>/*.jsp</url-pattern> 
    <http-method>GET</http-method> 
    <http-method>POST</http-method> 
</web-resource-collection> 
<user-data-constraint> 
    <description>CONFIDENTIAL requires SSL</description> 
    <transport-guarantee>CONFIDENTIAL</transport-guarantee> 
</user-data-constraint> 

,並添加過濾器

http://blogs.oracle.com/jluehe/entry/how_to_downshift_from_https

但只有一個危險在那裏,我正在使用richFaces。一旦它轉到HTTPS,它不會改變頁面,我的意思是如果我執行後操作,它實際上並沒有發生。但是,如果我從當地bmachine的瀏覽器去做它完美的作品從HTTPS遠程瀏覽器,它stucks後

其不改變,這裏是我的web.xml的快照

<filter> 
    <filter-name>MyFilter</filter-name> 
    <filter-class>MyFilter</filter-class> 
    <init-param> 
     <param-name>httpPort</param-name> 
     <param-value>8080</param-value> 
    </init-param> 
</filter> 

<filter-mapping> 
    <filter-name>MyFilter</filter-name> 
    <url-pattern>/*</url-pattern> 
</filter-mapping> 

<security-constraint> 
    <web-resource-collection> 
     <web-resource-name>Protected resource</web-resource-name> 
     <url-pattern>somePattern</url-pattern> 
     <http-method>GET</http-method> 
    <http-method>POST</http-method> 


    </web-resource-collection> 
    <user-data-constraint> 
     <transport-guarantee>CONFIDENTIAL</transport-guarantee> 
    </user-data-constraint> 
</security-constraint> 

和RichFaces的一些其他過濾器。問題很奇怪,如果我嘗試從本地計算機的瀏覽器訪問網絡應用程序,它可以正常工作,但是在遠程計算機的瀏覽器進入HTTP後,該頁面的所有表單以及href停止工作(使用JSF,facelet)。

回答

1

在我的申請中需要 個只有某些網頁需要使用SSL進行保護 ,所以我將其配置

由用戶提交的信息是不是你擔心的唯一的事情。總之你正在努力完成的是一個漏洞。

僅限於如果用戶不再對您的應用程序進行身份驗證,則此時間很安全。通過這樣做,您將以明文形式發送您的SESSION ID。會話ID用於驗證瀏覽器,如果攻擊者通過XSS或通過嗅探線獲取該值,則不需要用戶名/密碼。

這是對OWASP十大2010 A3-Broken Authentication and Session Management

+0

最常被誤解的部分沒有得到你魯克。 本地計算機不存在問題,如果我只從遠程計算機訪問它,則存在問題。導入後還需要證書。 – 2010-05-07 04:40:03

+0

@java初學者我在說的是你的答案的開頭語句是一個漏洞:'在我的應用程序中,只需要使用SSL保護某些頁面,所以我配置了' – rook 2010-05-07 05:46:00

+0

'仍然沒有得到。 – 2010-05-07 06:53:01