Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in
haskell-gargantext
haskell-gargantext
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 154
    • Issues 154
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 7
    • Merge Requests 7
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • gargantext
  • haskell-gargantexthaskell-gargantext
  • Merge Requests
  • !237

Merged
Opened Jan 15, 2024 by Alfredo Di Napoli@AlfredoDiNapoli
  • Report abuse
Report abuse

Sanitise logged requests

Fixes #298 (closed).

This commit introduces a slight variation to the logStdOutDev middleware which is capable of redacting secrets from our gargantext requests.

This way we can run the server in dev mode (for instrumentation purposes) without leaking users' secrets.

@anoe Thanks to this patch, we now obfuscate in the logs things like the login password and the PubMed API key supplied for corpus searches. If you have in mind other sensitive information we might be leaking, feel free to share them here, or add the relevant keyword to the list called sensitiveKeywords inside Gargantext.API.Middleware.

We filter these keywords from any JSON body payload and from any query parameter (in case of GET requests).

It took me more than expected to code this patch as wai-extra didn't make it super easy to accomplish what we wanted, and I had to crib some code over.

Demo

When running the server with Dev mode enabled, this was the output before this patch:

Screenshot_2024-01-15_at_12.15.35

This is the result after:

Screenshot_2024-01-15_at_16.13.53

Screenshot_2024-01-15_at_16.14.44

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b adinapoli/issue-298 origin/adinapoli/issue-298

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout origin/dev
git merge --no-ff adinapoli/issue-298

Step 4. Push the result of the merge to GitLab

git push origin dev

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 0
  • Commits 1
  • Pipelines 1
  • Changes 8
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View project labels
Reference: gargantext/haskell-gargantext!237

Revert this merge request

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.