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

Regenerate certificates to use SANs instead of Common Name #2461

Merged
merged 5 commits into from
Sep 12, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,39 @@ dist: bionic

matrix:
include:
- go: "1.14.x"
- go: "1.15.x"
env:
- TESTS=true
- COVERAGE=true
- go: "1.14.x"
- go: "1.15.x"
env:
- PROTO_GEN_TEST=true
- go: "1.14.x"
- go: "1.15.x"
env:
- ALL_IN_ONE=true
- go: "1.14.x"
- go: "1.15.x"
env:
- CROSSDOCK=true
- go: "1.14.x"
- go: "1.15.x"
env:
- CROSSDOCK_OTEL=true
- go: "1.14.x"
- CROSSDOCK_OTEL=true
- go: "1.15.x"
env:
- DOCKER=true
- DEPLOY=true
- go: "1.14.x"
- go: "1.15.x"
env:
- ES_INTEGRATION_TEST=true
- go: "1.14.x"
- go: "1.15.x"
env:
- ES_OTEL_INTEGRATION_TEST=true
- go: "1.14.x"
- go: "1.15.x"
env:
- KAFKA_INTEGRATION_TEST=true
- go: "1.14.x"
- go: "1.15.x"
env:
- CASSANDRA_INTEGRATION_TEST=true
- go: "1.14.x"
- go: "1.15.x"
env:
- HOTROD=true

Expand Down
35 changes: 0 additions & 35 deletions pkg/config/tlscfg/testdata/README.md

This file was deleted.

