diff --git a/_modules/index.html b/_modules/index.html index ec339ac..eda9549 100644 --- a/_modules/index.html +++ b/_modules/index.html @@ -5,14 +5,14 @@ - Overview: module code — parsedmarc 9.4.0 documentation + Overview: module code — parsedmarc 9.5.0 documentation - + diff --git a/_modules/parsedmarc.html b/_modules/parsedmarc.html index 83667e4..5f30dbd 100644 --- a/_modules/parsedmarc.html +++ b/_modules/parsedmarc.html @@ -5,14 +5,14 @@ - parsedmarc — parsedmarc 9.4.0 documentation + parsedmarc — parsedmarc 9.5.0 documentation - + diff --git a/_modules/parsedmarc/elastic.html b/_modules/parsedmarc/elastic.html index c7c184a..b299cc2 100644 --- a/_modules/parsedmarc/elastic.html +++ b/_modules/parsedmarc/elastic.html @@ -5,14 +5,14 @@ - parsedmarc.elastic — parsedmarc 9.4.0 documentation + parsedmarc.elastic — parsedmarc 9.5.0 documentation - + diff --git a/_modules/parsedmarc/opensearch.html b/_modules/parsedmarc/opensearch.html index 65f9a45..a70469b 100644 --- a/_modules/parsedmarc/opensearch.html +++ b/_modules/parsedmarc/opensearch.html @@ -5,14 +5,14 @@ - parsedmarc.opensearch — parsedmarc 9.4.0 documentation + parsedmarc.opensearch — parsedmarc 9.5.0 documentation - + diff --git a/_modules/parsedmarc/splunk.html b/_modules/parsedmarc/splunk.html index 3a3cdb9..244fae0 100644 --- a/_modules/parsedmarc/splunk.html +++ b/_modules/parsedmarc/splunk.html @@ -5,14 +5,14 @@ - parsedmarc.splunk — parsedmarc 9.4.0 documentation + parsedmarc.splunk — parsedmarc 9.5.0 documentation - + diff --git a/_modules/parsedmarc/types.html b/_modules/parsedmarc/types.html index 048def4..811da87 100644 --- a/_modules/parsedmarc/types.html +++ b/_modules/parsedmarc/types.html @@ -5,14 +5,14 @@ - parsedmarc.types — parsedmarc 9.4.0 documentation + parsedmarc.types — parsedmarc 9.5.0 documentation - + diff --git a/_modules/parsedmarc/utils.html b/_modules/parsedmarc/utils.html index bf8a605..48fab21 100644 --- a/_modules/parsedmarc/utils.html +++ b/_modules/parsedmarc/utils.html @@ -5,14 +5,14 @@ - parsedmarc.utils — parsedmarc 9.4.0 documentation + parsedmarc.utils — parsedmarc 9.5.0 documentation - + diff --git a/_sources/usage.md.txt b/_sources/usage.md.txt index e920c53..72116d8 100644 --- a/_sources/usage.md.txt +++ b/_sources/usage.md.txt @@ -531,6 +531,96 @@ PUT _cluster/settings Increasing this value increases resource usage. ::: +## Environment variable configuration + +Any configuration option can be set via environment variables using the +naming convention `PARSEDMARC_{SECTION}_{KEY}` (uppercase). This is +especially useful for Docker deployments where file permissions make it +difficult to use config files for secrets. + +**Priority order:** CLI arguments > environment variables > config file > defaults + +### Examples + +```bash +# Set IMAP credentials via env vars +export PARSEDMARC_IMAP_HOST=imap.example.com +export PARSEDMARC_IMAP_USER=dmarc@example.com +export PARSEDMARC_IMAP_PASSWORD=secret + +# Elasticsearch +export PARSEDMARC_ELASTICSEARCH_HOSTS=http://localhost:9200 +export PARSEDMARC_ELASTICSEARCH_SSL=false + +# Splunk HEC (note: section name splunk_hec becomes SPLUNK_HEC) +export PARSEDMARC_SPLUNK_HEC_URL=https://splunk.example.com +export PARSEDMARC_SPLUNK_HEC_TOKEN=my-hec-token +export PARSEDMARC_SPLUNK_HEC_INDEX=email + +# General settings +export PARSEDMARC_GENERAL_SAVE_AGGREGATE=true +export PARSEDMARC_GENERAL_DEBUG=true +``` + +### Specifying the config file via environment variable + +```bash +export PARSEDMARC_CONFIG_FILE=/etc/parsedmarc.ini +parsedmarc +``` + +### Running without a config file (env-only mode) + +When no config file is given (neither `-c` flag nor `PARSEDMARC_CONFIG_FILE`), +parsedmarc will still pick up any `PARSEDMARC_*` environment variables. This +enables fully file-less deployments: + +```bash +export PARSEDMARC_GENERAL_SAVE_AGGREGATE=true +export PARSEDMARC_GENERAL_OFFLINE=true +export PARSEDMARC_ELASTICSEARCH_HOSTS=http://elasticsearch:9200 +parsedmarc /path/to/reports/* +``` + +### Docker Compose example + +```yaml +services: + parsedmarc: + image: parsedmarc:latest + environment: + PARSEDMARC_IMAP_HOST: imap.example.com + PARSEDMARC_IMAP_USER: dmarc@example.com + PARSEDMARC_IMAP_PASSWORD: ${IMAP_PASSWORD} + PARSEDMARC_MAILBOX_WATCH: "true" + PARSEDMARC_ELASTICSEARCH_HOSTS: http://elasticsearch:9200 + PARSEDMARC_GENERAL_SAVE_AGGREGATE: "true" + PARSEDMARC_GENERAL_SAVE_FORENSIC: "true" +``` + +### Section name mapping + +For sections with underscores in the name, the full section name is used: + +| Section | Env var prefix | +|------------------|-------------------------------| +| `general` | `PARSEDMARC_GENERAL_` | +| `mailbox` | `PARSEDMARC_MAILBOX_` | +| `imap` | `PARSEDMARC_IMAP_` | +| `msgraph` | `PARSEDMARC_MSGRAPH_` | +| `elasticsearch` | `PARSEDMARC_ELASTICSEARCH_` | +| `opensearch` | `PARSEDMARC_OPENSEARCH_` | +| `splunk_hec` | `PARSEDMARC_SPLUNK_HEC_` | +| `kafka` | `PARSEDMARC_KAFKA_` | +| `smtp` | `PARSEDMARC_SMTP_` | +| `s3` | `PARSEDMARC_S3_` | +| `syslog` | `PARSEDMARC_SYSLOG_` | +| `gmail_api` | `PARSEDMARC_GMAIL_API_` | +| `maildir` | `PARSEDMARC_MAILDIR_` | +| `log_analytics` | `PARSEDMARC_LOG_ANALYTICS_` | +| `gelf` | `PARSEDMARC_GELF_` | +| `webhook` | `PARSEDMARC_WEBHOOK_` | + ## Performance tuning For large mailbox imports or backfills, parsedmarc can consume a noticeable amount diff --git a/_static/documentation_options.js b/_static/documentation_options.js index b08924a..d573462 100644 --- a/_static/documentation_options.js +++ b/_static/documentation_options.js @@ -1,5 +1,5 @@ const DOCUMENTATION_OPTIONS = { - VERSION: '9.4.0', + VERSION: '9.5.0', LANGUAGE: 'en', COLLAPSE_INDEX: false, BUILDER: 'html', diff --git a/api.html b/api.html index 77956b8..1de7005 100644 --- a/api.html +++ b/api.html @@ -6,14 +6,14 @@ - API reference — parsedmarc 9.4.0 documentation + API reference — parsedmarc 9.5.0 documentation - + diff --git a/contributing.html b/contributing.html index 10913e5..914c859 100644 --- a/contributing.html +++ b/contributing.html @@ -6,14 +6,14 @@ - Contributing to parsedmarc — parsedmarc 9.4.0 documentation + Contributing to parsedmarc — parsedmarc 9.5.0 documentation - + diff --git a/davmail.html b/davmail.html index 83ec1de..8a58a16 100644 --- a/davmail.html +++ b/davmail.html @@ -6,14 +6,14 @@ - Accessing an inbox using OWA/EWS — parsedmarc 9.4.0 documentation + Accessing an inbox using OWA/EWS — parsedmarc 9.5.0 documentation - + diff --git a/dmarc.html b/dmarc.html index 94dbbc2..543335a 100644 --- a/dmarc.html +++ b/dmarc.html @@ -6,14 +6,14 @@ - Understanding DMARC — parsedmarc 9.4.0 documentation + Understanding DMARC — parsedmarc 9.5.0 documentation - + diff --git a/elasticsearch.html b/elasticsearch.html index 123243d..c720463 100644 --- a/elasticsearch.html +++ b/elasticsearch.html @@ -6,14 +6,14 @@ - Elasticsearch and Kibana — parsedmarc 9.4.0 documentation + Elasticsearch and Kibana — parsedmarc 9.5.0 documentation - + diff --git a/genindex.html b/genindex.html index 721874e..5427fe6 100644 --- a/genindex.html +++ b/genindex.html @@ -5,14 +5,14 @@ - Index — parsedmarc 9.4.0 documentation + Index — parsedmarc 9.5.0 documentation - + diff --git a/index.html b/index.html index 9fd64cb..9ef4968 100644 --- a/index.html +++ b/index.html @@ -6,14 +6,14 @@ - parsedmarc documentation - Open source DMARC report analyzer and visualizer — parsedmarc 9.4.0 documentation + parsedmarc documentation - Open source DMARC report analyzer and visualizer — parsedmarc 9.5.0 documentation - + @@ -183,6 +183,7 @@ for RHEL or Debian.

  • Using parsedmarc