OpenFn / OpenFn/lightning

Add CSP to router.ex

Open
#59 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

security
Dominant language
Elixir
Stars
296
Forks
86
Avg merge
1d 13h
Merged PRs (30d)
50

Description

Something like, but not quite:

plug :put_secure_browser_headers, %{"content-security-policy" => "default-src 'self'"}

ToDo:

  • Add a sensible CSP to the router
  • Remove the exception for this rule from sobelow and

Notes:

First attempt: https://github.com/nccgroup/sobelow/issues/61#issuecomment-610660542
Stu says: "The issue with this policy is that all inline styles, svgs etc are blocked. This also includes any DOM changes that LiveView sends that do things inline styles like display: none; also don't work."

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in router.ex and review the existing Sobelow exception for this rule. Compare the proposed CSP with the notes about inline styles, SVGs, and LiveView DOM updates, then verify the policy with the relevant Sobelow checks. Done means a sensible router CSP is in place and the exception is removed without breaking the noted LiveView behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
backend, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.