LoginSignup
1
4

More than 5 years have passed since last update.

脆弱性診断などで、cookieをsecureにしましょうと言われた時に

Last updated at Posted at 2017-11-10

常時SSL化にともなって最近指摘が多くなってきて、その際に時間もなくプログラムのソースコードをすべてチェックできない場合に

mod_headers.so を有効にしてから

すいません、やってませんでしたの場合、cookie を強制セキュア


Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure

すでに設定している箇所があるかもという場合に、セキュア設定にしている場所をチェックして最適化


Header edit Set-Cookie ^(.);\s?Secure;?\s?(.);\s?Secure;?\s?(.)$ "$1; $2; $3; Secure"
Header edit Set-Cookie ^(.);\s?HttpOnly;?\s?(.);\s?HttpOnly;?\s?(.)$ "$1; $2; $3; HttpOnly"
Header edit Set-Cookie ^(.);\s?;\s?(.)$ "$1; $2"

こちらの設定をいつも入れておけば・・安心ですね。

備忘録でした。

1
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
4