Skip to content

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
merged 83 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
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 Jun 4, 2024
d7aa82c
revert some tests to hbase-latest
razvan Jun 4, 2024
86ca320
fix indentation
razvan Jun 4, 2024
bc3299a
fix access-hbase container image
razvan Jun 4, 2024
f7da603
wip: temp test setup
adwk67 Jun 4, 2024
8a7a984
fix yaml lint
razvan Jun 4, 2024
4da9949
merge branch feat/opa-authorizer
razvan Jun 4, 2024
1ce9881
fix opa pull policy
razvan Jun 4, 2024
44e8456
use AllowAccessController
razvan Jun 4, 2024
8b21b56
Added custom logging to the kerberos test
razvan Jun 5, 2024
71b77b7
Set log4j2 properties in the kerberos test
razvan Jun 5, 2024
50b6dec
Use log4j2 properties starting with HBase 2.6
razvan Jun 6, 2024
bd70621
Fix clippy errors
razvan Jun 6, 2024
0065ae3
fix kerberos test
razvan Jun 6, 2024
aa082eb
separated opa from kerberos tests
razvan Jun 6, 2024
94485cb
restore kerberos tests from main
razvan Jun 6, 2024
24c1d0e
readd custom image support to the kerberos tests
razvan Jun 6, 2024
8cff952
reduce opa test dimensions
razvan Jun 7, 2024
3eb7c6e
example rego rules and test
adwk67 Jun 10, 2024
bbe7d26
use 2.6.0 sandbox image for tests
razvan Jun 10, 2024
0cdbb63
working integration test
adwk67 Jun 11, 2024
3afc3c1
Merge branch 'feat/opa' of github.com:stackabletech/hbase-operator in…
adwk67 Jun 11, 2024
f6d810e
update profiler integration test
razvan Jun 11, 2024
ddd3329
fix logging test
razvan Jun 11, 2024
8270710
Merge branch 'main' into feat/opa
razvan Jun 11, 2024
608aa00
update krb5 image for opa tests
razvan Jun 11, 2024
19b2881
fix snapshot tests
razvan Jun 11, 2024
4812832
fix yaml lint
razvan Jun 11, 2024
86b3fdc
Merge branch 'main' into feat/opa
razvan Jun 12, 2024
e6d927b
working rego rules test
adwk67 Jun 12, 2024
9b6b3b8
Merge branch 'feat/opa' of github.com:stackabletech/hbase-operator in…
adwk67 Jun 12, 2024
a6b3aa7
Operator adds OPA authorizer props
razvan Jun 13, 2024
fbc15b6
regenerate charts
razvan Jun 13, 2024
a179c45
adapted tests to addition of scanner checks
adwk67 Jun 13, 2024
49231cc
Update OPA test with authorization props
razvan Jun 13, 2024
144219d
replace realm dimension with CLUSTER.LOCAL
razvan Jun 13, 2024
1e0db7c
add docs
adwk67 Jun 13, 2024
8cb9ccf
Merge branch 'feat/opa' of github.com:stackabletech/hbase-operator in…
adwk67 Jun 13, 2024
96dc40f
Update changelog and test-definition.yaml
razvan Jun 14, 2024
fd77f5d
Minor doc tweaks
razvan Jun 14, 2024
3f28b3a
docs: separate Rego examples from authorizer configuration
razvan Jun 14, 2024
8c27797
fix yaml lint
razvan Jun 14, 2024
b24fb38
Merge branch 'main' into feat/opa
razvan Jun 18, 2024
589e647
temporarily use 2.6 for most tests
razvan Jun 20, 2024
c2876a0
Use Hbase 2.6 built in Prometheus exporter.
razvan Jun 24, 2024
c2777f7
Merge branch 'main' into feat/opa
razvan Jun 24, 2024
17587c5
Update CHANGELOG.md
razvan Jun 24, 2024
44224b0
Cleanup
razvan Jun 24, 2024
1ee457b
fix markdown lint
razvan Jun 24, 2024
4f89ebf
temp: ignore metrics port
razvan Jun 24, 2024
12e2fdd
Revert "temp: ignore metrics port"
razvan Jun 25, 2024
1c8ca9e
Remove dedicated metrics port for 2.6
razvan Jun 25, 2024
c226228
Fix typo
razvan Jun 25, 2024
0861d3c
Update monitoring docs
razvan Jun 25, 2024
c38118b
Merge branch 'main' into feat/opa
razvan Jun 26, 2024
ff0e9bf
Move the function closer to where it's actually used.
razvan Jun 26, 2024
12aa033
Validate custom resource
razvan Jun 26, 2024
df06736
Merge branch 'main' into feat/opa
razvan Jun 26, 2024
f656bef
regenerate charts
razvan Jun 26, 2024
67e2635
Add resource type to OPA rules.
razvan Jun 26, 2024
c33ddd8
Update op-rs branch
razvan Jun 26, 2024
3bce908
main merge
razvan Jun 27, 2024
30fa366
Merge branch 'main' into feat/opa
razvan Jun 27, 2024
a1efea9
Add support for 2.4.18
lfrancke Jul 3, 2024
ee23732
Update changelog
lfrancke Jul 3, 2024
289fe28
Update changelog
lfrancke Jul 3, 2024
3d9c94e
test 2.4.18 and 2.6.0 at the same time
razvan Jul 11, 2024
faf6447
Fix the log4j2 filename
siegfriedweber Jul 11, 2024
273479f
merge feat/hbase-2.4.18
razvan Jul 11, 2024
793b86e
main merge
razvan Jul 11, 2024
005b908
cleanups
razvan Jul 12, 2024
fddc165
Update Cargo.lock
razvan Jul 12, 2024
96289a5
Update docs/modules/hbase/pages/usage-guide/security.adoc
razvan Jul 12, 2024
72ce1ec
Update docs/modules/hbase/pages/usage-guide/security.adoc
razvan Jul 12, 2024
e85e305
Update docs/modules/hbase/pages/usage-guide/security.adoc
razvan Jul 12, 2024
079850f
Update docs/modules/hbase/pages/usage-guide/security.adoc
razvan Jul 12, 2024
d4f3b4c
Update docs/modules/hbase/pages/usage-guide/security.adoc
razvan Jul 12, 2024
ca61ad9
Update docs/modules/hbase/partials/supported-versions.adoc
razvan Jul 12, 2024
da127aa
Update docs/modules/hbase/pages/usage-guide/security.adoc
razvan Jul 12, 2024
0be7a20
Update docs/modules/hbase/pages/usage-guide/security.adoc
razvan Jul 12, 2024
ac80b16
review feedback
razvan Jul 12, 2024
28f6ee3
Update docs/modules/hbase/pages/usage-guide/security.adoc
razvan Jul 12, 2024
327adc3
Update docs/modules/hbase/pages/usage-guide/security.adoc
razvan Jul 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,23 @@

