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

[fixes 254] Add mTLS support with client cert and key. #211

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions docs/data-sources/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ resource "null_resource" "example" {
### Optional

- `ca_cert_pem` (String) Certificate data of the Certificate Authority (CA) in [PEM (RFC 1421)](https://datatracker.ietf.org/doc/html/rfc1421) format.
- `client_cert_pem` (String) Certificate data of the Client certificate in [PEM (RFC 1421)](https://datatracker.ietf.org/doc/html/rfc1421) format.
- `client_key_pem` (String) Certificate data of the Client certificate in [PEM (RFC 1421)](https://datatracker.ietf.org/doc/html/rfc1421) format.
- `insecure` (Boolean) Disables verification of the server's certificate chain and hostname. Defaults to `false`
- `method` (String) The HTTP Method for the request. Allowed methods are a subset of methods defined in [RFC7231](https://datatracker.ietf.org/doc/html/rfc7231#section-4.3) namely, `GET`, `HEAD`, and `POST`. `POST` support is only intended for read-only URLs, such as submitting a search.
- `request_body` (String) The request body as a string.
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/hashicorp/terraform-plugin-framework v1.2.0
github.com/hashicorp/terraform-plugin-framework-validators v0.10.0
github.com/hashicorp/terraform-plugin-go v0.14.3
github.com/hashicorp/terraform-plugin-testing v1.2.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1
golang.org/x/net v0.8.0
)

Expand Down Expand Up @@ -38,7 +38,6 @@ require (
github.com/hashicorp/terraform-exec v0.18.1 // indirect
github.com/hashicorp/terraform-json v0.16.0 // indirect
github.com/hashicorp/terraform-plugin-log v0.8.0 // indirect
github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1 // indirect
github.com/hashicorp/terraform-registry-address v0.1.0 // indirect
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ github.com/hashicorp/terraform-plugin-log v0.8.0 h1:pX2VQ/TGKu+UU1rCay0OlzosNKe4
github.com/hashicorp/terraform-plugin-log v0.8.0/go.mod h1:1myFrhVsBLeylQzYYEV17VVjtG8oYPRFdaZs7xdW2xs=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1 h1:G9WAfb8LHeCxu7Ae8nc1agZlQOSCUWsb610iAogBhCs=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1/go.mod h1:xcOSYlRVdPLmDUoqPhO9fiO/YCN/l6MGYeTzGt5jgkQ=
github.com/hashicorp/terraform-plugin-testing v1.2.0 h1:pASRAe6BOZFO4xSGQr9WzitXit0nrQAYDk8ziuRfn9E=
github.com/hashicorp/terraform-plugin-testing v1.2.0/go.mod h1:+8bp3O7xUb1UtBcdknrGdVRIuTw4b62TYSIgXHqlyew=
github.com/hashicorp/terraform-registry-address v0.1.0 h1:W6JkV9wbum+m516rCl5/NjKxCyTVaaUBbzYcMzBDO3U=
github.com/hashicorp/terraform-registry-address v0.1.0/go.mod h1:EnyO2jYO6j29DTHbJcm00E5nQTFeTtyZH3H5ycydQ5A=
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0=
Expand Down
30 changes: 30 additions & 0 deletions internal/provider/data_source_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"crypto/tls"
"crypto/x509"
"fmt"
"github.com/hashicorp/terraform-plugin-framework/diag"
"io"
"mime"
"net/http"
Expand Down Expand Up @@ -111,6 +112,24 @@ your control should be treated as untrustworthy.`,
},
},

"client_cert_pem": schema.StringAttribute{
Description: "Certificate data of the Client certificate " +
"in [PEM (RFC 1421)](https://datatracker.ietf.org/doc/html/rfc1421) format.",
Optional: true,
Validators: []validator.String{
stringvalidator.AlsoRequires(path.MatchRoot("client_key_pem")),
},
},

"client_key_pem": schema.StringAttribute{
Description: "Certificate data of the Client certificate " +
"in [PEM (RFC 1421)](https://datatracker.ietf.org/doc/html/rfc1421) format.",
Optional: true,
Validators: []validator.String{
stringvalidator.AlsoRequires(path.MatchRoot("client_cert_pem")),
},
},

"insecure": schema.BoolAttribute{
Description: "Disables verification of the server's certificate chain and hostname. Defaults to `false`",
Optional: true,
Expand Down Expand Up @@ -195,6 +214,15 @@ func (d *httpDataSource) Read(ctx context.Context, req datasource.ReadRequest, r
clonedTr.TLSClientConfig.RootCAs = caCertPool
}

if !model.ClientCert.IsNull() && !model.ClientKey.IsNull() {
cert, err := tls.X509KeyPair([]byte(model.ClientCert.ValueString()), []byte(model.ClientKey.ValueString()))
if err != nil {
resp.Diagnostics.Append(diag.NewErrorDiagnostic("error creating x509 key pair",
fmt.Sprintf("error creating x509 key pair from provided pem blocks\n\nError: %s", err)))
}
clonedTr.TLSClientConfig.Certificates = []tls.Certificate{cert}
}

client := &http.Client{
Transport: clonedTr,
}
Expand Down Expand Up @@ -306,6 +334,8 @@ type modelV0 struct {
RequestBody types.String `tfsdk:"request_body"`
ResponseHeaders types.Map `tfsdk:"response_headers"`
CaCertificate types.String `tfsdk:"ca_cert_pem"`
ClientCert types.String `tfsdk:"client_cert_pem"`
ClientKey types.String `tfsdk:"client_key_pem"`
Insecure types.Bool `tfsdk:"insecure"`
ResponseBody types.String `tfsdk:"response_body"`
Body types.String `tfsdk:"body"`
Expand Down
59 changes: 54 additions & 5 deletions internal/provider/data_source_http_test.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
package provider

import (
"crypto/tls"
"crypto/x509"
"encoding/pem"
"fmt"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
"net/http"
"net/http/httptest"
"net/http/httputil"
"net/url"
"os"
"regexp"
"strings"
"testing"

"github.com/hashicorp/terraform-plugin-testing/helper/resource"
"github.com/hashicorp/terraform-plugin-testing/terraform"
)

func TestDataSource_200(t *testing.T) {
Expand Down Expand Up @@ -374,6 +375,27 @@ EOF
})
}

func TestDataSource_WithClientCert(t *testing.T) {
s := setupMockMTLSHttpServer(t)
defer s.server.Close()

resource.UnitTest(t, resource.TestCase{
ProtoV5ProviderFactories: protoV5ProviderFactories(),
Steps: []resource.TestStep{
{
Config: fmt.Sprintf(`
data "http" "http_test" {
url = "%s"
ca_cert_pem = file("testdata/certs/ca.cert.pem")
client_cert_pem = file("testdata/certs/client.crt")
client_key_pem = file("testdata/certs/client.key")
}
`, s.server.URL),
},
},
})
}

func TestDataSource_WithCACertificateFalse(t *testing.T) {
testHttpMock := setUpMockHttpServer(true)
defer testHttpMock.server.Close()
Expand Down Expand Up @@ -430,7 +452,7 @@ func TestDataSource_InsecureFalse(t *testing.T) {

insecure = false
}`, testHttpMock.server.URL),
ExpectError: regexp.MustCompile(fmt.Sprintf(`Error making request: Get "%s/200": x509: `, testHttpMock.server.URL)),
ExpectError: regexp.MustCompile(fmt.Sprintf(`Error making request: Get "%s/200": (:?x509|tls): `, testHttpMock.server.URL)),
},
},
})
Expand All @@ -448,7 +470,7 @@ func TestDataSource_InsecureUnconfigured(t *testing.T) {
data "http" "http_test" {
url = "%s/200"
}`, testHttpMock.server.URL),
ExpectError: regexp.MustCompile(fmt.Sprintf(`Error making request: Get "%s/200": x509: `, testHttpMock.server.URL)),
ExpectError: regexp.MustCompile(fmt.Sprintf(`Error making request: Get "%s/200": (:?x509|tls): `, testHttpMock.server.URL)),
},
},
})
Expand Down Expand Up @@ -547,6 +569,33 @@ type TestHttpMock struct {
server *httptest.Server
}

func setupMockMTLSHttpServer(t *testing.T) *TestHttpMock {
server := httptest.NewUnstartedServer(
http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
httpReqHandler(w, r)
}),
)
CAs := x509.NewCertPool()
data, err := os.ReadFile("testdata/certs/ca.cert.pem")
if err != nil {
t.Fatalf("error reading testdata/certs/ca.cert.pem: %v", err)
}
if !CAs.AppendCertsFromPEM(data) {
t.Fatalf("error AppendCertsFromPEM from testdata/certs/ca.cert.pem: %v", err)
}
serverCert, err := tls.LoadX509KeyPair("testdata/certs/server.crt", "testdata/certs/server.key")
if err != nil {
t.Fatalf("error loading server key pair: %v", err)
}
server.TLS = &tls.Config{
ClientAuth: tls.RequireAndVerifyClientCert,
ClientCAs: CAs,
Certificates: []tls.Certificate{serverCert},
}
server.StartTLS()
return &TestHttpMock{server: server}
}

func setUpMockHttpServer(tls bool) *TestHttpMock {
var Server *httptest.Server

Expand Down
29 changes: 29 additions & 0 deletions internal/provider/testdata/certs/ca.cert.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-----BEGIN CERTIFICATE-----
MIIFBzCCAu+gAwIBAgIUVfGh49cbMRNPRqkxKOoNT1ttbTgwDQYJKoZIhvcNAQEL
BQAwEjEQMA4GA1UEAwwHdGVzdC1jYTAgFw0yMjEyMTYwMTQxNThaGA8zMDIyMDQx
ODAxNDE1OFowEjEQMA4GA1UEAwwHdGVzdC1jYTCCAiIwDQYJKoZIhvcNAQEBBQAD
ggIPADCCAgoCggIBANbhry//aJNTBPuqT2qFp5MonJJ3fk+ev8kdEx32uDmZKDSH
ueY6C1QRQv0bClS/0R70Pi5MUF/gAXqqTR7rowzr4d70AQcbs5dawfyuHg/UxRHY
cLSB+EGxc1AGfFObqBBH+RDFsha0V6TSBzPqeaRxVBd/5QV14lEik6xxVMTPmcA3
DYyU6T21FomXHL0jkA3utTBCD7iRuOWNobMGblywrKuVLwFEimqBFckG5+BYRt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LgVlU9SzqKJN3bXa4DX6UnuOteYhiqvKa9onIBr/u2M+mCQTXecO
EtlKsz/Y0WsqY+GZgRhtq4oLMhRT7dkuvsFAsNsw3uO2ClUhbhPt3nV/qc9L5XgL
Utkf3IxZCFNnhsIbbFuCPGL8Iiu1vZZEEk6Z+M1zGe0sb8ZTvxGf6+kuVLt2No36
s4R4ZCfkAkw23Bk+voAH4FLEq4Jg9hOHcHMD0l61x2KcqDmezBgiJQjoyw==
-----END CERTIFICATE-----
1 change: 1 addition & 0 deletions internal/provider/testdata/certs/ca.cert.srl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
654A65EB3A4E7CB53E55BFF12717DFB7FC6771D7
52 changes: 52 additions & 0 deletions internal/provider/testdata/certs/ca.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
-----BEGIN PRIVATE KEY-----
MIIJQQIBADANBgkqhkiG9w0BAQEFAASCCSswggknAgEAAoICAQDW4a8v/2iTUwT7
qk9qhaeTKJySd35Pnr/JHRMd9rg5mSg0h7nmOgtUEUL9GwpUv9Ee9D4uTFBf4AF6
qk0e66MM6+He9AEHG7OXWsH8rh4P1MUR2HC0gfhBsXNQBnxTm6gQR/kQxbIWtFek
0gcz6nmkcVQXf+UFdeJRIpOscVTEz5nANw2MlOk9tRaJlxy9I5AN7rUwQg+4kbjl
jaGzBm5csKyrlS8BRIpqgRXJBufgWEbcT+Pn+x7WljntpmSsg8vMvpoCzNgdlLvy
8msF8HLOHDJZxLXTeJBwtPWXXbn9x7tXTBBMGPRjs+zutcU8IcYe8n/99f3YufDt
TeznR01aaBM2pN+I3B1Ea7GtX3terK62LDpI2TkJrQ4wJafX7Osvm059rAeaLWce
/jZ15Gvwi9BgQtPtl4wz6qPTBQMVhpPsz/uh3t1zAA2dET8Fu5cBhl5PivpGyRca
M/b9ykDAVj+LSM7V2gS9HuGfp5pVU4GCVQ3MzkvaF2/5ltiww42GvBzCSGCE5MU2
uJO9PXRWCm7JePEam13jNpClSWtKDiF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z87HdV25Y9GefVHTk6GENlGoV4Vq
p9YFSYW0lb4Ei52wrZNDpeZTPZrCy7H766qQDPZOE1j7yewfUiYxTqRodCp09YVH
FQKCAQBT7OT/txFW2s3Qpf/WVojNTpfsqDSJLzgwjeZFCuaTAvJHcZ1fKeIxMfZv
7/zjmwywkksd40A1vpyd2m9OKEtg3W7ukg0bzGZZj/P+89kb94xWpnLPmwkfIOdx
khht0HhLdfwnEzAfiGskIhXxgMgIOBq8vohRnqYUyrjYO5lvIAxMhryr6Ni9xRMn
7jLr5LvhmZl6vr3Hc05R1TmbWigtrwHUFR1wCjB4RB+R8heC/9nlUibm3ww3Tr9n
Be1L0MXjepKqtXFLzC0kTpCYqeg1NO1Dd4SHbVYQqA6AvsbRSXaYAnIdWUbXn9B8
HnFYZz0A02D2zoL1bkOjja/AuCs7
-----END PRIVATE KEY-----
29 changes: 29 additions & 0 deletions internal/provider/testdata/certs/client.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-----BEGIN CERTIFICATE-----
MIIFCzCCAvOgAwIBAgIUZUpl6zpOfLU+Vb/xJxfft/xncdcwDQYJKoZIhvcNAQEL
BQAwEjEQMA4GA1UEAwwHdGVzdC1jYTAgFw0yMjEyMTYwMTQyMzNaGA8zMDIyMDQx
ODAxNDIzM1owFjEUMBIGA1UEAwwLdGVzdC1jbGllbnQwggIiMA0GCSqGSIb3DQEB
AQUAA4ICDwAwggIKAoICAQDia2YsE5UxOL28YDRgIXgsQzWx+IKcQCrJDMAUMSR5
37rSbggPo2s3xK3Pt6yL/LzHf6mJ7l74Q+MWx1TRwEYNH0OMuf/BlBuxceuna8Vt
228HI/kQAUPzeDXYg+ToyZkkh0ljN/8uV3/PpzJDyvUDPcZUNMAFb1bFinRkPrZ4
/nrlLijHwr9jZrXhvvST1LSo5qhMqer48PZw9kpE1Oks7vky6BlqpZ39bc6c7PAj
qCJ/4cfqO5FtoNw4zwRdaR2+mpbi8UyaZ1gnYsM2XEQ9Zs7wmQbeG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AcPVMIYmAMDKXeJiO2eQZKMrcNOPTSuW
kmybuvKny+7KUsa1X2B4eyO2UBsquF1H8YL4tUqSB8JT0vvQ5/OFaNDKMRcNbtnx
BPhJSKBt3Pep9Kau4GBHeZSLopKAAR6BCQImn4LcNZfTRidd+ixWvKpLreVOiRs=
-----END CERTIFICATE-----
27 changes: 27 additions & 0 deletions internal/provider/testdata/certs/client.csr
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-----BEGIN CERTIFICATE REQUEST-----
MIIEfTCCAmUCAQAwFjEUMBIGA1UEAwwLdGVzdC1jbGllbnQwggIiMA0GCSqGSIb3
DQEBAQUAA4ICDwAwggIKAoICAQDia2YsE5UxOL28YDRgIXgsQzWx+IKcQCrJDMAU
MSR537rSbggPo2s3xK3Pt6yL/LzHf6mJ7l74Q+MWx1TRwEYNH0OMuf/BlBuxceun
a8Vt228HI/kQAUPzeDXYg+ToyZkkh0ljN/8uV3/PpzJDyvUDPcZUNMAFb1bFinRk
PrZ4/nrlLijHwr9jZrXhvvST1LSo5qhMqer48PZw9kpE1Oks7vky6BlqpZ39bc6c
7PAjqCJ/4cfqO5FtoNw4zwRdaR2+mpbi8UyaZ1gnYsM2XEQ9Zs7wmQbeGVfDe1gJ
5L5fXDHWPRIbfOLejllJKv4ocEH0vLd3h/4keVZSLQtYodwP6o3OO/oM4Wti//oJ
nglB11y0LDGnVzYX1njme0JrNVRNjXFGGD/RQNKIInVpUFkNAY1lynXH8r3VD5Io
Bsmw75E9Mfe7WqqPSiKY6+F2O9+mlAwagdk3DOxAy8KtGaSVDU4Drdex/gu1/fyT
S90wRWLVks1JB9aSmPSmlY98qvhDRfVVu3P6wkHIGm4BG6FPBc9TEc9n9qRadZtM
CQKz1IHFEWtd2/4Fue6BMWAGd+fjwBgBDBGSp2o/vg4czUDoMi0lojL0LM8ns4RF
jhiJAY/UhVQZLdTEL22n8B9/2YVFbKAf1LsORiwTP7799gAULpECGlU2kBVrdGCF
Mv2LOwIDAQABoCIwIAYJKoZIhvcNAQkOMRMwETAPBgNVHREECDAGhwR/AAABMA0G
CSqGSIb3DQEBCwUAA4ICAQABOneaJg2VUEaVU74uNrXYBNPnHkCG4gUknYIL/fUi
qXxuOI5svh7NBIl0Z8vshBpzT8A2tlhLdRpmlWrfn7cRwNSumRjtoCcNeXkR8XPX
rWGQ85O7yXInBECeJF5+lIoKZPEMlHcejXAru4ieDNEthbuGYds3RuSicVvKP1fP
21PsFoURzVIVjRZ6n57bEy4PqBAzfpoBw/nh8d7j5oP0AxVUd+OBZdoe50HIaVal
r6Zv59Bzwk4xkntoQqqYetFuMKUI6PPObjGVMKx2RBz4anfvPnDEjhYX8y1etVNL
s1moL3C+UkCT7tnKHQkATuH82/heoosU+8E56Ujke3QZHKzSUwwHdP2zRd/M6BFe
r0tAe71aQUwQ3+WllznfcsvL863C+qZWtIRmE5N9hgnmkvyb5HDLURiL/WTuj6rM
RdPT1PvINO0RlJfVYCGUa3uLxiweyyUZ0T7i2ZKtT6CJMMXMOs8qFIAelolMaZAx
nO9uju7fuJGqXR6ehi0VBh6SH4AA3OvpHOd1+9whiubPo4df3ZFCeh6kOdvIIxRF
qb9+bILdkdIL9v1E1dV2DxX9FZakJTGNap2WhPWN2UhQMfkA1GvB3IgMzXNBBKOi
dCakbe5B2+LS5NPm3/tg/LIcnlx4BuISc5+rQMCXGVLFU2PhWPOmqY8Olf1O2hrC
KA==
-----END CERTIFICATE REQUEST-----
52 changes: 52 additions & 0 deletions internal/provider/testdata/certs/client.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
-----BEGIN PRIVATE KEY-----
MIIJQQIBADANBgkqhkiG9w0BAQEFAASCCSswggknAgEAAoICAQDia2YsE5UxOL28
YDRgIXgsQzWx+IKcQCrJDMAUMSR537rSbggPo2s3xK3Pt6yL/LzHf6mJ7l74Q+MW
x1TRwEYNH0OMuf/BlBuxceuna8Vt228HI/kQAUPzeDXYg+ToyZkkh0ljN/8uV3/P
pzJDyvUDPcZUNMAF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