Audit Logging
Configure audit logging for all requests going through Seldon Enterprise Platform
Audit logging is an optional part of the platform which can be enabled or disabled based on your requirements. With audit logging all requests to Seldon Enterprise Platform will be logged to a configurable place.
For a description of the log schema, available metrics, and limitations please refer to the audit architecture .
Configuration
Audit Logging can be quite verbose, so it is disabled by default. Audit logging in Seldon Enterprise Platform supports two different output mechanisms:
writing to
stdout
forwarding the logs to a Fluentd instance that then can store them in your desired storage solution
Both can be setup independently by configuring the values in install-values.yaml
file of the Seldon Enterprise Platform as follows:
Note: As audit logging is an essential security requirement, the default requirement is a connection to the audit Fluentd instance to be established before Seldon Enterprise Platform starts serving users if Fluentd logging is enabled.
To disable this behaviour when logging to Fluentd you can set `audit.fluentd.requireConn` to `false` in the Seldon Enterprise Platform Helm values file.
Fluentd Setup
Fluentd can be used to listen for audit logs and forward them to a number of storage solutions.
Copy the default Fluentd config file and edit if required:
Install Fluentd using the bitnami/fluentd
Helm chart:
The important parts that must be present in the Fluentd configuration are the source
configuration and the match
part of the output configuration.
Seldon Enterprise Platform uses the forward
input plugin for sending requests to Fluentd. The source configuration should look something like this, where {{ .Values.aggregator.port }}
is the same as .Values.audit.fluentd.port
in the Seldon Enterprise Platform Helm chart values file:
For output, the pattern to use for Seldon Enterprise Platform's audit logs in the <match>
clause is deploy_audit.**
. An example configuration to write to a s3/minio bucket looks like this:
For a list of all output plugins Fluentd supports refer to the official documentation.
Note: This configuration of Fluentd for audit logging is different from the Elasticsearch installation for container logs. As part of the EFK stack for container logs, Fluentd runs as a `DaemonSet` so it can collect application logs from all relevant Pods transparently, regardless of which nodes they are placed on.
For audit logging, the Pods do not need to be running on the same node because Seldon Enterprise Platform explicitly forwards information to Fluentd. Using a small number of Fluentd Pods, rather than one per node, allows audit logging to be more resource efficient. It also allows for scaling the audit logging pipeline with the actual load on it, rather than with the number of nodes in Kubernetes.
Troubleshooting
Preserving the source IP of the original client
The audit logs contain a SourceAddress
field which shows the IP of the sender of the request. Seldon Enterprise Platform will first look for a X-Forwarded-For
header to determine the original client and only if not present will use the address in the request.
By default, Istio does not include the X-Forwarded-For
header. To include it, some configuration to the Ingress Gateway is required as described in the official documentation depending on the type of your load balancer.
If the actual client IP is still not shown properly, make sure there are no other proxies, load balancers, or firewalls overwriting the IP.
Last updated