-
Notifications
You must be signed in to change notification settings - Fork 40k
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
HEAD & OPTIONS http verbs don’t seem to show up in the apiserver audit logs when we hit proxy endpoints. #95966
Comments
/assign @smarterclayton |
/sig network |
/sig apimachinery |
@hh: The label(s) In response to this:
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. |
/sig api-machinery |
/sig auth |
@roycaihw: Please ensure the request meets the requirements listed here. If this request no longer meets these requirements, the label can be removed In response to this:
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. |
/triage accepted |
by definition I think the first question is for sig auth on whether this is working as intended. (p.s. the code that does |
/remove-sig api-machinery I think sig auth owns both the definition of Kubernetes request verb (given this doc falls under auth), and the implementation of how audit log collects the verb from request info. |
/sig auth |
The API is not inaccessible (the HEAD or OPTIONS requests should still be proxied through), but the audit event does not distinguish between them.
|
You are right, it's not inaccessible. We are hitting it! I wonder about the intention for auditing purposes. Should we be logging enough information information to map back to the OpenAPI spec? I started a thread in #sig-auth mailing list, but might be good to pull this back here. Our primary use case is to be able to map audit log entries back to the operationId of the openapi spec. It might be useful to share the effort and work arounds we've taken to map audit log path and k8s verb back to http methods so we can lookup operationIds in the OpenAPI swagger definition. We had to figure out this mapping manually, and found ourselves surprised sometimes on the logic:
And for audit entries where the k8s 'verb' is missing, our current hack is to set it to "options":
Note the rest of our 'find_operation_id' function tries to cache lookups as processing gigabytes of logs used to take hours before we settled on this bit of caching / operationId lookup logic. As we look into correcting the k8s verb recording to the audit logs, it would be extremely helpful if the audit logging mechanisms where updated to include the OpenAPI operationId so these type of manual audit log->k8s verb->http method->swagger->OperationId mapping lookups and caching are unnecessary. (@liggitt I think we explored this before, but our use case may have been deemed to much of an outlier) I think we are at a point where we have no way to concretely map (for some of the Audited API) which OpenAPI operation was called. |
Mapping audit events back to the openapi spec is not a particular goal of the audit log. Understanding frequency and type of API access is (especially distinguishing read vs write, and distinguishing different types of write requests). I think head/get → get is reasonable from an audit perspective I'm not sure what I would expect |
/cc |
Discussed in sig-auth meeting on 2/17 From a requestinfo/audit/authorization perspective:
To unblock conformance-testing:
|
/assign @liggitt |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
@smarterclayton @liggitt should this be kept open? |
Dear Sig Auth, I'm a newcomer to the Kubernetes codebase and I would be more than happy to work on this as my first contribution. I hope this issue is not time-critical as it might take some time until I learn the codebase. Thanks! /assign |
/remove-lifecycle stale |
You can take your time, it's been open for a long while. It'll definitely be a good deep dive into the pool! Once you wrap your head around what's happening, I'm sure you'll find an excellent solution. Let us know if you need help. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
This PR was fixed by #95128 |
Description:
In the process of conformance testing of the 'PodProxyWithPath' Endpoints we have ran into issue with testing
HEAD' and
OPTION` endpoints.Affected endpoints:
The http.Method(HEAD) is hard coded into RestquestInfo.Verb(get) making some of the API inaccessible from what we see.
When special verbs "Proxy" are hit it is suppose to check if the current part of the URL has proxy in it and override the request verb.
When running our test, we know that the http.Method is set to HEAD, but shows up in the audit logs as get.
In the audit log the K8s operation is not visible in the audit log. We rely on the a combination of the verb as stored by the audit logs and request URI to match up and find the operation ID. If the verb is not correct we identified the operation.
Request HEAD doesn’t make sense for APIs other than proxy. This might be an API Server bug.
Write-up:
HEAD & OPTIONS write-up give more details.
Conformance office hours discussion:
The topic was discussed in the Conformance office hours meeting on 20 Oct 2020 and can be reviewed in the video from 28min - 35min
Next steps:
Please review and help to move this forward.
The text was updated successfully, but these errors were encountered: