Skip to content

Commit

Permalink
dev-environment: listen-tls
Browse files Browse the repository at this point in the history
  • Loading branch information
eguzki committed Oct 20, 2023
1 parent cff87c9 commit 9c61cb0
Show file tree
Hide file tree
Showing 10 changed files with 267 additions and 0 deletions.
18 changes: 18 additions & 0 deletions dev-environments/listen-tls/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec
.DEFAULT_GOAL := gateway
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
WORKDIR := $(patsubst %/,%,$(dir $(MKFILE_PATH)))
DOCKER ?= $(shell which docker 2> /dev/null || echo "docker")

gateway: ## run gateway configured to access upstream powered with TLS
$(DOCKER) compose -f docker-compose.yml run --service-ports gateway

clean:
$(DOCKER) compose down --volumes --remove-orphans
$(DOCKER) compose -f docker-compose.yml down --volumes --remove-orphans

certs:
$(MAKE) clean -C $(WORKDIR)/cert -f $(WORKDIR)/cert/Makefile
$(MAKE) ca -C $(WORKDIR)/cert -f $(WORKDIR)/cert/Makefile
$(MAKE) clientcerts -C $(WORKDIR)/cert -f $(WORKDIR)/cert/Makefile DOMAIN=example.com
15 changes: 15 additions & 0 deletions dev-environments/listen-tls/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Making APIcast listen on HTTPS

Run `make gateway`

## Testing

```sh
curl --resolve example.com:8443:127.0.0.1 -v --cacert cert/rootCA.pem "https://example.com:8443/?user_key=123"
```

## SSL Certificates

```sh
make certs
```
31 changes: 31 additions & 0 deletions dev-environments/listen-tls/apicast-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"services": [
{
"id": "1",
"backend_version": "1",
"proxy": {
"hosts": ["example.com"],
"api_backend": "http://one.upstream/get",
"backend": {
"endpoint": "http://127.0.0.1:8081",
"host": "backend"
},
"policy_chain": [
{
"name": "apicast.policy.apicast"
}
],
"proxy_rules": [
{
"http_method": "GET",
"pattern": "/",
"metric_system_name": "hits",
"delta": 1,
"parameters": [],
"querystring_parameters": {}
}
]
}
}
]
}
15 changes: 15 additions & 0 deletions dev-environments/listen-tls/cert/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
clean:
- rm *.crt *.key *.pem *.csr

ca:
openssl genrsa -out rootCA.key 2048
openssl req -batch -new -x509 -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem

