Skip to content

Conversation

tedyu
Copy link
Contributor

@tedyu tedyu commented Aug 13, 2019

What type of PR is this?
/kind bug

What this PR does / why we need it:
As #81114 has stated, we need to mask bearer token in logs.

The code in this PR originated from @liggitt comment in the above issue.

Which issue(s) this PR fixes:
Fixes #81114

Fixes CVE-2019-11250: client-go header logging (at verbosity levels >= 7) now masks `Authorization` header contents

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/S Denotes a PR that changes 10-29 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. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Aug 13, 2019
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 13, 2019
@tedyu
Copy link
Contributor Author

tedyu commented Aug 13, 2019

@liggitt
I have added unit test.

@wanghaoran1988
Copy link
Contributor

gofmt failed

@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 Aug 13, 2019
@tedyu
Copy link
Contributor Author

tedyu commented Aug 13, 2019

@liggitt
Your comment has been addressed.

@tedyu
Copy link
Contributor Author

tedyu commented Aug 13, 2019

@liggitt
Please take another look.

@liggitt
Copy link
Member

liggitt commented Aug 13, 2019

/lgtm
/approve
/retest

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 13, 2019
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Aug 13, 2019
@liggitt
Copy link
Member

liggitt commented Aug 13, 2019

/priority important-longterm

@k8s-ci-robot k8s-ci-robot added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Aug 13, 2019
@tedyu
Copy link
Contributor Author

tedyu commented Aug 13, 2019

/test pull-kubernetes-integration

@tedyu
Copy link
Contributor Author

tedyu commented Aug 13, 2019

/test pull-kubernetes-e2e-gce

@liggitt
Copy link
Member

liggitt commented Aug 13, 2019

/lgtm cancel

test failure is legitimate. this is using debug logging to check in-cluster-config:

ginkgo.By("trying to use kubectl with invalid token")
_, err = framework.RunHostCmd(ns, simplePodName, "/tmp/kubectl get pods --token=invalid --v=7 2>&1")
e2elog.Logf("got err %v", err)
framework.ExpectError(err)
gomega.Expect(err).To(gomega.ContainSubstring("Using in-cluster namespace"))
gomega.Expect(err).To(gomega.ContainSubstring("Using in-cluster configuration"))
gomega.Expect(err).To(gomega.ContainSubstring("Authorization: Bearer invalid"))
gomega.Expect(err).To(gomega.ContainSubstring("Response Status: 401 Unauthorized"))

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 13, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, tedyu

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

@tedyu
Copy link
Contributor Author

tedyu commented Aug 13, 2019

@liggitt
test/e2e/kubectl/kubectl.go has been modified to account for the masking.

@k8s-ci-robot k8s-ci-robot added area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Aug 13, 2019
@liggitt
Copy link
Member

liggitt commented Aug 13, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 13, 2019
@tedyu
Copy link
Contributor Author

tedyu commented Aug 13, 2019

/test pull-kubernetes-e2e-gce

@tedyu
Copy link
Contributor Author

tedyu commented Aug 13, 2019

/test pull-kubernetes-integration

@tedyu
Copy link
Contributor Author

tedyu commented Aug 14, 2019

I wonder what happened to this PR - #81372 which received approval much later than this got merged.

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/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. 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/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CVE-2019-11250: Bearer tokens are revealed in logs (audit finding TOB-K8S-001)
4 participants