舞台裏

Qiita が表でこっちが裏。こっそりやっていく。

2017-04-01から1ヶ月間の記事一覧

34. Run-As Authentication Replacement

34. Run-As Authentication Replacement 34.1 Overview The AbstractSecurityInterceptor is able to temporarily replace the Authentication object in the SecurityContext and SecurityContextHolder during the secure object callback phase. Abstract…

HttpFirewall について勉強

HttpServletRequest や HttpServletResponse をラップして、危険な操作を未然に防ぐ機能。 結構いろんなことやってるのかなぁとか思ってたけど、意外とやってることは少なくて、書くこともあまりなかった。

Formログインに関する微調整とかを調査中

ログインURL の変更とか、そういうのをこまごま検証中。 assertjGen にバグ報告があったりとか、 JDT2017 の登録とか、ぴあの情報流出問題の確認とか、明日の関Java の準備とか色々別作業で手を取られたのであまり進んでない。

同時セッション制御についていろいろ試した

<concurrency-control> の error-if-maximum-exceeded を true にした場合で、 Remember-Me を組み合わせた場合にうまくエラー制御ができない問題を色々試した。 結局、回避方法は分からなかった。 実装見る限り、回避は無理っぽい気がするが、、、</concurrency-control>

6.3.3 Session Management

Detecting Timeouts You can configure Spring Security to detect the submission of an invalid session ID and redirect the user to an appropriate URL. あなたは、無効なセッションIDが渡されたことを検出し、適切な URL にリダイレクトするために Spr…

SessionManagementFilter の価値がようやくわかった気がする

Session Management について勉強開始。 翻訳は以前していた。 SessionManagementFilter セッション管理するフィルター。 SecurityContextRepository に SecurityContext が無かったら何もしない あったら Authentication を取り出す Authenticaiton が匿名…

HPKP について調べてたけどあきらめた

HPKP (HTTP Public Key Pinning) について調べてたが、あきらめた。 pin の設定がよくわからんし、上手くブロックされたところを調べるための環境を用意するのが面倒そう。 それに 自堕落な技術者の日記 : HPKP(HTTP Public Key Pinning)公開鍵ピニングにつ…

Spring Security メモを分割したった

Spring Security のメモが自分でも引くほど長くなってきたので、いくつかの記事に分割した。 スクロールバーが現実的な長さになった気がする。 Qiita はとくに文字数制限とかはないっぽいが、あまりにも長くなってくるとプレビューがまともに動かなくなって…

X-XSS-Protection を試した

<%@page contentType="text/html" pageEncoding="UTF-8"%> <html> <head> <meta charset="utf-8" /> <title>Reflected XSS</title> </head> <body> <h1>Reflected XSS</h1> ${param["q"]} </body> </html> こんな感じの JSP を作って、 “?q=alert("Hey”);“ みたいなクエリパラメータを乗せたリクエストを送る。 X-XSS-Protection ヘッダーが設定され…

Strict-Transport-Security を試した

HTTP Strict-Transport-Security の動作について実際に動かして試した。 HTTPS 通信の検証については、 Payara (GlassFish) を使っていればデフォルトで 8181 ポートにアクセスすれば HTTPS で通信できるので、それを利用(証明書の作成とかインポートとか面…

X-Frame-Options の変更を試した

デフォルトだとレスポンスヘッダーに Cache-Control: no-cache, no-store, max-age=0, must-revalidate Pragma: no-cache Expires: 0 X-Content-Type-Options: nosniff X-Frame-Options: DENY X-XSS-Protection: 1; mode=block がついていることを確認。 こ…

20.2.3 DelegatingRequestMatcherHeaderWriter

20.2.3 DelegatingRequestMatcherHeaderWriter At times you may want to only write a header for certain requests. ときどき、あなたは一定のリクエストでだけヘッダーを書きたいと思うことでしょう。 For example, perhaps you want to only protect you…

20.2.2 Headers Writer

20.2.2 Headers Writer When the namespace or Java configuration does not support the headers you want, you can create a custom HeadersWriter instance or even provide a custom implementation of the HeadersWriter. namespace か Java Configurat…

20.2 Custom Headers, 20.2.1 Static Headers

20.2 Custom Headers Spring Security has mechanisms to make it convenient to add the more common security headers to your application. Spring Security はより共通のセキュリティヘッダーをアプリケーションに追加することを便利にするメカニズムを…

20.1.8 Referrer Policy

20.1.8 Referrer Policy Referrer Policy is a mechanism that web applications can leverage to manage the referrer field, which contains the last page the user was on. Referer ポリシーは Web アプリケーションがユーザーが最後にアクセスしていた…

20.1.7 Content Security Policy (CSP)

20.1.7 Content Security Policy (CSP) Content Security Policy (CSP) is a mechanism that web applications can leverage to mitigate content injection vulnerabilities, such as cross-site scripting (XSS). Content Security Policy は、 Web アプリ…

20.1.6 X-XSS-Protection

正しさの保証なんてものは(ry 20.1.6 X-XSS-Protection Some browsers have built in support for filtering out reflected XSS attacks. いくつかのブラウザは Refrected XSS 攻撃を回避する組み込みのサポートを持っています。 ※Referected XSS 攻撃 反…

20.1.5 X-Frame-Options

正しさの保証なんてものはない。 ※印で始まる文章は本文にはない、私個人の感想やコメント・注釈です。 20.1.5 X-Frame-Options Allowing your website to be added to a frame can be a security issue. Web サイトをフレームに追加できることを許可すると…