脆弱性診断などで、cookieをsecureにしましょうと言われた時に
常時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"
こちらの設定をいつも入れておけば・・安心ですね。
備忘録でした。
Author And Source
この問題について(脆弱性診断などで、cookieをsecureにしましょうと言われた時に), 我々は、より多くの情報をここで見つけました https://qiita.com/atakaha/items/930b83d912df3dd823e5著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .