@appland/scanner 1.46.3 → 1.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/built/analyzer/recordSecrets.js +29 -3
  2. package/built/analyzer/recordSecrets.js.map +1 -1
  3. package/built/ruleChecker.js +44 -18
  4. package/built/ruleChecker.js.map +1 -1
  5. package/built/rules/authzBeforeAuthn.js +0 -1
  6. package/built/rules/authzBeforeAuthn.js.map +1 -1
  7. package/built/rules/circularDependency.js +0 -2
  8. package/built/rules/circularDependency.js.map +1 -1
  9. package/built/rules/deserializationOfUntrustedData.js +12 -82
  10. package/built/rules/deserializationOfUntrustedData.js.map +1 -1
  11. package/built/rules/execOfUntrustedCommand.js +95 -0
  12. package/built/rules/execOfUntrustedCommand.js.map +1 -0
  13. package/built/rules/http500.js +0 -1
  14. package/built/rules/http500.js.map +1 -1
  15. package/built/rules/illegalPackageDependency.js +7 -1
  16. package/built/rules/illegalPackageDependency.js.map +1 -1
  17. package/built/rules/incompatibleHttpClientRequest.js +1 -1
  18. package/built/rules/incompatibleHttpClientRequest.js.map +1 -1
  19. package/built/rules/insecureCompare.js +0 -1
  20. package/built/rules/insecureCompare.js.map +1 -1
  21. package/built/rules/jobNotCancelled.js +0 -1
  22. package/built/rules/jobNotCancelled.js.map +1 -1
  23. package/built/rules/lib/parseRuleDescription.js +4 -3
  24. package/built/rules/lib/parseRuleDescription.js.map +1 -1
  25. package/built/rules/lib/precedingEvents.js +80 -0
  26. package/built/rules/lib/precedingEvents.js.map +1 -0
  27. package/built/rules/lib/sanitizesData.js +10 -0
  28. package/built/rules/lib/sanitizesData.js.map +1 -0
  29. package/built/rules/lib/util.js +18 -2
  30. package/built/rules/lib/util.js.map +1 -1
  31. package/built/rules/logoutWithoutSessionReset.js +0 -1
  32. package/built/rules/logoutWithoutSessionReset.js.map +1 -1
  33. package/built/rules/missingAuthentication.js +3 -3
  34. package/built/rules/missingAuthentication.js.map +1 -1
  35. package/built/rules/queryFromInvalidPackage.js +7 -2
  36. package/built/rules/queryFromInvalidPackage.js.map +1 -1
  37. package/built/rules/queryFromView.js +12 -1
  38. package/built/rules/queryFromView.js.map +1 -1
  39. package/built/rules/secretInLog.js +11 -9
  40. package/built/rules/secretInLog.js.map +1 -1
  41. package/built/rules/tooManyJoins.js +0 -2
  42. package/built/rules/tooManyJoins.js.map +1 -1
  43. package/built/rules/tooManyUpdates.js +0 -1
  44. package/built/rules/tooManyUpdates.js.map +1 -1
  45. package/built/rules/unbatchedMaterializedQuery.js +0 -1
  46. package/built/rules/unbatchedMaterializedQuery.js.map +1 -1
  47. package/built/sampleConfig/default.yml +2 -1
  48. package/built/scope/commandScope.js +2 -3
  49. package/built/scope/commandScope.js.map +1 -1
  50. package/doc/labels/{public.md → access.public.md} +1 -1
  51. package/doc/labels/command.perform.md +7 -0
  52. package/doc/labels/deserialize.safe.md +2 -0
  53. package/doc/labels/deserialize.sanitize.md +22 -0
  54. package/doc/labels/deserialize.unsafe.md +2 -0
  55. package/doc/labels/job.perform.md +6 -0
  56. package/doc/labels/system.exec.md +7 -0
  57. package/doc/labels/system.exec.safe.md +7 -0
  58. package/doc/labels/system.exec.sanitize.md +22 -0
  59. package/doc/rules/circularDependency.md +0 -1
  60. package/doc/rules/deserializationOfUntrustedData.md +1 -1
  61. package/doc/rules/execOfUntrustedCommand.md +16 -0
  62. package/doc/rules/missingAuthentication.md +1 -1
  63. package/doc/rules/tooManyJoins.md +0 -1
  64. package/doc/rules/unbatchedMaterializedQuery.md +0 -1
  65. package/package.json +1 -1
  66. package/doc/labels/sanitize.md +0 -29
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: system.exec.sanitize
3
+ rules:
4
+ - exec-of-untrusted-command
5
+ ---
6
+
7
+ Ensures that data is safe and trusted for use as a system command, transforming it if necessary, and
8
+ returning `falsey` or raising an exception if it's impossible to make the data safe.
9
+
10
+ A function with this label can be used to convert untrusted data such as direct user input or HTTP
11
+ request parameters into trusted data.
12
+
13
+ Note that this is not the same as ensuring that a parameter satisfies business logic constraints -
14
+ such as presence or max length. It's a security check that ensures the data cannot cause harm when
15
+ used as a system command.
16
+
17
+ To be considered successful, a `system.exec.sanitize` function must return a `truthy` value.
18
+
19
+ ## Examples
20
+
21
+ - Ensuring that a user-provided file path is a subdirectory of a known allowed directory.
22
+ - Ensuring that a system command string does not have any potential injection or side-effects.
@@ -5,7 +5,6 @@ title: Circular package dependency
5
5
  references:
6
6
  CWE-1047: https://cwe.mitre.org/data/definitions/1047.html
7
7
  impactDomain: Maintainability
8
- scope: command
9
8
  ---
10
9
 
11
10
  Finds cycles in the package dependency graph. Cyclic dependencies make code hard to maintain,
@@ -9,7 +9,7 @@ impactDomain: Security
9
9
  labels:
10
10
  - deserialize.unsafe
11
11
  - deserialize.safe
12
- - sanitize
12
+ - deserialize.sanitize
13
13
  ---
14
14
 
15
15
  Finds occurrances of deserialization in which the mechanism employed is known to be unsafe, and the
@@ -0,0 +1,16 @@
1
+ ---
2
+ rule: exec-of-untrusted-command
3
+ name: Exec of untrusted command
4
+ title: Execution of untrusted system command
5
+ references:
6
+ CWE-78: https://cwe.mitre.org/data/definitions/78.html
7
+ impactDomain: Security
8
+ labels:
9
+ - system.exec
10
+ - system.exec.safe
11
+ - system.exec.sanitize
12
+ ---
13
+
14
+ Find occurrances of system command execution in which the command string is not guaranteed to be
15
+ safe.
16
+
@@ -6,7 +6,7 @@ references:
6
6
  CWE-306: https://cwe.mitre.org/data/definitions/306.html
7
7
  impactDomain: Security
8
8
  labels:
9
- - public
9
+ - access.public
10
10
  - security.authentication
11
11
  scope: http_server_request
12
12
  ---
@@ -5,7 +5,6 @@ title: Too many joins
5
5
  references:
6
6
  CWE-1049: https://cwe.mitre.org/data/definitions/1049.html
7
7
  impactDomain: Performance
8
- scope: command
9
8
  ---
10
9
 
11
10
  Verifies that the number of joins in SQL queries does not exceed a threshold.
@@ -7,7 +7,6 @@ references:
7
7
  impactDomain: Performance
8
8
  labels:
9
9
  - dao.materialize
10
- scope: command
11
10
  ---
12
11
 
13
12
  Finds large data sets that are queried from the database and loaded into memory.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appland/scanner",
3
- "version": "1.46.3",
3
+ "version": "1.49.0",
4
4
  "description": "",
5
5
  "bin": "built/cli.js",
6
6
  "files": [
@@ -1,29 +0,0 @@
1
- ---
2
- name: sanitize
3
- rules:
4
- - deserialization-of-untrusted-data
5
- ---
6
-
7
- Ensures that data is safe and trusted, transforming it if necessary, and returning `falsey` or
8
- raising an exception if it's impossible to make the data safe.
9
-
10
- A function with this label can be used to convert untrusted data such as direct user input or HTTP
11
- request parameters into trusted data.
12
-
13
- Note that this is not the same as ensuring that a parameter satisfies business logic constraints -
14
- such as presence or max length. It's a security check that ensures the data cannot cause downstream
15
- harm.
16
-
17
- To be considered successful, a `sanitize` function must return a `truthy` value.
18
-
19
- ## Examples
20
-
21
- - Sanitizing HTML by removing all potentially harmful elements, such as script tags.
22
- - Ensuring that SQL queries are properly escaped.
23
- - Running user-provided YAML through a "safe loader" which discards unsafe syntax such as object
24
- class names.
25
- - Ensuring that a user-provided file path is a subdirectory of a known allowed directory.
26
- - Ensuring that a system command string does not have any potential injection or side-effects.
27
- - Ruby -
28
- [sanitize_filename](https://github.com/technoweenie/attachment_fu/blob/fa08cb03914b02b66853b4615cd3eca768291ca7/lib/technoweenie/attachment_fu.rb#L410)
29
- in `attachment_fu`.