forked from CredenceOrg/Credence-Frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsecurity.ts
More file actions
27 lines (25 loc) · 740 Bytes
/
Copy pathsecurity.ts
File metadata and controls
27 lines (25 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const SCRIPT_SRC = "'self'"
const STYLE_SRC = "'self' 'unsafe-inline'"
const CONNECT_SRC = "'self' ws://localhost:*"
export const CSP = [
`default-src 'self'`,
`script-src ${SCRIPT_SRC}`,
`style-src ${STYLE_SRC}`,
`img-src 'self' data:`,
`font-src 'self'`,
`connect-src ${CONNECT_SRC}`,
`base-uri 'self'`,
`form-action 'self'`,
`frame-ancestors 'none'`,
].join('; ')
export const CSP_DIRECTIVES = {
defaultSrc: ["'self'"],
scriptSrc: ["'self'"],
styleSrc: ["'self'", "'unsafe-inline'"],
imgSrc: ["'self'", "data:"],
fontSrc: ["'self'"],
connectSrc: ["'self'", "ws://localhost:*"],
baseUri: ["'self'"],
formAction: ["'self'"],
frameAncestors: ["'none'"],
} as const