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

inbound: Support multiple authorization types #1560

Merged
merged 5 commits into from
Mar 24, 2022
Merged

inbound: Support multiple authorization types #1560

merged 5 commits into from
Mar 24, 2022

Conversation

olix0r
Copy link
Member

@olix0r olix0r commented Mar 24, 2022

The inbound policy module uses the label saz_name to indicate the
authorization resource being employed to allow/deny traffic. This
corresponds to the ServerAuthorization kubernetes resource (with the
saz shortname). This resource type is going to be deprecated in favor
of a new, more general, AuthorizationPolicy resource.

When this change is made in the control plane, the policy controller
will include a kind label on gRPC messages indicating whether the
resource type, or default if a default policy is in effect.

This change honors this new kind field and adds a dedicated label to
indicate the kind.

Server labels are changed from:

srv_name="default:foo"
srv_name="fah"

to:

srv_kind="default",srv_name="foo"
srv_kind="server",srv_name="fah"

Authorization labels are changed from:

saz_name="default:bar"
saz_name="bah"

to:

authz_kind="default",authz_name="bar"
authz_kind="serverauthorization",authz_name="bah"

Signed-off-by: Oliver Gould ver@buoyant.io

@olix0r olix0r marked this pull request as ready for review March 24, 2022 16:20
@olix0r olix0r requested a review from a team as a code owner March 24, 2022 16:20
The inbound policy module uses the label `saz_name` to indicate the
authorization resource being employed to allow/deny traffic. This
corresponds to the `ServerAuthorization` kubernetes resource (with the
`saz` shortname). This resource type is going to be deprecated in favor
of a new, more general, `AuthorizationPolicy` resource.

When this change is made in the control plane, the policy controller
will include a `kind` label on gRPC messages indicating whether the
resource type, or `default` if a default policy is in effect.

This change honors this new `kind` field and adds a dedicated label to
indicate the kind.

Server labels are changed from:

    srv_name="default:foo"
    srv_name="fah"

to:

    srv_kind="default",srv_name="foo"
    srv_kind="server",srv_name="fah"

Authorization labels are changed from:

    saz_name="default:bar"
    saz_name="bah"

to:

    authz_kind="default",authz_name="bar"
    authz_kind="serverauthorization",authz_name="bah"

Signed-off-by: Oliver Gould <ver@buoyant.io>
@olix0r olix0r marked this pull request as draft March 24, 2022 16:31
Copy link
Contributor

@hawkw hawkw left a comment

Choose a reason for hiding this comment

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

this looks good to me!

linkerd/app/inbound/src/policy/discover.rs Outdated Show resolved Hide resolved
Signed-off-by: Oliver Gould <ver@buoyant.io>
Signed-off-by: Oliver Gould <ver@buoyant.io>
@olix0r olix0r marked this pull request as ready for review March 24, 2022 18:46
Signed-off-by: Oliver Gould <ver@buoyant.io>
Signed-off-by: Oliver Gould <ver@buoyant.io>
@olix0r olix0r merged commit 279b301 into main Mar 24, 2022
@olix0r olix0r deleted the ver/saz-labels branch March 24, 2022 19:35
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Mar 24, 2022
This release alters the policy-related labels that the proxy sets on inbound traffic:

* The `srv_kind` label is set with a value of "default" or "server",
  depending on whether the `srv_name` label correponds to a default
  policy or a `Server` resource. `srv_name` no longer includes a
  "default:" prefix for default policies.
* The `saz_name` label is removed, replaced by `authz_kind` and
  `authz_name` labels. Similarly, the `authz_kind` label is either
  `default` or `serverauthorization`, and the `authz_name` label never
  includes a "default:" prefix.

---

