Page MenuHomePhabricator

Allow IT Services to view inbound email logs
Open, MediumPublic

Description

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:

  1. Upgrade the mx-in servers to Trixie
  2. Backport rsyslog, v8.2602.0, to Trixie
  3. Package aws-sigv4-proxy for Trixie
  4. Configure aws-sigv4-proxy and rsyslog

Alternatives

  1. Re-visit the decision to not allow ingesting email logs into our logstash instance, due to their sensitive metadata
  2. Help to get the sensitive or secret logstash instance prioritized
  3. Setup something in aux-k8s to serve the logs
  4. Serve the logs directly from the mail servers, behind our IDM
  5. Move forward without self serve log access for ITS

Event Timeline

If this data is too sensitive for our normal Logstash instance, why are we fine shipping them to a yet another third party?

our public logstash instance

public?

If this data is too sensitive for our normal Logstash instance, why are we fine shipping them to a yet another third party?

good question, the CloudWatch data would only be accessible to folks in ITS who already have gmail log access. As to the third party question, that would need to be investigated.

our public logstash instance

public?

good catch, should be that a developer account is required, amending

jhathaway triaged this task as Medium priority.Mar 16 2026, 2:19 PM

good catch, should be that a developer account is required, amending

This is still not correct, access to Logstash requires membership in the nda, logstash-access or ops groups (see T376790).

good catch, should be that a developer account is required, amending

This is still not correct, access to Logstash requires membership in the nda, logstash-access or ops groups (see T376790).

true, I should have been more specific, I'll update

added, a few alternatives, after discussing with other folks, happy to hear of others.

A_smart_kitten changed the subtype of this task from "Bug Report" to "Task".Apr 11 2026, 8:11 AM

From the technical angle the solution with cloudproxy seems feasible, and aws-sigv4-proxy also has limited dependencies which seem fine to maintain going forward. But it also means that the logs are made available to an external party and that we have one more external infrastructure dependency.

On alterative options: One thing that came to my mind: It's worth noting that we have precedence for a special purpose OpenSearch cluster in addition to our main Logstash one: DataHub has a three node mini cluster running on three Ganeti nodes (set up via https://phabricator.wikimedia.org/T301382), specifically only for Datahub. Given that all of this is puppetised already, this can probably also easily be spun up for the Postfix logs, which then get shipped there and for auth purposes we can create a cn=its LDAP group which together with cn=ops grants access to that OpenSearch instance. Effort-wise that is probably the same ballpark as creating the cloudproxy setup?