34 changes: 17 additions & 17 deletions pkg/config/tlscfg/testdata/example-CA-cert.pem
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
-----BEGIN CERTIFICATE-----
MIIDADCCAeigAwIBAgIJAN1tVXtPkw1HMA0GCSqGSIb3DQEBCwUAMBUxEzARBgNV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client-cert.pem
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
-----BEGIN CERTIFICATE-----
MIICqjCCAZICCQCH8q683rqz7zANBgkqhkiG9w0BAQsFADAVMRMwEQYDVQQDDApl
eGFtcGxlLUNBMB4XDTIwMDgxMzE2MjYzNFoXDTMwMDgxMTE2MjYzNFowGTEXMBUG
A1UEAwwOZXhhbXBsZS1jbGllbnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
AoIBAQCvwR7iRItIeeE42ll9bp3qisyuUNAk6f/3kF4f12mVtuOdCQDHoAtUb4aN
LfGRNxIt7XRZDfSc2R/J7qs0IwVDiX23id3BG4vyM6E0Y7iAVefD1eDF0zFKiUyx
WQRyuwmO+1KQRkg5/0hTVMHTbitnGjsNmfUIxz/PxGF91AkqTUSrhVR1vrSQkvKs
fUjdh3/BJAOZeEhwW3hcT5UVDg4N/Za1NwrdZPnUVN0XHdiKzy3rovs5TtZsS9Ss
aXLdzWmN/xHB1rGRfAW+hAp0/QjfhmCE/kH2rpJ4+8tTk2Q4685mIS5CVSbxGNSC
VbJ8Y+bx0au5IauAOKo78sY5qCHfAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAOCA
OfYL6Kbd+jF9r5diWadfqhOKIctN/tCoislQ/qGWuoDL23DXNDeqbL49X37K+bQj
UlXETfRZf3LpQkCqd/TByYwAkRXyX1zkD2WTpdcg06IF/JMQeGeF4yhAPQBT5FoA
l7P3++0c3D+g8EG0QdT3lbPNAjxw4pW002c80eNtdg7euOrTxrUGYe0ZXd5eJYaN
raFNjE3TOceH1ZOAJ24/C5cug8Ng1RQzkRShYdsSnaG9kXp2CkPGFoFdThsV2x1K
hofUYT5tXYKSqIgGrjc7G+Vypird8xJEWmwEiwE7ehLK2jYYqBxjVsSaS1RQw6JN
obYaak2TPx0oDnJCJtY=
MIIDXzCCAkegAwIBAgIJAJu8RcLAVAT9MA0GCSqGSIb3DQEBCwUAMFUxCzAJBgNV
BAYTAkFVMRIwEAY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XjLEfO3QQGUPqRfIe
IPlh
-----END CERTIFICATE-----
50 changes: 25 additions & 25 deletions pkg/config/tlscfg/testdata/example-client-key.pem
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpgIBAAKCAQEAr8Ee4kSLSHnhONpZfW6d6orMrlDQJOn/95BeH9dplbbjnQkA
x6ALVG+GjS3xkTcSLe10WQ30nNkfye6rNCMFQ4l9t4ndwRuL8jOhNGO4gFXnw9Xg
xdMxSolMsVkEcrsJjvtSkEZIOf9IU1TB024rZxo7DZn1CMc/z8RhfdQJKk1Eq4VU
db60kJLyrH1I3Yd/wSQDmXhIcFt4XE+VFQ4ODf2WtTcK3WT51FTdFx3Yis8t66L7
OU7WbEvUrGly3c1pjf8RwdaxkXwFvoQKdP0I34ZghP5B9q6SePvLU5NkOOvOZiEu
QlUm8RjUglWyfGPm8dGruSGrgDiqO/LGOagh3wIDAQABAoIBAQCOvJABgVuBBAMG
8kYlmXXE6u7qTxWMNUK941CeGYtVnM/kVFB+z5sD+wNSm1KJ9ijchfGs9amIzMmF
bUE7uYln3Tztl5kyYNXaYVX1v1szVxFAOe4vm6J3f2R6z+nN59sOdUwLghjciVhK
3RYBSYMUW/hDxpp7g55udXYcA91hrUCW1+aEUZNQAwLdhDiyw1NhbQvHpsayk2gY
7pr7eT1o/1ekES3J4InkYvOxkc5UvPdHYbOCitctg6JOa9paMmPXVNy9TOib74c5
KcQrQCDf4s6CBQrMXGRrW3VyXztqu0EogiFFjxdfFQOxzFWmTsiNs2qt5Qe3fmy0
gaAYrZ/pAoGBANel6gK3Rn0wvVdYkEZc3JMMXcoOhy81kJqL5ILLKlHlDYVef8Gx
S+/VDIgMt3JOX/eAzM1wloV3SHja5jeRFOyabzyX51NHT2Vbpp7PnnVt5rx24Es+
+oIlrrQKyYsIPnDCCpDvx++NK5NE9UYc337nvHhzFuuQzCWHIkom3UWVAoGBANCk
MmgpS0y1Kbh49evWy820HQLizw2mngu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
0BjkAnOyuQg+Awq8Tt0MlTyilHQXyRZxuWmXbw4EuhCZ2Ed2qS+m+ZxGN8AuUvl4
AsmoB1weKDWu+0fXxSSnautP9HlxJCQ+bLXTfaltLVNf/L0+k7I=
-----END RSA PRIVATE KEY-----
34 changes: 19 additions & 15 deletions pkg/config/tlscfg/testdata/example-server-cert.pem
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
-----BEGIN CERTIFICATE-----
MIICpzCCAY8CCQCH8q683rqz7jANBgkqhkiG9w0BAQsFADAVMRMwEQYDVQQDDApl
eGFtcGxlLUNBMB4XDTIwMDgxMzE2MjYzNFoXDTMwMDgxMTE2MjYzNFowFjEUMBIG
A1UEAwwLZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
AQCgXgmpBT+Q6MxRUno7FrjtC5WfVOL5iIvpU89pYzjyqnZrrDEsdOQIrJroPCRW
nskOev4t5E9fRpRPL2u7lMZvYZvoMUsyEAZTevVjdyeSW1itTAtfD2OMRcUA6pc2
Vc5izwAGETXQfNZERw0oFxFBj292D2bfU1lA38Zzuy9OKMfcpvo3Rdq6QJGg07Ck
3DoSalKLZ6HAqYqy01zxy8n5vY4NAaTwAgEeX5iIrFCzkyXJT79Gv/IDD9KSwo+W
fdv2OnOHd/b/Hp9mazGiCoAfvi2h2EIaGvFktiq3xP7YpGWqiOrxDiOgSz1MI+1t
l0sf+YQ+vpcrsx3SMVy0ogytAgMBAAEwDQYJKoZIhvcNAQELBQADggEBACcKU9Q+
FRqParf+QfYl4N0jX2euYnyyvbniohXowavMxBZlmuzc7XK7EV8T7Td13l/YSzxO
1RttUtEO1Kt/kxSbh1OhGYkuHiNPRCg9aeKib63ki/xtdv5/xIRZPlEm9YaytNe2
/mKtudZurOPDpvPmIp23AL688MGWdwQzVjhY+TYQkAhbGv6R5qltNZOg+vLmI9lv
DQH4XTEp+Wm4S1xtcu+qQqTGFxxsKyjCoBKwqgUVOSXuRRS7PsKvS8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e2NF4T9c8Sb7c
Gg/Upkk9/uJ04hCJm7X6TyRUS56GTlBvLHvmspoaZu14dDpkRyXlrHQiwmuZs9xr
mZNT7xZZgrlSCIfadILMafm2DkNhc7ByADurYOF7SORWWJMyJXx/Mb8r+IaWH2tW
ouaqWPzQNdIHePa8eJyPE7ypZuJsaMvXu5MwEayvOux1P13dyorOdqcL1vybtvxm
qT1B
-----END CERTIFICATE-----
50 changes: 25 additions & 25 deletions pkg/config/tlscfg/testdata/example-server-key.pem
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAoF4JqQU/kOjMUVJ6Oxa47QuVn1Ti+YiL6VPPaWM48qp2a6wx
LHTkCKya6DwkVp7JDnr+LeRPX0aUTy9ru5TGb2Gb6DFLMhAGU3r1Y3cnkltYrUwL
Xw9jjEXFAOqXNlXOYs8ABhE10HzWREcNKBcRQY9vdg9m31NZQN/Gc7svTijH3Kb6
N0XaukCRoNOwpNw6EmpSi2ehwKmKstNc8cvJ+b2ODQGk8AIBHl+YiKxQs5MlyU+/
Rr/yAw/SksKPln3b9jpzh3f2/x6fZmsxogqAH74todhCGhrxZLYqt8T+2KRlqojq
8Q4joEs9TCPtbZdLH/mEPr6XK7Md0jFctKIMrQIDAQABAoIBAGdrPZ+amtvAxcLM
BbeFd8ym497Ux2tU+6WFPwUfz+HuvF/DtBKPb1+IsH2EC4sw60hDWRgPXIB867gF
RNy7nRzHPdwHrg6i9vFvIkD63rIr5owbtlmfevtDI0DsCIgp3ecqx0EiaCoD18pA
Z+OqvJ4i+iaQ2C69eZm0ti58UI1+Ccd9u02Ge6HCs6G10JuRxdx1fTC5xjymgmZ5
gQHmpwIRlMo07qvqhu0BRChjuaO87NIA3jWwfT23JV8keXRUrQjYhkUEwMvb/SGn
8ZzAbUYUoFTE71HGkK+fYYZaL7TrBlNgTCWW2IaaMgM1tdb7UfGODb3gMrvtr6Ln
bB8WqgECgYEAzeAEqkooy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yKJ+k6UCgYEAgFLo1px5sTJGH2Hf8qNI+kbuj7GxL0+gchMA
95DMFoX+sLlaanoMyzWLsK7QZcoqsOyEyVwkDW9t2LjAZW91kIfuGFCQHFN42Wx2
addY1Aj0Cp9aJmcGHufID0fd/6eQHsIqfRE+NrAyF/H9fPGRqdN9dlmQUiCQ+pzS
uppA1wUCgYEA29yNmR6+Y1erm9ynneesOxo6mnPArEyQJal/LHowbrJL08yva4gQ
GlZUYyjPrbj2wNaUGXDmmRcbeilSXblUhB4j50dhSB1GqiRvNs9E1W9UGoO/tI/3
8sjE2E/zkWHax7ynUEvSWm5PK9Y587ioOe3OBgMyE6KGGuKINg+8HrE=
-----END RSA PRIVATE KEY-----
58 changes: 58 additions & 0 deletions pkg/config/tlscfg/testdata/gen-certs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/usr/bin/env bash

yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
# The following commands were used to create the CA, server and client's certificates and keys in this directory used by unit tests.
# These certificates use the Subject Alternative Name extension rather than the Common Name, which will be unsupported in Go 1.15.

# Generate config files.
# The server name (under alt_names in the ssl.conf) is `example.com`. (in accordance to [RFC 2006](https://tools.ietf.org/html/rfc2606))
source gen-ssl-conf.sh example.com ssl.conf
source gen-ssl-conf.sh wrong.com wrong-ssl.conf
Copy link
Member

Choose a reason for hiding this comment

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

perhaps instead of writing to the current dir (and accidentally checking in), we could use temp dir

tmp_dir=$(mktemp -d -t certificates)
clean_up () {
    ARG=$?
    rm -rf $tmp_dir
    exit $ARG
} 
trap clean_up EXIT


# Create CA (accept defaults from prompts).
openssl genrsa -out example-CA-key.pem 2048
openssl req -new -key example-CA-key.pem -x509 -days 3650 -out example-CA-cert.pem -config ssl.conf

# Create Wrong CA (a dummy CA which doesn't provide any certificate; accept defaults from prompts).
openssl genrsa -out wrong-CA-key.pem 2048
openssl req -new -key wrong-CA-key.pem -x509 -days 3650 -out wrong-CA-cert.pem -config wrong-ssl.conf

