Skip to content

Update images, fix some minor issues and improve qol #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/files/
/output_files/
/parsedmarc/GeoLite2-Country*
/elastic_data/
parsedmarc.ini
/elastic_data/*
!/elastic_data/.gitkeep
/input_files/*
!/input_files/.gitkeep
/output_files/*
!/output_files/.gitkeep
25 changes: 14 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
version: '3.5'
services:
parsedmarc:
build: ./parsedmarc/
build: ./parsedmarc
volumes:
- ./files:/input:ro
- ./input_files:/input:ro
- ./output_files:/output
command: parsedmarc -c /parsedmarc.ini /input/* --debug
- ./parsedmarc/parsedmarc.ini:/parsedmarc.ini
command: parsedmarc -c /parsedmarc.ini /input/*
depends_on:
- elasticsearch
elasticsearch:
condition: service_healthy
restart: on-failure

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.5
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.28
environment:
- discovery.type=single-node
volumes:
- ./elastic_data:/usr/share/elasticsearch/data
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:9200 || exit 1"]
interval: 10s
timeout: 5s
retries: 5
restart: on-failure

grafana:
build: ./grafana/
build: ./grafana
ports:
- 3000:3000
user: root
environment:
GF_INSTALL_PLUGINS: grafana-piechart-panel,grafana-worldmap-panel
GF_AUTH_ANONYMOUS_ENABLED: 'true'
Empty file added elastic_data/.gitkeep
Empty file.
18 changes: 14 additions & 4 deletions grafana/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
FROM grafana/grafana:8.5.4
FROM grafana/grafana-oss

ADD --chown=grafana:root https://raw.githubusercontent.com/domainaware/parsedmarc/master/grafana/Grafana-DMARC_Reports.json /var/lib/grafana/dashboards/
RUN chmod 644 /etc/grafana/provisioning
# Install dashboard and dependencies
ARG DMARC_DASHBOARD=https://raw.githubusercontent.com/domainaware/parsedmarc/master/grafana/Grafana-DMARC_Reports.json
ADD --chown=grafana:root ${DMARC_DASHBOARD} /var/lib/grafana/dashboards/
RUN grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install grafana-piechart-panel
RUN grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install grafana-worldmap-panel

COPY grafana-provisioning/ /etc/grafana/provisioning/
# Copy provisioning files and fix permissions
COPY --chown=grafana:root provisioning/ /etc/grafana/provisioning/
USER root
RUN chmod -R +X /etc/grafana/provisioning
USER grafana

# Configure Grafana
ENV GF_AUTH_ANONYMOUS_ENABLED=true
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ datasources:
database: '[dmarc_aggregate-]YYYY-MM-DD'
isDefault: true
jsonData:
esVersion: 7.17.5
esVersion: 7.17.28
timeField: 'date_range'
interval: 'Daily'
version: 1
Expand All @@ -22,7 +22,7 @@ datasources:
database: '[dmarc_forensic-]YYYY-MM-DD'
isDefault: false
jsonData:
esVersion: 7.17.5
esVersion: 7.17.28
timeField: 'arrival_date'
interval: 'Daily'
version: 1
Expand Down
Empty file added input_files/.gitkeep
Empty file.
Empty file added output_files/.gitkeep
Empty file.
5 changes: 1 addition & 4 deletions parsedmarc/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
FROM python:3.9-alpine3.16
FROM python:3.13-alpine

RUN apk add --update --no-cache libxml2-dev libxslt-dev
RUN apk add --update --no-cache --virtual .build_deps build-base libffi-dev \
&& pip install parsedmarc \
&& apk del .build_deps

COPY parsedmarc.ini /
#COPY GeoLite2-Country.mmdb /usr/share/GeoIP/GeoLite2-Country.mmdb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[general]
offline = True
output = /output/
save_aggregate = True
save_forensic = True
output = /output/

[elasticsearch]
hosts = elasticsearch:9200
Expand Down