From d066d547cce64a4f02bb05d718bc53fe71d06ad3 Mon Sep 17 00:00:00 2001 From: xuzhonghu Date: Wed, 6 Jun 2018 10:53:03 +0800 Subject: [PATCH 1/4] logging user-agent in audit --- staging/src/k8s.io/apiserver/pkg/apis/audit/types.go | 4 ++++ staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go | 4 ++++ staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/types.go | 4 ++++ staging/src/k8s.io/apiserver/pkg/audit/request.go | 1 + 4 files changed, 13 insertions(+) diff --git a/staging/src/k8s.io/apiserver/pkg/apis/audit/types.go b/staging/src/k8s.io/apiserver/pkg/apis/audit/types.go index d72505d10b9..5503ed64eb0 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/audit/types.go +++ b/staging/src/k8s.io/apiserver/pkg/apis/audit/types.go @@ -99,6 +99,10 @@ type Event struct { // Source IPs, from where the request originated and intermediate proxies. // +optional SourceIPs []string + // UserAgent is an optional field that specifies the caller of this request. + // Note that the UserAgent is provided by the client, and must not be trusted. + // +optional + UserAgent string // Object reference this request is targeted at. // Does not apply for List-type requests, or non-resource requests. // +optional diff --git a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go index 7e8af12b87f..064fc487454 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go +++ b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go @@ -105,6 +105,10 @@ type Event struct { // Source IPs, from where the request originated and intermediate proxies. // +optional SourceIPs []string `json:"sourceIPs,omitempty" protobuf:"bytes,10,rep,name=sourceIPs"` + // UserAgent is an optional field that specifies the caller of this request. + // Note that the UserAgent is provided by the client, and must not be trusted. + // +optional + UserAgent string `json:"userAgent,omitempty" protobuf:"bytes,18,opt,name=userAgent"` // Object reference this request is targeted at. // Does not apply for List-type requests, or non-resource requests. // +optional diff --git a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/types.go b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/types.go index 0c3299b4ac3..27e338cac10 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/types.go +++ b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/types.go @@ -101,6 +101,10 @@ type Event struct { // Source IPs, from where the request originated and intermediate proxies. // +optional SourceIPs []string `json:"sourceIPs,omitempty" protobuf:"bytes,10,rep,name=sourceIPs"` + // UserAgent is an optional field that specifies the caller of this request. + // Note that the UserAgent is provided by the client, and must not be trusted. + // +optional + UserAgent string `json:"userAgent,omitempty" protobuf:"bytes,18,opt,name=userAgent"` // Object reference this request is targeted at. // Does not apply for List-type requests, or non-resource requests. // +optional diff --git a/staging/src/k8s.io/apiserver/pkg/audit/request.go b/staging/src/k8s.io/apiserver/pkg/audit/request.go index 25d6c33ebad..f62b0359f53 100644 --- a/staging/src/k8s.io/apiserver/pkg/audit/request.go +++ b/staging/src/k8s.io/apiserver/pkg/audit/request.go @@ -42,6 +42,7 @@ func NewEventFromRequest(req *http.Request, level auditinternal.Level, attribs a RequestReceivedTimestamp: metav1.NewMicroTime(time.Now()), Verb: attribs.GetVerb(), RequestURI: req.URL.RequestURI(), + UserAgent: req.UserAgent(), } ev.Level = level From b5990b78cb821507ec6d8823ff1341e904694e90 Mon Sep 17 00:00:00 2001 From: xuzhonghu Date: Wed, 6 Jun 2018 11:12:37 +0800 Subject: [PATCH 2/4] auto gen --- .../k8s.io/apiserver/pkg/apis/audit/types.go | 2 +- .../pkg/apis/audit/v1alpha1/generated.pb.go | 199 ++++++++++------- .../pkg/apis/audit/v1alpha1/generated.proto | 5 + .../pkg/apis/audit/v1alpha1/types.go | 2 +- .../audit/v1alpha1/zz_generated.conversion.go | 2 + .../pkg/apis/audit/v1beta1/generated.pb.go | 203 +++++++++++------- .../pkg/apis/audit/v1beta1/generated.proto | 5 + .../apiserver/pkg/apis/audit/v1beta1/types.go | 2 +- .../audit/v1beta1/zz_generated.conversion.go | 2 + 9 files changed, 257 insertions(+), 165 deletions(-) diff --git a/staging/src/k8s.io/apiserver/pkg/apis/audit/types.go b/staging/src/k8s.io/apiserver/pkg/apis/audit/types.go index 5503ed64eb0..7785b11814d 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/audit/types.go +++ b/staging/src/k8s.io/apiserver/pkg/apis/audit/types.go @@ -99,7 +99,7 @@ type Event struct { // Source IPs, from where the request originated and intermediate proxies. // +optional SourceIPs []string - // UserAgent is an optional field that specifies the caller of this request. + // UserAgent records the user agent string reported by the client. // Note that the UserAgent is provided by the client, and must not be trusted. // +optional UserAgent string diff --git a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/generated.pb.go b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/generated.pb.go index d5494d35c3e..1dfd3d3927d 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/generated.pb.go +++ b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/generated.pb.go @@ -266,6 +266,12 @@ func (m *Event) MarshalTo(dAtA []byte) (int, error) { i += copy(dAtA[i:], v) } } + dAtA[i] = 0x92 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.UserAgent))) + i += copy(dAtA[i:], m.UserAgent) return i, nil } @@ -704,6 +710,8 @@ func (m *Event) Size() (n int) { n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) } } + l = len(m.UserAgent) + n += 2 + l + sovGenerated(uint64(l)) return n } @@ -890,6 +898,7 @@ func (this *Event) String() string { `RequestReceivedTimestamp:` + strings.Replace(strings.Replace(this.RequestReceivedTimestamp.String(), "MicroTime", "k8s_io_apimachinery_pkg_apis_meta_v1.MicroTime", 1), `&`, ``, 1) + `,`, `StageTimestamp:` + strings.Replace(strings.Replace(this.StageTimestamp.String(), "MicroTime", "k8s_io_apimachinery_pkg_apis_meta_v1.MicroTime", 1), `&`, ``, 1) + `,`, `Annotations:` + mapStringForAnnotations + `,`, + `UserAgent:` + fmt.Sprintf("%v", this.UserAgent) + `,`, `}`, }, "") return s @@ -1615,6 +1624,35 @@ func (m *Event) Unmarshal(dAtA []byte) error { m.Annotations[mapkey] = mapvalue } iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UserAgent", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UserAgent = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -2782,84 +2820,85 @@ func init() { } var fileDescriptorGenerated = []byte{ - // 1258 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6f, 0x1b, 0xc5, - 0x17, 0xcf, 0xd6, 0x71, 0x63, 0x8f, 0x1b, 0xc7, 0x99, 0x56, 0xdf, 0xae, 0x72, 0xb0, 0xfd, 0x35, - 0x12, 0xb2, 0x20, 0xec, 0x26, 0x21, 0xd0, 0x80, 0x04, 0x22, 0x56, 0x2b, 0xb0, 0x94, 0x86, 0x30, - 0x89, 0x2b, 0xf1, 0xe3, 0xc0, 0xda, 0x7e, 0xb1, 0x17, 0xdb, 0xbb, 0xcb, 0xcc, 0xac, 0xab, 0xdc, - 0x38, 0x70, 0x45, 0xe2, 0xce, 0x1f, 0x53, 0x71, 0xcb, 0xb1, 0xc7, 0x9e, 0x2c, 0x62, 0xfe, 0x8b, - 0x1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1, 0x24, 0xb5, 0x00, 0xce, 0x50, 0xd6, 0xe5, 0x30, 0x62, - 0xe6, 0x1d, 0x99, 0x1e, 0xfb, 0x96, 0xe9, 0x69, 0xac, 0xc7, 0x63, 0xb5, 0x29, 0x58, 0x48, 0x44, - 0x56, 0xfb, 0xc3, 0x40, 0xc5, 0x2f, 0xa9, 0x1f, 0x06, 0x04, 0xa2, 0x59, 0xc1, 0xf0, 0x3b, 0x28, - 0xdb, 0x13, 0x92, 0x28, 0x05, 0xda, 0x2e, 0x82, 0x45, 0x3a, 0x31, 0x7b, 0x68, 0x6c, 0x21, 0x23, - 0x52, 0xb3, 0x27, 0xa1, 0x21, 0x5a, 0x8f, 0x1f, 0x89, 0x4e, 0x8d, 0x0e, 0xc7, 0xce, 0x08, 0x98, - 0x99, 0x91, 0x06, 0xaa, 0xff, 0x52, 0x0a, 0x32, 0x8b, 0xab, 0xfd, 0x9a, 0x41, 0x1b, 0x73, 0xa3, - 0x07, 0x6f, 0xa3, 0x5c, 0x0c, 0x52, 0x11, 0x26, 0x59, 0x8b, 0xb9, 0x48, 0x82, 0xc0, 0x36, 0xca, - 0x7b, 0x82, 0x2a, 0x70, 0x3a, 0xea, 0xff, 0xe9, 0xe5, 0x76, 0x1c, 0x2b, 0x88, 0xc6, 0x88, 0x55, - 0x21, 0x0e, 0x72, 0x69, 0xa6, 0x56, 0x85, 0xc0, 0x12, 0xa9, 0xc1, 0x0d, 0x94, 0x09, 0xdd, 0xae, - 0x5a, 0x7d, 0x3b, 0x0a, 0x90, 0x69, 0x2d, 0xbb, 0xf6, 0x84, 0xb1, 0x58, 0x62, 0x4e, 0xe0, 0x3e, - 0x03, 0xca, 0x5c, 0xdf, 0x53, 0x7b, 0x2f, 0x59, 0x62, 0x87, 0x27, 0x4d, 0xa5, 0x21, 0x29, 0x14, - 0x3e, 0x44, 0x1b, 0xf1, 0xb5, 0x62, 0xc3, 0x68, 0xfb, 0x3d, 0x54, 0x86, 0x1b, 0x64, 0x56, 0x4d, - 0xe6, 0xf1, 0xf8, 0x23, 0x54, 0x60, 0x61, 0x3b, 0x49, 0x5f, 0xb4, 0x0e, 0x93, 0x36, 0x39, 0xd5, - 0x2a, 0x92, 0xc6, 0xd5, 0x5e, 0x1b, 0xe8, 0xee, 0x89, 0x3f, 0x74, 0x3b, 0x17, 0x6f, 0xe1, 0xa1, - 0xf3, 0x2d, 0xca, 0xd2, 0x70, 0x08, 0x71, 0x9d, 0xef, 0x2f, 0x5f, 0xe7, 0x51, 0x88, 0x24, 0x1c, - 0x82, 0x2e, 0x5a, 0x71, 0x62, 0x24, 0x62, 0xc4, 0x8f, 0x10, 0xf2, 0x47, 0x2e, 0x97, 0xd3, 0x28, - 0x2e, 0xc2, 0x87, 0x32, 0x90, 0x44, 0xaa, 0x9f, 0x1b, 0x29, 0x68, 0xed, 0x4f, 0x03, 0xa1, 0x88, - 0xfd, 0x2d, 0x34, 0x7a, 0x6b, 0xb6, 0xd1, 0x77, 0x6e, 0x9b, 0x80, 0x05, 0x9d, 0xfe, 0x22, 0x13, - 0xdf, 0x41, 0xe4, 0x44, 0xbf, 0x27, 0x8d, 0x65, 0xde, 0x93, 0x15, 0x94, 0x15, 0x8f, 0x9b, 0xb8, - 0xd5, 0xf3, 0x02, 0x29, 0xde, 0x20, 0x8c, 0x44, 0x72, 0x6c, 0x21, 0x24, 0x3e, 0xe4, 0x8c, 0x88, - 0x53, 0x5b, 0x14, 0xa9, 0x6d, 0x25, 0x52, 0x92, 0x42, 0x08, 0x42, 0xf1, 0xee, 0x62, 0xe6, 0xaa, - 0x26, 0x14, 0xcf, 0x31, 0x46, 0x22, 0x39, 0x76, 0xd3, 0x03, 0x26, 0x2b, 0x33, 0x71, 0xb0, 0x7c, - 0x26, 0x66, 0x47, 0x9a, 0x6e, 0xf9, 0x37, 0x8e, 0x27, 0x0b, 0xa1, 0xa4, 0xff, 0x99, 0x79, 0x57, - 0xc7, 0x9e, 0x0c, 0x08, 0x46, 0x52, 0x08, 0xfc, 0x19, 0xda, 0xf0, 0x7c, 0x2f, 0xa6, 0x6a, 0x91, - 0x23, 0x66, 0xae, 0x49, 0xa3, 0xfb, 0xa2, 0x09, 0x8f, 0x67, 0x55, 0x64, 0x1e, 0x3b, 0x57, 0x85, - 0xb9, 0xa5, 0xab, 0xb0, 0x61, 0x5d, 0x5e, 0x95, 0x57, 0x5e, 0x5e, 0x95, 0x57, 0x5e, 0x5d, 0x95, - 0x57, 0x7e, 0x99, 0x96, 0x8d, 0xcb, 0x69, 0xd9, 0x78, 0x39, 0x2d, 0x1b, 0xaf, 0xa6, 0x65, 0xe3, - 0xaf, 0x69, 0xd9, 0xf8, 0xfd, 0xef, 0xf2, 0xca, 0x77, 0xb9, 0x38, 0x09, 0xff, 0x04, 0x00, 0x00, - 0xff, 0xff, 0x3e, 0x3d, 0x28, 0x0e, 0x4d, 0x0e, 0x00, 0x00, + // 1278 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4d, 0x6f, 0x23, 0x45, + 0x13, 0xce, 0xac, 0xe3, 0x8d, 0xdd, 0xde, 0x38, 0x4e, 0xef, 0xea, 0xdd, 0x51, 0x0e, 0xb6, 0x5f, + 0x23, 0x21, 0x0b, 0xc2, 0x4c, 0x12, 0x02, 0x1b, 0x90, 0x40, 0xc4, 0xda, 0x15, 0x58, 0xca, 0x86, + 0xd0, 0x89, 0x57, 0xe2, 0xe3, 0xc0, 0xd8, 0xae, 0xd8, 0x83, 0xed, 0x9e, 0xa1, 0xbb, 0xc7, 0xab, + 0xdc, 0x38, 0x70, 0x45, 0xe2, 0xce, 0x8f, 0xe0, 0x27, 0xac, 0xb8, 0xe5, 0xb8, 0xc7, 0x3d, 0x59, + 0xc4, 0xfc, 0x8b, 0x1c, 0x10, 0xea, 0x9e, 0x8f, 0x1e, 0x3b, 0x6b, 0xe1, 0x70, 0xd8, 0xdb, 0x74, + 0xd5, 0x53,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 0x14, 0x6d, 0x2e, 0x96, 0xa4, 0x36, 0xc6, 0x19, + 0xca, 0xba, 0x02, 0x46, 0xdc, 0xbc, 0xa3, 0xf2, 0x69, 0xdf, 0x32, 0x9f, 0x8d, 0xf5, 0x78, 0x0e, + 0x37, 0x25, 0x0b, 0x09, 0xc9, 0x6a, 0xbf, 0x19, 0xa8, 0xf8, 0x39, 0xf3, 0x02, 0x9f, 0x40, 0x38, + 0x5c, 0x38, 0x7e, 0x0b, 0x65, 0x7b, 0x52, 0x12, 0xa6, 0x40, 0xdb, 0x85, 0xb0, 0x50, 0x27, 0x87, + 0x15, 0x8b, 0x2d, 0x54, 0x44, 0xd1, 0xb0, 0x4a, 0x68, 0x88, 0xd6, 0xe3, 0x47, 0xb2, 0xb5, 0xc3, + 0xc3, 0xb1, 0x33, 0x02, 0x6e, 0x66, 0x94, 0x41, 0xd4, 0xb0, 0x29, 0x05, 0x99, 0xc5, 0xd5, 0x7e, + 0xce, 0xa0, 0x8d, 0xb9, 0x59, 0x85, 0xb7, 0x51, 0x2e, 0x06, 0x45, 0x11, 0x26, 0x59, 0x8b, 0xb9, + 0x48, 0x82, 0x90, 0x25, 0x41, 0x25, 0x95, 0xef, 0x74, 0xa2, 0xff, 0xa7, 0x4b, 0xe2, 0x38, 0x56, + 0x10, 0x8d, 0x91, 0xbb, 0x45, 0x1e, 0xd4, 0x96, 0x4d, 0xed, 0x16, 0x89, 0x25, 0x4a, 0x83, 0x1b, + 0x28, 0x13, 0xb8, 0xdd, 0x68, 0x57, 0xee, 0x44, 0x80, 0x4c, 0x6b, 0xd9, 0x3d, 0x29, 0x8d, 0xe5, + 0xd6, 0x73, 0x7c, 0xf7, 0x19, 0x30, 0xee, 0x7a, 0x34, 0x5a, 0x94, 0xc9, 0xd6, 0x3b, 0x3c, 0x69, + 0x46, 0x1a, 0x92, 0x42, 0xe1, 0x43, 0xb4, 0x11, 0x5f, 0x2b, 0x36, 0x0c, 0xd7, 0xe5, 0xc3, 0xc8, + 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x32, 0x20, 0x38, 0x49, 0x21, 0xf0, 0x27, 0x68, 0x83, 0x7a, + 0x34, 0xa6, 0x6a, 0x91, 0x23, 0x6e, 0xae, 0x29, 0xa3, 0xfb, 0xb2, 0x09, 0x8f, 0x67, 0x55, 0x64, + 0x1e, 0x3b, 0x57, 0x85, 0xb9, 0xa5, 0xab, 0xb0, 0x61, 0x5d, 0x5e, 0x95, 0x57, 0x5e, 0x5e, 0x95, + 0x57, 0x5e, 0x5d, 0x95, 0x57, 0x7e, 0x9a, 0x96, 0x8d, 0xcb, 0x69, 0xd9, 0x78, 0x39, 0x2d, 0x1b, + 0xaf, 0xa6, 0x65, 0xe3, 0xcf, 0x69, 0xd9, 0xf8, 0xf5, 0xaf, 0xf2, 0xca, 0x37, 0xb9, 0x38, 0x09, + 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x58, 0x26, 0x49, 0x92, 0x7e, 0x0e, 0x00, 0x00, } diff --git a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/generated.proto b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/generated.proto index 279c5c80b2b..b3f3692e2aa 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/generated.proto +++ b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/generated.proto @@ -66,6 +66,11 @@ message Event { // +optional repeated string sourceIPs = 10; + // UserAgent records the user agent string reported by the client. + // Note that the UserAgent is provided by the client, and must not be trusted. + // +optional + optional string userAgent = 18; + // Object reference this request is targeted at. // Does not apply for List-type requests, or non-resource requests. // +optional diff --git a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go index 064fc487454..3fc46376204 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go +++ b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/types.go @@ -105,7 +105,7 @@ type Event struct { // Source IPs, from where the request originated and intermediate proxies. // +optional SourceIPs []string `json:"sourceIPs,omitempty" protobuf:"bytes,10,rep,name=sourceIPs"` - // UserAgent is an optional field that specifies the caller of this request. + // UserAgent records the user agent string reported by the client. // Note that the UserAgent is provided by the client, and must not be trusted. // +optional UserAgent string `json:"userAgent,omitempty" protobuf:"bytes,18,opt,name=userAgent"` diff --git a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/zz_generated.conversion.go b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/zz_generated.conversion.go index 4421bb6b9b4..2d9015e49be 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/zz_generated.conversion.go +++ b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1alpha1/zz_generated.conversion.go @@ -70,6 +70,7 @@ func autoConvert_v1alpha1_Event_To_audit_Event(in *Event, out *audit.Event, s co } out.ImpersonatedUser = (*audit.UserInfo)(unsafe.Pointer(in.ImpersonatedUser)) out.SourceIPs = *(*[]string)(unsafe.Pointer(&in.SourceIPs)) + out.UserAgent = in.UserAgent if in.ObjectRef != nil { in, out := &in.ObjectRef, &out.ObjectRef *out = new(audit.ObjectReference) @@ -100,6 +101,7 @@ func autoConvert_audit_Event_To_v1alpha1_Event(in *audit.Event, out *Event, s co } out.ImpersonatedUser = (*authentication_v1.UserInfo)(unsafe.Pointer(in.ImpersonatedUser)) out.SourceIPs = *(*[]string)(unsafe.Pointer(&in.SourceIPs)) + out.UserAgent = in.UserAgent if in.ObjectRef != nil { in, out := &in.ObjectRef, &out.ObjectRef *out = new(ObjectReference) diff --git a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/generated.pb.go b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/generated.pb.go index 7ac6951fb93..946f6969001 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/generated.pb.go +++ b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/generated.pb.go @@ -266,6 +266,12 @@ func (m *Event) MarshalTo(dAtA []byte) (int, error) { i += copy(dAtA[i:], v) } } + dAtA[i] = 0x92 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.UserAgent))) + i += copy(dAtA[i:], m.UserAgent) return i, nil } @@ -708,6 +714,8 @@ func (m *Event) Size() (n int) { n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize)) } } + l = len(m.UserAgent) + n += 2 + l + sovGenerated(uint64(l)) return n } @@ -896,6 +904,7 @@ func (this *Event) String() string { `RequestReceivedTimestamp:` + strings.Replace(strings.Replace(this.RequestReceivedTimestamp.String(), "MicroTime", "k8s_io_apimachinery_pkg_apis_meta_v1.MicroTime", 1), `&`, ``, 1) + `,`, `StageTimestamp:` + strings.Replace(strings.Replace(this.StageTimestamp.String(), "MicroTime", "k8s_io_apimachinery_pkg_apis_meta_v1.MicroTime", 1), `&`, ``, 1) + `,`, `Annotations:` + mapStringForAnnotations + `,`, + `UserAgent:` + fmt.Sprintf("%v", this.UserAgent) + `,`, `}`, }, "") return s @@ -1622,6 +1631,35 @@ func (m *Event) Unmarshal(dAtA []byte) error { m.Annotations[mapkey] = mapvalue } iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UserAgent", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UserAgent = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -2818,86 +2856,87 @@ func init() { } var fileDescriptorGenerated = []byte{ - // 1283 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0xce, 0xd6, 0x71, 0x63, 0x8f, 0x1b, 0xc7, 0x9d, 0x56, 0x74, 0x95, 0x83, 0x6d, 0x8c, 0x04, - 0x11, 0xa4, 0xbb, 0x6d, 0x5a, 0x48, 0x84, 0x04, 0x28, 0x56, 0x2b, 0xb0, 0x94, 0x86, 0x68, 0x1c, - 0x57, 0x08, 0x38, 0xb0, 0xb6, 0x5f, 0xec, 0xc5, 0xf6, 0xee, 0x32, 0x33, 0x6b, 0x94, 0x1b, 0x7f, - 0x00, 0x89, 0x3b, 0xff, 0x82, 0x1f, 0x50, 0x71, 0xcc, 0xb1, 0xc7, 0x9e, 0x2c, 0x62, 0xfe, 0x45, - 0x04, 0x12, 0x9a, 0xd9, 0xd9, 0x9d, 0xb5, 0x5d, 0xab, 0x0e, 0x87, 0xde, 0x66, 0xde, 0xfb, 0xbe, - 0xef, 0xbd, 0x79, 0x33, 0xf3, 0x66, 0xd0, 0xc9, 0xe0, 0x80, 0x59, 0xae, 0x6f, 0x0f, 0xc2, 0x36, - 0x50, 0x0f, 0x38, 0x30, 0x7b, 0x0c, 0x5e, 0xd7, 0xa7, 0xb6, 0x72, 0x38, 0x81, 0xcb, 0x80, 0x8e, - 0x81, 0xda, 0xc1, 0xa0, 0x27, 0x67, 0xb6, 0x13, 0x76, 0x5d, 0x6e, 0x8f, 0x1f, 0xb6, 0x81, 0x3b, - 0x0f, 0xed, 0x1e, 0x78, 0x40, 0x1d, 0x0e, 0x5d, 0x2b, 0xa0, 0x3e, 0xf7, 0xf1, 0x07, 0x11, 0xd1, - 0x4a, 0x88, 0x56, 0x30, 0xe8, 0xc9, 0x99, 0x25, 0x89, 0x96, 0x22, 0x6e, 0xdf, 0xef, 0xb9, 0xbc, - 0x1f, 0xb6, 0xad, 0x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, 0xbe, - 0xbe, 0x29, 0x36, 0xad, 0x19, 0x1b, 0x89, 0xf6, 0x63, 0x40, 0x79, 0x5f, 0x9e, 0x2b, 0x02, 0x67, - 0x66, 0x41, 0xe6, 0x73, 0x60, 0xad, 0xd8, 0x53, 0xd4, 0x29, 0x25, 0x70, 0x06, 0x14, 0xbc, 0x0e, - 0x44, 0x61, 0x12, 0x23, 0xd1, 0xca, 0xb8, 0x8f, 0x8a, 0x14, 0x58, 0xe0, 0x7b, 0x0c, 0x9a, 0xdc, - 0xe1, 0x21, 0x33, 0x6f, 0xc9, 0x58, 0xbb, 0xab, 0x9d, 0xbe, 0x88, 0x53, 0xc7, 0xd3, 0x49, 0xa5, - 0x48, 0x66, 0x74, 0xc8, 0x9c, 0x2e, 0x76, 0xd0, 0xa6, 0xda, 0xe1, 0x28, 0x11, 0x73, 0x53, 0x06, - 0xda, 0x59, 0x1a, 0x48, 0xf5, 0x0e, 0xab, 0xe5, 0x0d, 0x3c, 0xff, 0x67, 0xaf, 0x7e, 0x7b, 0x3a, - 0xa9, 0x6c, 0x92, 0xb4, 0x04, 0x99, 0x55, 0xc4, 0x5d, 0xbd, 0x18, 0x15, 0xa3, 0x78, 0xcd, 0x18, - 0x33, 0x0b, 0x51, 0x41, 0xe6, 0x34, 0xf1, 0xaf, 0x06, 0x32, 0x55, 0x5c, 0x02, 0x1d, 0x70, 0xc7, - 0xd0, 0x4d, 0xae, 0x9d, 0xb9, 0x25, 0x03, 0xda, 0xab, 0x55, 0xef, 0x99, 0xdb, 0xa1, 0xbe, 0xbc, - 0xc0, 0x55, 0x75, 0x30, 0x4d, 0xb2, 0x44, 0x98, 0x2c, 0x0d, 0x89, 0x7d, 0x54, 0x94, 0x37, 0x4d, - 0x27, 0x51, 0xfa, 0x7f, 0x49, 0xc4, 0x17, 0xb9, 0xd8, 0x9c, 0x91, 0x23, 0x73, 0xf2, 0x78, 0x8c, - 0x0a, 0x8e, 0xe7, 0xf9, 0x5c, 0xde, 0x04, 0x66, 0xde, 0xae, 0x66, 0x76, 0x0a, 0x7b, 0x5f, 0xac, - 0x7c, 0x38, 0x65, 0x07, 0xb6, 0x0e, 0xb5, 0xc2, 0x53, 0x8f, 0xd3, 0xf3, 0xfa, 0x1d, 0x15, 0xbd, - 0x90, 0xf2, 0x90, 0x74, 0xa0, 0xed, 0xcf, 0x51, 0x69, 0x9e, 0x85, 0x4b, 0x28, 0x33, 0x80, 0x73, - 0xd9, 0xc3, 0xf3, 0x44, 0x0c, 0xf1, 0x5d, 0x94, 0x1d, 0x3b, 0xc3, 0x10, 0xa2, 0xc6, 0x4b, 0xa2, - 0xc9, 0xa7, 0x37, 0x0e, 0x8c, 0xda, 0x0b, 0x03, 0xe5, 0x65, 0xf0, 0x23, 0x97, 0x71, 0xfc, 0xfd, - 0xc2, 0x13, 0x60, 0xad, 0x56, 0x30, 0xc1, 0x96, 0x0f, 0x40, 0x49, 0x65, 0x9c, 0x8b, 0x2d, 0xa9, - 0xf6, 0xdf, 0x44, 0x59, 0x97, 0xc3, 0x88, 0x99, 0x37, 0x64, 0x75, 0xac, 0xeb, 0x55, 0xa7, 0xbe, - 0x19, 0xf7, 0xd4, 0x86, 0x10, 0x21, 0x91, 0x56, 0xed, 0x77, 0x03, 0x15, 0xbf, 0xa4, 0x7e, 0x18, - 0x10, 0x88, 0x1a, 0x05, 0xc3, 0xef, 0xa1, 0x6c, 0x4f, 0x58, 0xa2, 0x0a, 0x68, 0x5e, 0x04, 0x8b, - 0x7c, 0xa2, 0xf1, 0xd0, 0x98, 0x21, 0x13, 0x52, 0x8d, 0x27, 0x91, 0x21, 0xda, 0x8f, 0xf7, 0xc5, - 0x3d, 0x8d, 0x26, 0xc7, 0xce, 0x08, 0x98, 0x99, 0x91, 0x04, 0x75, 0xfb, 0x52, 0x0e, 0x32, 0x8b, - 0xab, 0xfd, 0x91, 0x41, 0x5b, 0x73, 0x8d, 0x07, 0xef, 0xa2, 0x5c, 0x0c, 0x52, 0x19, 0x26, 0x45, - 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aa, 0xac, - 0x0e, 0x00, 0x00, + // 1303 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0xd6, 0x71, 0x13, 0x4f, 0x1a, 0xc7, 0x9d, 0x56, 0x74, 0x95, 0x83, 0x6d, 0x8c, 0x04, + 0x11, 0xa4, 0xbb, 0xfd, 0x07, 0x8d, 0x90, 0x00, 0xd9, 0x6a, 0x05, 0x96, 0xda, 0x10, 0x8d, 0xeb, + 0x0a, 0x01, 0x07, 0xd6, 0xf6, 0x8b, 0xbd, 0xd8, 0x9e, 0x5d, 0x66, 0x66, 0x8d, 0x72, 0xe3, 0x0b, + 0x20, 0x71, 0xe7, 0x33, 0x70, 0xe1, 0x03, 0x54, 0x1c, 0x7b, 0xec, 0xb1, 0x27, 0x8b, 0x9a, 0x6f, + 0x11, 0x09, 0x09, 0xcd, 0xec, 0xec, 0xce, 0xda, 0xae, 0x55, 0x87, 0x43, 0x6f, 0x3b, 0xf3, 0x7e, + 0xef, 0xf7, 0xde, 0xbc, 0x79, 0xef, 0x37, 0x8b, 0x4e, 0x86, 0x47, 0xdc, 0xf1, 0x03, 0x77, 0x18, + 0x75, 0x80, 0x51, 0x10, 0xc0, 0xdd, 0x09, 0xd0, 0x5e, 0xc0, 0x5c, 0x6d, 0xf0, 0x42, 0x9f, 0x03, + 0x9b, 0x00, 0x73, 0xc3, 0x61, 0x5f, 0xad, 0x5c, 0x2f, 0xea, 0xf9, 0xc2, 0x9d, 0xdc, 0xee, 0x80, + 0xf0, 0x6e, 0xbb, 0x7d, 0xa0, 0xc0, 0x3c, 0x01, 0x3d, 0x27, 0x64, 0x81, 0x08, 0xf0, 0x07, 0xb1, + 0xa3, 0x93, 0x3a, 0x3a, 0xe1, 0xb0, 0xaf, 0x56, 0x8e, 0x72, 0x74, 0xb4, 0xe3, 0xfe, 0xc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xf1, 0x28, 0x0d, 0x84, 0x9a, 0x04, 0x6e, 0x5f, 0xad, 0xe6, 0x0e, 0x76, 0xee, + 0x7c, 0xb1, 0x76, 0x73, 0x2a, 0x05, 0x76, 0xea, 0x86, 0xe1, 0x21, 0x15, 0xec, 0xac, 0x71, 0x4d, + 0x47, 0xdf, 0xc9, 0x58, 0x48, 0x36, 0x10, 0x76, 0x51, 0x41, 0x4e, 0x6c, 0xbd, 0x0f, 0x54, 0xd8, + 0x58, 0x49, 0x43, 0x2a, 0x7c, 0xed, 0xc4, 0x40, 0x0c, 0x66, 0xff, 0x73, 0x54, 0x5a, 0x0c, 0x83, + 0x4b, 0x28, 0x37, 0x84, 0x33, 0x25, 0xfa, 0x05, 0x22, 0x3f, 0xf1, 0x75, 0x94, 0x9f, 0x78, 0xa3, + 0x08, 0x62, 0xa5, 0x26, 0xf1, 0xe2, 0xd3, 0x4b, 0x47, 0x56, 0xed, 0x99, 0x85, 0x0a, 0x2a, 0xdb, + 0x47, 0x3e, 0x17, 0xf8, 0xfb, 0xa5, 0x37, 0xc3, 0x59, 0xaf, 0xc2, 0xd2, 0x5b, 0xbd, 0x18, 0x25, + 0x9d, 0xed, 0x76, 0xb2, 0x93, 0x79, 0x2f, 0x5a, 0x28, 0xef, 0x0b, 0x18, 0x73, 0xfb, 0x92, 0x2a, + 0xa7, 0x73, 0xb1, 0x72, 0x36, 0x76, 0x13, 0x11, 0x6e, 0x4a, 0x12, 0x12, 0x73, 0xd5, 0x7e, 0xb7, + 0x50, 0xf1, 0x4b, 0x16, 0x44, 0x21, 0x81, 0x58, 0x59, 0x38, 0x7e, 0x0f, 0xe5, 0xfb, 0x72, 0x27, + 0xae, 0x80, 0xf1, 0x8b, 0x61, 0xb1, 0x4d, 0x2a, 0x15, 0x4b, 0x3c, 0x54, 0x42, 0x5a, 0xa9, 0x52, + 0x1a, 0x62, 0xec, 0xf8, 0xbe, 0x1c, 0xec, 0x78, 0x71, 0xec, 0x8d, 0x81, 0xdb, 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, 0xb3, 0xb2, 0xf5, 0xf7, 0xac, 0x6c, + 0xfd, 0xf6, 0x4f, 0x79, 0xe3, 0xdb, 0x2d, 0x5d, 0x83, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x3c, + 0x5a, 0xb6, 0x6f, 0xdd, 0x0e, 0x00, 0x00, } diff --git a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/generated.proto b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/generated.proto index 40deceadeea..efea140b0d9 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/generated.proto +++ b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/generated.proto @@ -70,6 +70,11 @@ message Event { // +optional repeated string sourceIPs = 10; + // UserAgent records the user agent string reported by the client. + // Note that the UserAgent is provided by the client, and must not be trusted. + // +optional + optional string userAgent = 18; + // Object reference this request is targeted at. // Does not apply for List-type requests, or non-resource requests. // +optional diff --git a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/types.go b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/types.go index 27e338cac10..42b99009642 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/types.go +++ b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/types.go @@ -101,7 +101,7 @@ type Event struct { // Source IPs, from where the request originated and intermediate proxies. // +optional SourceIPs []string `json:"sourceIPs,omitempty" protobuf:"bytes,10,rep,name=sourceIPs"` - // UserAgent is an optional field that specifies the caller of this request. + // UserAgent records the user agent string reported by the client. // Note that the UserAgent is provided by the client, and must not be trusted. // +optional UserAgent string `json:"userAgent,omitempty" protobuf:"bytes,18,opt,name=userAgent"` diff --git a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/zz_generated.conversion.go b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/zz_generated.conversion.go index 6df889a6b96..c8d8d8f9878 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/zz_generated.conversion.go +++ b/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/zz_generated.conversion.go @@ -70,6 +70,7 @@ func autoConvert_v1beta1_Event_To_audit_Event(in *Event, out *audit.Event, s con } out.ImpersonatedUser = (*audit.UserInfo)(unsafe.Pointer(in.ImpersonatedUser)) out.SourceIPs = *(*[]string)(unsafe.Pointer(&in.SourceIPs)) + out.UserAgent = in.UserAgent out.ObjectRef = (*audit.ObjectReference)(unsafe.Pointer(in.ObjectRef)) out.ResponseStatus = (*v1.Status)(unsafe.Pointer(in.ResponseStatus)) out.RequestObject = (*runtime.Unknown)(unsafe.Pointer(in.RequestObject)) @@ -92,6 +93,7 @@ func autoConvert_audit_Event_To_v1beta1_Event(in *audit.Event, out *Event, s con } out.ImpersonatedUser = (*authentication_v1.UserInfo)(unsafe.Pointer(in.ImpersonatedUser)) out.SourceIPs = *(*[]string)(unsafe.Pointer(&in.SourceIPs)) + out.UserAgent = in.UserAgent out.ObjectRef = (*ObjectReference)(unsafe.Pointer(in.ObjectRef)) out.ResponseStatus = (*v1.Status)(unsafe.Pointer(in.ResponseStatus)) out.RequestObject = (*runtime.Unknown)(unsafe.Pointer(in.RequestObject)) From a8b0ccc70c1848ac15d32622e33de1da5c6821f9 Mon Sep 17 00:00:00 2001 From: xuzhonghu Date: Fri, 8 Jun 2018 17:06:39 +0800 Subject: [PATCH 3/4] add ut for audit useragent --- .../apiserver/pkg/endpoints/audit_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/audit_test.go b/staging/src/k8s.io/apiserver/pkg/endpoints/audit_test.go index 78bbe4464e4..5301f95ea18 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/audit_test.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/audit_test.go @@ -63,6 +63,7 @@ func TestAudit(t *testing.T) { Other: "bla", } simpleCPrimeJSON, _ := runtime.Encode(testCodec, simpleCPrime) + userAgent := "audit-test" // event checks noRequestBody := func(i int) eventCheck { @@ -111,6 +112,16 @@ func TestAudit(t *testing.T) { return nil } } + requestUserAgentMatches := func(userAgent string) eventCheck { + return func(events []*auditinternal.Event) error { + for i := range events { + if events[i].UserAgent != userAgent { + return fmt.Errorf("expected request user agent to match %q, but got: %q", userAgent, events[i].UserAgent) + } + } + return nil + } + } for _, test := range []struct { desc string @@ -295,6 +306,8 @@ func TestAudit(t *testing.T) { t.Errorf("[%s] error creating the request: %v", test.desc, err) } + req.Header.Set("User-Agent", userAgent) + response, err := client.Do(req) if err != nil { t.Errorf("[%s] error: %v", test.desc, err) @@ -326,6 +339,10 @@ func TestAudit(t *testing.T) { t.Errorf("[%s,%d] %v", test.desc, i, err) } } + + if err := requestUserAgentMatches(userAgent)(events); err != nil { + t.Errorf("[%s] %v", test.desc, err) + } } if len(events) > 0 { From f0b1f1c2f67877ddb2eceac5eb7c9c4ea22b4b6b Mon Sep 17 00:00:00 2001 From: xuzhonghu Date: Wed, 20 Jun 2018 11:15:09 +0800 Subject: [PATCH 4/4] limit User-Agent max length 1024 and add ...TRUNCATED suffix --- .../src/k8s.io/apiserver/pkg/audit/request.go | 20 ++++++++++++++++--- .../apiserver/pkg/audit/request_test.go | 18 +++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/staging/src/k8s.io/apiserver/pkg/audit/request.go b/staging/src/k8s.io/apiserver/pkg/audit/request.go index f62b0359f53..9593b6c8ab4 100644 --- a/staging/src/k8s.io/apiserver/pkg/audit/request.go +++ b/staging/src/k8s.io/apiserver/pkg/audit/request.go @@ -37,16 +37,20 @@ import ( "k8s.io/apiserver/pkg/authorization/authorizer" ) +const ( + maxUserAgentLength = 1024 + userAgentTruncateSuffix = "...TRUNCATED" +) + func NewEventFromRequest(req *http.Request, level auditinternal.Level, attribs authorizer.Attributes) (*auditinternal.Event, error) { ev := &auditinternal.Event{ RequestReceivedTimestamp: metav1.NewMicroTime(time.Now()), Verb: attribs.GetVerb(), RequestURI: req.URL.RequestURI(), - UserAgent: req.UserAgent(), + UserAgent: maybeTruncateUserAgent(req), + Level: level, } - ev.Level = level - // prefer the id from the headers. If not available, create a new one. // TODO(audit): do we want to forbid the header for non-front-proxy users? ids := req.Header.Get(auditinternal.HeaderAuditID) @@ -234,3 +238,13 @@ func LogAnnotations(ae *auditinternal.Event, annotations map[string]string) { LogAnnotation(ae, key, value) } } + +// truncate User-Agent if too long, otherwise return it directly. +func maybeTruncateUserAgent(req *http.Request) string { + ua := req.UserAgent() + if len(ua) > maxUserAgentLength { + ua = ua[:maxUserAgentLength] + userAgentTruncateSuffix + } + + return ua +} diff --git a/staging/src/k8s.io/apiserver/pkg/audit/request_test.go b/staging/src/k8s.io/apiserver/pkg/audit/request_test.go index b8bfacbdacd..12c36ccd669 100644 --- a/staging/src/k8s.io/apiserver/pkg/audit/request_test.go +++ b/staging/src/k8s.io/apiserver/pkg/audit/request_test.go @@ -17,9 +17,11 @@ limitations under the License. package audit import ( + "net/http" "testing" "github.com/stretchr/testify/assert" + auditinternal "k8s.io/apiserver/pkg/apis/audit" ) @@ -36,3 +38,19 @@ func TestLogAnnotation(t *testing.T) { LogAnnotation(ev, "qux", "baz") assert.Equal(t, "", ev.Annotations["qux"], "audit annotation should not be overwritten.") } + +func TestMaybeTruncateUserAgent(t *testing.T) { + req := &http.Request{} + req.Header = http.Header{} + + ua := "short-agent" + req.Header.Set("User-Agent", ua) + assert.Equal(t, ua, maybeTruncateUserAgent(req)) + + ua = "" + for i := 0; i < maxUserAgentLength*2; i++ { + ua = ua + "a" + } + req.Header.Set("User-Agent", ua) + assert.NotEqual(t, ua, maybeTruncateUserAgent(req)) +}