Skip to content

Separate config option to enable restapi: permissions#2605

Merged
RyanL1997 merged 1 commit intoopensearch-project:mainfrom
willyborankin:separate-rest-admin-settings
Apr 6, 2023
Merged

Separate config option to enable restapi: permissions#2605
RyanL1997 merged 1 commit intoopensearch-project:mainfrom
willyborankin:separate-rest-admin-settings

Conversation

@willyborankin
Copy link
Copy Markdown
Collaborator

@willyborankin willyborankin commented Mar 30, 2023

Description

Added config settings plugins.security.restapi.admin.enabled which enables/disables :resapi permissions.
Default is false

Issues Resolved

Is this a backport? If so, please add backport PR # and/or commits #

Testing

[Please provide details of testing done: unit testing, integration testing and manual testing]

Check List

  • New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 30, 2023

Codecov Report

Attention: Patch coverage is 53.33333% with 7 lines in your changes missing coverage. Please review.

Project coverage is 61.25%. Comparing base (a9bad90) to head (29789ef).
Report is 667 commits behind head on main.

Files with missing lines Patch % Lines
...dlic/rest/api/RestApiAdminPrivilegesEvaluator.java 41.66% 6 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #2605      +/-   ##
============================================
- Coverage     61.25%   61.25%   -0.01%     
- Complexity     3331     3332       +1     
============================================
  Files           260      260              
  Lines         18509    18515       +6     
  Branches       3269     3271       +2     
============================================
+ Hits          11338    11341       +3     
- Misses         5576     5580       +4     
+ Partials       1595     1594       -1     
Files with missing lines Coverage Δ
.../opensearch/security/OpenSearchSecurityPlugin.java 79.91% <100.00%> (+0.04%) ⬆️
...arch/security/dlic/rest/api/AbstractApiAction.java 76.26% <100.00%> (+0.09%) ⬆️
...security/dlic/rest/api/SecuritySSLCertsAction.java 71.13% <ø> (-0.59%) ⬇️
...g/opensearch/security/support/ConfigConstants.java 94.44% <ø> (ø)
...dlic/rest/api/RestApiAdminPrivilegesEvaluator.java 75.75% <41.66%> (-2.58%) ⬇️

Copy link
Copy Markdown
Member

@peternied peternied left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @willyborankin! Couple of minor comments inline

@willyborankin willyborankin force-pushed the separate-rest-admin-settings branch 2 times, most recently from 9d33282 to 3dfd122 Compare April 1, 2023 14:55
Added config settings
plugins.security.restapi.admin.enabled which enables/disables :resapi permissions.
Default is false

