@neralabs/rerail-pack-python 0.1.2 → 0.1.4
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.
- package/README.md +707 -3
- package/licenses/bandit/UPSTREAM.md +10 -0
- package/licenses/ruff/UPSTREAM.md +56 -0
- package/pack.json +7 -20
- package/package.json +1 -1
- package/rules/bandit-b101-assert-used.json +2 -2
- package/rules/bandit-b102-exec-used.json +2 -2
- package/rules/bandit-b110-try-except-pass.json +1 -1
- package/rules/bandit-b112-try-except-continue.json +1 -1
- package/rules/bandit-b113-request-without-timeout.json +2 -2
- package/rules/bandit-b301-pickle.json +2 -2
- package/rules/bandit-b302-marshal.json +2 -2
- package/rules/bandit-b303-md5.json +1 -1
- package/rules/bandit-b305-cipher-modes.json +2 -2
- package/rules/bandit-b306-mktemp-q.json +2 -2
- package/rules/bandit-b307-eval.json +1 -1
- package/rules/bandit-b308-mark-safe.json +2 -2
- package/rules/bandit-b310-urllib-urlopen.json +1 -1
- package/rules/bandit-b311-random.json +1 -1
- package/rules/bandit-b312-telnetlib.json +1 -1
- package/rules/bandit-b313-xml-bad-celementtree.json +1 -1
- package/rules/bandit-b314-xml-bad-elementtree.json +1 -1
- package/rules/bandit-b315-xml-bad-expatreader.json +1 -1
- package/rules/bandit-b316-xml-bad-expatbuilder.json +1 -1
- package/rules/bandit-b317-xml-bad-sax.json +1 -1
- package/rules/bandit-b318-xml-bad-minidom.json +1 -1
- package/rules/bandit-b319-xml-bad-pulldom.json +1 -1
- package/rules/bandit-b321-ftplib.json +2 -2
- package/rules/bandit-b323-unverified-context.json +2 -2
- package/rules/bandit-b401-import-telnetlib.json +2 -2
- package/rules/bandit-b402-import-ftplib.json +2 -2
- package/rules/bandit-b405-import-xml-etree.json +1 -1
- package/rules/bandit-b407-import-xml-expat.json +1 -1
- package/rules/bandit-b408-import-xml-minidom.json +1 -1
- package/rules/bandit-b409-import-xml-pulldom.json +1 -1
- package/rules/bandit-b411-import-xmlrpclib.json +1 -1
- package/rules/bandit-b413-import-pycrypto.json +1 -1
- package/rules/bandit-b415-import-pyghmi.json +2 -2
- package/rules/bandit-b502-ssl-with-bad-version.json +2 -2
- package/rules/bandit-b505-weak-cryptographic-key.json +2 -2
- package/rules/bandit-b507-ssh-no-host-key-verification.json +2 -2
- package/rules/bandit-b606-start-process-with-no-shell.json +2 -2
- package/rules/bandit-b615-huggingface-unsafe-download.json +2 -2
- package/rules/ruff-async100-cancel-scope-no-checkpoint.json +2 -2
- package/rules/ruff-async105-trio-sync-call.json +1 -1
- package/rules/ruff-async115-async-zero-sleep.json +1 -1
- package/rules/ruff-async116-long-sleep-not-forever.json +1 -1
- package/rules/ruff-async210-blocking-http-call-in-async-function.json +2 -2
- package/rules/ruff-async221-run-process-in-async-function.json +1 -1
- package/rules/ruff-async222-wait-for-process-in-async-function.json +2 -2
- package/rules/ruff-async230-blocking-open-call-in-async-function.json +2 -2
- package/rules/ruff-async250-blocking-input-in-async-function.json +2 -2
- package/rules/ruff-async251-blocking-sleep-in-async-function.json +1 -1
- package/rules/ruff-b002-unary-prefix-increment-decrement.json +3 -3
- package/rules/ruff-b003-assignment-to-os-environ.json +2 -2
- package/rules/ruff-b004-unreliable-callable-check.json +1 -1
- package/rules/ruff-b005-strip-with-multi-characters.json +2 -2
- package/rules/ruff-b007-unused-loop-control-variable.json +1 -1
- package/rules/ruff-b009-get-attr-with-constant.json +1 -1
- package/rules/ruff-b010-set-attr-with-constant.json +2 -2
- package/rules/ruff-b011-assert-false.json +1 -1
- package/rules/ruff-b013-redundant-tuple-in-exception-handler.json +1 -1
- package/rules/ruff-b014-duplicate-handler-exception.json +1 -1
- package/rules/ruff-b016-raise-literal.json +1 -1
- package/rules/ruff-b020-loop-variable-overrides-iterator.json +1 -1
- package/rules/ruff-b021-f-string-docstring.json +1 -1
- package/rules/ruff-b022-useless-contextlib-suppress.json +1 -1
- package/rules/ruff-b023-function-uses-loop-variable.json +2 -2
- package/rules/ruff-b025-duplicate-try-block-exception.json +1 -1
- package/rules/ruff-b026-star-arg-unpacking-after-keyword-arg.json +1 -1
- package/rules/ruff-b028-no-explicit-stacklevel.json +2 -2
- package/rules/ruff-b029-except-with-empty-tuple.json +1 -1
- package/rules/ruff-b030-except-with-non-exception-classes.json +406 -0
- package/rules/ruff-b032-unintentional-type-annotation.json +1 -1
- package/rules/ruff-b033-duplicate-value.json +1 -1
- package/rules/ruff-b034-re-sub-positional-args.json +1 -1
- package/rules/ruff-b039-mutable-contextvar-default.json +2 -2
- package/rules/ruff-b904-raise-without-from-inside-except.json +2 -2
- package/rules/ruff-b905-zip-without-explicit-strict.json +1 -1
- package/rules/ruff-e711-none-comparison.json +1 -1
- package/rules/ruff-e721-type-comparison.json +1 -1
- package/rules/ruff-e722-bare-except.json +2 -2
- package/rules/ruff-e742-ambiguous-class-name.json +2 -2
- package/rules/ruff-e743-ambiguous-function-name.json +2 -2
- package/rules/ruff-f403-undefined-local-with-import-star.json +1 -1
- package/rules/ruff-f405-undefined-local-with-import-star-usage.json +2 -2
- package/rules/ruff-f406-undefined-local-with-nested-import-star-usage.json +2 -2
- package/rules/ruff-f407-future-feature-not-defined.json +1 -1
- package/rules/ruff-f501-percent-format-invalid-format.json +2 -2
- package/rules/ruff-f502-percent-format-expected-mapping.json +1 -1
- package/rules/ruff-f503-percent-format-expected-sequence.json +1 -1
- package/rules/ruff-f504-percent-format-extra-named-arguments.json +1 -1
- package/rules/ruff-f505-percent-format-missing-argument.json +1 -1
- package/rules/ruff-f506-percent-format-mixed-positional-and-named.json +2 -2
- package/rules/ruff-f507-percent-format-positional-count-mismatch.json +2 -2
- package/rules/ruff-f508-percent-format-star-requires-sequence.json +2 -2
- package/rules/ruff-f509-percent-format-unsupported-format-character.json +2 -2
- package/rules/ruff-f521-string-dot-format-invalid-format.json +1 -1
- package/rules/ruff-f522-string-dot-format-extra-named-arguments.json +2 -2
- package/rules/ruff-f523-string-dot-format-extra-positional-arguments.json +1 -1
- package/rules/ruff-f524-string-dot-format-missing-arguments.json +1 -1
- package/rules/ruff-f525-string-dot-format-mixing-automatic.json +1 -1
- package/rules/ruff-f541-f-string-missing-placeholders.json +2 -2
- package/rules/ruff-f601-multi-value-repeated-key-literal.json +1 -1
- package/rules/ruff-f602-multi-value-repeated-key-variable.json +2 -2
- package/rules/ruff-f622-multiple-starred-expressions.json +1 -1
- package/rules/ruff-f632-is-literal.json +1 -1
- package/rules/ruff-f633-invalid-print-syntax.json +2 -2
- package/rules/ruff-f701-break-outside-loop.json +1 -1
- package/rules/ruff-f702-continue-outside-loop.json +1 -1
- package/rules/ruff-f706-return-outside-function.json +1 -1
- package/rules/ruff-f707-default-except-not-last.json +1 -1
- package/rules/ruff-f822-undefined-export.json +1 -1
- package/rules/ruff-f823-undefined-local.json +2 -2
- package/rules/ruff-f842-unused-annotation.json +1 -1
- package/rules/ruff-f901-raise-not-implemented.json +1 -1
- package/rules/ruff-pie794-duplicate-class-field-definition.json +1 -1
- package/rules/ruff-pie796-non-unique-enums.json +1 -1
- package/rules/ruff-pie800-unnecessary-spread.json +1 -1
- package/rules/ruff-pie804-unnecessary-dict-kwargs.json +1 -1
- package/rules/ruff-pie807-reimplemented-container-builtin.json +1 -1
- package/rules/ruff-pie810-multiple-starts-ends-with.json +2 -2
- package/rules/ruff-ret501-unnecessary-return-none.json +1 -1
- package/rules/ruff-ret502-implicit-return-value.json +2 -2
- package/rules/ruff-ret505-superfluous-else-return.json +1 -1
- package/rules/ruff-ret506-superfluous-else-raise.json +1 -1
- package/rules/ruff-ret507-superfluous-else-continue.json +1 -1
- package/rules/ruff-ret508-superfluous-else-break.json +1 -1
- package/rules/ruff-sim101-duplicate-isinstance-call.json +1 -1
- package/rules/ruff-sim107-return-in-try-except-finally.json +2 -2
- package/rules/ruff-sim109-compare-with-tuple.json +1 -1
- package/rules/ruff-sim112-uncapitalized-environment-variables.json +2 -2
- package/rules/ruff-sim113-enumerate-for-loop.json +1 -1
- package/rules/ruff-sim208-double-negation.json +1 -1
- package/rules/ruff-sim210-if-expr-with-true-false.json +1 -1
- package/rules/ruff-sim211-if-expr-with-false-true.json +1 -1
- package/rules/ruff-sim212-if-expr-with-twisted-arms.json +2 -2
- package/rules/ruff-sim300-yoda-conditions.json +2 -2
- package/rules/ruff-sim905-split-static-string.json +1 -1
- package/rules/ruff-sim910-dict-get-with-none-default.json +1 -1
- package/rules/ruff-t100-debugger.json +3 -3
- package/rules/bandit-b406-import-xml-sax.json +0 -73
- package/rules/bandit-b610-django-extra-used.json +0 -268
- package/rules/ruff-f722-forward-annotation-syntax-error.json +0 -654
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-ret502-implicit-return-value",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Use return None instead of a bare return in Python functions that also return a value; make the None result explicit.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"violation": {
|
|
150
150
|
"anchor": "witness.span",
|
|
151
151
|
"code": "RET502",
|
|
152
|
-
"message": "
|
|
152
|
+
"message": "Write `return None` instead of a bare `return`, since this function returns a value elsewhere.",
|
|
153
153
|
"suppress": {
|
|
154
154
|
"noqa": {
|
|
155
155
|
"codes": [
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-ret505-superfluous-else-return",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Remove the else or elif after an if branch that returns, and dedent its code; the branch already leaves the function.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-ret506-superfluous-else-raise",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Remove the else or elif after an if branch that raises, and dedent its code; the branch already leaves the function.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-ret507-superfluous-else-continue",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Remove the else or elif after an if branch that continues the loop, and dedent its code; the branch already skips ahead.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-ret508-superfluous-else-break",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Remove the else or elif after an if branch that breaks out of the loop, and dedent its code; the branch already exits the loop.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-sim101-duplicate-isinstance-call",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Merge isinstance() checks on the same object joined by or into one call with a tuple of types.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-sim107-return-in-try-except-finally",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Don't return from a finally block when the try or except also returns; the finally return silently overrides theirs.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"violation": {
|
|
69
69
|
"anchor": "witness.span",
|
|
70
70
|
"code": "SIM107",
|
|
71
|
-
"message": "
|
|
71
|
+
"message": "Remove the `return` from the `finally` block; it silently overrides the `return` in `try` or `except`.",
|
|
72
72
|
"suppress": {
|
|
73
73
|
"noqa": {
|
|
74
74
|
"codes": [
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-sim109-compare-with-tuple",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Use a membership test against a tuple instead of several or-chained equality checks of the same variable.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-sim112-uncapitalized-environment-variables",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Use uppercase names when reading environment variables through os.environ or os.getenv; the lowercase proxy variables are exempt.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
"violation": {
|
|
155
155
|
"anchor": "witness.span",
|
|
156
156
|
"code": "SIM112",
|
|
157
|
-
"message": "
|
|
157
|
+
"message": "Write this environment variable name in uppercase, and set the variable under that name wherever it is defined.",
|
|
158
158
|
"suppress": {
|
|
159
159
|
"noqa": {
|
|
160
160
|
"codes": [
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-sim113-enumerate-for-loop",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Use enumerate() instead of a counter that starts at 0 and is incremented by hand in each pass of a for loop.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-sim208-double-negation",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Remove double negation with not not; use the value itself, or bool() if you need a real boolean.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-sim210-if-expr-with-true-false",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Use bool() on the condition instead of a conditional expression that yields True when it holds and False otherwise.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-sim211-if-expr-with-false-true",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Use not on the condition instead of a conditional expression that yields False when it holds and True otherwise.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-sim212-if-expr-with-twisted-arms",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Swap the arms of a conditional expression that tests not x and falls back to x, so the test reads x without the negation.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"violation": {
|
|
82
82
|
"anchor": "witness.span",
|
|
83
83
|
"code": "SIM212",
|
|
84
|
-
"message": "
|
|
84
|
+
"message": "Swap the arms to read `$A if $A else ...`, dropping the `not` from `... if not $A else $A`.",
|
|
85
85
|
"suppress": {
|
|
86
86
|
"noqa": {
|
|
87
87
|
"codes": [
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-sim300-yoda-conditions",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Put the variable first and the constant or literal second in comparisons, avoiding Yoda conditions; it reads the way you would say it.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -473,7 +473,7 @@
|
|
|
473
473
|
"violation": {
|
|
474
474
|
"anchor": "witness.span",
|
|
475
475
|
"code": "SIM300",
|
|
476
|
-
"message": "
|
|
476
|
+
"message": "Swap the comparison so the variable comes first and the constant second, as in `x == 1`.",
|
|
477
477
|
"suppress": {
|
|
478
478
|
"noqa": {
|
|
479
479
|
"codes": [
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-sim905-split-static-string",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Use a list literal instead of calling split() or rsplit() on a string literal; the result is known in advance.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-sim910-dict-get-with-none-default",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Drop the redundant None default from dict.get() calls; get() already returns None for a missing key.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-t100-debugger",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Remove debugger imports and calls such as pdb.set_trace() and breakpoint() before committing.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"violation": {
|
|
107
107
|
"anchor": "witness.span",
|
|
108
108
|
"code": "T100",
|
|
109
|
-
"message": "
|
|
109
|
+
"message": "Remove this debugger import of `$D` before committing.",
|
|
110
110
|
"each": "D",
|
|
111
111
|
"suppress": {
|
|
112
112
|
"noqa": {
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
"violation": {
|
|
184
184
|
"anchor": "witness.span",
|
|
185
185
|
"code": "T100",
|
|
186
|
-
"message": "
|
|
186
|
+
"message": "Remove this debugger call before committing.",
|
|
187
187
|
"suppress": {
|
|
188
188
|
"noqa": {
|
|
189
189
|
"codes": [
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"format": "rerail.policy/v1",
|
|
3
|
-
"id": "bandit-b406-import-xml-sax",
|
|
4
|
-
"revision": 2,
|
|
5
|
-
"mode": "steer",
|
|
6
|
-
"description": "Detect direct imports of xml.sax. Port of Bandit 1.9.4's B406 import_xml_sax. Divergence: an import of only xml.sax.saxutils (`from xml.sax.saxutils import ...`, `from xml.sax import saxutils`, aliased or parenthesised) is not reported. saxutils holds XML writing and escaping helpers (escape, quoteattr, unescape, XMLGenerator) and no parser, so defusedxml, which the steer points to, has nothing to replace it with. `import xml.sax.saxutils` is still reported, since it also binds xml.sax and its parse functions (NER-1827).",
|
|
7
|
-
"scope": {
|
|
8
|
-
"include": [
|
|
9
|
-
"**/*.py"
|
|
10
|
-
],
|
|
11
|
-
"exclude": []
|
|
12
|
-
},
|
|
13
|
-
"clauses": [
|
|
14
|
-
{
|
|
15
|
-
"id": "B406",
|
|
16
|
-
"forbid": {
|
|
17
|
-
"ast": {
|
|
18
|
-
"language": "python",
|
|
19
|
-
"rule": {
|
|
20
|
-
"any": [
|
|
21
|
-
{
|
|
22
|
-
"pattern": "import xml.sax"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"pattern": "import xml.sax as $ALIAS"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"pattern": "from xml.sax import $$$NAMES"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"pattern": "from xml import sax"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"pattern": "from xml import sax as $ALIAS"
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
"not": {
|
|
38
|
-
"any": [
|
|
39
|
-
{
|
|
40
|
-
"pattern": "from xml.sax.saxutils import $$$NAMES"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"pattern": "from xml.sax import saxutils"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"pattern": "from xml.sax import saxutils as $ALIAS"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"pattern": "from xml.sax import (saxutils)"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"pattern": "from xml.sax import (saxutils as $ALIAS)"
|
|
53
|
-
}
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
"violation": {
|
|
60
|
-
"code": "B406",
|
|
61
|
-
"anchor": "witness.span",
|
|
62
|
-
"message": "xml.sax parsing may be vulnerable to XML attacks; use defusedxml or defuse the standard library.",
|
|
63
|
-
"suppress": {
|
|
64
|
-
"nosec": {
|
|
65
|
-
"codes": [
|
|
66
|
-
"B406"
|
|
67
|
-
]
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
]
|
|
73
|
-
}
|
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"format": "rerail.policy/v1",
|
|
3
|
-
"id": "bandit-b610-django-extra-used",
|
|
4
|
-
"revision": 2,
|
|
5
|
-
"mode": "steer",
|
|
6
|
-
"description": "Port of Bandit 1.9.4's B610 django_extra_used: a call of `extra` whose `where` or `tables` is not a list of plain strings, or whose `select` is not a dict of plain strings, bound to QuerySet.extra's six positional slots. Port of the kernel test b610_extra_with_a_non_literal_where_tables_or_select. Bandit's `# nosec` is honoured (`suppress.nosec`), as its recordings honour it. Divergence: Bandit reports a call of any function or method named `extra`; the port reports only a method call whose receiver looks like a Django QuerySet or Manager: a name or attribute named `objects`, `qs`, `QS`, `queryset`, `querysets`, `manager` or `managers`, alone or after an underscore-joined prefix (`User.objects`, `self.queryset`, `base_qs`, `_default_manager`); a call of `get_queryset`; a method call on such a receiver (`User.objects.filter(...)`); or `self` or `super()` inside a class with a base whose name ends in `QuerySet` (`QuerySet`, `SoftDeleteQuerySet`, `TreeQuerySet`) or is `Manager`, `BaseManager` or `BaseUserManager`, optionally dotted (`models.QuerySet`); a base that only ends in `Manager` (`AbstractContextManager`, `PluginManager`, `TreeManager`) does not count. A bare `extra(...)` call and `extra` on any other receiver (`parser.extra(...)`, `self.extra(...)` in an unrelated class) are not reported (NER-1827).",
|
|
7
|
-
"scope": {
|
|
8
|
-
"include": [
|
|
9
|
-
"**/*"
|
|
10
|
-
],
|
|
11
|
-
"exclude": []
|
|
12
|
-
},
|
|
13
|
-
"clauses": [
|
|
14
|
-
{
|
|
15
|
-
"id": "django-extra-used",
|
|
16
|
-
"forbid": {
|
|
17
|
-
"ast": {
|
|
18
|
-
"language": "python",
|
|
19
|
-
"rule": {
|
|
20
|
-
"any": [
|
|
21
|
-
{
|
|
22
|
-
"pattern": "$R.extra($$$)"
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
"all": [
|
|
26
|
-
{
|
|
27
|
-
"has": {
|
|
28
|
-
"field": "function",
|
|
29
|
-
"has": {
|
|
30
|
-
"field": "object",
|
|
31
|
-
"matches": "queryset-receiver"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"any": [
|
|
37
|
-
{
|
|
38
|
-
"arguments": {
|
|
39
|
-
"signature": [
|
|
40
|
-
"select",
|
|
41
|
-
"where",
|
|
42
|
-
"params",
|
|
43
|
-
"tables",
|
|
44
|
-
"order_by",
|
|
45
|
-
"select_params"
|
|
46
|
-
],
|
|
47
|
-
"bind": {
|
|
48
|
-
"W": "where"
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
"has": {
|
|
52
|
-
"stopBy": "end",
|
|
53
|
-
"pattern": "$W",
|
|
54
|
-
"not": {
|
|
55
|
-
"matches": "strings"
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"arguments": {
|
|
61
|
-
"signature": [
|
|
62
|
-
"select",
|
|
63
|
-
"where",
|
|
64
|
-
"params",
|
|
65
|
-
"tables",
|
|
66
|
-
"order_by",
|
|
67
|
-
"select_params"
|
|
68
|
-
],
|
|
69
|
-
"bind": {
|
|
70
|
-
"T": "tables"
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
"has": {
|
|
74
|
-
"stopBy": "end",
|
|
75
|
-
"pattern": "$T",
|
|
76
|
-
"not": {
|
|
77
|
-
"matches": "strings"
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"arguments": {
|
|
83
|
-
"signature": [
|
|
84
|
-
"select",
|
|
85
|
-
"where",
|
|
86
|
-
"params",
|
|
87
|
-
"tables",
|
|
88
|
-
"order_by",
|
|
89
|
-
"select_params"
|
|
90
|
-
],
|
|
91
|
-
"bind": {
|
|
92
|
-
"S": "select"
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
"has": {
|
|
96
|
-
"stopBy": "end",
|
|
97
|
-
"pattern": "$S",
|
|
98
|
-
"not": {
|
|
99
|
-
"matches": "string-pairs"
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
]
|
|
104
|
-
}
|
|
105
|
-
]
|
|
106
|
-
},
|
|
107
|
-
"utils": {
|
|
108
|
-
"queryset-receiver": {
|
|
109
|
-
"any": [
|
|
110
|
-
{
|
|
111
|
-
"kind": "identifier",
|
|
112
|
-
"regex": "^(?:[A-Za-z0-9_]*_)?(?:qs|QS|querysets?|objects|managers?)$"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"kind": "attribute",
|
|
116
|
-
"has": {
|
|
117
|
-
"field": "attribute",
|
|
118
|
-
"regex": "^(?:[A-Za-z0-9_]*_)?(?:qs|QS|querysets?|objects|managers?)$"
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"kind": "call",
|
|
123
|
-
"has": {
|
|
124
|
-
"field": "function",
|
|
125
|
-
"kind": "attribute",
|
|
126
|
-
"has": {
|
|
127
|
-
"field": "object",
|
|
128
|
-
"matches": "queryset-receiver"
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
"kind": "call",
|
|
134
|
-
"has": {
|
|
135
|
-
"field": "function",
|
|
136
|
-
"any": [
|
|
137
|
-
{
|
|
138
|
-
"kind": "identifier",
|
|
139
|
-
"regex": "^get_queryset$"
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
"kind": "attribute",
|
|
143
|
-
"has": {
|
|
144
|
-
"field": "attribute",
|
|
145
|
-
"regex": "^get_queryset$"
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
]
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
"any": [
|
|
153
|
-
{
|
|
154
|
-
"kind": "identifier",
|
|
155
|
-
"regex": "^self$"
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
"pattern": "super()"
|
|
159
|
-
}
|
|
160
|
-
],
|
|
161
|
-
"inside": {
|
|
162
|
-
"stopBy": "end",
|
|
163
|
-
"kind": "class_definition",
|
|
164
|
-
"has": {
|
|
165
|
-
"field": "superclasses",
|
|
166
|
-
"regex": "(?:^|[(,\\s])(?:[A-Za-z_][A-Za-z0-9_]*\\.)*(?:[A-Za-z0-9_]*QuerySet|Manager|BaseManager|BaseUserManager)\\b"
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
]
|
|
171
|
-
},
|
|
172
|
-
"string": {
|
|
173
|
-
"any": [
|
|
174
|
-
{
|
|
175
|
-
"kind": "string",
|
|
176
|
-
"not": {
|
|
177
|
-
"regex": "^[A-Za-z]*[fFbBtT]"
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
"kind": "concatenated_string",
|
|
182
|
-
"not": {
|
|
183
|
-
"has": {
|
|
184
|
-
"kind": "string",
|
|
185
|
-
"regex": "^[A-Za-z]*[fFbBtT]"
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
]
|
|
190
|
-
},
|
|
191
|
-
"strings": {
|
|
192
|
-
"kind": "list",
|
|
193
|
-
"not": {
|
|
194
|
-
"has": {
|
|
195
|
-
"stopBy": "neighbor",
|
|
196
|
-
"not": {
|
|
197
|
-
"any": [
|
|
198
|
-
{
|
|
199
|
-
"matches": "string"
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
"regex": "^[\\[\\],]$"
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
"kind": "comment"
|
|
206
|
-
}
|
|
207
|
-
]
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
},
|
|
212
|
-
"string-pairs": {
|
|
213
|
-
"kind": "dictionary",
|
|
214
|
-
"not": {
|
|
215
|
-
"has": {
|
|
216
|
-
"stopBy": "neighbor",
|
|
217
|
-
"not": {
|
|
218
|
-
"any": [
|
|
219
|
-
{
|
|
220
|
-
"kind": "pair",
|
|
221
|
-
"not": {
|
|
222
|
-
"has": {
|
|
223
|
-
"stopBy": "neighbor",
|
|
224
|
-
"not": {
|
|
225
|
-
"any": [
|
|
226
|
-
{
|
|
227
|
-
"matches": "string"
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
"regex": "^:$"
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
"kind": "comment"
|
|
234
|
-
}
|
|
235
|
-
]
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
"regex": "^[{},]$"
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
"kind": "comment"
|
|
245
|
-
}
|
|
246
|
-
]
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
},
|
|
254
|
-
"violation": {
|
|
255
|
-
"anchor": "witness.span",
|
|
256
|
-
"code": "B610",
|
|
257
|
-
"message": "Bandit B610 (django-extra-used)",
|
|
258
|
-
"suppress": {
|
|
259
|
-
"nosec": {
|
|
260
|
-
"codes": [
|
|
261
|
-
"B610"
|
|
262
|
-
]
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
]
|
|
268
|
-
}
|