웹사이트에 어떤 권한이 필요합니까?

내용물


  • Intro
  • Feature Policy
  • Permissions Policy
  • Summary

  • 소개

    Continuing on from my previous blog about website security week , 우리는 웹사이트의 기능 및 권한에 대해 이야기할 것입니다.

    이는 사이트가 제공될 때 사이트의 헤더로 설정됩니다.

    기능 정책

    The feature policy was introduced several years ago and allows you to limit the web features that your website and anything embedded including iframes can use.

    This helps protect your users from anything running that shouldn't be and accessing any web features that you didn't intend.

    Here are some of the most important features to enable/disable:

    • accelerometer
    • camera
    • geolocation
    • gyroscope
    • magnetometer
    • microphone
    • payment
    • usb
    The full list can be found on Modzilla .

    사용 예:

    feature-policy: accelerometer 'none'; camera 'none'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; payment 'none'; usb 'none'
    


    허용되는 값은 다음과 같습니다.
  • * - 모든 최상위 사이트 및 포함된 콘텐츠에서 기능을 허용합니다
  • .
  • self - 모든 최상위 사이트 및 포함된 콘텐츠에서 기능을 허용하지만 중첩 컨텍스트에서 원본 문서를 교차할 수 없음
  • <origin> - 특정 원점에 대한 기능을 허용합니다. 이 경우 <origin>를 사용하려는 원점
  • 으로 바꿉니다.
  • none - 기능을 비활성화합니다
  • .

    권한 정책

    The features policy has been superseded by the better named Permissions Policy. I would still recommend setting both to support older browsers.

    It supports the same features as the Features Policy but with a slightly different syntax.

    In features policy it would look like:

    feature-policy: accelerometer 'none'; camera 'self'; geolocation 'self' https://google.com
    

    which translates to:

    permissions-policy: accelerometer=(), camera=(self), geolocation=(self "https://google.com")
    

    Really simple to convert from the old policy and a slightly nicer syntax too!

    요약

    In summary, it's really easy to set two additional headers to help improve the security of your site. Denying permission to unused features limits the risk to your users and the possibilities if there is a breach of any untoward web features being used.

    Set those headers now!

    Happy Building!

    좋은 웹페이지 즐겨찾기