* build(deps): bump tj-actions/changed-files from 17.3 to 18 (linkerd/linkerd2-proxy#1539)
* build(deps): bump async-stream from 0.3.2 to 0.3.3 (linkerd/linkerd2-proxy#1540)
* build(deps): bump syn from 1.0.86 to 1.0.87 (linkerd/linkerd2-proxy#1541)
* build(deps): bump mio from 0.8.0 to 0.8.1 (linkerd/linkerd2-proxy#1542)
* build(deps): bump syn from 1.0.87 to 1.0.88 (linkerd/linkerd2-proxy#1545)
* build(deps): bump libc from 0.2.119 to 0.2.120 (linkerd/linkerd2-proxy#1544)
* build(deps): bump tj-actions/changed-files from 18 to 18.1 (linkerd/linkerd2-proxy#1543)
* build(deps): bump tj-actions/changed-files from 18.1 to 18.2 (linkerd/linkerd2-proxy#1546)
* build(deps): bump mio from 0.8.1 to 0.8.2 (linkerd/linkerd2-proxy#1550)
* build(deps): bump quote from 1.0.15 to 1.0.16 (linkerd/linkerd2-proxy#1549)
* build(deps): bump syn from 1.0.88 to 1.0.89 (linkerd/linkerd2-proxy#1548)
* build(deps): bump tj-actions/changed-files from 18.2 to 18.3 (linkerd/linkerd2-proxy#1547)
* build(deps): bump which from 4.2.4 to 4.2.5 (linkerd/linkerd2-proxy#1554)
* build(deps): bump tokio-rustls from 0.23.2 to 0.23.3 (linkerd/linkerd2-proxy#1553)
* build(deps): bump tj-actions/changed-files from 18.3 to 18.4 (linkerd/linkerd2-proxy#1551)
* build(deps): bump log from 0.4.14 to 0.4.15 (linkerd/linkerd2-proxy#1555)
* build(deps): bump foreign-types-shared from 0.3.0 to 0.3.1 (linkerd/linkerd2-proxy#1557)
* build(deps): bump foreign-types-macros from 0.2.1 to 0.2.2 (linkerd/linkerd2-proxy#1556)
* build(deps): bump hyper from 0.14.17 to 0.14.18 (linkerd/linkerd2-proxy#1559)
* build(deps): bump log from 0.4.15 to 0.4.16 (linkerd/linkerd2-proxy#1558)
* inbound: Support multiple authorization types (linkerd/linkerd2-proxy#1560)

Signed-off-by: Oliver Gould <ver@buoyant.io>
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Mar 29, 2022
This release alters the policy-related labels that the proxy sets on inbound traffic:

* The `srv_kind` label is set with a value of "default" or "server",
  depending on whether the `srv_name` label correponds to a default
  policy or a `Server` resource. `srv_name` no longer includes a
  "default:" prefix for default policies.
* The `saz_name` label is removed, replaced by `authz_kind` and
  `authz_name` labels. Similarly, the `authz_kind` label is either
  `default` or `serverauthorization`, and the `authz_name` label never
  includes a "default:" prefix.

---

* build(deps): bump tj-actions/changed-files from 17.3 to 18 (linkerd/linkerd2-proxy#1539)
* build(deps): bump async-stream from 0.3.2 to 0.3.3 (linkerd/linkerd2-proxy#1540)
* build(deps): bump syn from 1.0.86 to 1.0.87 (linkerd/linkerd2-proxy#1541)
* build(deps): bump mio from 0.8.0 to 0.8.1 (linkerd/linkerd2-proxy#1542)
* build(deps): bump syn from 1.0.87 to 1.0.88 (linkerd/linkerd2-proxy#1545)
* build(deps): bump libc from 0.2.119 to 0.2.120 (linkerd/linkerd2-proxy#1544)
* build(deps): bump tj-actions/changed-files from 18 to 18.1 (linkerd/linkerd2-proxy#1543)
* build(deps): bump tj-actions/changed-files from 18.1 to 18.2 (linkerd/linkerd2-proxy#1546)
* build(deps): bump mio from 0.8.1 to 0.8.2 (linkerd/linkerd2-proxy#1550)
* build(deps): bump quote from 1.0.15 to 1.0.16 (linkerd/linkerd2-proxy#1549)
* build(deps): bump syn from 1.0.88 to 1.0.89 (linkerd/linkerd2-proxy#1548)
* build(deps): bump tj-actions/changed-files from 18.2 to 18.3 (linkerd/linkerd2-proxy#1547)
* build(deps): bump which from 4.2.4 to 4.2.5 (linkerd/linkerd2-proxy#1554)
* build(deps): bump tokio-rustls from 0.23.2 to 0.23.3 (linkerd/linkerd2-proxy#1553)
* build(deps): bump tj-actions/changed-files from 18.3 to 18.4 (linkerd/linkerd2-proxy#1551)
* build(deps): bump log from 0.4.14 to 0.4.15 (linkerd/linkerd2-proxy#1555)
* build(deps): bump foreign-types-shared from 0.3.0 to 0.3.1 (linkerd/linkerd2-proxy#1557)
* build(deps): bump foreign-types-macros from 0.2.1 to 0.2.2 (linkerd/linkerd2-proxy#1556)
* build(deps): bump hyper from 0.14.17 to 0.14.18 (linkerd/linkerd2-proxy#1559)
* build(deps): bump log from 0.4.15 to 0.4.16 (linkerd/linkerd2-proxy#1558)
* inbound: Support multiple authorization types (linkerd/linkerd2-proxy#1560)

Signed-off-by: Oliver Gould <ver@buoyant.io>
Signed-off-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
Co-authored-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
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