Signed-off-by: Andrey Pleskach <ples@aiven.io>
);
if (logger.isDebugEnabled()) {
logger.debug(
"User {} with permission {} {} access to endpoint {}",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@RyanL1997 RyanL1997 merged commit 6446268 into opensearch-project:main Apr 6, 2023
stephen-crawford pushed a commit to stephen-crawford/security that referenced this pull request Apr 11, 2023
…ject#2605)

Added config settings
plugins.security.restapi.admin.enabled which enables/disables :resapi permissions.
Default is false

Signed-off-by: Andrey Pleskach <ples@aiven.io>
MaciejMierzwa pushed a commit to MaciejMierzwa/security that referenced this pull request Apr 11, 2023
…ject#2605)

Added config settings
plugins.security.restapi.admin.enabled which enables/disables :resapi permissions.
Default is false

Signed-off-by: Andrey Pleskach <ples@aiven.io>
MaciejMierzwa pushed a commit to MaciejMierzwa/security that referenced this pull request Apr 11, 2023
…ject#2605)

Added config settings
plugins.security.restapi.admin.enabled which enables/disables :resapi permissions.
Default is false

Signed-off-by: Andrey Pleskach <ples@aiven.io>
MaciejMierzwa pushed a commit to MaciejMierzwa/security that referenced this pull request Apr 20, 2023
…ject#2605)

Added config settings
plugins.security.restapi.admin.enabled which enables/disables :resapi permissions.
Default is false

Signed-off-by: Andrey Pleskach <ples@aiven.io>
Signed-off-by: Maciej Mierzwa <dev.maciej.mierzwa@gmail.com>
MaciejMierzwa pushed a commit to MaciejMierzwa/security that referenced this pull request Apr 27, 2023
…ject#2605)

Added config settings
plugins.security.restapi.admin.enabled which enables/disables :resapi permissions.
Default is false

Signed-off-by: Andrey Pleskach <ples@aiven.io>
Signed-off-by: Maciej Mierzwa <dev.maciej.mierzwa@gmail.com>
@willyborankin willyborankin deleted the separate-rest-admin-settings branch May 22, 2023 15:18
@DarshitChanpura DarshitChanpura added backport 2.x backport 2.8 Backport to 2.8 branch labels May 30, 2023
@opensearch-trigger-bot
Copy link
Copy Markdown
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-2605-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 6446268bdf4fd9f39d0e669aafa227b582dbf4e6
# Push it to GitHub
git push --set-upstream origin backport/backport-2605-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-2605-to-2.x.

@opensearch-trigger-bot
Copy link
Copy Markdown
Contributor

The backport to 2.8 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.8 2.8
# Navigate to the new working tree
cd .worktrees/backport-2.8
# Create a new branch
git switch --create backport/backport-2605-to-2.8
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 6446268bdf4fd9f39d0e669aafa227b582dbf4e6
# Push it to GitHub
git push --set-upstream origin backport/backport-2605-to-2.8
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.8

Then, create a pull request where the base branch is 2.8 and the compare/head branch is backport/backport-2605-to-2.8.

DarshitChanpura pushed a commit to DarshitChanpura/security that referenced this pull request May 30, 2023
…ject#2605)

Added config settings
plugins.security.restapi.admin.enabled which enables/disables :resapi permissions.
Default is false

Signed-off-by: Andrey Pleskach <ples@aiven.io>
(cherry picked from commit 6446268)
DarshitChanpura pushed a commit to DarshitChanpura/security that referenced this pull request May 30, 2023
…ject#2605)

Added config settings
plugins.security.restapi.admin.enabled which enables/disables :resapi permissions.
Default is false

Signed-off-by: Andrey Pleskach <ples@aiven.io>
(cherry picked from commit 6446268)
DarshitChanpura added a commit that referenced this pull request May 30, 2023
Added config settings
plugins.security.restapi.admin.enabled which enables/disables :resapi permissions.
Default is false

Signed-off-by: Andrey Pleskach <ples@aiven.io>
(cherry picked from commit 6446268)

Co-authored-by: Andrey Pleskach <ples@aiven.io>
RyanL1997 pushed a commit that referenced this pull request May 31, 2023
Added config settings
plugins.security.restapi.admin.enabled which enables/disables :resapi permissions.
Default is false

Signed-off-by: Andrey Pleskach <ples@aiven.io>
(cherry picked from commit 6446268)

Co-authored-by: Andrey Pleskach <ples@aiven.io>
MaciejMierzwa pushed a commit to MaciejMierzwa/security that referenced this pull request Jun 13, 2023
…ject#2605)

Added config settings
plugins.security.restapi.admin.enabled which enables/disables :resapi permissions.
Default is false

Signed-off-by: Andrey Pleskach <ples@aiven.io>
Signed-off-by: Maciej Mierzwa <dev.maciej.mierzwa@gmail.com>
MaciejMierzwa pushed a commit to MaciejMierzwa/security that referenced this pull request Jun 13, 2023
…ject#2605)

Added config settings
plugins.security.restapi.admin.enabled which enables/disables :resapi permissions.
Default is false

Signed-off-by: Andrey Pleskach <ples@aiven.io>
Signed-off-by: Maciej Mierzwa <dev.maciej.mierzwa@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.8 Backport to 2.8 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] There should be a seperate configuration option to enable restapi: permissions

5 participants