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

feat: Add support for OPA authorizer #474

Merged
merged 30 commits into from Feb 28, 2024
Merged

feat: Add support for OPA authorizer #474

merged 30 commits into from Feb 28, 2024

Conversation

sbernauer
Copy link
Member

@sbernauer sbernauer commented Feb 20, 2024

Description

Closes #400

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

Edit tasklist title
Beta Give feedback Tasklist Author, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. Changes are OpenShift compatible
    Options
  2. CRD changes approved
    Options
  3. CRD documentation for all fields, following the style guide.
    Options
  4. Integration tests passed (for non trivial changes)
    Options
  5. Changes need to be "offline" compatible
    Options

Reviewer

Edit tasklist title
Beta Give feedback Tasklist Reviewer, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. Code contains useful comments
    Options
  2. Code contains useful logging statements
    Options
  3. (Integration-)Test cases added
    Options
  4. Documentation added or updated. Follows the style guide.
    Options
  5. Changelog updated
    Options
  6. Cargo.toml only contains references to git tags (not specific commits or branches)
    Options

Acceptance

Edit tasklist title
Beta Give feedback Tasklist Acceptance, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. Feature Tracker has been updated
    Options
  2. Proper release label has been added
    Options

rust/crd/src/lib.rs Outdated Show resolved Hide resolved
@sbernauer sbernauer marked this pull request as ready for review February 20, 2024 14:27
@NickLarsenNZ NickLarsenNZ self-requested a review February 21, 2024 07:55
NickLarsenNZ
NickLarsenNZ previously approved these changes Feb 21, 2024
Copy link
Member

@NickLarsenNZ NickLarsenNZ left a comment

Choose a reason for hiding this comment

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

LGTM

rust/operator-binary/src/security/opa.rs Outdated Show resolved Hide resolved
@sbernauer
Copy link
Member Author

In terms of CRD change we have two options:

1. Enable authorizer and group-mapper simultaneous

  # Enable authorizer and group-mapper at the same time
  clusterConfig:
    authorization: # optional
      opa: # mandatory
        configMapName: opa # mandatory
        package: hdfs # mandatory
  • Good, because consistent and users can not enable authZ and forget about group mapping
  • Good, because rego rules can rely on the groups being propagated (although not recommended)

2. Enable authorizer and group-mapper separately

  clusterConfig:
    authorization: # optional
      opaAuthorization: # mandatory
        configMapName: opa # mandatory
        package: hdfs # mandatory
      opaGroupMapping: # optional
        configMapName: opa # mandatory
        package: hdfs # mandatory
  • Good, because more flexible, e.g. you can enable AuthZ without group mapping (which you basically would get for free)
  • Bad, because more complex and error-prone

Originally I was thinking of 2., but now I am in favor of 1., as it's simpler and more consistent and 2. only enables stuff we should probably not support :)
User can always use configOverrides to easily partially enabled stuff when they really really want to.

@sbernauer
Copy link
Member Author

@adwk67 adwk67 self-requested a review February 27, 2024 13:42
Copy link
Member

@adwk67 adwk67 left a comment

Choose a reason for hiding this comment

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

Just reviewed the docs so far with a few comments. Nit: we use regorule, rego rule and rego-rule here: I don't mind which it is but we should be consistent. The opa docs seem to use two separate words i.e. rego rules.

docs/modules/hdfs/pages/usage-guide/security.adoc Outdated Show resolved Hide resolved
docs/modules/hdfs/pages/usage-guide/security.adoc Outdated Show resolved Hide resolved
docs/modules/hdfs/pages/usage-guide/security.adoc Outdated Show resolved Hide resolved
docs/modules/hdfs/pages/usage-guide/security.adoc Outdated Show resolved Hide resolved
docs/modules/hdfs/pages/usage-guide/security.adoc Outdated Show resolved Hide resolved
docs/modules/hdfs/pages/usage-guide/security.adoc Outdated Show resolved Hide resolved
docs/modules/hdfs/pages/usage-guide/security.adoc Outdated Show resolved Hide resolved
docs/modules/hdfs/pages/usage-guide/security.adoc Outdated Show resolved Hide resolved
docs/modules/hdfs/pages/usage-guide/security.adoc Outdated Show resolved Hide resolved
docs/modules/hdfs/pages/usage-guide/security.adoc Outdated Show resolved Hide resolved
@sbernauer
Copy link
Member Author

@adwk67 feedback should be addressed

@sbernauer
Copy link
Member Author

adwk67
adwk67 previously approved these changes Feb 28, 2024
Copy link
Member

@adwk67 adwk67 left a comment

Choose a reason for hiding this comment

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

LGTM! Can merge when the CI tests are all done.

Copy link
Member

@adwk67 adwk67 left a comment

Choose a reason for hiding this comment

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

LGTM! Can merge when the CI tests are all done.

@sbernauer
Copy link
Member Author

@sbernauer
Copy link
Member Author

Another full testsuite run, after I increased the resources in stackabletech/ci@40937a9:
https://ci.stackable.tech/view/02%20Operator%20Tests%20(custom)/job/hdfs-operator-it-custom/131/

@sbernauer
Copy link
Member Author

Full testsuite passed 🚀

@sbernauer sbernauer added this pull request to the merge queue Feb 28, 2024
Merged via the queue into main with commit 4505bf7 Feb 28, 2024
30 checks passed
@sbernauer sbernauer deleted the feat/opa-authorizer branch February 28, 2024 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Implement Authorizer
3 participants