2017-02-16 23 views
0

を指摘:ワークフロー管理コンソールでは動作しません:可能なCSRF攻撃は、私が持っているもの

のAlfresco共有v5.2.d(r134641-B15、Aikauの1.0.101.3、春サーフ 5.2.d、春WebScripts 6.13、Freemarkerの2.3.20-屋外-パッチし、ライノ1.7R4-屋外-パッチし、唯2.9.0-屋外-20141223)

AlfrescoのコミュニティV5.2.0(r134428-B13)スキーマ10005

ワークフロー管理コンソールを使用したいと思います。例えばhttp://....:8080/alfresco/s/admin/admin-workflowconsole

私は、プロセスの定義を削除し、すべてのプロセス定義を見ることができるようにしたいと思い、など

:コンソールは、リンクで入手可能です

show definitions all 
undeploy definition ... 
use definition ... 

etc 

アクセスした後コンソールは、私は、任意のコマンドを実行しようとするが、これは例外(画面からコピー)を取得:

HTTP Status 500 - Possible CSRF attack noted when comparing token in session and request parameter. Request: POST /alfresco/s/admin/admin-workflowconsole 

type Exception report 

message Possible CSRF attack noted when comparing token in session and request parameter. Request: POST /alfresco/s/admin/admin-workflowconsole 

description The server encountered an internal error that prevented it from fulfilling this request. 

exception 

javax.servlet.ServletException: Possible CSRF attack noted when comparing token in session and request parameter. Request: POST /alfresco/s/admin/admin-workflowconsole 
    org.springframework.extensions.webscripts.servlet.CSRFFilter$AssertTokenAction.run(CSRFFilter.java:845) 
    org.springframework.extensions.webscripts.servlet.CSRFFilter.doFilter(CSRFFilter.java:312) 
    org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:68) 

ワークフロー管理コンソールを設定するには、どのように?ウェブ・クライアント・セキュリティ-config.xmlには CSRFPolicyセグメントのデフォルト設定を持っているとビアを上書きすることができ

Axel Faustによって書かれたとおり、

:私は何をしようとしていた

alfresco/extensionパスの web-scripts-config-custom.xmlファイル。

はこのように、私は、ファイルweb-scripts-config-custom.xmlを作成し、ルールを逃すことに加えて、パス/opt/alfresco-community/tomcat/shared/classes/alfresco/exten‌​sion下に置か:

<alfrescoco-config> 
    <config evaluator="string-compare" condition="CSRFPolicy" replace="true"> 
     <filter> 
     <rule> 
      <request> 
       <method>GET</method> 
       <path>/service/admin/.*</path> 
      </request> 
      <action name="generateToken"> 
       <param name="session">{token}</param> 
       <param name="cookie">{token}</param> 
      </action> 
     </rule> 
     <rule> 
      <request> 
       <method>GET</method> 
       <path>/s/admin/.*</path> 
      </request> 
      <action name="generateToken"> 
       <param name="session">{token}</param> 
       <param name="cookie">{token}</param> 
      </action> 
     </rule> 
     </filter> 
    </config> 
</alfresco-config> 

それは動作しません...

私がいっぱい追加設定:それは動作しません