## [Unreleased]

### Added

- Added support for HBase 2.6.0 with the following changes ([#506]):
- Added `clusterConfig.authorization` property to support the OPA authorizer
- Configure log4j2 properties
- Use built-in prometheus metric exporter
- Added support for HBase 2.4.18 ([#523])

### Changed

- Bump `stackable-operator` from `0.64.0` to `0.70.0` ([#524]).
- Bump `product-config` from `0.6.0` to `0.7.0` ([#524]).

[#506]: https://github.com/stackabletech/hbase-operator/pull/506
[#523]: https://github.com/stackabletech/hbase-operator/pull/523
[#524]: https://github.com/stackabletech/hbase-operator/pull/524

## [24.3.0] - 2024-03-20

### Added
Expand Down Expand Up @@ -37,7 +49,6 @@
[#441]: https://github.com/stackabletech/hbase-operator/pull/441
[#454]: https://github.com/stackabletech/hbase-operator/pull/454
[#511]: https://github.com/stackabletech/hbase-operator/pull/511
[#524]: https://github.com/stackabletech/hbase-operator/pull/524

## [23.11.0] - 2023-11-24

Expand Down
14 changes: 8 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ strum = { version = "0.26", features = ["derive"] }
tokio = { version = "1.37", features = ["full"] }
tracing = "0.1"

# [patch."https://github.com/stackabletech/operator-rs.git"]
# stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" }
#[patch."https://github.com/stackabletech/operator-rs.git"]
#stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" }
19 changes: 19 additions & 0 deletions deploy/helm/hbase-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,25 @@ spec:
required:
- kerberos
type: object
authorization:
nullable: true
properties:
opa:
description: Configure the OPA stacklet [discovery ConfigMap](https://docs.stackable.tech/home/nightly/concepts/service_discovery) and the name of the Rego package containing your authorization rules. Consult the [OPA authorization documentation](https://docs.stackable.tech/home/nightly/concepts/opa) to learn how to deploy Rego authorization rules with OPA.
properties:
configMapName:
description: The [discovery ConfigMap](https://docs.stackable.tech/home/nightly/concepts/service_discovery) for the OPA stacklet that should be used for authorization requests.
type: string
package:
description: The name of the Rego package containing the Rego rules for the product.
nullable: true
type: string
required:
- configMapName
type: object
required:
- opa
type: object
hdfsConfigMapName:
description: Name of the [discovery ConfigMap](https://docs.stackable.tech/home/nightly/concepts/service_discovery) for an HDFS cluster.
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ version() {
echo "Check cluster version..."
cluster_version=$(version | jq -r '.Version')

if [ "$cluster_version" == "2.4.17" ]; then
if [ "$cluster_version" == "2.4.18" ]; then
echo "Cluster version: $cluster_version"
else
echo "Unexpected version: $cluster_version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ version() {
echo "Check cluster version..."
cluster_version=$(version | jq -r '.Version')

if [ "$cluster_version" == "2.4.17" ]; then
if [ "$cluster_version" == "2.4.18" ]; then
echo "Cluster version: $cluster_version"
else
echo "Unexpected version: $cluster_version"
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/hbase/examples/getting_started/hbase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: simple-hbase
spec:
image:
productVersion: 2.4.17
productVersion: 2.4.18
clusterConfig:
hdfsConfigMapName: simple-hdfs
zookeeperConfigMapName: simple-hbase-znode
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/hbase/examples/getting_started/hbase.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: simple-hbase
spec:
image:
productVersion: 2.4.17
productVersion: 2.4.18
clusterConfig:
hdfsConfigMapName: simple-hdfs
zookeeperConfigMapName: simple-hbase-znode
Expand Down
128 changes: 128 additions & 0 deletions docs/modules/hbase/examples/rego/hbase.rego
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:",
},
]
Loading
Loading