Skip to content

Commit

Permalink
add security rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioggstream committed Sep 8, 2021
1 parent 051e185 commit 897d742
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 18 deletions.
9 changes: 5 additions & 4 deletions security/tests/array-test.snapshot
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
OpenAPI 3.x detected
OpenAPI 3.0.x detected

/code/security/tests/array-test.yml
13:14 warning array-boundaries Schema of type array must specify maxItems and minItems. #/components/schemas/ko_Array `ko_Array.maxItems` property should be defined components.schemas.ko_Array
17:23 warning array-boundaries Schema of type array must specify maxItems and minItems. #/components/schemas/ko_Array_minItems `ko_Array_minItems.minItems` property should be defined components.schemas.ko_Array_minItems
22:23 warning array-boundaries Schema of type array must specify maxItems and minItems. #/components/schemas/ko_Array_maxItems `ko_Array_maxItems.maxItems` property should be defined components.schemas.ko_Array_maxItems
45:18 warning array-boundaries Schema of type array must specify maxItems and minItems. #/paths/~1array-ko-params/post/parameters/0/schema/properties/a3 `a3.maxItems` property should be defined paths./array-ko-params.post.parameters[0].schema.properties.a3
13:14 warning array-boundaries Schema of type array must specify maxItems and minItems. #/components/schemas/ko_Array `ko_Array.maxItems` property must be defined components.schemas.ko_Array
17:23 warning array-boundaries Schema of type array must specify maxItems and minItems. #/components/schemas/ko_Array_minItems `ko_Array_minItems.minItems` property must be defined components.schemas.ko_Array_minItems
22:23 warning array-boundaries Schema of type array must specify maxItems and minItems. #/components/schemas/ko_Array_maxItems `ko_Array_maxItems.maxItems` property must be defined components.schemas.ko_Array_maxItems
45:18 warning array-boundaries Schema of type array must specify maxItems and minItems. #/paths/~1array-ko-params/post/parameters/0/schema/properties/a3 `a3.maxItems` property must be defined paths./array-ko-params.post.parameters[0].schema.properties.a3

✖ 4 problems (0 errors, 4 warnings, 0 infos, 0 hints)

11 changes: 6 additions & 5 deletions security/tests/numbers-test.snapshot
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
OpenAPI 3.x detected
OpenAPI 3.0.x detected

/code/security/tests/numbers-test.yml
4:15 warning number-boundaries Schema of type number or integer must specify a maximum and a minimum. #/components/schemas/ko_Number `ko_Number.maximum` property should be defined components.schemas.ko_Number
6:21 warning number-boundaries Schema of type number or integer must specify a maximum and a minimum. #/components/schemas/ko_Number_nomin `ko_Number_nomin.minimum` property should be defined components.schemas.ko_Number_nomin
9:21 warning number-boundaries Schema of type number or integer must specify a maximum and a minimum. #/components/schemas/ko_Number_nomax `ko_Number_nomax.maximum` property should be defined components.schemas.ko_Number_nomax
26:17 warning number-boundaries Schema of type number or integer must specify a maximum and a minimum. #/paths/~1number-ko-params/put/parameters/0/schema/oneOf/0 `[0].maximum` property should be defined paths./number-ko-params.put.parameters[0].schema.oneOf[0]
42:19 warning number-boundaries Schema of type number or integer must specify a maximum and a minimum. #/paths/~1number-ko-inline/put/requestBody/content/application~1json-patch+json/schema `schema.maximum` property should be defined paths./number-ko-inline.put.requestBody.content.application/json-patch+json.schema
4:15 warning number-boundaries Schema of type number or integer must specify a maximum and a minimum. #/components/schemas/ko_Number `ko_Number.maximum` property must be defined components.schemas.ko_Number
6:21 warning number-boundaries Schema of type number or integer must specify a maximum and a minimum. #/components/schemas/ko_Number_nomin `ko_Number_nomin.minimum` property must be defined components.schemas.ko_Number_nomin
9:21 warning number-boundaries Schema of type number or integer must specify a maximum and a minimum. #/components/schemas/ko_Number_nomax `ko_Number_nomax.maximum` property must be defined components.schemas.ko_Number_nomax
26:17 warning number-boundaries Schema of type number or integer must specify a maximum and a minimum. #/paths/~1number-ko-params/put/parameters/0/schema/oneOf/0 `[0].maximum` property must be defined paths./number-ko-params.put.parameters[0].schema.oneOf[0]
42:19 warning number-boundaries Schema of type number or integer must specify a maximum and a minimum. #/paths/~1number-ko-inline/put/requestBody/content/application~1json-patch+json/schema `schema.maximum` property must be defined paths./number-ko-inline.put.requestBody.content.application/json-patch+json.schema

✖ 5 problems (0 errors, 5 warnings, 0 infos, 0 hints)

1 change: 1 addition & 0 deletions security/tests/objects-test.snapshot
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
OpenAPI 3.x detected
OpenAPI 3.0.x detected

/code/security/tests/objects-test.yml
4:13 warning no-default-additionalProperties Objects should not allow additionalProperties. Disable them with `additionalProperties: false` or constraint them. components.schemas.ko_wild
Expand Down
9 changes: 5 additions & 4 deletions security/tests/securitySchemes-test.snapshot
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
OpenAPI 3.x detected
OpenAPI 3.0.x detected

