Skip to content

Conversation

@pbarker
Copy link
Contributor

@pbarker pbarker commented Oct 2, 2018

Scopes down the dynamic audit configuration API in case we need to change the policy in the future

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 2, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: liggitt

If they are not already assigned, you can assign the PR to them by writing /assign @liggitt in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 2, 2018
@k8s-ci-robot k8s-ci-robot added sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/auth Categorizes an issue or PR as relevant to SIG Auth. labels Oct 2, 2018
@tallclair
Copy link
Member

/ok-to-test
/cc @lavalamp

@k8s-ci-robot k8s-ci-robot requested a review from lavalamp October 2, 2018 18:40
@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 2, 2018
Copy link
Member

@tallclair tallclair left a comment

Choose a reason for hiding this comment

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

Thanks, mostly just nits around the language.


// Policy is a scoped down policy for audit webhooks
type Policy struct {
// The Level that all requests are recorded at.
Copy link
Member

Choose a reason for hiding this comment

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

nit: indentation


// OmitStages is a list of stages for which no events are created.
// +optional
OmitStages []Stage
Copy link
Member

Choose a reason for hiding this comment

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

Can we please make this a whitelist? I know it deviates from the static version, but IMO not making that a whitelist was a mistake (IncludeStages). Must be non-empty (or default to all?).

- level: <level>
level: <level>
omitStages:
- stage: <stage>
Copy link
Member

Choose a reason for hiding this comment

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

nit: this shouldn't have stage:, just - <stage>

drop any pieces that do not conform to its policy. A new sink interface will be required for these changes called `EnforcedSink`,
this will largely follow suite with the existing sink but take a fully formed event and the authorizer attributes as its
parameters. It will then utilize the `LevelAndStages` method in the policy
This addition will move policy enforcement from the main handler to the backends. The policy object is a scoped down
Copy link
Member

Choose a reason for hiding this comment

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

nit: Rather than "... is a scoped down version ...", I would say "... is a minimal top-level policy ..."

this will largely follow suite with the existing sink but take a fully formed event and the authorizer attributes as its
parameters. It will then utilize the `LevelAndStages` method in the policy
This addition will move policy enforcement from the main handler to the backends. The policy object is a scoped down
version of the V1 Policy object, further filtering will be done in a proxy. This has been done because how we handle policy
Copy link
Member

Choose a reason for hiding this comment

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

nit: and further filtering...

may change in the future. From the `withDynamicAudit` handler, the full event will be generated and then passed to the backends.
Each backend will copy the event and then be required to drop any pieces that do not conform to its policy. A new sink interface
will be required for these changes called `EnforcedSink`, this will largely follow suite with the existing sink but take a
fully formed event and the authorizer attributes as its parameters. It will then utilize the `LevelAndStages` method in the policy
Copy link
Member

Choose a reason for hiding this comment

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

I'm a bit confused by this. What is EnforcedSink? Is that client (apiserver) side, or server (webhook) side? Is it just another audit backend plugin, or something else?

called `withDynamicAudit`. Another conditional clause will be added where the handlers are
[provisioned](https://github.com/kubernetes/apiserver/blob/master/pkg/server/config.go#L536) allowing for the proper feature gating.

#### Policy Enforcement
Copy link
Member

Choose a reason for hiding this comment

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

Do you want to add a note somewhere in here that this approach lets us prototype the flexible policy design as a CRD with a proxy backend?

@justaugustus
Copy link
Member

REMINDER: KEPs are moving to k/enhancements on November 30. Please attempt to merge this KEP before then to signal consensus.
For more details on this change, review this thread.

Any questions regarding this move should be directed to that thread and not asked on GitHub.

@justaugustus
Copy link
Member

KEPs have moved to k/enhancements.
This PR will be closed and any additional changes to this KEP should be submitted to k/enhancements.
For more details on this change, review this thread.

Any questions regarding this move should be directed to that thread and not asked on GitHub.
/close

@k8s-ci-robot
Copy link
Contributor

@justaugustus: Closed this PR.

In response to this:

KEPs have moved to k/enhancements.
This PR will be closed and any additional changes to this KEP should be submitted to k/enhancements.
For more details on this change, review this thread.

Any questions regarding this move should be directed to that thread and not asked on GitHub.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/auth Categorizes an issue or PR as relevant to SIG Auth. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants