forked from opensearch-project/security
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add validation for null elements in JSON array (opensearch-project#1157)
(cherry picked from commit 960d420)
- Loading branch information
Showing
18 changed files
with
221 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/test/resources/restapi/actiongroup_null_array_element.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"allowed_actions": [null, "OPENDISTRO_SECURITY_WRITE"] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"nodes_dn" : [null] | ||
} |
9 changes: 9 additions & 0 deletions
9
src/test/resources/restapi/roles_null_array_element_allowed_actions.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"cluster_permissions" : ["cluster:monitor1*"], | ||
"index_permissions" : [{ | ||
"index_patterns" : [ "*" ], | ||
"masked_fields" : [ "abvfg", "*ip_dest*::/[0-9]{1,3}$/::XXX", "*ip_source*::/[0-9]{1,3}$/::XXX::/^[0-9]{1,3}/::***", "customer.name::SHA-512", "/[0-9]{1,3}/::SHA-512" ], | ||
"allowed_actions" : [ "123", null ] | ||
}], | ||
"tenant_permissions" : [ ] | ||
} |
9 changes: 9 additions & 0 deletions
9
src/test/resources/restapi/roles_null_array_element_cluster_permissions.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"cluster_permissions" : [null], | ||
"index_permissions" : [ { | ||
"index_patterns" : [ "*" ], | ||
"masked_fields" : [ "abvfg", "*ip_dest*::/[0-9]{1,3}$/::XXX", "*ip_source*::/[0-9]{1,3}$/::XXX::/^[0-9]{1,3}/::***", "customer.name::SHA-512", "/[0-9]{1,3}/::SHA-512" ], | ||
"allowed_actions" : [ "123", "indices:data/read/*" ] | ||
} ], | ||
"tenant_permissions" : [ ] | ||
} |
9 changes: 9 additions & 0 deletions
9
src/test/resources/restapi/roles_null_array_element_index_patterns.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"cluster_permissions" : ["cluster:monitor1*"], | ||
"index_permissions" : [{ | ||
"index_patterns" : [null], | ||
"masked_fields" : [ "abvfg", "*ip_dest*::/[0-9]{1,3}$/::XXX", "*ip_source*::/[0-9]{1,3}$/::XXX::/^[0-9]{1,3}/::***", "customer.name::SHA-512", "/[0-9]{1,3}/::SHA-512" ], | ||
"allowed_actions" : [ "123", "indices:data/read/*" ] | ||
}], | ||
"tenant_permissions" : [ ] | ||
} |
5 changes: 5 additions & 0 deletions
5
src/test/resources/restapi/roles_null_array_element_index_permissions.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"cluster_permissions" : ["cluster:monitor1*"], | ||
"index_permissions" : [null], | ||
"tenant_permissions" : [ ] | ||
} |
9 changes: 9 additions & 0 deletions
9
src/test/resources/restapi/roles_null_array_element_masked_fields.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"cluster_permissions" : ["cluster:monitor1*"], | ||
"index_permissions" : [{ | ||
"index_patterns" : [ "*" ], | ||
"masked_fields" : [ "abvfg", null, "*ip_source*::/[0-9]{1,3}$/::XXX::/^[0-9]{1,3}/::***", "customer.name::SHA-512", "/[0-9]{1,3}/::SHA-512" ], | ||
"allowed_actions" : [ "123", "indices:data/read/*" ] | ||
}], | ||
"tenant_permissions" : [ ] | ||
} |
9 changes: 9 additions & 0 deletions
9
src/test/resources/restapi/roles_null_array_element_tenant_permissions.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"cluster_permissions" : ["cluster:monitor1*"], | ||
"index_permissions" : [{ | ||
"index_patterns" : [ "*" ], | ||
"masked_fields" : [ "abvfg", "*ip_dest*::/[0-9]{1,3}$/::XXX", "*ip_source*::/[0-9]{1,3}$/::XXX::/^[0-9]{1,3}/::***", "customer.name::SHA-512", "/[0-9]{1,3}/::SHA-512" ], | ||
"allowed_actions" : [ "123", "indices:data/read/*" ] | ||
}], | ||
"tenant_permissions" : [null] | ||
} |
14 changes: 14 additions & 0 deletions
14
src/test/resources/restapi/rolesmapping_null_array_element_backend_roles.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"users": [ | ||
"user1", | ||
"user2" | ||
], | ||
"backend_roles": [ | ||
"captains", | ||
null | ||
], | ||
"hosts": [ | ||
"8.8.8.8", | ||
"8.8.4.4" | ||
] | ||
} |
14 changes: 14 additions & 0 deletions
14
src/test/resources/restapi/rolesmapping_null_array_element_hosts.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"users": [ | ||
"user1", | ||
"user2" | ||
], | ||
"backend_roles": [ | ||
"captains", | ||
"role2" | ||
], | ||
"hosts": [ | ||
null, | ||
"8.8.4.4" | ||
] | ||
} |
11 changes: 11 additions & 0 deletions
11
src/test/resources/restapi/rolesmapping_null_array_element_users.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"users": [ | ||
null | ||
], | ||
"backend_roles": [ | ||
"captains" | ||
], | ||
"hosts": [ | ||
"8.8.8.8" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"backend_roles": [ | ||
null | ||
] | ||
} |