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

drop managed fields from audit entries #94986

Merged
merged 3 commits into from Nov 3, 2021

Conversation

tkashem
Copy link
Contributor

@tkashem tkashem commented Sep 22, 2020

What type of PR is this?

/kind feature

What this PR does / why we need it:
Implements kubernetes/enhancements#2982

This PR adds a new field OmitManagedFields to both audit.Policy and audit.PolicyRule so cluster operators can opt in to omit managed fields of the request and response bodies from being written to the API audit log.

Does this PR introduce a user-facing change?:

A new field `omitManagedFields` has been added to both `audit.Policy` and `audit.PolicyRule` 
so cluster operators can opt in to omit managed fields of the request and response bodies from 
being written to the API audit log.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. 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. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Sep 22, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @tkashem. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@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 Sep 22, 2020
@tkashem
Copy link
Contributor Author

tkashem commented Sep 22, 2020

/assign @sttts

@k8s-ci-robot k8s-ci-robot added area/apiserver sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/auth Categorizes an issue or PR as relevant to SIG Auth. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Sep 22, 2020
@tkashem tkashem changed the title drop managed fields from audit entries [WIP] drop managed fields from audit entries Sep 22, 2020
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 22, 2020
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 23, 2020
@tkashem tkashem changed the title [WIP] drop managed fields from audit entries drop managed fields from audit entries Sep 23, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 23, 2020
@tkashem tkashem changed the title drop managed fields from audit entries [WIP] drop managed fields from audit entries Sep 23, 2020
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 23, 2020
@tkashem tkashem force-pushed the audit-drop-managed-fields branch 2 times, most recently from c61ca20 to b629fb9 Compare September 23, 2020 19:32
@tkashem tkashem changed the title [WIP] drop managed fields from audit entries drop managed fields from audit entries Sep 23, 2020
@tkashem tkashem changed the title [WIP] drop managed fields from audit entries drop managed fields from audit entries Oct 12, 2021
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 12, 2021
@tkashem
Copy link
Contributor Author

tkashem commented Oct 12, 2021

API changes have been made according to the KEP - kubernetes/enhancements#2982. This is ready for another pass.

@wojtek-t @apelisse @sttts

@sttts
Copy link
Contributor

sttts commented Oct 29, 2021

/hold cancel

as discussed, KEP update has been done

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 29, 2021
@sttts
Copy link
Contributor

sttts commented Oct 29, 2021

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 29, 2021
@sttts
Copy link
Contributor

sttts commented Oct 29, 2021

/assign @liggitt

for API approval.

Copy link
Member

@liggitt liggitt left a comment

Choose a reason for hiding this comment

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

audit policy config lgtm

return nil, false, nil
}

copy := obj.DeepCopyObject()
Copy link
Member

Choose a reason for hiding this comment

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

do we know the relative cost (cpu/allocs) of adding a deep copy into the audit pipeline by enabling the omitManagedFields option globally?

@liggitt liggitt added this to API review completed, 1.23 in API Reviews Nov 2, 2021
drop the managed fields of the objects from the audit entries when we
are logging request and response bodies.
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 2, 2021
@tkashem
Copy link
Contributor Author

tkashem commented Nov 2, 2021

@liggitt @sttts I added an empty TableRow object to my test to cover the nil case. that's the only change.

@liggitt
Copy link
Member

liggitt commented Nov 3, 2021

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, sttts, tkashem

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 3, 2021
@sttts
Copy link
Contributor

sttts commented Nov 3, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 3, 2021
@k8s-ci-robot k8s-ci-robot merged commit 904e972 into kubernetes:master Nov 3, 2021
SIG Auth Old automation moved this from Needs KEP to Closed / Done Nov 3, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.23 milestone Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/apiserver area/audit area/provider/gcp Issues or PRs related to gcp provider area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: API review completed, 1.23
Archived in project
SIG Auth Old
Closed / Done
Development

Successfully merging this pull request may close these issues.

None yet