Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions content/docs/defenses/isolation-policies/framing-isolation.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def allow_request(req):
return False
```

IMPORTANT: To ensure the policy works well under caching, you must additionally include `Sec-Fetch-Dest`, `Sec-Fetch-Mode`, and `Sec-Fetch-Site` in the `Vary` response header.

## Considerations
Framing Isolation Policy cannot be applied if an endpoint allows framing requests from specific origins via `X-Frame-Options` and/or Content Security Policy's
`frame-ancestors` directive.
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@ def allow_request(req):
# Allow all other requests
return True
```

IMPORTANT: To ensure the policy works well under caching, you must additionally include `Sec-Fetch-Mode` and `Sec-Fetch-Site` in the `Vary` response header.

## References
[^secmetadata]: Fetch Metadata Request Headers playground, [link](https://secmetadata.appspot.com/)
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def allow_request(req):
return False
```

IMPORTANT: To ensure the policy works well under caching, you must additionally include `Sec-Fetch-Dest`, `Sec-Fetch-Mode`, and `Sec-Fetch-Site` in the `Vary` response header.

## Considerations
It should be safe to set a `Cross-Origin-Resource-Policy: same-site` response header on all requests that have not explicitly been exempted from Resource Isolation Policy. See [CORP]({{< ref "../opt-in/corp.md" >}}).

Expand Down
2 changes: 2 additions & 0 deletions content/docs/defenses/isolation-policies/strict-isolation.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def allow_request(req):
return True
```

IMPORTANT: To ensure the policy works well under caching, you must additionally include `Sec-Fetch-Site` in the `Vary` response header.

## Implementation with SameSite cookies
If a server sends a cookie with the [`SameSite=strict`]({{< ref "../opt-in/same-site-cookies/#samesite-cookie-modes" >}}) flag, any returned request that doesn't contain that cookie can be rejected, as showcased in this snippet:

Expand Down