Commit a1f1a937 authored by Paul Graydon's avatar Paul Graydon

software/simpleran: Add TLS mutual authentication for eNB fluentbit

parent 06154499
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
[template] [template]
filename = instance.cfg filename = instance.cfg
md5sum = 770fccd0e4c5ad30e9637fd643a126c5 md5sum = 82d7168d89f7c7b1f66ba3a800547949
[template-ors] [template-ors]
filename = instance-ors.cfg filename = instance-ors.cfg
...@@ -60,7 +60,7 @@ md5sum = 52da9fe3a569199e35ad89ae1a44c30e ...@@ -60,7 +60,7 @@ md5sum = 52da9fe3a569199e35ad89ae1a44c30e
[template-enb] [template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg _update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = a05c6ed1830d77a9faea67ac54cf9c2f md5sum = 5e16584e820f187afee806819db9788c
[template-ors-enb] [template-ors-enb]
_update_hash_filename_ = instance-ors-enb.jinja2.cfg _update_hash_filename_ = instance-ors-enb.jinja2.cfg
......
...@@ -224,6 +224,11 @@ ...@@ -224,6 +224,11 @@
"type": "string", "type": "string",
"default": "wendelin-telecom-enb-shared-instance" "default": "wendelin-telecom-enb-shared-instance"
}, },
"xlog_fluentbit_caucase_url": {
"title": "Fluentbit Xlog Caucase URL",
"description": "URL of a forward Caucase instance from which to request a certificate to establish TLS mutual authentication",
"type": "string"
},
"xlog_fluentbit_forward_host": { "xlog_fluentbit_forward_host": {
"title": "Fluentbit Xlog forwarding address", "title": "Fluentbit Xlog forwarding address",
"description": "Address of remote Fluentd or Fluentbit server to which Fluentbit should forward Xlog data", "description": "Address of remote Fluentd or Fluentbit server to which Fluentbit should forward Xlog data",
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
{%- do slapparameter_dict.setdefault(k, v) %} {%- do slapparameter_dict.setdefault(k, v) %}
{%- endfor %} {%- endfor %}
{%- set B = xbuildout.encode %} {%- set B = xbuildout.encode %}
{%- import "caucase" as caucase with context %}
[buildout] [buildout]
...@@ -28,6 +29,10 @@ parts = ...@@ -28,6 +29,10 @@ parts =
xamari-xlog-service xamari-xlog-service
request-wendelin-telecom-shared request-wendelin-telecom-shared
{%- if slapparameter_dict.xlog_forwarding_enabled %} {%- if slapparameter_dict.xlog_forwarding_enabled %}
{%- if slapparameter_dict.get("xlog_fluentbit_caucase_url", "") %}
xlog-fluentbit-caucase-updater
xlog-fluentbit-caucase-updater-promise
{%- endif %}
xlog-fluentbit-service xlog-fluentbit-service
check-xlog-fluentbit-forward-host.py check-xlog-fluentbit-forward-host.py
check-xlog-fluentbit-health.py check-xlog-fluentbit-health.py
...@@ -89,6 +94,7 @@ script = ${:etc}/run ...@@ -89,6 +94,7 @@ script = ${:etc}/run
service = ${:etc}/service service = ${:etc}/service
promise = ${:etc}/promise promise = ${:etc}/promise
log = ${:var}/log log = ${:var}/log
xlog-fluentbit-certificates = ${:srv}/ssl/xlog-fluentbit
xlog-fluentbit = ${:var}/xlog-fluentbit xlog-fluentbit = ${:var}/xlog-fluentbit
[enb-sh-wrapper] [enb-sh-wrapper]
...@@ -183,6 +189,28 @@ return = gateway-host ...@@ -183,6 +189,28 @@ return = gateway-host
{%- endif %} {%- endif %}
{% if slapparameter_dict.xlog_forwarding_enabled %} {% if slapparameter_dict.xlog_forwarding_enabled %}
{%- if slapparameter_dict.get("xlog_fluentbit_caucase_url", "") %}
[xlog-fluentbit-certificate]
key-file = ${directory:xlog-fluentbit-certificates}/${:_buildout_section_name_}.pem
cert-file = ${directory:xlog-fluentbit-certificates}/${:_buildout_section_name_}-crt.pem
ca-file = ${directory:xlog-fluentbit-certificates}/${:_buildout_section_name_}-ca.pem
crl-file = ${directory:xlog-fluentbit-certificates}/${:_buildout_section_name_}-crl.pem
{{ caucase.updater(
prefix='xlog-fluentbit-caucase-updater',
buildout_bin_directory=buildout_bin_directory,
updater_path='${directory:service}/xlog-fluentbit-caucase-updater',
url=slapparameter_dict.get('xlog_fluentbit_caucase_url'),
data_dir='${directory:srv}/caucase-updater',
key_path='${xlog-fluentbit-certificate:key-file}',
crt_path='${xlog-fluentbit-certificate:cert-file}',
ca_path='${xlog-fluentbit-certificate:ca-file}',
crl_path='${xlog-fluentbit-certificate:crl-file}',
template_csr_pem=None,
openssl=openssl_location + '/bin/openssl'
)}}
{%- endif %}
[xlog-fluentbit-tag] [xlog-fluentbit-tag]
recipe = slapos.recipe.build recipe = slapos.recipe.build
computer = ${slap-connection:computer-id} computer = ${slap-connection:computer-id}
...@@ -241,7 +269,15 @@ inline = ...@@ -241,7 +269,15 @@ inline =
Self_Hostname ${:forward-self-hostname} Self_Hostname ${:forward-self-hostname}
Retry_Limit 50 Retry_Limit 50
tls on tls on
{%- if slapparameter_dict.get("xlog_fluentbit_caucase_url", "") %}
net.keepalive on
tls.verify on
tls.ca_file ${xlog-fluentbit-certificate:ca-file}
tls.crt_file ${xlog-fluentbit-certificate:cert-file}
tls.key_file ${xlog-fluentbit-certificate:key-file}
{%- else %}
tls.verify off tls.verify off
{%- endif %}
[xlog-fluentbit-service] [xlog-fluentbit-service]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
......
...@@ -35,6 +35,7 @@ context = ...@@ -35,6 +35,7 @@ context =
key eggs_directory buildout:eggs-directory key eggs_directory buildout:eggs-directory
key develop_eggs_directory buildout:develop-eggs-directory key develop_eggs_directory buildout:develop-eggs-directory
raw buildout_directory ${buildout:directory} raw buildout_directory ${buildout:directory}
raw buildout_bin_directory ${buildout:bin-directory}
section directory directory section directory directory
raw pythonwitheggs ${buildout:bin-directory}/pythonwitheggs raw pythonwitheggs ${buildout:bin-directory}/pythonwitheggs
section slap_connection slap-connection section slap_connection slap-connection
...@@ -43,11 +44,13 @@ context = ...@@ -43,11 +44,13 @@ context =
key my_ipv4 slap-configuration:ipv4-random key my_ipv4 slap-configuration:ipv4-random
key my_ipv6 slap-configuration:ipv6-random key my_ipv6 slap-configuration:ipv6-random
$${:extra-context} $${:extra-context}
caucase-jinja2-library-target = ${caucase-jinja2-library:target}
import-list = import-list =
rawfile slaplte.jinja2 ${slaplte.jinja2:target} rawfile slaplte.jinja2 ${slaplte.jinja2:target}
rawfile ru_libinstance.jinja2.cfg ${ru_libinstance.jinja2.cfg:target} rawfile ru_libinstance.jinja2.cfg ${ru_libinstance.jinja2.cfg:target}
rawfile ru_sdr_libinstance.jinja2.cfg ${ru_sdr_libinstance.jinja2.cfg:target} rawfile ru_sdr_libinstance.jinja2.cfg ${ru_sdr_libinstance.jinja2.cfg:target}
rawfile ru_sunwave_libinstance.jinja2.cfg ${ru_sunwave_libinstance.jinja2.cfg:target} rawfile ru_sunwave_libinstance.jinja2.cfg ${ru_sunwave_libinstance.jinja2.cfg:target}
file caucase :caucase-jinja2-library-target
# activate eggs and modules used in jinja2 templates # activate eggs and modules used in jinja2 templates
[activate-eggs] [activate-eggs]
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
extends = extends =
buildout.hash.cfg buildout.hash.cfg
../../stack/slapos.cfg ../../stack/slapos.cfg
../../stack/caucase/buildout.cfg
../../stack/monitor/buildout.cfg ../../stack/monitor/buildout.cfg
../../component/logrotate/buildout.cfg ../../component/logrotate/buildout.cfg
../../component/nghttp2/buildout.cfg ../../component/nghttp2/buildout.cfg
...@@ -25,6 +26,7 @@ extends = ...@@ -25,6 +26,7 @@ extends =
parts += parts +=
template template
slapos-cookbook slapos-cookbook
caucase-eggs
# copy all configs by default # copy all configs by default
mme.jinja2.cfg mme.jinja2.cfg
dnsmasq-core-network.jinja2.cfg dnsmasq-core-network.jinja2.cfg
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment