-
-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add support for 2.6.0 and OPA authorizer #506
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
Merged
Changes from all commits
Commits
Show all changes
83 commits
Select commit
Hold shift + click to select a range
e87034f
feat(test): make it easy to test custom images
razvan d7aa82c
revert some tests to hbase-latest
razvan 86ca320
fix indentation
razvan bc3299a
fix access-hbase container image
razvan f7da603
wip: temp test setup
adwk67 8a7a984
fix yaml lint
razvan 4da9949
merge branch feat/opa-authorizer
razvan 1ce9881
fix opa pull policy
razvan 44e8456
use AllowAccessController
razvan 8b21b56
Added custom logging to the kerberos test
razvan 71b77b7
Set log4j2 properties in the kerberos test
razvan 50b6dec
Use log4j2 properties starting with HBase 2.6
razvan bd70621
Fix clippy errors
razvan 0065ae3
fix kerberos test
razvan aa082eb
separated opa from kerberos tests
razvan 94485cb
restore kerberos tests from main
razvan 24c1d0e
readd custom image support to the kerberos tests
razvan 8cff952
reduce opa test dimensions
razvan 3eb7c6e
example rego rules and test
adwk67 bbe7d26
use 2.6.0 sandbox image for tests
razvan 0cdbb63
working integration test
adwk67 3afc3c1
Merge branch 'feat/opa' of github.com:stackabletech/hbase-operator in…
adwk67 f6d810e
update profiler integration test
razvan ddd3329
fix logging test
razvan 8270710
Merge branch 'main' into feat/opa
razvan 608aa00
update krb5 image for opa tests
razvan 19b2881
fix snapshot tests
razvan 4812832
fix yaml lint
razvan 86b3fdc
Merge branch 'main' into feat/opa
razvan e6d927b
working rego rules test
adwk67 9b6b3b8
Merge branch 'feat/opa' of github.com:stackabletech/hbase-operator in…
adwk67 a6b3aa7
Operator adds OPA authorizer props
razvan fbc15b6
regenerate charts
razvan a179c45
adapted tests to addition of scanner checks
adwk67 49231cc
Update OPA test with authorization props
razvan 144219d
replace realm dimension with CLUSTER.LOCAL
razvan 1e0db7c
add docs
adwk67 8cb9ccf
Merge branch 'feat/opa' of github.com:stackabletech/hbase-operator in…
adwk67 96dc40f
Update changelog and test-definition.yaml
razvan fd77f5d
Minor doc tweaks
razvan 3f28b3a
docs: separate Rego examples from authorizer configuration
razvan 8c27797
fix yaml lint
razvan b24fb38
Merge branch 'main' into feat/opa
razvan 589e647
temporarily use 2.6 for most tests
razvan c2876a0
Use Hbase 2.6 built in Prometheus exporter.
razvan c2777f7
Merge branch 'main' into feat/opa
razvan 17587c5
Update CHANGELOG.md
razvan 44224b0
Cleanup
razvan 1ee457b
fix markdown lint
razvan 4f89ebf
temp: ignore metrics port
razvan 12e2fdd
Revert "temp: ignore metrics port"
razvan 1c8ca9e
Remove dedicated metrics port for 2.6
razvan c226228
Fix typo
razvan 0861d3c
Update monitoring docs
razvan c38118b
Merge branch 'main' into feat/opa
razvan ff0e9bf
Move the function closer to where it's actually used.
razvan 12aa033
Validate custom resource
razvan df06736
Merge branch 'main' into feat/opa
razvan f656bef
regenerate charts
razvan 67e2635
Add resource type to OPA rules.
razvan c33ddd8
Update op-rs branch
razvan 3bce908
main merge
razvan 30fa366
Merge branch 'main' into feat/opa
razvan a1efea9
Add support for 2.4.18
lfrancke ee23732
Update changelog
lfrancke 289fe28
Update changelog
lfrancke 3d9c94e
test 2.4.18 and 2.6.0 at the same time
razvan faf6447
Fix the log4j2 filename
siegfriedweber 273479f
merge feat/hbase-2.4.18
razvan 793b86e
main merge
razvan 005b908
cleanups
razvan fddc165
Update Cargo.lock
razvan 96289a5
Update docs/modules/hbase/pages/usage-guide/security.adoc
razvan 72ce1ec
Update docs/modules/hbase/pages/usage-guide/security.adoc
razvan e85e305
Update docs/modules/hbase/pages/usage-guide/security.adoc
razvan 079850f
Update docs/modules/hbase/pages/usage-guide/security.adoc
razvan d4f3b4c
Update docs/modules/hbase/pages/usage-guide/security.adoc
razvan ca61ad9
Update docs/modules/hbase/partials/supported-versions.adoc
razvan da127aa
Update docs/modules/hbase/pages/usage-guide/security.adoc
razvan 0be7a20
Update docs/modules/hbase/pages/usage-guide/security.adoc
razvan ac80b16
review feedback
razvan 28f6ee3
Update docs/modules/hbase/pages/usage-guide/security.adoc
razvan 327adc3
Update docs/modules/hbase/pages/usage-guide/security.adoc
razvan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
package hbase | ||
|
||
import rego.v1 | ||
|
||
default allow := false | ||
default matches_identity(identity) := false | ||
|
||
# table is null if the request is for namespace permissions, but as parameters cannot be | ||
# undefined, we have to set it to something specific: | ||
checked_table_name := input.table.qualifierAsString if {input.table.qualifierAsString} | ||
checked_table_name := "__undefined__" if {not input.table.qualifierAsString} | ||
|
||
allow if { | ||
some acl in acls | ||
matches_identity(acl.identity) | ||
matches_resource(input.namespace, checked_table_name, acl.resource) | ||
action_sufficient_for_operation(acl.action, input.action) | ||
} | ||
|
||
# Identity mentions the (long) userName explicitly | ||
matches_identity(identity) if { | ||
identity in { | ||
concat("", ["user:", input.callerUgi.userName]) | ||
} | ||
} | ||
|
||
# Identity regex matches the (long) userName | ||
matches_identity(identity) if { | ||
match_entire(identity, concat("", ["userRegex:", input.callerUgi.userName])) | ||
} | ||
|
||
# Identity mentions group the user is part of (by looking up using the (long) userName) | ||
matches_identity(identity) if { | ||
some group in groups_for_user[input.callerUgi.userName] | ||
identity == concat("", ["group:", group]) | ||
} | ||
|
||
# Allow all resources | ||
matches_resource(namespace, table, resource) if { | ||
resource == "hbase:" | ||
} | ||
|
||
# Allow all namespaces | ||
matches_resource(namespace, table, resource) if { | ||
resource == "hbase:namespace:" | ||
} | ||
|
||
# Resource mentions the namespace explicitly | ||
matches_resource(namespace, table, resource) if { | ||
resource == concat(":", ["hbase:namespace", namespace]) | ||
} | ||
|
||
# Resource mentions the namespaced table explicitly | ||
matches_resource(namespace, table, resource) if { | ||
resource == concat("", ["hbase:table:", namespace, "/", table]) | ||
} | ||
|
||
match_entire(pattern, value) if { | ||
# Add the anchors ^ and $ | ||
pattern_with_anchors := concat("", ["^", pattern, "$"]) | ||
|
||
regex.match(pattern_with_anchors, value) | ||
} | ||
|
||
action_sufficient_for_operation(action, operation) if { | ||
action_hierarchy[action][_] == action_for_operation[operation] | ||
} | ||
|
||
action_hierarchy := { | ||
"full": ["full", "rw", "ro"], | ||
"rw": ["rw", "ro"], | ||
"ro": ["ro"], | ||
} | ||
|
||
action_for_operation := { | ||
"ADMIN": "full", | ||
"CREATE": "full", | ||
"WRITE": "rw", | ||
"READ": "ro", | ||
} | ||
|
||
groups_for_user := { | ||
"hbase/test-hbase-permissions.default.svc.cluster.local@CLUSTER.LOCAL": ["admins"], | ||
"testuser/test-hbase-permissions.default.svc.cluster.local@CLUSTER.LOCAL": ["admins"], | ||
"admin/test-hbase-permissions.default.svc.cluster.local@CLUSTER.LOCAL": ["admins"], | ||
"alice/test-hbase-permissions.default.svc.cluster.local@CLUSTER.LOCAL": ["developers"], | ||
"readonlyuser1/test-hbase-permissions.default.svc.cluster.local@CLUSTER.LOCAL": [], | ||
"readonlyuser2/test-hbase-permissions.default.svc.cluster.local@CLUSTER.LOCAL": [], | ||
"bob/test-hbase-permissions.default.svc.cluster.local@CLUSTER.LOCAL": [] | ||
} | ||
|
||
acls := [ | ||
{ | ||
"identity": "group:admins", | ||
"action": "full", | ||
"resource": "hbase:", | ||
}, | ||
{ | ||
"identity": "group:developers", | ||
"action": "full", | ||
"resource": "hbase:namespace:developers", | ||
}, | ||
{ | ||
"identity": "user:alice/test-hbase-permissions.default.svc.cluster.local@CLUSTER.LOCAL", | ||
"action": "rw", | ||
"resource": "hbase:table:developers/table2", | ||
}, | ||
{ | ||
"identity": "user:bob/test-hbase-permissions.default.svc.cluster.local@CLUSTER.LOCAL", | ||
"action": "rw", | ||
"resource": "hbase:table:developers/table1", | ||
}, | ||
{ | ||
"identity": "user:bob/test-hbase-permissions.default.svc.cluster.local@CLUSTER.LOCAL", | ||
"action": "rw", | ||
"resource": "hbase:table:public/table3", | ||
}, | ||
{ | ||
"identity": "user:readonlyuser1/test-hbase-permissions.default.svc.cluster.local@CLUSTER.LOCAL", | ||
"action": "ro", | ||
"resource": "hbase:table:public/test", | ||
}, | ||
{ | ||
"identity": "user:readonlyuser2/test-hbase-permissions.default.svc.cluster.local@CLUSTER.LOCAL", | ||
"action": "ro", | ||
"resource": "hbase:namespace:", | ||
}, | ||
] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.