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

[WIP] feat: Cookie auditor script #3

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft

Conversation

EnMod
Copy link
Contributor

@EnMod EnMod commented Nov 11, 2021

Description

This PR aims to add a script for the purpose of gathering cookies from our sites to be audited. Additionally, the script compares this new, gathered data against a set of base data (usually from a previous run), and records added/removed cookies since that base data was made.

This script was originally designed to be run locally as opposed to from an npm package, but work will be done to make the logic package-friendly.

Why?

Manual cookie audits take quite a long time. They involve the opening of browsers, clearing of caches, opening of tabs, manual copy-pasting of data into a spreadsheet...there are many points of failure and processes to keep track of.

With a highly automated process using Playwright, human error is minimized (if not, eliminated), time taken to gather the data is dramatically reduced, and data from browsers using three different engines can be gathered in an efficient, quick way.

"Highly automated"?

While much of the tedious work of opening browsers/tabs, navigating to sites, copying cookie data etc. is automated away with this script, there is still a manual step.

Each cookie's intended use, and which entities have third-party access to its data, have to be manually-researched and added to the final results data, under the "Third-party access?" and "What does it intend to store?" columns. This should be done to the results data exported after the data comparison step.

Why is this a script and not a package?

It was initially developed and intended for local running, as a utility to aid in cookie auditing. However, it can be converted into an npm package with some work to externalize its inputs and outputs, such that they aren't required to be colocated with the script.

Remaining work to convert this script into a package is being tracked via Asana.

Long-term

  • Writing tests? This script was meant as a utility (and makes use of a package intended for testing), but it is rather large; tests can only help here to ensure it's all running smoothly.

PR Checklist 🚀

  • Conduct thorough self-review.
  • Add or update tests as appropriate.
  • Write a useful description (above) to give reviewers appropriate context.
  • Identify (in the description above) and document (add Asana tasks on this board) any technical debt that you're aware of, but are not addressing as part of this PR.

@changeset-bot
Copy link

changeset-bot bot commented Nov 11, 2021

⚠️ No Changeset found

Latest commit: 96fc41b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment on lines +62 to +64
// ==============
// Functions used
// ==============
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This thing is a monster, I'm aware 😅 Each of these functions can likely be reworked to live in their own files, but the current state of this file reflects my process developing the logic.

scripts/cookie-auditor/run/index.js Show resolved Hide resolved
scripts/cookie-auditor/run/index.js Outdated Show resolved Hide resolved
@EnMod EnMod changed the title script: Cookie auditor [WIP] script: Cookie auditor Nov 12, 2021
@hashicorp-cla
Copy link

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

@EnMod EnMod changed the title [WIP] script: Cookie auditor [WIP] feat: Cookie auditor script Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants