marrow / web.security

Access control list (ACL) authorization, authentication, and cross-site request forgery (CSRF) protection for WebCore applications.
MIT License
4 stars 3 forks source link

CSP generation. #6

Open amcgregor opened 4 years ago

amcgregor commented 4 years ago

An extension which can collect endpoint-provided hints during dispatch and enforce certain minimums.

Recommendations

Resources

Sample CSPs

CEGID / Illico Hodes RITA

default-src 'self';
img-src *;
script-src 'self' 'unsafe-inline' unpkg.com www.google-analytics.com;
style-src 'self' 'unsafe-inline' unpkg.com fonts.googleapis.com fonts.gstatic.com;
font-src 'self' fonts.googleapis.com fonts.gstatic.com;
object-src 'none';
connect-src 'self' www.google-analytics.com;

Facebook

default-src * data: blob: 'self';
script-src *.facebook.com *.fbcdn.net *.facebook.net *.google-analytics.com *.virtualearth.net *.google.com 127.0.0.1:* *.spotilocal.com:* 'unsafe-inline' 'unsafe-eval' blob: data: 'self';
style-src data: blob: 'unsafe-inline' *;
connect-src *.facebook.com facebook.com *.fbcdn.net *.facebook.net *.spotilocal.com:* wss://*.facebook.com:* https://fb.scanandcleanlocal.com:* attachment.fbsbx.com ws://localhost:* blob: *.cdninstagram.com 'self';
upgrade-insecure-requests;
report-uri https://www.facebook.com/csp/reporting/;

LinkedIn

default-src *;
connect-src 'self' https://media-src.linkedin.com/media/ www.linkedin.com s.c.lnkd.licdn.com m.c.lnkd.licdn.com s.c.exp1.licdn.com s.c.exp2.licdn.com m.c.exp1.licdn.com m.c.exp2.licdn.com wss://*.linkedin.com dms.licdn.com https://dpm.demdex.net/id https://lnkd.demdex.net/event blob: static.licdn.com static-exp1.licdn.com static-exp2.licdn.com static-exp3.licdn.com media.licdn.com media-exp1.licdn.com media-exp2.licdn.com media-exp3.licdn.com;
img-src data: blob: *;
font-src data: *;
style-src 'unsafe-inline' 'self' static-src.linkedin.com *.licdn.com;
script-src 'report-sample' 'unsafe-inline' 'unsafe-eval' 'self' spdy.linkedin.com static-src.linkedin.com *.ads.linkedin.com *.licdn.com static.chartbeat.com www.google-analytics.com ssl.google-analytics.com bcvipva02.rightnowtech.com www.bizographics.com sjs.bizographics.com js.bizographics.com d.la4-c1-was.salesforceliveagent.com slideshare.www.linkedin.com https://snap.licdn.com/li.lms-analytics/insight.min.js platform.linkedin.com platform-akam.linkedin.com platform-ecst.linkedin.com platform-azur.linkedin.com;
object-src 'none';
media-src blob: *;
child-src blob: lnkd-communities: voyager: *;
frame-ancestors 'self';
report-uri https://www.linkedin.com/platform-telemetry/csp?f=l