Once we enable DMARC enforcement on our inbound email servers, it would be helpful if IT Services could view the Postfix logs. Postfix logs would aid them in troubleshooting email deliverability problems that may be the result of DMARC enforcement. The logs contain email addresses, so they are considered private and cannot be pushed to our logstash instance which is accessible by developers in the nda, logstash-access or ops groups. Since at present we do not have a security sensitive logstash, T213902, another solution must be devised.
Proposal
Push Postfix logs from the mx-in servers to an AWS CloudWatch instance managed by IT Services.
CloudWatch supports ingesting OpenTelemetry Logs over HTTP or ingesting logs over HTTP via a custom json schema to its HLC endpoints.
Proof of concept
Software:
- Debian Sid
- rsyslog, v8.2602.0, compiled by hand
- aws-sigv4-proxy, v1.11.1, compiled by hand
IT Services created a CloudWatch log group and log stream. Using the provided credentials we configured rsyslog to push logs to CloudWatch via the aws-sigv4-proxy. The proxy is required, because rsyslog does not support the AWS signing protocol.
$ export OTEL_EXPORTER_OTLP_LOGS_HEADERS='x-aws-log-group=/aws/hlc-logs/sre-mail-server-log-forwarding,x-aws-log-stream=log-forwarding-stream-001' $ cat > /etc/rsyslog.d/cloudwatch.conf <<EOF module(load="omotel") action( type="omotel" endpoint="http://logs.us-west-2.amazonaws.com" proxy="http://192.168.0.65:8080" path="/v1/logs" protocol="http/json" template="RSYSLOG_SyslogProtocol23Format" batch.max_items="200" batch.max_bytes="262144" batch.timeout.ms="2000" compression="gzip" retry.max_retries="7" retry.max.ms="45000" ) EOF $ aws-sigv4-proxy $ rsyslogd
Using the above config we were able to push sample logs to CloudWatch
Production work
To turn the proof of concept into production we would need to:
- Upgrade the mx-in servers to Trixie
- Backport rsyslog, v8.2602.0, to Trixie
- Package aws-sigv4-proxy for Trixie
- Configure aws-sigv4-proxy and rsyslog
Alternatives
- Re-visit the decision to not allow ingesting email logs into our logstash instance, due to their sensitive metadata
- Help to get the sensitive or secret logstash instance prioritized
- Setup something in aux-k8s to serve the logs
- Serve the logs directly from the mail servers, behind our IDM
- Move forward without self serve log access for ITS