-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix!: migrated from cookieyes to a custom cookie solution
Co-authored-by: meza <[email protected]> Co-authored-by: SJ Hayman <[email protected]>
- Loading branch information
1 parent
8701777
commit 36115e2
Showing
76 changed files
with
2,840 additions
and
323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ jobs: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
with: | ||
command: install | ||
node-version: "19.7.0" | ||
node-version: "latest" | ||
junit-report-path: "reports/junit.xml" | ||
cobertura-report-path: "reports/**/cobertura-coverage.xml" | ||
build: | ||
|
@@ -29,7 +29,7 @@ jobs: | |
uses: meza/action-setup-node-npm@main | ||
with: | ||
command: install | ||
node-version: 19.7.0 | ||
node-version: latest | ||
cache-name: ${{ needs.verify.outputs.cache-name }} | ||
- name: 🔂 CDK Cache | ||
uses: pat-s/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ jobs: | |
uses: meza/action-setup-node-npm@main | ||
with: | ||
command: install | ||
node-version: 19.7.0 | ||
node-version: latest | ||
cache-name: 'playwright' | ||
- name: Create envfile | ||
uses: SpicyPizza/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
11 | ||
13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# 12. Session Cookie Same Site None | ||
|
||
Date: 2023-03-25 | ||
|
||
## Status | ||
|
||
Accepted | ||
|
||
## Context | ||
|
||
We've fought long and hard to keep the session cookie same-site: lax at the minimum however we've been running into a lot | ||
of issues. | ||
|
||
Mainly that during the authorization process, the cookie wouldn't be sent back to us when auth0 makes a POST request to the | ||
callback URL. | ||
|
||
This meant that the cookie consent, the theme setting and the visitor ID all got wiped out and forgotten. | ||
|
||
## Decision | ||
|
||
The decision is to use the SameSite: None setting, like most of the internet does. | ||
|
||
## Consequences | ||
|
||
While this doesn't pose too much of an added security risk, it's still not as secure as it could be. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# 13. Custom Cookie Consent | ||
|
||
Date: 2023-04-02 | ||
|
||
## Status | ||
|
||
Accepted | ||
|
||
## Context | ||
|
||
The cookie laws in the EU are rather strict and require that users are informed about the cookies that are being used on | ||
a website and that they have the ability to opt out of cookies that are not necessary for the website to function. | ||
|
||
One of the main specifics of this is that cookies **cannot be stored** until the user has given their consent. | ||
|
||
It is common practice to use third party providers for the consent management. | ||
|
||
We've explored the use of: | ||
|
||
- [Cookiebot](https://www.cookiebot.com/en/) | ||
- [CookieYes](https://www.cookieyes.com/) | ||
- [OneTrust](https://www.onetrust.com/) | ||
|
||
... and a few more. | ||
|
||
What we've discovered is that the way these providers work is by injecting a script into the page which then intercepts | ||
all the subsequent <script> tags and replaces them with a script that will only be executed if the user has given consent. | ||
|
||
This is a problem when you're aiming to also have a high level of XSS protection in place. | ||
|
||
These scripts will remove the script tags and then inject them back into the page, which means that the browser will block | ||
the script from executing. | ||
|
||
This is a general problem across the board with all of these providers. | ||
|
||
## Decision | ||
|
||
In order to have both a secure solution and a solution that is compliant with the EU cookie laws, we've decided to build | ||
our own solution. | ||
|
||
## Consequences | ||
|
||
Due to this, there is a bit more maintenance involved in keeping the solution up to date. | ||
|
||
- We need to hand-craft the cookie policies that list out the cookies we use and what they are used for. | ||
- We need to keep the cookie policies up to date with any changes to the cookies we use. | ||
|
||
The other unfortunate consequence / trade-off is that when the user does give consent, we *must* perform a page | ||
reload in order to inject the scripts that were blocked by the browser. | ||
|
||
It's a small price to pay for the security and compliance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.