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

IGNITE-22844 control.sh --consistency repair permissions fixes #11456

Merged
merged 9 commits into from
Aug 9, 2024

Conversation

maksaska
Copy link
Contributor

@maksaska maksaska commented Jul 25, 2024

Intro:
Currently 'Read Repair' task performed for the chosen partitions by control.sh requires CACHE_READ and CACHE PUT permissions in addition to ADMIN_OPS. Thus, to perform the comand control.sh --consistency repair the one needs all 3 permissions.

There is no point to have additional CACHE_READ and CACHE_PUT permissions to perform the operation, as they are useless for the task itself, and introduces security risk, by allowing the user to manipulate the cache in parallel.

The solution would be to substitute user's security context with the context of the cluster node that performs the command. The former is used for the ADMIN_OPS permission check and the latter is used for cache. This will ease the requirement for the users to perform control.sh --consistency repair without introducing any additional security risk.

What have I changed:

  • As the task logic proceeds with cache reads after initial authorization, we switch the user SecurityContext to a random node SecurityContext
  • Additional tests for users with ADMIN_OPS only. Those should be able to start control.sh --consistency repair command with no authorization error relates to CACHE_READ and CACHE_PUT

Thank you for submitting the pull request to the Apache Ignite.

In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:

The Contribution Checklist

  • There is a single JIRA ticket related to the pull request.
  • The web-link to the pull request is attached to the JIRA ticket.
  • The JIRA ticket has the Patch Available state.
  • The pull request body describes changes that have been made.
    The description explains WHAT and WHY was made instead of HOW.
  • The pull request title is treated as the final commit message.
    The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • A reviewer has been mentioned through the JIRA comments
    (see the Maintainers list)
  • The pull request has been checked by the Teamcity Bot and
    the green visa attached to the JIRA ticket (see TC.Bot: Check PR)

Notes

If you need any help, please email [email protected] or ask anу advice on http://asf.slack.com #ignite channel.

Maksim Davydov added 7 commits July 25, 2024 18:47
* codeStyle fix
* Removed extra variable
* Additional test cases
* tests
* code style fixes
* code style fixes
* redundant code refactored
Maksim Davydov added 2 commits August 8, 2024 17:27
* code style fixes
* code style fixes
Copy link

sonarqubecloud bot commented Aug 9, 2024

@petrov-mg petrov-mg merged commit 984d9ae into apache:master Aug 9, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants