Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new APIs to customize content security policy for non-HTML responses #39398

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Commits on Jun 16, 2020

  1. Generate content security policy for non-HTML responses

    One feature of the content security policy DSL, though undocumented,
    is that it will not generate headers for non-HTML responses, even if a
    configuration is explicitly provided. While it may not seem obvious
    that anyone would want to send this header in an API response, Mozilla
    Observatory, for instance, recommends the following for API responses:
    
    `Content-Security-Policy: default-src 'none'; frame-ancestors 'none'`
    
    (source: https://observatory.mozilla.org/faq/)
    
    The Secure Headers gem also makes recommendations about the content
    security policy for API responses: https://github.com/github/secure_headers#api-configurations
    
    As such, this removes the HTML guard clause from the
    `ContentSecurityPolicy` middleware.
    imtayadeway committed Jun 16, 2020
    Configuration menu
    Copy the full SHA
    05344fc View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2020

  1. Configuration menu
    Copy the full SHA
    b840a7d View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2020

  1. Configuration menu
    Copy the full SHA
    2aa6585 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2ea33e8 View commit details
    Browse the repository at this point in the history
  3. Approximating a solution

    imtayadeway committed Jul 6, 2020
    Configuration menu
    Copy the full SHA
    12a0048 View commit details
    Browse the repository at this point in the history
  4. Parse the content_type

    imtayadeway committed Jul 6, 2020
    Configuration menu
    Copy the full SHA
    0731722 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2020

  1. Some metaprogramming

    imtayadeway committed Jul 8, 2020
    Configuration menu
    Copy the full SHA
    418fa0b View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2020

  1. Refactory

    imtayadeway committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    0105939 View commit details
    Browse the repository at this point in the history
  2. ...and we're green

    imtayadeway committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    9a7c513 View commit details
    Browse the repository at this point in the history
  3. sort n merge

    imtayadeway committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    d14792f View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2020

  1. Warn on no policy

    imtayadeway committed Jul 22, 2020
    Configuration menu
    Copy the full SHA
    8f54f18 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    88c02f9 View commit details
    Browse the repository at this point in the history