<alfresco-config> 

    <!-- 
     CSRF filter config to mitigate CSRF/Seasurfing/XSRF attacks 

     To disable the CSRF filter override the <filter> to not contain any values, for example: 
     <config evaluator="string-compare" condition="CSRFPolicy" replace="true"> 
      <filter/> 
     </config> 

     @since 5.2 
    --> 
    <config evaluator="string-compare" condition="CSRFPolicy"> 

     <!-- 
     Force creation of a Session when the filter matches a path - this should only be used when you are 
     confident the filtered part of the web application is using an authentication mechanism that will avoid 
     protected pages being accessed until the user is authenticated. Otherwise this would be a route to 
     a Session fixation attack. 
     --> 
     <session>true</session> 

     <!-- 
     Properties that may be used inside the rest of the CSRFPolicy config to avoid repetition but 
     also making it possible to provide different values in different environments. 
     I.e. Different "Referer" & "Origin" properties for test & production etc. 
     Reference a property using "{propertyName}". 
     --> 
     <properties> 

     <!-- There is normally no need to override this property --> 
     <token>alf-csrftoken</token> 

     <!-- 
      Override and set this property with a regexp that if you have placed Alfresco behind a proxy that 
      does not rewrite the Referer header. 
     --> 
     <referer></referer> 

     <!-- 
      Override and set this property with a regexp that if you have placed Alfresco behind a proxy that 
      does not rewrite the Origin header. 
     --> 
     <origin></origin> 
     </properties> 

     <!-- 
     Will be used and exposed to the client side code in Admin.CSRF 
     Use the Admin.CSRF.getHeader() or Admin.CSRF.getParameter() with Admin.CSRF.getToken() 
     to set the token in custom 3rd party code. 
     --> 
     <client> 
     <cookie>{token}</cookie> 
     <header>{token}</header> 
     <parameter>{token}</parameter> 
     </client> 

     <!-- The first rule with a matching request will get its action invoked, the remaining rules will be ignored. --> 
     <filter> 

     <!-- Refresh token on each new page visit --> 
     <rule> 
      <request> 
       <method>GET</method> 
       <path>/service/enterprise/admin/.*</path> 
      </request> 
      <action name="generateToken"> 
       <param name="session">{token}</param> 
       <param name="cookie">{token}</param> 
      </action> 
     </rule> 
     <rule> 
      <request> 
       <method>GET</method> 
       <path>/s/enterprise/admin/.*</path> 
      </request> 
      <action name="generateToken"> 
       <param name="session">{token}</param> 
       <param name="cookie">{token}</param> 
      </action> 
     </rule> 
     <rule> 
      <request> 
       <method>GET</method> 
       <path>/service/admin/.*</path> 
      </request> 
      <action name="generateToken"> 
       <param name="session">{token}</param> 
       <param name="cookie">{token}</param> 
      </action> 
     </rule> 
     <rule> 
      <request> 
       <method>GET</method> 
       <path>/s/admin/.*</path> 
      </request> 
      <action name="generateToken"> 
       <param name="session">{token}</param> 
       <param name="cookie">{token}</param> 
      </action> 
     </rule> 

     <!-- 
      Verify multipart requests contain the token as a parameter 
      and also correct referer & origin header if available 
     --> 
     <rule> 
      <request> 
       <method>POST</method> 
       <header name="Content-Type">multipart/.+</header> 
      </request> 
      <action name="assertToken"> 
       <param name="session">{token}</param> 
       <param name="parameter">{token}</param> 
      </action> 
      <action name="assertReferer"> 
       <param name="referer">{referer}</param> 
      </action> 
      <action name="assertOrigin"> 
       <param name="origin">{origin}</param> 
      </action> 
     </rule> 

     <!-- 
      Verify that all remaining state changing requests contain a token in the header and correct referer & origin headers 
      if available. We "catch" all content types since just setting it to "application/json.*" since a webscript that doesn't 
      require a json request body otherwise would be successfully executed using i.e."text/plain". 
     --> 
     <rule> 
      <request> 
       <method>POST|PUT|DELETE</method> 
      </request> 
      <action name="assertToken"> 
       <param name="session">{token}</param> 
       <param name="header">{token}</param> 
      </action> 
      <action name="assertReferer"> 
       <param name="referer">{referer}</param> 
      </action> 
      <action name="assertOrigin"> 
       <param name="origin">{origin}</param> 
      </action> 
     </rule> 
     </filter> 

    </config> 

</alfresco-config> 

...

としては、私は、次のweb.xmlに追加し、hereを説明した:私は、以下の方法により、CSRFフィルターを無効にしてみました...

<filter-mapping> 
     <filter-name>CSRF Token Filter</filter-name> 
     <url-pattern>/service/admin/*</url-pattern> 
    </filter-mapping> 

    <filter-mapping> 
     <filter-name>CSRF Token Filter</filter-name> 
     <url-pattern>/s/admin/*</url-pattern> 
    </filter-mapping> 

それは動作しません

を:

<alfresco-config> 
    <config evaluator="string-compare" condition="CSRFPolicy" replace="true"> 
     <filter/> 
    </config> 
</alfresco-config> 

動作しません...

ワークフロー管理コンソールの設定方法は?

私は情報に非常に感謝します。ありがとうございます。

+0

このコミュニティリンクhttps://community.alfresco.com/thread/228162-hitting-csrf-when-trying-to-use-the-workflowを参照してください。 -admin-console – vikash

+0

Axel Faustは既にこの記事を指摘してくれてありがとうございます。私はすでにそれを読んでいますが、自分の設定で 'web-scripts-config-custom.xml'というファイルが見つかりませんでした。代わりに、私は 'web-client-security-config.xml'を使い、それに欠落しているルールを追加しました。 –

+0

このファイルは '/ opt/alfresco-community/tomcat/webapps/alfresco/WEB-INF/classes/alfresco'からコピーされ、'/opt/alfresco-community/tomcat/shared/classes/alfresco/extension'を実行した後、再デプロイされましたが、古いファイル 'web-client-security-config.xml'は'/webapps/'に残りました。次に、私の 'web-client-security-config.xml'を'/opt/alfresco-community/tomcat/shared/classes/alfresco/'に追加しましたが、助けにはなりませんでした。どのような設定を使用し、どこに配置する必要がありますか? –

答えて

2

は最後に、私は私のミスを見つけた!..

代わりのweb-scripts-config-custom.xml私はweb-script-config-custom.xmlを作成しました。私は手紙 'を拝見しました。'

すべてはOKです。

は、非常に多くのAxel Faustをありがとう!..

関連する問題