Commit a53a8a6
Authorize rest requests (#2753)
* WIP on rest layer authz
Signed-off-by: Craig Perkins <cwperx@amazon.com>
* WIP on rest-layer authz
Signed-off-by: Craig Perkins <cwperx@amazon.com>
* Extension handshake
Signed-off-by: Craig Perkins <cwperx@amazon.com>
* Extension TLS
Signed-off-by: Craig Perkins <cwperx@amazon.com>
* Remove SecurityRestFilterChanges to isolate extension TLS change
Signed-off-by: Craig Perkins <cwperx@amazon.com>
* Remove SecurityRestFilterChanges to isolate extension TLS change
Signed-off-by: Craig Perkins <cwperx@amazon.com>
* Remove SecurityRestFilterChanges to isolate extension TLS change
Signed-off-by: Craig Perkins <cwperx@amazon.com>
* Remove SecurityRestFilterChanges to isolate extension TLS change
Signed-off-by: Craig Perkins <cwperx@amazon.com>
* Remove SecurityRestFilterChanges to isolate extension TLS change
Signed-off-by: Craig Perkins <cwperx@amazon.com>
* WIP for HelloWorld sample extension role
Signed-off-by: Craig Perkins <cwperx@amazon.com>
* Initial implementation of authz check in REST layer
Signed-off-by: Craig Perkins <cwperx@amazon.com>
* Remove header
Signed-off-by: Craig Perkins <cwperx@amazon.com>
* Create authorizeRequest method
Signed-off-by: Craig Perkins <cwperx@amazon.com>
* small fix
Signed-off-by: Craig Perkins <cwperx@amazon.com>
* Change to ProtectedRoute
Signed-off-by: Craig Perkins <cwperx@amazon.com>
* Remove extension permissions
Signed-off-by: Craig Perkins <cwperx@amazon.com>
* Initial implementation of authz check in REST layer
Signed-off-by: Craig Perkins <cwperx@amazon.com>
* Extension TLS
Signed-off-by: Craig Perkins <cwperx@amazon.com>
* Adds dummy roles for testing rest authorization against legacy permissions
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Adds support for legacy permissions to perform rest authorization
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Fixes white-space changes
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Rebases ConfigConstants with main
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Implements a new logic for rest permissions check to be more flexible
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Fixes spotless errors
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Adds regex to match against current role permissions when comparing new permission with legacy ones
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Moves legacy permission check logic to ConfigModelV7
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Fixes extra new-lines
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Fixes unused imports
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Fixes out-of-scope white space changes
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Fixes code-ql errors
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Fixes spotless and code-ql errors
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Fixes variable name and remove references to whitelist in javadoc
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Adds tests for rest layer privilege evaluator
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Adds license header to the test file
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Updates zstd dependency to fetch from core version.properties
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Updates action name in the regex to be dynamic
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Adds support for allowing evaluation against multiple actions names for a registered named route
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Updates tests
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Adds null check
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Makes authorize logic clearer to follow
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Adds extra check to ensure new actions are also evaluated against transport actions
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Fixes spotless errors
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Fixes security rest filter setup
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Removes extension reference
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* turn on audit logging
Signed-off-by: Maciej Mierzwa <dev.maciej.mierzwa@gmail.com>
* Adds unit tests for restPathMatches method
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Cleans up TODOs
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Organizes demo users and roles for extension
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Address PR feedback
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Adds more comments
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* add privileges info
Signed-off-by: Maciej Mierzwa <dev.maciej.mierzwa@gmail.com>
* Makes whoami action a named route and fixes license header check
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Adds integ tests for whoami route
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Change permissions order in roles.yml
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Adds developer documentation for authorization in REST layer
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Fixes broken tests
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Fixes checkstyle errors
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Addresses feedback and cleans up logic for super admin check
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Addresses Plugin Install CI failure
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Fixes failing citest task
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Modifies WhoAmI integ tests
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Adds a new endpoint called whoamiprotected and removes changes made to whoami route
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Updates documentation to reflect the new API
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Addresses PR feedback
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Renames action0 to actions
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
---------
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Maciej Mierzwa <dev.maciej.mierzwa@gmail.com>
Co-authored-by: Craig Perkins <cwperx@amazon.com>
Co-authored-by: MaciejMierzwa <dev.maciej.mierzwa@gmail.com>1 parent 49cbf52 commit a53a8a6
14 files changed
Lines changed: 795 additions & 24 deletions
File tree
- src
- integrationTest/java/org/opensearch/security/rest
- main/java/org/opensearch/security
- auditlog/impl
- dlic/rest/support
- filter
- privileges
- rest
- test
- java/org/opensearch/security
- filter
- privileges
- resources
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
81 | 127 | | |
82 | 128 | | |
83 | 129 | | |
| |||
188 | 234 | | |
189 | 235 | | |
190 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
191 | 242 | | |
192 | 243 | | |
193 | 244 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
Lines changed: 107 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| |||
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
| 209 | + | |
208 | 210 | | |
209 | 211 | | |
210 | 212 | | |
| |||
1019 | 1021 | | |
1020 | 1022 | | |
1021 | 1023 | | |
| 1024 | + | |
| 1025 | + | |
1022 | 1026 | | |
1023 | 1027 | | |
| 1028 | + | |
1024 | 1029 | | |
1025 | 1030 | | |
1026 | 1031 | | |
| |||
1035 | 1040 | | |
1036 | 1041 | | |
1037 | 1042 | | |
| 1043 | + | |
1038 | 1044 | | |
1039 | 1045 | | |
1040 | 1046 | | |
| |||
1072 | 1078 | | |
1073 | 1079 | | |
1074 | 1080 | | |
| 1081 | + | |
1075 | 1082 | | |
1076 | 1083 | | |
1077 | 1084 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| 187 | + | |
187 | 188 | | |
188 | 189 | | |
189 | 190 | | |
| |||
Lines changed: 12 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
240 | 241 | | |
241 | 242 | | |
242 | 243 | | |
243 | | - | |
244 | | - | |
245 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
246 | 255 | | |
247 | 256 | | |
248 | 257 | | |
| |||
0 commit comments