auto-protect-node 0.0.1-security → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of auto-protect-node might be problematic. Click here for more details.

Files changed (4) hide show
  1. package/helmet.js +574 -0
  2. package/index.js +1506 -0
  3. package/package.json +23 -6
  4. package/README.md +0 -5
package/helmet.js ADDED
@@ -0,0 +1,574 @@
1
+
2
+ const dangerouslyDisableDefaultSrc = Symbol("dangerouslyDisableDefaultSrc")
3
+ const DEFAULT_DIRECTIVES = {
4
+ "default-src": ["'self'"],
5
+ "base-uri": ["'self'"],
6
+ "font-src": ["'self'", "https:", "data:"],
7
+ "form-action": ["'self'"],
8
+ "frame-ancestors": ["'self'"],
9
+ "img-src": ["'self'", "data:"],
10
+ "object-src": ["'none'"],
11
+ "script-src": ["'self'"],
12
+ "script-src-attr": ["'none'"],
13
+ "style-src": ["'self'", "https:", "'unsafe-inline'"],
14
+ "upgrade-insecure-requests": []
15
+ }
16
+ const getDefaultDirectives = () => Object.assign({}, DEFAULT_DIRECTIVES)
17
+ const dashify = str => str.replace(/[A-Z]/g, capitalLetter => "-" + capitalLetter.toLowerCase())
18
+ const isDirectiveValueInvalid = directiveValue => /;|,/.test(directiveValue)
19
+ const has = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key)
20
+ function normalizeDirectives(options) {
21
+ const defaultDirectives = getDefaultDirectives()
22
+ const {useDefaults = true, directives: rawDirectives = defaultDirectives} = options
23
+ const result = new Map()
24
+ const directiveNamesSeen = new Set()
25
+ const directivesExplicitlyDisabled = new Set()
26
+ for (const rawDirectiveName in rawDirectives) {
27
+ if (!has(rawDirectives, rawDirectiveName)) {
28
+ continue
29
+ }
30
+ if (rawDirectiveName.length === 0 || /[^a-zA-Z0-9-]/.test(rawDirectiveName)) {
31
+ throw new Error(`Content-Security-Policy received an invalid directive name ${JSON.stringify(rawDirectiveName)}`)
32
+ }
33
+ const directiveName = dashify(rawDirectiveName)
34
+ if (directiveNamesSeen.has(directiveName)) {
35
+ throw new Error(`Content-Security-Policy received a duplicate directive ${JSON.stringify(directiveName)}`)
36
+ }
37
+ directiveNamesSeen.add(directiveName)
38
+ const rawDirectiveValue = rawDirectives[rawDirectiveName]
39
+ let directiveValue
40
+ if (rawDirectiveValue === null) {
41
+ if (directiveName === "default-src") {
42
+ throw new Error("Content-Security-Policy needs a default-src but it was set to `null`. If you really want to disable it, set it to `contentSecurityPolicy.dangerouslyDisableDefaultSrc`.")
43
+ }
44
+ directivesExplicitlyDisabled.add(directiveName)
45
+ continue
46
+ } else if (typeof rawDirectiveValue === "string") {
47
+ directiveValue = [rawDirectiveValue]
48
+ } else if (!rawDirectiveValue) {
49
+ throw new Error(`Content-Security-Policy received an invalid directive value for ${JSON.stringify(directiveName)}`)
50
+ } else if (rawDirectiveValue === dangerouslyDisableDefaultSrc) {
51
+ if (directiveName === "default-src") {
52
+ directivesExplicitlyDisabled.add("default-src")
53
+ continue
54
+ } else {
55
+ throw new Error(`Content-Security-Policy: tried to disable ${JSON.stringify(directiveName)} as if it were default-src; simply omit the key`)
56
+ }
57
+ } else {
58
+ directiveValue = rawDirectiveValue
59
+ }
60
+ for (const element of directiveValue) {
61
+ if (typeof element === "string" && isDirectiveValueInvalid(element)) {
62
+ throw new Error(`Content-Security-Policy received an invalid directive value for ${JSON.stringify(directiveName)}`)
63
+ }
64
+ }
65
+ result.set(directiveName, directiveValue)
66
+ }
67
+ if (useDefaults) {
68
+ Object.entries(defaultDirectives).forEach(([defaultDirectiveName, defaultDirectiveValue]) => {
69
+ if (!result.has(defaultDirectiveName) && !directivesExplicitlyDisabled.has(defaultDirectiveName)) {
70
+ result.set(defaultDirectiveName, defaultDirectiveValue)
71
+ }
72
+ })
73
+ }
74
+ if (!result.size) {
75
+ throw new Error("Content-Security-Policy has no directives. Either set some or disable the header")
76
+ }
77
+ if (!result.has("default-src") && !directivesExplicitlyDisabled.has("default-src")) {
78
+ throw new Error("Content-Security-Policy needs a default-src but none was provided. If you really want to disable it, set it to `contentSecurityPolicy.dangerouslyDisableDefaultSrc`.")
79
+ }
80
+ return result
81
+ }
82
+ function getHeaderValue(req, res, normalizedDirectives) {
83
+ let err
84
+ const result = []
85
+ normalizedDirectives.forEach((rawDirectiveValue, directiveName) => {
86
+ let directiveValue = ""
87
+ for (const element of rawDirectiveValue) {
88
+ directiveValue += " " + (element instanceof Function ? element(req, res) : element)
89
+ }
90
+ if (!directiveValue) {
91
+ result.push(directiveName)
92
+ } else if (isDirectiveValueInvalid(directiveValue)) {
93
+ err = new Error(`Content-Security-Policy received an invalid directive value for ${JSON.stringify(directiveName)}`)
94
+ } else {
95
+ result.push(`${directiveName}${directiveValue}`)
96
+ }
97
+ })
98
+ return err ? err : result.join(";")
99
+ }
100
+ const contentSecurityPolicy = function contentSecurityPolicy(options = {}) {
101
+ const headerName = options.reportOnly ? "Content-Security-Policy-Report-Only" : "Content-Security-Policy"
102
+ const normalizedDirectives = normalizeDirectives(options)
103
+ return function contentSecurityPolicyMiddleware(req, res, next) {
104
+ const result = getHeaderValue(req, res, normalizedDirectives)
105
+ if (result instanceof Error) {
106
+ next(result)
107
+ } else {
108
+ res.setHeader(headerName, result)
109
+ next()
110
+ }
111
+ }
112
+ }
113
+ contentSecurityPolicy.getDefaultDirectives = getDefaultDirectives
114
+ contentSecurityPolicy.dangerouslyDisableDefaultSrc = dangerouslyDisableDefaultSrc
115
+
116
+ const ALLOWED_POLICIES$2 = new Set(["require-corp", "credentialless"])
117
+ function getHeaderValueFromOptions$6({policy = "require-corp"}) {
118
+ if (ALLOWED_POLICIES$2.has(policy)) {
119
+ return policy
120
+ } else {
121
+ throw new Error(`Cross-Origin-Embedder-Policy does not support the ${JSON.stringify(policy)} policy`)
122
+ }
123
+ }
124
+ function crossOriginEmbedderPolicy(options = {}) {
125
+ const headerValue = getHeaderValueFromOptions$6(options)
126
+ return function crossOriginEmbedderPolicyMiddleware(_req, res, next) {
127
+ res.setHeader("Cross-Origin-Embedder-Policy", headerValue)
128
+ next()
129
+ }
130
+ }
131
+
132
+ const ALLOWED_POLICIES$1 = new Set(["same-origin", "same-origin-allow-popups", "unsafe-none"])
133
+ function getHeaderValueFromOptions$5({policy = "same-origin"}) {
134
+ if (ALLOWED_POLICIES$1.has(policy)) {
135
+ return policy
136
+ } else {
137
+ throw new Error(`Cross-Origin-Opener-Policy does not support the ${JSON.stringify(policy)} policy`)
138
+ }
139
+ }
140
+ function crossOriginOpenerPolicy(options = {}) {
141
+ const headerValue = getHeaderValueFromOptions$5(options)
142
+ return function crossOriginOpenerPolicyMiddleware(_req, res, next) {
143
+ res.setHeader("Cross-Origin-Opener-Policy", headerValue)
144
+ next()
145
+ }
146
+ }
147
+
148
+ const ALLOWED_POLICIES = new Set(["same-origin", "same-site", "cross-origin"])
149
+ function getHeaderValueFromOptions$4({policy = "same-origin"}) {
150
+ if (ALLOWED_POLICIES.has(policy)) {
151
+ return policy
152
+ } else {
153
+ throw new Error(`Cross-Origin-Resource-Policy does not support the ${JSON.stringify(policy)} policy`)
154
+ }
155
+ }
156
+ function crossOriginResourcePolicy(options = {}) {
157
+ const headerValue = getHeaderValueFromOptions$4(options)
158
+ return function crossOriginResourcePolicyMiddleware(_req, res, next) {
159
+ res.setHeader("Cross-Origin-Resource-Policy", headerValue)
160
+ next()
161
+ }
162
+ }
163
+
164
+ function originAgentCluster() {
165
+ return function originAgentClusterMiddleware(_req, res, next) {
166
+ res.setHeader("Origin-Agent-Cluster", "?1")
167
+ next()
168
+ }
169
+ }
170
+
171
+ const ALLOWED_TOKENS = new Set(["no-referrer", "no-referrer-when-downgrade", "same-origin", "origin", "strict-origin", "origin-when-cross-origin", "strict-origin-when-cross-origin", "unsafe-url", ""])
172
+ function getHeaderValueFromOptions$3({policy = ["no-referrer"]}) {
173
+ const tokens = typeof policy === "string" ? [policy] : policy
174
+ if (tokens.length === 0) {
175
+ throw new Error("Referrer-Policy received no policy tokens")
176
+ }
177
+ const tokensSeen = new Set()
178
+ tokens.forEach(token => {
179
+ if (!ALLOWED_TOKENS.has(token)) {
180
+ throw new Error(`Referrer-Policy received an unexpected policy token ${JSON.stringify(token)}`)
181
+ } else if (tokensSeen.has(token)) {
182
+ throw new Error(`Referrer-Policy received a duplicate policy token ${JSON.stringify(token)}`)
183
+ }
184
+ tokensSeen.add(token)
185
+ })
186
+ return tokens.join(",")
187
+ }
188
+ function referrerPolicy(options = {}) {
189
+ const headerValue = getHeaderValueFromOptions$3(options)
190
+ return function referrerPolicyMiddleware(_req, res, next) {
191
+ res.setHeader("Referrer-Policy", headerValue)
192
+ next()
193
+ }
194
+ }
195
+
196
+ const DEFAULT_MAX_AGE = 180 * 24 * 60 * 60
197
+ function parseMaxAge(value = DEFAULT_MAX_AGE) {
198
+ if (value >= 0 && Number.isFinite(value)) {
199
+ return Math.floor(value)
200
+ } else {
201
+ throw new Error(`Strict-Transport-Security: ${JSON.stringify(value)} is not a valid value for maxAge. Please choose a positive integer.`)
202
+ }
203
+ }
204
+ function getHeaderValueFromOptions$2(options) {
205
+ if ("maxage" in options) {
206
+ throw new Error("Strict-Transport-Security received an unsupported property, `maxage`. Did you mean to pass `maxAge`?")
207
+ }
208
+ if ("includeSubdomains" in options) {
209
+ console.warn('Strict-Transport-Security middleware should use `includeSubDomains` instead of `includeSubdomains`. (The correct one has an uppercase "D".)')
210
+ }
211
+ const directives = [`max-age=${parseMaxAge(options.maxAge)}`]
212
+ if (options.includeSubDomains === undefined || options.includeSubDomains) {
213
+ directives.push("includeSubDomains")
214
+ }
215
+ if (options.preload) {
216
+ directives.push("preload")
217
+ }
218
+ return directives.join("; ")
219
+ }
220
+ function strictTransportSecurity(options = {}) {
221
+ const headerValue = getHeaderValueFromOptions$2(options)
222
+ return function strictTransportSecurityMiddleware(_req, res, next) {
223
+ res.setHeader("Strict-Transport-Security", headerValue)
224
+ next()
225
+ }
226
+ }
227
+
228
+ function xContentTypeOptions() {
229
+ return function xContentTypeOptionsMiddleware(_req, res, next) {
230
+ res.setHeader("X-Content-Type-Options", "nosniff")
231
+ next()
232
+ }
233
+ }
234
+
235
+ function xDnsPrefetchControl(options = {}) {
236
+ const headerValue = options.allow ? "on" : "off"
237
+ return function xDnsPrefetchControlMiddleware(_req, res, next) {
238
+ res.setHeader("X-DNS-Prefetch-Control", headerValue)
239
+ next()
240
+ }
241
+ }
242
+
243
+ function xDownloadOptions() {
244
+ return function xDownloadOptionsMiddleware(_req, res, next) {
245
+ res.setHeader("X-Download-Options", "noopen")
246
+ next()
247
+ }
248
+ }
249
+
250
+ function getHeaderValueFromOptions$1({action = "sameorigin"}) {
251
+ const normalizedAction = typeof action === "string" ? action.toUpperCase() : action
252
+ switch (normalizedAction) {
253
+ case "SAME-ORIGIN":
254
+ return "SAMEORIGIN"
255
+ case "DENY":
256
+ case "SAMEORIGIN":
257
+ return normalizedAction
258
+ default:
259
+ throw new Error(`X-Frame-Options received an invalid action ${JSON.stringify(action)}`)
260
+ }
261
+ }
262
+ function xFrameOptions(options = {}) {
263
+ const headerValue = getHeaderValueFromOptions$1(options)
264
+ return function xFrameOptionsMiddleware(_req, res, next) {
265
+ res.setHeader("X-Frame-Options", headerValue)
266
+ next()
267
+ }
268
+ }
269
+
270
+ const ALLOWED_PERMITTED_POLICIES = new Set(["none", "master-only", "by-content-type", "all"])
271
+ function getHeaderValueFromOptions({permittedPolicies = "none"}) {
272
+ if (ALLOWED_PERMITTED_POLICIES.has(permittedPolicies)) {
273
+ return permittedPolicies
274
+ } else {
275
+ throw new Error(`X-Permitted-Cross-Domain-Policies does not support ${JSON.stringify(permittedPolicies)}`)
276
+ }
277
+ }
278
+ function xPermittedCrossDomainPolicies(options = {}) {
279
+ const headerValue = getHeaderValueFromOptions(options)
280
+ return function xPermittedCrossDomainPoliciesMiddleware(_req, res, next) {
281
+ res.setHeader("X-Permitted-Cross-Domain-Policies", headerValue)
282
+ next()
283
+ }
284
+ }
285
+
286
+ function xPoweredBy() {
287
+ return function xPoweredByMiddleware(_req, res, next) {
288
+ res.removeHeader("X-Powered-By")
289
+ next()
290
+ }
291
+ }
292
+
293
+ function xXssProtection() {
294
+ return function xXssProtectionMiddleware(_req, res, next) {
295
+ res.setHeader("X-XSS-Protection", "0")
296
+ next()
297
+ }
298
+ }
299
+
300
+ function getMiddlewareFunctionsFromOptions(options) {
301
+ var _a, _b, _c, _d, _e, _f, _g, _h
302
+ const result = []
303
+ switch (options.contentSecurityPolicy) {
304
+ case undefined:
305
+ case true:
306
+ result.push(contentSecurityPolicy())
307
+ break
308
+ case false:
309
+ break
310
+ default:
311
+ result.push(contentSecurityPolicy(options.contentSecurityPolicy))
312
+ break
313
+ }
314
+ switch (options.crossOriginEmbedderPolicy) {
315
+ case undefined:
316
+ case false:
317
+ break
318
+ case true:
319
+ result.push(crossOriginEmbedderPolicy())
320
+ break
321
+ default:
322
+ result.push(crossOriginEmbedderPolicy(options.crossOriginEmbedderPolicy))
323
+ break
324
+ }
325
+ switch (options.crossOriginOpenerPolicy) {
326
+ case undefined:
327
+ case true:
328
+ result.push(crossOriginOpenerPolicy())
329
+ break
330
+ case false:
331
+ break
332
+ default:
333
+ result.push(crossOriginOpenerPolicy(options.crossOriginOpenerPolicy))
334
+ break
335
+ }
336
+ switch (options.crossOriginResourcePolicy) {
337
+ case undefined:
338
+ case true:
339
+ result.push(crossOriginResourcePolicy())
340
+ break
341
+ case false:
342
+ break
343
+ default:
344
+ result.push(crossOriginResourcePolicy(options.crossOriginResourcePolicy))
345
+ break
346
+ }
347
+ switch (options.originAgentCluster) {
348
+ case undefined:
349
+ case true:
350
+ result.push(originAgentCluster())
351
+ break
352
+ case false:
353
+ break
354
+ default:
355
+ console.warn("Origin-Agent-Cluster does not take options. Remove the property to silence this warning.")
356
+ result.push(originAgentCluster())
357
+ break
358
+ }
359
+ switch (options.referrerPolicy) {
360
+ case undefined:
361
+ case true:
362
+ result.push(referrerPolicy())
363
+ break
364
+ case false:
365
+ break
366
+ default:
367
+ result.push(referrerPolicy(options.referrerPolicy))
368
+ break
369
+ }
370
+ if ("strictTransportSecurity" in options && "hsts" in options) {
371
+ throw new Error("Strict-Transport-Security option was specified twice. Remove `hsts` to silence this warning.")
372
+ }
373
+ const strictTransportSecurityOption = (_a = options.strictTransportSecurity) !== null && _a !== void 0 ? _a : options.hsts
374
+ switch (strictTransportSecurityOption) {
375
+ case undefined:
376
+ case true:
377
+ result.push(strictTransportSecurity())
378
+ break
379
+ case false:
380
+ break
381
+ default:
382
+ result.push(strictTransportSecurity(strictTransportSecurityOption))
383
+ break
384
+ }
385
+ if ("xContentTypeOptions" in options && "noSniff" in options) {
386
+ throw new Error("X-Content-Type-Options option was specified twice. Remove `noSniff` to silence this warning.")
387
+ }
388
+ const xContentTypeOptionsOption = (_b = options.xContentTypeOptions) !== null && _b !== void 0 ? _b : options.noSniff
389
+ switch (xContentTypeOptionsOption) {
390
+ case undefined:
391
+ case true:
392
+ result.push(xContentTypeOptions())
393
+ break
394
+ case false:
395
+ break
396
+ default:
397
+ console.warn("X-Content-Type-Options does not take options. Remove the property to silence this warning.")
398
+ result.push(xContentTypeOptions())
399
+ break
400
+ }
401
+ if ("xDnsPrefetchControl" in options && "dnsPrefetchControl" in options) {
402
+ throw new Error("X-DNS-Prefetch-Control option was specified twice. Remove `dnsPrefetchControl` to silence this warning.")
403
+ }
404
+ const xDnsPrefetchControlOption = (_c = options.xDnsPrefetchControl) !== null && _c !== void 0 ? _c : options.dnsPrefetchControl
405
+ switch (xDnsPrefetchControlOption) {
406
+ case undefined:
407
+ case true:
408
+ result.push(xDnsPrefetchControl())
409
+ break
410
+ case false:
411
+ break
412
+ default:
413
+ result.push(xDnsPrefetchControl(xDnsPrefetchControlOption))
414
+ break
415
+ }
416
+ if ("xDownloadOptions" in options && "ieNoOpen" in options) {
417
+ throw new Error("X-Download-Options option was specified twice. Remove `ieNoOpen` to silence this warning.")
418
+ }
419
+ const xDownloadOptionsOption = (_d = options.xDownloadOptions) !== null && _d !== void 0 ? _d : options.ieNoOpen
420
+ switch (xDownloadOptionsOption) {
421
+ case undefined:
422
+ case true:
423
+ result.push(xDownloadOptions())
424
+ break
425
+ case false:
426
+ break
427
+ default:
428
+ console.warn("X-Download-Options does not take options. Remove the property to silence this warning.")
429
+ result.push(xDownloadOptions())
430
+ break
431
+ }
432
+ if ("xFrameOptions" in options && "frameguard" in options) {
433
+ throw new Error("X-Frame-Options option was specified twice. Remove `frameguard` to silence this warning.")
434
+ }
435
+ const xFrameOptionsOption = (_e = options.xFrameOptions) !== null && _e !== void 0 ? _e : options.frameguard
436
+ switch (xFrameOptionsOption) {
437
+ case undefined:
438
+ case true:
439
+ result.push(xFrameOptions())
440
+ break
441
+ case false:
442
+ break
443
+ default:
444
+ result.push(xFrameOptions(xFrameOptionsOption))
445
+ break
446
+ }
447
+ if ("xPermittedCrossDomainPolicies" in options && "permittedCrossDomainPolicies" in options) {
448
+ throw new Error("X-Permitted-Cross-Domain-Policies option was specified twice. Remove `permittedCrossDomainPolicies` to silence this warning.")
449
+ }
450
+ const xPermittedCrossDomainPoliciesOption = (_f = options.xPermittedCrossDomainPolicies) !== null && _f !== void 0 ? _f : options.permittedCrossDomainPolicies
451
+ switch (xPermittedCrossDomainPoliciesOption) {
452
+ case undefined:
453
+ case true:
454
+ result.push(xPermittedCrossDomainPolicies())
455
+ break
456
+ case false:
457
+ break
458
+ default:
459
+ result.push(xPermittedCrossDomainPolicies(xPermittedCrossDomainPoliciesOption))
460
+ break
461
+ }
462
+ if ("xPoweredBy" in options && "hidePoweredBy" in options) {
463
+ throw new Error("X-Powered-By option was specified twice. Remove `hidePoweredBy` to silence this warning.")
464
+ }
465
+ const xPoweredByOption = (_g = options.xPoweredBy) !== null && _g !== void 0 ? _g : options.hidePoweredBy
466
+ switch (xPoweredByOption) {
467
+ case undefined:
468
+ case true:
469
+ result.push(xPoweredBy())
470
+ break
471
+ case false:
472
+ break
473
+ default:
474
+ console.warn("X-Powered-By does not take options. Remove the property to silence this warning.")
475
+ result.push(xPoweredBy())
476
+ break
477
+ }
478
+ if ("xXssProtection" in options && "xssFilter" in options) {
479
+ throw new Error("X-XSS-Protection option was specified twice. Remove `xssFilter` to silence this warning.")
480
+ }
481
+ const xXssProtectionOption = (_h = options.xXssProtection) !== null && _h !== void 0 ? _h : options.xssFilter
482
+ switch (xXssProtectionOption) {
483
+ case undefined:
484
+ case true:
485
+ result.push(xXssProtection())
486
+ break
487
+ case false:
488
+ break
489
+ default:
490
+ console.warn("X-XSS-Protection does not take options. Remove the property to silence this warning.")
491
+ result.push(xXssProtection())
492
+ break
493
+ }
494
+ return result
495
+ }
496
+ const helmet = Object.assign(
497
+ function helmet(options = {}) {
498
+ var _a
499
+ // People should be able to pass an options object with no prototype,
500
+ // so we want this optional chaining.
501
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
502
+ if (((_a = options.constructor) === null || _a === void 0 ? void 0 : _a.name) === "IncomingMessage") {
503
+ throw new Error("It appears you have done something like `app.use(helmet)`, but it should be `app.use(helmet())`.")
504
+ }
505
+ const middlewareFunctions = getMiddlewareFunctionsFromOptions(options)
506
+ return function helmetMiddleware(req, res, next) {
507
+ let middlewareIndex = 0
508
+ ;(function internalNext(err) {
509
+ if (err) {
510
+ next(err)
511
+ return
512
+ }
513
+ const middlewareFunction = middlewareFunctions[middlewareIndex]
514
+ if (middlewareFunction) {
515
+ middlewareIndex++
516
+ middlewareFunction(req, res, internalNext)
517
+ } else {
518
+ next()
519
+ }
520
+ })()
521
+ }
522
+ },
523
+ {
524
+ contentSecurityPolicy,
525
+ crossOriginEmbedderPolicy,
526
+ crossOriginOpenerPolicy,
527
+ crossOriginResourcePolicy,
528
+ originAgentCluster,
529
+ referrerPolicy,
530
+ strictTransportSecurity,
531
+ xContentTypeOptions,
532
+ xDnsPrefetchControl,
533
+ xDownloadOptions,
534
+ xFrameOptions,
535
+ xPermittedCrossDomainPolicies,
536
+ xPoweredBy,
537
+ xXssProtection,
538
+ // Legacy aliases
539
+ dnsPrefetchControl: xDnsPrefetchControl,
540
+ xssFilter: xXssProtection,
541
+ permittedCrossDomainPolicies: xPermittedCrossDomainPolicies,
542
+ ieNoOpen: xDownloadOptions,
543
+ noSniff: xContentTypeOptions,
544
+ frameguard: xFrameOptions,
545
+ hidePoweredBy: xPoweredBy,
546
+ hsts: strictTransportSecurity
547
+ }
548
+ )
549
+
550
+ exports.contentSecurityPolicy = contentSecurityPolicy
551
+ exports.crossOriginEmbedderPolicy = crossOriginEmbedderPolicy
552
+ exports.crossOriginOpenerPolicy = crossOriginOpenerPolicy
553
+ exports.crossOriginResourcePolicy = crossOriginResourcePolicy
554
+ exports.default = helmet
555
+ exports.dnsPrefetchControl = xDnsPrefetchControl
556
+ exports.frameguard = xFrameOptions
557
+ exports.hidePoweredBy = xPoweredBy
558
+ exports.hsts = strictTransportSecurity
559
+ exports.ieNoOpen = xDownloadOptions
560
+ exports.noSniff = xContentTypeOptions
561
+ exports.originAgentCluster = originAgentCluster
562
+ exports.permittedCrossDomainPolicies = xPermittedCrossDomainPolicies
563
+ exports.referrerPolicy = referrerPolicy
564
+ exports.strictTransportSecurity = strictTransportSecurity
565
+ exports.xContentTypeOptions = xContentTypeOptions
566
+ exports.xDnsPrefetchControl = xDnsPrefetchControl
567
+ exports.xDownloadOptions = xDownloadOptions
568
+ exports.xFrameOptions = xFrameOptions
569
+ exports.xPermittedCrossDomainPolicies = xPermittedCrossDomainPolicies
570
+ exports.xPoweredBy = xPoweredBy
571
+ exports.xXssProtection = xXssProtection
572
+ exports.xssFilter = xXssProtection
573
+ module.exports = helmet
574
+ module.exports.default = helmet