Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roles yml changes for security-analytics plugin #2192

Merged
merged 5 commits into from
Nov 2, 2022

Conversation

raj-chak
Copy link
Contributor

@raj-chak raj-chak commented Oct 25, 2022

Signed-off-by: Raj Chakravarthi [email protected]

Description

Added entries in roles.yml for cluster permissions to security-analytics plugin end points
Added default roles configuration required for security-analytics plugin

Issues Resolved

opensearch-project/security-analytics#50

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.

@raj-chak raj-chak requested a review from a team October 25, 2022 21:04
Copy link
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 for creating this pull request, can you please fill in the pull request description for this change?

Biggest unknown for me is where the design usage of these permissions, would love to get more details on this. Please link associated issues/documents about this plugin.

config/roles.yml Outdated Show resolved Hide resolved
config/roles.yml Outdated Show resolved Hide resolved
config/roles.yml Outdated Show resolved Hide resolved
- 'cluster:admin/opensearch/securityanalytics/mapping/view/get'
- 'cluster:admin/opensearch/securityanalytics/rule/get'
- 'cluster:admin/opensearch/securityanalytics/rule/search'

Copy link
Member

Choose a reason for hiding this comment

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

Lets also add security_analytics_ack_alerts for the security operators to be able to acknowledge alerts with cluster permission as:

cluster_permissions:
    - 'cluster:admin/opendistro/securityanalytics/alerts/*'

Copy link
Contributor Author

@raj-chak raj-chak Nov 1, 2022

Choose a reason for hiding this comment

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

done as opensearch not opendistro to be consistent with the rest

- index_patterns:
- '*'
allowed_actions:
- 'indices:admin/mapping/put'
Copy link
Member

Choose a reason for hiding this comment

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

How about indices:admin/mappings/get ? Also are there more permissions such as for aliases that might be needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done and tested.

@peternied peternied added backport 2.x backport to 2.x branch backport 2.4 v2.4.0 'Issues and PRs related to version v2.4.0' labels Nov 1, 2022
@peternied
Copy link
Member

❌ CI / backward-compatibility (pull_request) Failing after 5m

This looks unrelated to this change, need to see if there is a new failure from main

@codecov-commenter
Copy link

codecov-commenter commented Nov 1, 2022

Codecov Report

Merging #2192 (399269e) into main (9f9fddc) will decrease coverage by 0.11%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##               main    #2192      +/-   ##
============================================
- Coverage     61.14%   61.02%   -0.12%     
- Complexity     3266     3267       +1     
============================================
  Files           259      259              
  Lines         18335    18335              
  Branches       3248     3248              
============================================
- Hits          11211    11189      -22     
- Misses         5535     5561      +26     
+ Partials       1589     1585       -4     
Impacted Files Coverage Δ
...curity/util/ratetracking/HeapBasedRateTracker.java 48.62% <0.00%> (-22.94%) ⬇️
...org/opensearch/security/support/SecurityUtils.java 72.30% <0.00%> (ø)
...search/security/transport/SecurityInterceptor.java 76.15% <0.00%> (+0.76%) ⬆️
.../dlic/auth/ldap2/LDAPConnectionFactoryFactory.java 58.95% <0.00%> (+1.49%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
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 for making these updates, merging!

@peternied
Copy link
Member

Note; the BWC issue is on main, merging this despite BWC failures since they were not impacted

@peternied peternied merged commit 89a11c5 into opensearch-project:main Nov 2, 2022
@opensearch-trigger-bot
Copy link
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-2192-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 89a11c5a165d9fc1a5412a3c2369d3b27869b305
# Push it to GitHub
git push --set-upstream origin backport/backport-2192-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-2192-to-2.x.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.4 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.4 2.4
# Navigate to the new working tree
cd .worktrees/backport-2.4
# Create a new branch
git switch --create backport/backport-2192-to-2.4
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 89a11c5a165d9fc1a5412a3c2369d3b27869b305
# Push it to GitHub
git push --set-upstream origin backport/backport-2192-to-2.4
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.4

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

raj-chak added a commit to raj-chak/security that referenced this pull request Nov 2, 2022
)

* roles yml changes for security-analytics plugin

Signed-off-by: Raj Chakravarthi <[email protected]>
Signed-off-by: Raj Chakravarthi <[email protected]>
(cherry picked from commit 89a11c5)
raj-chak added a commit to raj-chak/security that referenced this pull request Nov 2, 2022
)

* roles yml changes for security-analytics plugin

Signed-off-by: Raj Chakravarthi <[email protected]>
Signed-off-by: Raj Chakravarthi <[email protected]>
(cherry picked from commit 89a11c5)
peternied added a commit that referenced this pull request Nov 3, 2022
* roles yml changes for security-analytics plugin

Signed-off-by: Raj Chakravarthi <[email protected]>
Signed-off-by: Raj Chakravarthi <[email protected]>
(cherry picked from commit 89a11c5)

Co-authored-by: Peter Nied <[email protected]>
stephen-crawford pushed a commit to stephen-crawford/security that referenced this pull request Nov 10, 2022
)

* roles yml changes for security-analytics plugin

Signed-off-by: Raj Chakravarthi <[email protected]>
Signed-off-by: Raj Chakravarthi <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
cwperks pushed a commit that referenced this pull request Nov 22, 2022
* roles yml changes for security-analytics plugin

Signed-off-by: Raj Chakravarthi <[email protected]>
(cherry picked from commit 89a11c5)
wuychn pushed a commit to ochprince/security that referenced this pull request Mar 16, 2023
) (opensearch-project#2222)

* roles yml changes for security-analytics plugin

Signed-off-by: Raj Chakravarthi <[email protected]>
(cherry picked from commit 89a11c5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport to 2.x branch backport 2.4 v2.4.0 'Issues and PRs related to version v2.4.0'
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants