[ES-2916] fixed ui rendering and biometric login issue caused by csp header#1675
[ES-2916] fixed ui rendering and biometric login issue caused by csp header#1675zesu22 merged 2 commits intomosip:developfrom
Conversation
Signed-off-by: Sachin Rana <sacrana324@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughUpdated the Content-Security-Policy delivered via nginx/configmap: added 'unsafe-inline' to style-src; expanded img-src to include Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
oidc-ui/nginx/nginx.conf (1)
83-83: Treatstyle-src 'unsafe-inline'as temporary and plan nonce/hash migration.Line 83 weakens CSP policy globally. If this is needed to unblock rendering now, please track follow-up hardening to nonce/hash inline styles and remove
'unsafe-inline'.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@oidc-ui/nginx/nginx.conf` at line 83, The CSP directive currently permits inline styles via the entry "style-src 'self' https://fonts.googleapis.com 'unsafe-inline'" which weakens the policy; update the nginx.conf to treat this as a temporary allowance by adding a clear TODO comment next to that "style-src 'self' https://fonts.googleapis.com 'unsafe-inline'" entry, create a tracking ticket to replace 'unsafe-inline' with nonces or hashes, and prepare code changes to migrate inline styles to use per-response nonces (or computed style hashes) so you can remove 'unsafe-inline' from the "style-src" directive once migration is complete.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@oidc-ui/nginx/nginx.conf`:
- Line 88: The connect-src CSP directive currently allows any loopback port via
the entry "http://127.0.0.1:*"; update the nginx.conf connect-src directive to
restrict loopback to the SBI port range by replacing "http://127.0.0.1:*" with
"http://127.0.0.1:4501-4600" (or a reasonable upper bound if ports are dynamic)
so the connect-src rule only permits the expected SBI ports; locate the
connect-src directive in nginx.conf to make this change.
---
Nitpick comments:
In `@oidc-ui/nginx/nginx.conf`:
- Line 83: The CSP directive currently permits inline styles via the entry
"style-src 'self' https://fonts.googleapis.com 'unsafe-inline'" which weakens
the policy; update the nginx.conf to treat this as a temporary allowance by
adding a clear TODO comment next to that "style-src 'self'
https://fonts.googleapis.com 'unsafe-inline'" entry, create a tracking ticket to
replace 'unsafe-inline' with nonces or hashes, and prepare code changes to
migrate inline styles to use per-response nonces (or computed style hashes) so
you can remove 'unsafe-inline' from the "style-src" directive once migration is
complete.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 96a69bd4-2c11-4e7c-91f8-46b702e76726
📒 Files selected for processing (2)
helm/oidc-ui/templates/configmap.yamloidc-ui/nginx/nginx.conf
Signed-off-by: Sachin Rana <sacrana324@gmail.com>
…header (mosip#1675) * fixed ui rendering and biometric login issue caused by csp header Signed-off-by: Sachin Rana <sacrana324@gmail.com> * added mosip.net to csp header exception for images Signed-off-by: Sachin Rana <sacrana324@gmail.com> --------- Signed-off-by: Sachin Rana <sacrana324@gmail.com>
Summary by CodeRabbit