You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "hanahmily (via GitHub)" <gi...@apache.org> on 2026/09/01 00:09:42 UTC

[PR] feat(liaison): authorize data, streaming writes and ByDBQL by BanyanDB group [skywalking-banyandb]

hanahmily opened a new pull request, #1321:
URL: https://github.com/apache/skywalking-banyandb/pull/1321

   Group-scoped authorization already covers the liaison's cluster and schema APIs. The data APIs
   were classified but deliberately left undecidable: with RBAC enabled, every query, every write
   and every ByDBQL statement was refused for every principal, the global administrator included.
   That was the right shape while the decision machinery was being built, and it is why the
   documentation still tells operators to leave RBAC off until coverage catches up. This change
   closes that gap and makes the whole public API decidable.
   
   Five native reads, two property mutations, three streaming writes and ByDBQL now carry a typed
   extractor and an activated executor. No method the liaison serves is left fail-closed, and no
   method carrying a permission is left without a request shape its decision can read, so a newly
   added RPC still has to be classified explicitly rather than inheriting a policy by accident.
   
   Three of these needed a decision point the unary interceptor cannot provide, and the
   interesting part of the change is where each one sits.
   
   A native read names its groups in one repeated field, and the caller must hold `data:read` for
   all of them. Groups are deduplicated first, so a request naming one group twice and another
   once is one canonical scope set. A request mixing an allowed group with a forbidden one is
   refused whole — never served the part of it the caller is entitled to, which would leak the
   shape of the data it cannot see. A request no group can be read from is answered as malformed
   rather than as an authorization outcome, so an authenticated caller learns that its request was
   wrong and learns nothing about what it would have been allowed to do.
   
   A write stream is different: the principal is established once, at open, but the groups arrive
   one frame at a time. Opening the stream requires `data:write` in some scope, so a reader is
   turned away immediately instead of after sending a frame. Each received frame is then resolved
   to its group and decided on its own, before the handler ever sees it — a refused frame is
   withheld, so it cannot be published, indexed or written. Frame resolution follows the metadata
   contract the write handlers already implement: a frame carrying metadata establishes the group,
   a frame carrying none continues in the group the last one established. The decision reads the
   security snapshot in force at that moment rather than one captured when the stream opened,
   which is what makes revoking a binding take effect on the very next frame of a connection that
   is already open, with no reconnect and no restart.
   
   ByDBQL is the third. Its raw text is not the resource, and treating it as one would mean
   re-implementing the parser inside the authorizer. Instead the query is parsed, bound and
   transformed as before, and the typed native request that falls out is authorized immediately
   before dispatch, by exactly the rule the equivalent native method would apply. Casing,
   comments, bound parameters and the transport that carried the call therefore cannot address a
   group the decision does not see. The handler decides against the snapshot its request was
   admitted with rather than re-reading the current one, so a reload landing mid-handler cannot
   combine one revision's admission with another revision's grants.
   
   ```mermaid
   flowchart TD
       A["gRPC 17912 and grpc-gateway 17913"] --> B["Authenticate: trusted principal and snapshot"]
       B --> C{"Method policy"}
       C -->|"native read"| D["Require every listed group"]
       C -->|"property mutation"| E["Require the record's group"]
       C -->|"write stream"| F["Require data:write in some scope"]
       C -->|"ByDBQL"| G["Require data:read in some scope"]
       D --> H["Handler"]
       E --> H
       F --> I["Per-frame gate on receive"]
       I --> J{"Group the frame resolves to"}
       J -->|"granted"| H
       J -->|"refused"| K["PermissionDenied, nothing reaches storage"]
       G --> L["Parse, bind, transform"]
       L --> M{"Groups of the native request"}
       M -->|"granted"| H
       M -->|"refused"| K
   ```
   
   Property mutations get the same treatment as the reads, with one wrinkle worth stating: an
   apply is scoped by the group inside the property body it carries, a delete by the group it
   names directly. Both are decided before the handler runs, so a refused mutation leaves the
   record absent or unchanged rather than being rolled back afterwards. The tests assert that by
   reading the record back as an administrator, not by trusting the status code.
   
   Nothing here is persisted or on the wire. No message definitions change; every extractor reads
   fields that already exist, and the security configuration file gains no key. What does change
   is that two pieces of new code — the per-frame gate and the ByDBQL gate — now sit on a path
   every existing deployment uses, so both are inert unless RBAC is enabled. A deployment with no
   authentication file, with a users-only file, or with RBAC explicitly disabled sees every data
   path exactly as it did before, including for groups it never granted anybody access to. There
   is a test dedicated to that and it is expected to be green before and after.
   
   Proof runs at three levels. Narrow tests pin each decision against a fixed fixture of an
   administrator, a group-scoped reader and writer, a wildcard reader, a cluster-only monitor and
   an authenticated principal with no binding at all. A workflow test drives a real standalone
   liaison end to end: it seeds group-unique markers through the protected write API, reads them
   back within scope, sends an allowed frame followed by a forbidden one and proves the forbidden
   marker never landed, refuses a property mutation and shows the record unchanged, and checks
   that a ByDBQL query is bound by the groups it transformed into. Container cases repeat the
   matrix against a deployed standalone image and against a two-endpoint topology sharing one
   mounted policy revision, which is where the guarantee that public authorization leaves internal
   schema and data flow alone actually gets tested. The reload and restart concurrency journeys
   run as non-blocking nightly stress.
   
   The operator documentation is updated to describe the coverage that ships rather than the gap
   that no longer exists, and to record the proxy trust boundary: with a single shared upstream
   credential, BanyanDB authorizes the service account, and per-browser-user enforcement stays
   with the proxy. No end-to-end case is added for OAP or for the browser UI; those boundaries are
   documentation, as agreed.
   
   Fixes apache/skywalking#14016
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(liaison): authorize data, streaming writes and ByDBQL by BanyanDB group [skywalking-banyandb]

Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
hanahmily merged PR #1321:
URL: https://github.com/apache/skywalking-banyandb/pull/1321


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(liaison): authorize data, streaming writes and ByDBQL by BanyanDB group [skywalking-banyandb]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #1321:
URL: https://github.com/apache/skywalking-banyandb/pull/1321#issuecomment-5486607498

   ## [Codecov](https://app.codecov.io/gh/apache/skywalking-banyandb/pull/1321?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 59.88%. Comparing base ([`3530dd9`](https://app.codecov.io/gh/apache/skywalking-banyandb/commit/3530dd9b5cefaa4fef60eec91ecbfbdfcaf243c5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`3cb3422`](https://app.codecov.io/gh/apache/skywalking-banyandb/commit/3cb34225154fd8871f4b9cca59a622c4c46dd348?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 412 commits behind head on main.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff             @@
   ##             main    #1321       +/-   ##
   ===========================================
   + Coverage   45.97%   59.88%   +13.90%     
   ===========================================
     Files         328       35      -293     
     Lines       55505     6259    -49246     
   ===========================================
   - Hits        25520     3748    -21772     
   + Misses      27909     2288    -25621     
   + Partials     2076      223     -1853     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/skywalking-banyandb/pull/1321/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [fodc](https://app.codecov.io/gh/apache/skywalking-banyandb/pull/1321/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `59.88% <ø> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/skywalking-banyandb/pull/1321?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(liaison): authorize data, streaming writes and ByDBQL by BanyanDB group [skywalking-banyandb]

Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
hanahmily closed pull request #1321: feat(liaison): authorize data, streaming writes and ByDBQL by BanyanDB group
URL: https://github.com/apache/skywalking-banyandb/pull/1321


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org