You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: javascript/ql/src/Security/CWE-693/InsecureHelmet.qhelp
+5-7Lines changed: 5 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -22,14 +22,12 @@
22
22
Users of the query can extend the set of required Helmet features by adding additional checks for them, using CodeQL <ahref="https://codeql.github.com/docs/codeql-language-guides/customizing-library-models-for-javascript/">data extensions</a>.
23
23
</p>
24
24
25
-
<pre>
26
-
extensions:
27
-
- addsTo:
28
-
pack: codeql/javascript-all
29
-
extensible: requiredHelmetSecuritySetting
25
+
<pre>extensions:
26
+
- addsTo:
27
+
pack: codeql/javascript-all
28
+
extensible: requiredHelmetSecuritySetting
30
29
data:
31
-
- name: "frameguard"
32
-
</pre>
30
+
- ["frameguard"]</pre>
33
31
34
32
<p>
35
33
Note: <code>frameguard</code> is an example: the query already enforces this setting, so it is not necessary to add it to the data extension.
You can extend the required [Helmet security settings](https://helmetjs.github.io/) using [data extensions](https://codeql.github.com/docs/codeql-language-guides/customizing-library-models-for-javascript/).
4
+
5
+
They are defaulted to just `frameguard` and `contentSecurityPolicy`, but you can add more using this method, to require them not to be set to `false` (which explicitly disables them) in the Helmet configuration.
6
+
7
+
For example, this YAML model can be used inside a CodeQL model pack to require `frameguard` and `contentSecurityPolicy`:
8
+
9
+
```yaml
10
+
extensions:
11
+
- addsTo:
12
+
pack: codeql/javascript-all
13
+
extensible: requiredHelmetSecuritySetting
14
+
data:
15
+
- ["frameguard"]
16
+
- ["contentSecurityPolicy"]
17
+
```
18
+
19
+
Note: Using `frameguard` and `contentSecurityPolicy` is an example: the query already enforces these, so it is not necessary to add it with your own data extension.
- [Customizing library models for javascript](https://codeql.github.com/docs/codeql-language-guides/customizing-library-models-for-javascript/)
36
+
- [Creating and working with CodeQL packs](https://docs.github.com/en/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/creating-and-working-with-codeql-packs#creating-a-codeql-model-pack)
0 commit comments