# Create client and server keys.
openssl genrsa -out example-server-key.pem 2048
openssl genrsa -out example-client-key.pem 2048

# Create certificate sign request using the above created keys and configuration given and commandline arguments.
openssl req -new -nodes -key example-server-key.pem -out example-server.csr -config ssl.conf
openssl req -new -nodes -key example-client-key.pem -out example-client.csr -config ssl.conf

# Creating the client and server certificate.
openssl x509 -req \
-sha256 \
-days 3650 \
-in example-server.csr \
-signkey example-server-key.pem \
-out example-server-cert.pem \
-extensions req_ext \
-CA example-CA-cert.pem \
-CAkey example-CA-key.pem \
-CAcreateserial \
-extfile ssl.conf
openssl x509 -req \
-sha256 \
-days 3650 \
-in example-client.csr \
-signkey example-client-key.pem \
-out example-client-cert.pem \
-extensions req_ext \
-CA example-CA-cert.pem \
-CAkey example-CA-key.pem \
-CAcreateserial \
-extfile ssl.conf
Copy link
Member

Choose a reason for hiding this comment

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

how about writing PEM files into $tmp_dir and then copying into the right place in the source tree?


# Cleanup.
rm example-CA-key.pem
rm example-CA-cert.srl
rm example-client.csr
rm example-server.csr
rm ssl.conf
rm wrong-ssl.conf

34 changes: 34 additions & 0 deletions pkg/config/tlscfg/testdata/gen-ssl-conf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash

# Generates the SSL conf files required for generating certificates.

domain_name="$1"
output_file="$2"

if [[ -z "$domain_name" || -z "$output_file" ]]; then
printf "A script to generate SSL configuration files for testing purposes.\n\n"
printf "Usage: ssl-conf-gen.sh DOMAIN_NAME OUTPUT_FILE\n\n"
printf "Example: ssl-conf-gen.sh example.com ssl.conf\n"
return
Copy link
Member

Choose a reason for hiding this comment

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

should this be exit -1 instead?

Copy link
Contributor Author

@albertteoh albertteoh Sep 10, 2020

Choose a reason for hiding this comment

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

I believe negative numbers are not supported as return codes in bash. But good catch that it should return a non-0 return code.

return was intentional because this script is sourced, which means it runs within the parent shell.

The added benefit of source-ing is that the set -ex that you suggested above will also apply in this script so commands in this script are printed to STDOUT and will also trigger an early exit if something fails.

If developers want to call this script separately, it can be run with source gen-ssl-conf.sh <args...>.

fi

cat << EOF > "$output_file"
[ req ]
prompt = no
default_bits = 2048
distinguished_name = req_distinguished_name
req_extensions = req_ext

[ req_distinguished_name ]
countryName = AU
stateOrProvinceName = Australia
localityName = Sydney
organizationName = Logz.io
commonName = Jaeger

[ req_ext ]
subjectAltName = @alt_names

[alt_names]
DNS.1 = $domain_name
EOF
Loading