Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.

Commit 6770bdb

Browse files
a18eb1tamara
andauthored
fix(): Finalize bosh-part (excluding platform-TLS)
- allow pcap-api to run w/o TLS to platform (TLS currently not working) -- add spec tests for non-TLS mode -- adjust example manifest/ops files to run w/o platform TLS - add pcap-agent to pcap-api manifest so it get's deployed on the pcap-api VMs as well - update dependencies: stemmcell, releases - mTLS between api & agents currently works using a workaround: pcap-agents reuse whole cert-chain (instead of just CA) from pcap-api - minimal supported TLS version is now 1.2 - fix bug with decoding certificate files with newlines - add unit tests for certificate file parsing --------- Co-authored-by: Tamara Boehm <tamara.boehm@sap.com>
1 parent 052d873 commit 6770bdb

18 files changed

Lines changed: 234 additions & 108 deletions

File tree

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,12 @@ bosh -e bosh upload-release
100100

101101
# adjust the release to a dev release instead of the URL
102102
vim manifests/pcap-api.yml
103-
vim manifests/ops-files/add-pcap-agent-haproxy.yml
103+
vim manifests/ops-files/add-pcap-agent.yml
104104

105-
# deploy pcap-agent to the HAProxy deployment(s)
106-
bosh interpolate -o manifests/ops-files/add-pcap-agent.yml haproxy.yml > haproxy-pcap.yml
107-
bosh -d cf haproxy haproxy-pcap.yml
105+
# deploy pcap-agent to the desired deployment(s) (example: diego-cells in cf deployment)
106+
bosh -d cf manifest > cf.yml
107+
bosh interpolate -o manifests/ops-files/add-pcap-agent.yml cf.yml > cf-pcap.yml
108+
bosh -d cf deploy cf-pcap.yml
108109

109110
# deploy pcap-api
110111
cp manifests/vars-template.yml manifests/vars.yml

ci/scripts/lint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -euo pipefail
44
cd "${REPO_ROOT}"
55

66
echo "> Running 'bundle exec rake lint'"
7-
bundle package
7+
bundle install
88
bundle exec rake lint
99

1010
echo "> Running 'go vet'"

ci/scripts/unit-tests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -euo pipefail
55
cd "${REPO_ROOT}"
66

77
echo "> Running 'bundle exec rake spec'"
8-
bundle package
8+
bundle install
99
bundle exec rake spec
1010

1111
echo "> Running unit tests"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<%- if_p("pcap-agent.listen.tls.certificate") do |cert| -%>
2-
<%= cert -%>
1+
<%- if_p("pcap-agent.listen.tls.certificate") do |pem| -%>
2+
<%= pem -%>
33
<%- end -%>

jobs/pcap-api/spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ properties:
3838
pcap-api.listen.port:
3939
description: "The port for the pcap-api to listen on"
4040
default: 8080
41+
pcap-api.listen.tls.enabled:
42+
default: true
4143
pcap-api.listen.tls.certificate:
4244
description: "Certificate chain to talk to gorouter in PEM format"
4345
pcap-api.listen.tls.private_key:
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
<%
2-
if_p("pcap-api.listen.tls.ca") do |pem|
3-
%>
4-
<%= pem %>
5-
<%
6-
end
7-
%>
1+
<%- if_p("pcap-api.listen.tls.ca") do |pem| -%>
2+
<%= pem %>
3+
<%- end -%>
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
<%
2-
if_p("pcap-api.listen.tls.certificate") do |pem|
3-
%>
1+
<%- if_p("pcap-api.listen.tls.certificate") do |pem| -%>
42
<%= pem %>
5-
<%
6-
end
7-
%>
3+
<%- end -%>
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
<%
2-
if_p("pcap-api.listen.tls.private_key") do |pem|
3-
%>
1+
<%- if_p("pcap-api.listen.tls.private_key") do |pem| -%>
42
<%= pem %>
5-
<%
6-
end
7-
%>
3+
<%- end -%>

jobs/pcap-api/templates/pcap-api.yml.erb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,18 @@ config = {
1010
"concurrent_captures" => p("pcap-api.concurrent_captures"),
1111
"listen" => {
1212
"port" => p("pcap-api.listen.port"),
13-
"tls" => {
14-
"certificate"=> "/var/vcap/jobs/pcap-api/config/certs/pcap-api.crt",
15-
"private_key" => "/var/vcap/jobs/pcap-api/config/certs/pcap-api.key",
16-
"ca" => "/var/vcap/jobs/pcap-api/config/certs/pcap-api-ca.crt",
17-
},
1813
},
1914
"cli_download_root" => p("pcap-api.cli_download_root")
2015
}
2116

17+
if p("pcap-api.listen.tls.enabled").to_s == "true"
18+
config["listen"]["tls"] = {
19+
"certificate"=> "/var/vcap/jobs/pcap-api/config/certs/pcap-api.crt",
20+
"private_key" => "/var/vcap/jobs/pcap-api/config/certs/pcap-api.key",
21+
"ca" => "/var/vcap/jobs/pcap-api/config/certs/pcap-api-ca.crt"
22+
}
23+
end
24+
2225
if p("pcap-api.agents_mtls.enabled").to_s == "true"
2326
config["agents_mtls"] = {
2427
"common_name" => p("pcap-api.agents_mtls.common_name"),

manifests/ops-files/add-pcap-agent-haproxy.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)