/code/security/tests/securitySchemes-test.yml
7:9 error security-protection-non-idempotent The following non-idempotent operation is not protected by a `security` rule: #/paths/~1security-ko-put/put paths./security-ko-put.put
10:11 error security-protection-non-idempotent The following non-idempotent operation is not protected by a `security` rule: #/paths/~1security-ko-patch/patch paths./security-ko-patch.patch
15:16 error security-protection-non-idempotent The following non-idempotent operation is not protected by a `security` rule: #/paths/~1security-empty-ko-patch/patch/security paths./security-empty-ko-patch.patch.security
20:11 error security-protection-non-idempotent The following non-idempotent operation is not protected by a `security` rule: #/paths/~1security-minproperties-ko-patch/patch/security/0 paths./security-minproperties-ko-patch.patch.security[0]
27:9 information security-protection-get The following operation is not protected by a `security` rule: #/paths/~1security-ko-get/get paths./security-ko-get.get
35:16 warning securitySchemes-oauth JWT usage should be detailed in `description` `MyOauth_ko.description` property is not truthy. components.securitySchemes.MyOauth_ko
46:20 warning securitySchemes-oauth JWT usage should be detailed in `description` must match the pattern '.*RFC8725.*'. components.securitySchemes.MyOauth2_ko.description
47:18 warning securitySchemes-jwt JWT usage should be detailed in `description` `JWTBearer_ko.description` property is not truthy. components.securitySchemes.JWTBearer_ko
53:20 warning securitySchemes-jwt JWT usage should be detailed in `description` must match the pattern '.*RFC8725.*'. components.securitySchemes.JWTBearer2_ko.description
35:16 warning securitySchemes-oauth JWT usage should be detailed in `description` `MyOauth_ko.description` property must be truthy. components.securitySchemes.MyOauth_ko
46:20 warning securitySchemes-oauth JWT usage should be detailed in `description` "A blatant description" must match the pattern ".*RFC8725.*". components.securitySchemes.MyOauth2_ko.description
47:18 warning securitySchemes-jwt JWT usage should be detailed in `description` `JWTBearer_ko.description` property must be truthy. components.securitySchemes.JWTBearer_ko
53:20 warning securitySchemes-jwt JWT usage should be detailed in `description` "a blatant description" must match the pattern ".*RFC8725.*". components.securitySchemes.JWTBearer2_ko.description
66:31 error securitySchemes-oauth-http OAuth endpoints must use https:// components.securitySchemes.MyOauth_ko3.flows.authorizationCode.authorizationUrl
67:20 error securitySchemes-oauth-allowed-flows Do not use oauth2 insecure flow: "implicit". components.securitySchemes.MyOauth_ko3.flows.implicit
69:20 error securitySchemes-oauth-allowed-flows Do not use oauth2 insecure flow: "password". components.securitySchemes.MyOauth_ko3.flows.password
Expand Down
11 changes: 6 additions & 5 deletions security/tests/string-test.snapshot
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
OpenAPI 3.x detected
OpenAPI 3.0.x detected

/code/security/tests/string-test.yml
4:20 warning string-maxlength Strings (non enum) must specify a maximum length. #/components/schemas/ko_string_wild `ko_string_wild.maxLength` property should be defined components.schemas.ko_string_wild
4:20 hint string-pattern-or-format-or-enum Strings (non enum) must specify a pattern or a format. #/components/schemas/ko_string_wild components.schemas.ko_string_wild
7:26 hint string-pattern-or-format-or-enum Strings (non enum) must specify a pattern or a format. #/components/schemas/ko_string_no_pattern components.schemas.ko_string_no_pattern
44:16 warning string-maxlength Strings (non enum) must specify a maximum length. #/paths/~1string-ko-params/parameters/0/schema `schema.maxLength` property should be defined paths./string-ko-params.parameters[0].schema
44:16 hint string-pattern-or-format-or-enum Strings (non enum) must specify a pattern or a format. #/paths/~1string-ko-params/parameters/0/schema paths./string-ko-params.parameters[0].schema
4:20 warning string-maxlength Strings (non enum) must specify a maximum length. #/components/schemas/ko_string_wild `ko_string_wild.maxLength` property must be defined components.schemas.ko_string_wild
4:20 hint string-pattern-or-format-or-enum Strings (non enum) must specify a pattern or a format. #/components/schemas/ko_string_wild components.schemas.ko_string_wild
7:26 hint string-pattern-or-format-or-enum Strings (non enum) must specify a pattern or a format. #/components/schemas/ko_string_no_pattern components.schemas.ko_string_no_pattern
44:16 warning string-maxlength Strings (non enum) must specify a maximum length. #/paths/~1string-ko-params/parameters/0/schema `schema.maxLength` property must be defined paths./string-ko-params.parameters[0].schema
44:16 hint string-pattern-or-format-or-enum Strings (non enum) must specify a pattern or a format. #/paths/~1string-ko-params/parameters/0/schema paths./string-ko-params.parameters[0].schema

✖ 5 problems (0 errors, 2 warnings, 0 infos, 3 hints)

0 comments on commit 897d742

Please sign in to comment.