clientcerts:
openssl req -subj '/CN=$(DOMAIN)' -newkey rsa:4096 -nodes \
-sha256 \
-days 3650 \
-keyout $(DOMAIN).key \
-out $(DOMAIN).csr
chmod +r $(DOMAIN).key
openssl x509 -req -in $(DOMAIN).csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out $(DOMAIN).crt -days 500 -sha256
23 changes: 23 additions & 0 deletions dev-environments/listen-tls/cert/example.com.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
-----BEGIN CERTIFICATE-----
MIID4jCCAsoCFCjc4z8RXWcyESODtBBV9dBrvSiRMA0GCSqGSIb3DQEBCwUAMEUx
CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl
cm5ldCBXaWRnaXRzIFB0eSBMdGQwHhcNMjMxMDIwMjEzNTA4WhcNMjUwMzAzMjEz
NTA4WjAWMRQwEgYDVQQDDAtleGFtcGxlLmNvbTCCAiIwDQYJKoZIhvcNAQEBBQAD
ggIPADCCAgoCggIBAK7TVeoG/VwDHVwDEDhk8MuLEigK4vT/jkeCaorFnjl2y3hN
++tSaMzvG6/z3bkNgbmW92abSXebM4Hd+rdumAcKBnUkuYBLhaVvkn7jLZAbt5to
Nhb5XHZKfb8FLPa79OnFXVVPGBNjsBAvhiNh1webjFxb8QWrZuO5u6z35pr/DAZm
Jzy4ldyYadOW5KNWKjyNYNj72N3u2DxSzOnylDaRJV64tqc2xFyCPsd0LjZkIXDr
ljOIANmri5VmfYgExTilZuXU5FCS9W0fIYVZsyBI68jAHOTFT2wUBwJeX40Nopsz
dwBItmT1KEQ4T+GRbi0n3tQ8I3PndZPKVkpESo+UPZAvmzORmIgnrsjB8D/KEBKe
frAYlPL8igvp9L4zJZL7erh078DKSMuLmiScQ/kc/GuqgVn8YVxSQ4UFQWw70Ipf
b4Afwk4rixzh5yP9Qt9aEyAgNWhXG7nhbUwxb0KaBIH/fF4+/ruMIAKtRGapigmz
Xg91WGmVT4GX0MIkT40ufjVcJNqj0q1JZkTHdsZKqkZ5nFd0M3MXXss558F1EOE6
ru/U62Xd9zaknCPhUsjHT9nXSFmpYiZMVjN48uMeNO3Vl0KmjB71TQ9BYYyrVuD7
nxcSMPr2+zaEnT9h1H2LskLYD5APGoq/IxDOsmfwtyhJOQAY/2M9lAupbh0xAgMB
AAEwDQYJKoZIhvcNAQELBQADggEBAMRlqTfszGi6Zesw8eirSfkQpZlzXHm/okAa
wS1ZTMN3L7a/PtouPIVaHCvcQhRIqL0Rq/LDWWyzVieKwM/iAl1U3nh3Sgz+DOX3
Cb2HkL9FF95n+yJ/HpMadIvba7bVTEil/5428d9dNzsdefvfvc/cNtck3t4fidtu
7qduN4FpQRsxI0JjoqPEYr1paPXGxpYHJNi511Yiih3gm3ZSgFlJ5ImFNFPolqHr
g2OfWZV9IzyRrZwhcIRjT1oy1IKK3H00Rvn9fgza/5sS2A7GXcjjlNNewfs3xIUS
vGUh/iAsiGXmFVNfxzCc11yLmoPnJwqYRcXq+ZkjcFs6asP6mzI=
-----END CERTIFICATE-----
26 changes: 26 additions & 0 deletions dev-environments/listen-tls/cert/example.com.csr
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
-----BEGIN CERTIFICATE REQUEST-----
MIIEWzCCAkMCAQAwFjEUMBIGA1UEAwwLZXhhbXBsZS5jb20wggIiMA0GCSqGSIb3
DQEBAQUAA4ICDwAwggIKAoICAQCu01XqBv1cAx1cAxA4ZPDLixIoCuL0/45HgmqK
xZ45dst4TfvrUmjM7xuv8925DYG5lvdmm0l3mzOB3fq3bpgHCgZ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SXouQLg689Am/fhKLdZY1PaGCF9+Vl5qCD0Dn0dDFHf
HBRGP2M1rQXycAUkzOokMhy9uBJ6hGXUwa8pMZzt7qkmUdqYD1S/olQycAuykwPR
YwVz5x1pp0OFQIFy22XXMxbSRJsLxUCo8E71jTm6ZWVd3fHU8guNnb0Bb0BOSaPc
0sDBkQ8TRg9Ua5/kBWCB8LX6RcAb/0KHoZgSBA+W//JpiqtLARVhA2wZ4aRkwXfU
2m5EAeRlioWsImnVN9qA
-----END CERTIFICATE REQUEST-----
52 changes: 52 additions & 0 deletions dev-environments/listen-tls/cert/example.com.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
-----BEGIN PRIVATE KEY-----
MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQCu01XqBv1cAx1c
AxA4ZPDLixIoCuL0/45HgmqKxZ45dst4TfvrUmjM7xuv8925DYG5lvdmm0l3mzOB
3fq3bpgHCgZ1JLmAS4Wlb5J+4y2QG7ebaDYW+Vx2Sn2/BSz2u/TpxV1VTxgTY7AQ
L4YjYdcHm4xcW/EFq2bjubus9+aa/wwGZic8uJXcmGnTluSjVio8jWDY+9jd7tg8
Uszp8pQ2kSVeuLanNsRcgj7HdC42ZCFw65YziADZq4uVZn2IBMU4pWbl1ORQkvVt
HyGFWbMgSOvIwBzkxU9sFAcCXl+NDaKbM3cASLZk9ShEOE/hkW4tJ97UPCNz53WT
ylZKREqPlD2QL5szkZiIJ67IwfA/yhASnn6wGJTy/IoL6fS+MyWS+3q4dO/AykjL
i5oknEP5HPxrqoFZ/GFcUkOFBUFsO9CKX2+AH8JOK4sc4ecj/ULfWhMgIDVoVxu5
4W1MMW9CmgSB/3xePv67jCACrURmqYoJs14PdVhplU+Bl9DCJE+NLn41XCTao9Kt
SWZEx3bGSqpGeZxXdDNzF17LOefBdRDhOq7v1Otl3fc2pJwj4VLIx0/Z10hZqWIm
TFYzePLjHjTt1ZdCpowe9U0PQWGMq1bg+58XEjD69vs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o5seU+BLdP24N1fo5XrUW
ABECggEADO3uyz8wHFMYFq1DCHZpaDUd6e5Za6wZoJb5gOiYJPdkqkbHbRW58RV7
6ZHRmyaD8bAqFiQIeTKerc09x65r2xb4OZ03Ote9njkhWi5A6CRBxCA9HZSz/zg/
dF50OMa8dq5EOXajudkmFokI01yCM0gxLAsEj5/6aOJ0+0BIxZPX6eCOZotXvDEU
WSCyjuE2fjjGaNpbMO1A1x6llKpb3SooMaNVyMljjvoJiqXAIrtp2sAFKVe9Iyrr
zPDBt9WzS/eJmerPC36OEOSBWssDhJk7kSkq8eguvQ6Nc1e4eiHAZ5oU/WEcpnbI
oKpEM8cL/H2Xs+qpYTtdohnab4eu+Q==
-----END PRIVATE KEY-----
28 changes: 28 additions & 0 deletions dev-environments/listen-tls/cert/rootCA.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDJ68CqAsB8H9il
lCJ70r6WhkHq8VG04srwUjSEmmcBqkqPmc4earZfvQAgTFA0zTgLQZj/fWGAzDpV
TZjyi7qg26bkc5RGSphPgHO6oTf2TdfxTw/2pODl+H/+Xf9tWXbfnrsi7hY2l+lh
xoLFNb1s5a5rp6P2OxCRqNXb1xE6CBayZdYUfxtNwMju5SmtTUCyEq2fXaNHavm9
hEe3q097w/Vr7JMVvzShGjw7KO3DL+Gxau/c9dKLUxO4500Ha56on7yGAqNIpZv3
egdMvPTWdAk9YrU9NBOB6v0sd+ApZpnwV0p5WOcJo/bbUpBw1ahxtwXQMKQuJlcG
KHx49kANAgMBAAECggEAGToEsUjUOv2wj6k08LLY4E3oNN3O1zJBZ+phSNLQfS8F
DzFIRNkQrV/bwO0/1QTxlEhvALZtpM1/GTKvYdgOqjOfA2okM2703fPeoYmsR++c
Q7fctvQM6/ZSqVkdhRAZD6GRYDEOIeZzQCWwp0pKPu1oD+ebDrN847HL/CH/szff
0MWLIce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IVATE KEY-----
21 changes: 21 additions & 0 deletions dev-environments/listen-tls/cert/rootCA.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-----BEGIN CERTIFICATE-----
MIIDazCCAlOgAwIBAgIUc9a5ttgMllDxkMlEHb+LCMW0JuwwDQYJKoZIhvcNAQEL
BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMzEwMjAyMTM1MDdaFw0yNjA4
MDkyMTM1MDdaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw
HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQDJ68CqAsB8H9illCJ70r6WhkHq8VG04srwUjSEmmcB
qkqPmc4earZfvQAgTFA0zTgLQZj/fWGAzDpVTZjyi7qg26bkc5RGSphPgHO6oTf2
TdfxTw/2pODl+H/+Xf9tWXbfnrsi7hY2l+lhxoLFNb1s5a5rp6P2OxCRqNXb1xE6
CBayZdYUfxtNwMju5SmtTUCyEq2fXaNHavm9hEe3q097w/Vr7JMVvzShGjw7KO3D
L+Gxau/c9dKLUxO4500Ha56on7yGAqNIpZv3egdMvPTWdAk9YrU9NBOB6v0sd+Ap
ZpnwV0p5WOcJo/bbUpBw1ahxtwXQMKQuJlcGKHx49kANAgMBAAGjUzBRMB0GA1Ud
DgQWBBT+VNJGUzHPeEMmJtaJVw9j4g6TMTAfBgNVHSMEGDAWgBT+VNJGUzHPeEMm
JtaJVw9j4g6TMTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQCV
m6RpWaCcCKtqWcX53MFTXJg7mDOsqUwUCHpLJCOvNpv0Ql5JM1u8VjzoHnHI4NPr
lHmsyHGpOjikYp7sgyxhG2EeGQaQ6qTjkozVVdGd5poA8diNpk7fQHlJGbj5etCr
nskOHrDSpIdi6nrJSgcacsbJ2arAGmfFp3SkXTA08q+5cd8UPi1n2TRg9mcOUwr1
0l/Yrbhm8QYj2/nvkZQIo8ReSlEom8nnqTCxT0Na66z/KaLqQyEHh1dVj9Pv9Ac0
pygNXsdRGnXTfhshp9+li6vx0r+k3i7zkD6qEt7e7eN5hJFvE3VGYQ6zxI2Scbyz
U8NcQ9FK0vAO24SWBsWL
-----END CERTIFICATE-----
38 changes: 38 additions & 0 deletions dev-environments/listen-tls/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
version: '3.8'
services:
gateway:
image: ${IMAGE_NAME:-apicast-test}
depends_on:
- one.upstream
- two.upstream
environment:
APICAST_HTTPS_PORT: 8443
APICAST_HTTPS_CERTIFICATE: /var/run/secrets/apicast/example.com.crt
APICAST_HTTPS_CERTIFICATE_KEY: /var/run/secrets/apicast/example.com.key
THREESCALE_CONFIG_FILE: /tmp/config.json
THREESCALE_DEPLOYMENT_ENV: staging
APICAST_CONFIGURATION_LOADER: lazy
APICAST_WORKERS: 1
APICAST_LOG_LEVEL: debug
APICAST_CONFIGURATION_CACHE: "0"
expose:
- "8443"
- "8090"
ports:
- "8443:8443"
- "8090:8090"
volumes:
- ./apicast-config.json:/tmp/config.json
- ./cert:/var/run/secrets/apicast
one.upstream:
image: alpine/socat:1.7.4.4
container_name: one.upstream
command: "-d -v -d TCP-LISTEN:80,reuseaddr,fork TCP:two.upstream:80"
expose:
- "80"
restart: unless-stopped
two.upstream:
image: kennethreitz/httpbin
expose:
- "80"

0 comments on commit 9c61cb0

Please sign in to comment.