diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 472c372..0991102 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -24,8 +24,8 @@ A clear and concise description of what you expected to happen. If applicable, add screenshots to help explain your problem. **Software Version** +[ ] Version 1 Beta 2 [ ] Version 1 Beta 1 -[ ] Version 1 Feature Complete [ ] Other **Desktop (please complete the following information):** diff --git a/.github/ISSUE_TEMPLATE/critical_report.md b/.github/ISSUE_TEMPLATE/critical_report.md index 8901472..a767846 100644 --- a/.github/ISSUE_TEMPLATE/critical_report.md +++ b/.github/ISSUE_TEMPLATE/critical_report.md @@ -24,8 +24,8 @@ A clear and concise description of what you expected to happen. If applicable, add screenshots to help explain your problem. **Software Version** +[ ] Version 1 Beta 2 [ ] Version 1 Beta 1 -[ ] Version 1 Feature Complete [ ] Other **Desktop (please complete the following information):** diff --git a/README.md b/README.md index 81f1ef2..55a4505 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ # Open DMARC Analyzer +![Open DMARC Analyzer Screenshot](docs/images/oda-screenshot.jpg?raw=true) -This is Open DMARC Analyzer Version 1 Beta 1 (1-β1) by John Bradley (john@systemanomaly.com). Open DMARC Analyzer is an Open Source DMARC Report Analyzer to be used with DMARC reports that have been parsed by [John Levine's rrdmarc script](http://www.taugh.com/rddmarc/) or [techsneeze's dmarcts-report-parser](https://github.com/techsneeze/dmarcts-report-parser). +Open DMARC Analyzer is an Open Source DMARC Report Analyzer to be used with DMARC reports that have been parsed by [John Levine's rrdmarc script](http://www.taugh.com/rddmarc/) or [techsneeze's dmarcts-report-parser](https://github.com/techsneeze/dmarcts-report-parser). Open DMARC Analyzer was written because there didn't seem to be a full-featured self-hosted report analyzer that provided enough details to make heads or tails of a large volume of DMARC reports that come into medium to large-sized organizations. While other solutions required paid subscriptions or have part of it hosted on AWS, Open DMARC Analyzer will run on any webserver that supports PHP 7.4+ and MySQL 15.1+. +Open DMARC Analyzer Version 1 Beta 2 (1-β2) is an [Anomaly ](https://systemanomaly.com/codebase) project by John Bradley (john@systemanomaly.com) + # Requirements - Apache 2 or equivalent - PHP 5 (PHP 7 required for phpWhois) @@ -94,9 +97,10 @@ Valid date signifiers are `m`, `w`, and `d` for "month", "week", and "day". # Latest Changes -## 1-β1 -- Corrected a geoip/whois bug (thank you [volkermauel](https://github.com/userjack6880/Open-DMARC-Analyzer/commits?author=volkermauel)). -- Corrected template formatting bug with GEOIP disabled. +## 1-β2 +- Corrected a divide-by-zero error in `template.php` issue #68. +- Limited width of page to a minimum of 1230px to fix visual element issues. +- Added `openda_light` theme. See `CHANGELOG` under `docs` for full details of all changes. @@ -117,11 +121,11 @@ This project regular release cycle is not yet determined. Versioning is under th Support will be provided as outlined in the following schedule. For more details, see `SUPPORT`. -| Version | Support Level | Released | End of Support | End of Life | -| ----------------------------------- | ---------------- | --------------- | --------------- | --------------- | -| Version 1 Beta 1 | Full Support | 4 November 2022 | TBD | TBD | -| Version 1 Feature Complete | Critical Support | 27 July 2022 | 4 November 2022 | TBD | -| Version 0 Alpha 9 | End of Life | 2 May 2022 | 27 July 2022 | 4 November 2022 | +| Version | Support Level | Released | End of Support | End of Life | +| ----------------------------------- | ---------------- | ---------------- | ---------------- | ---------------- | +| Version 1 Beta 2 | Full Support | 29 November 2022 | TBD | TBD | +| Version 1 Beta 1 | Critical Support | 4 November 2022 | 29 November 2022 | TBD | +| Version 1 Feature Complete | End of Life | 27 July 2022 | 4 November 2022 | 29 November 2022 | # Contributing @@ -136,4 +140,4 @@ Thanks to [all who contributed](https://github.com/userjack6880/Open-DMARC-Analy # Licenses and Copyrights -Copyright © 2022 John Bradley (userjack6880). Open DMARC Analyzer is released under GNU GPLv3. See `LICENSE`. +Copyright © 2022 John Bradley (userjack6880). Open DMARC Analyzer is released under GNU GPLv3. See `LICENSE`. \ No newline at end of file diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 5a10dff..0f12968 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1-β2 +- Corrected a divide-by-zero error in `template.php` issue #68. +- Limited width of page to a minimum of 1230px to fix visual element issues. +- Added `openda_light` theme. + ## 1-β1 - Corrected a geoip/whois bug (thank you [volkermauel](https://github.com/userjack6880/Open-DMARC-Analyzer/commits?author=volkermauel)). - Corrected template formatting bug with GEOIP disabled. diff --git a/docs/SECURITY.md b/docs/SECURITY.md index 989cd5f..978f7e5 100644 --- a/docs/SECURITY.md +++ b/docs/SECURITY.md @@ -18,12 +18,9 @@ A response should be recieved within 72 hours. If no response is given, please f Open DMARC Analyzer Version Security Support -| Version | Supported | End of Life | -| -------------------------- | --------- | --------------- | -| Version 1 Beta 1 | YES | TBD | -| Version 1 Feature Complete | YES | TBD | -| Version 0 Alpha 9 | NO | 4 November 2022 | -| Version 0 Alpha 8.2 | NO | 27 July 2022 | -| Version 0 Alpha 8.1 | NO | 2 May 2022 | -| Version 0 Alpha 8 | NO | 30 March 2022 | -| Version 0 Alpha 7 or Older | NO | 29 March 2022 | +| Version | Supported | End of Life | +| -------------------------- | --------- | ---------------- | +| Version 1 Beta 2 | YES | TBD | +| Version 1 Beta 1 | YES | TBD | +| Version 1 Feature Complete | NO | 29 November 2022 | +| Version 0 Alpha 9 | NO | 4 November 2022 | diff --git a/docs/SUPPORT.md b/docs/SUPPORT.md index fb27739..f4c1ae0 100644 --- a/docs/SUPPORT.md +++ b/docs/SUPPORT.md @@ -2,14 +2,15 @@ Due to the limited time available to developrs to maintain support, dates must be set where support must end. The following is a chart outlining the support shedule for Open DMARC Analyzer. -| Version | Support Level | Released | End of Support | End of Life | -| ----------------------------------- | ---------------- | --------------- | --------------- | --------------- | -| Version 1 Beta 1 | Full Support | 4 November 2022 | TBD | TBD | -| Version 1 Feature Complete | Critical Support | 27 July 2022 | 4 November 2022 | TBD | -| Version 0 Alpha 9 | End of Life | 2 May 2022 | 27 July 2022 | 4 November 2022 | -| Version 0 Alpha 8.2 | End of Life | 31 March 2022 | 2 May 2022 | 27 July 2022 | -| Version 0 Alpha 8.1 | End of Life | 30 March 2022 | 31 March 2022 | 2 May 2022 | -| Version 0 Alpha 8 or Older | End of Life | 29 March 2022 | 30 March 2022 | 30 March 2022 | +| Version | Support Level | Released | End of Support | End of Life | +| ----------------------------------- | ---------------- | ---------------- | ---------------- | ---------------- | +| Version 1 Beta 2 | Full Support | 29 November 2022 | TBD | TBD | +| Version 1 Beta 1 | Critical Support | 4 November 2022 | 29 November 2022 | TBD | +| Version 1 Feature Complete | End of Life | 27 July 2022 | 4 November 2022 | 29 November 2022 | +| Version 0 Alpha 9 | End of Life | 2 May 2022 | 27 July 2022 | 4 November 2022 | +| Version 0 Alpha 8.2 | End of Life | 31 March 2022 | 2 May 2022 | 27 July 2022 | +| Version 0 Alpha 8.1 | End of Life | 30 March 2022 | 31 March 2022 | 2 May 2022 | +| Version 0 Alpha 8 or Older | End of Life | 29 March 2022 | 30 March 2022 | 30 March 2022 | # Support Levels diff --git a/docs/images/oda-screenshot.jpg b/docs/images/oda-screenshot.jpg new file mode 100644 index 0000000..5b3bcc3 Binary files /dev/null and b/docs/images/oda-screenshot.jpg differ diff --git a/includes/template.php b/includes/template.php index dcbf8a1..db13caa 100644 --- a/includes/template.php +++ b/includes/template.php @@ -31,7 +31,7 @@ // Versioning ----------------------------------------------------------------- function oda_version() { - echo "1-β1"; + echo "1-β2"; } @@ -193,12 +193,21 @@ function overview_bar($stats, $domain) { if ($stats[0]['spf_pass_unaligned'] > 0) { $spf_pass_noalign = $stats[0]['spf_pass_unaligned']; } } - // stat calculations - $dmarc_comp_pct = number_format(100 * ($dmarc_comp / $dmarc_none)); - $dkim_comp_pct = number_format(100 * ($dkim_pass_aligned / $dmarc_none)); - $dkim_pass_pct = number_format(100 * (($dkim_pass_aligned + $dkim_pass_noalign) / $dmarc_none)); - $spf_comp_pct = number_format(100 * ($spf_pass_aligned / $dmarc_none)); - $spf_pass_pct = number_format(100 * (($spf_pass_aligned + $spf_pass_noalign) / $dmarc_none)); +// stat calculations + if ($dmarc_none) { + $dmarc_comp_pct = number_format(100 * ($dmarc_comp / $dmarc_none)); + $dkim_comp_pct = number_format(100 * ($dkim_pass_aligned / $dmarc_none)); + $dkim_pass_pct = number_format(100 * (((int)$dkim_pass_aligned + (int)$dkim_pass_noalign) / $dmarc_none)); + $spf_comp_pct = number_format(100 * ($spf_pass_aligned / $dmarc_none)); + $spf_pass_pct = number_format(100 * (((int)$spf_pass_aligned + (int)$spf_pass_noalign) / $dmarc_none)); + } + else { + $dmarc_comp_pct = 0; + $dkim_comp_pct = 0; + $dkim_pass_pct = 0; + $spf_comp_pct = 0; + $spf_pass_pct = 0; + } // overview details echo "
\n @@ -277,11 +286,20 @@ function domain_overview($stats, $dateRange) { $sender_count = getSenderCount($dateRange, $domain); // stat calculations - $dmarc_comp_pct = number_format(100 * ($dmarc_comp / $dmarc_none)); - $dkim_comp_pct = number_format(100 * ($dkim_pass_aligned / $dmarc_none)); - $dkim_pass_pct = number_format(100 * (((int)$dkim_pass_aligned + (int)$dkim_pass_noalign) / $dmarc_none)); - $spf_comp_pct = number_format(100 * ($spf_pass_aligned / $dmarc_none)); - $spf_pass_pct = number_format(100 * (((int)$spf_pass_aligned + (int)$spf_pass_noalign) / $dmarc_none)); + if ($dmarc_none) { + $dmarc_comp_pct = number_format(100 * ($dmarc_comp / $dmarc_none)); + $dkim_comp_pct = number_format(100 * ($dkim_pass_aligned / $dmarc_none)); + $dkim_pass_pct = number_format(100 * (((int)$dkim_pass_aligned + (int)$dkim_pass_noalign) / $dmarc_none)); + $spf_comp_pct = number_format(100 * ($spf_pass_aligned / $dmarc_none)); + $spf_pass_pct = number_format(100 * (((int)$spf_pass_aligned + (int)$spf_pass_noalign) / $dmarc_none)); + } + else { + $dmarc_comp_pct = 0; + $dkim_comp_pct = 0; + $dkim_pass_pct = 0; + $spf_comp_pct = 0; + $spf_pass_pct = 0; + } // overview details echo "
\n @@ -494,14 +512,14 @@ function sender_details($geo_data, $stats, $domain, $dateRange, $ip) { ".$stat['reason']."\n "; if ($stat['dkimdomain'] != '') { - echo "Signed by ".$stat['dkimdomain']."
\n + echo "Signed by ".$stat['dkimdomain']."
\n Result: $dkimresult | Alignment: $dkim_align\n"; } else { echo "Not Signed\n"; } - echo " Envelope from ".$stat['spfdomain']."
\n + echo " Envelope from ".$stat['spfdomain']."
\n Result: $spfresult | Alignment: $spf_align\n \n"; @@ -589,14 +607,14 @@ function report_details($data, $report) { ".$row['reason']."\n "; if ($row['dkimdomain'] != '') { - echo "Signed by ".$row['dkimdomain']."
\n + echo "Signed by ".$row['dkimdomain']."
\n Result: $dkimresult | Alignment: $dkim_align\n"; } else { echo "Not Signed\n"; } - echo " Envelope from ".$row['spfdomain']."
\n + echo " Envelope from ".$row['spfdomain']."
\n Result: $spfresult | Alignment: $spf_align\n \n"; diff --git a/templates/openda/codebase_logo.png b/templates/openda/codebase_logo.png new file mode 100644 index 0000000..316e628 Binary files /dev/null and b/templates/openda/codebase_logo.png differ diff --git a/templates/openda/footer.php b/templates/openda/footer.php index 3af8130..091c618 100644 --- a/templates/openda/footer.php +++ b/templates/openda/footer.php @@ -32,7 +32,8 @@
diff --git a/templates/openda/header.php b/templates/openda/header.php index 47f423c..3e65e71 100644 --- a/templates/openda/header.php +++ b/templates/openda/header.php @@ -35,6 +35,19 @@ + + <?php page_title($page, $domain); ?> + + + + +
+ diff --git a/templates/openda_light/index.php b/templates/openda_light/index.php new file mode 100644 index 0000000..ac669ff --- /dev/null +++ b/templates/openda_light/index.php @@ -0,0 +1,36 @@ +. + +---------------------------------------------------------------------------- */ + +// Header +function page_header ($page, $domain, $dateRange, $ip) { include_once("header.php"); } + +// Footer +function page_footer () { include_once("footer.php"); } + +?> diff --git a/templates/openda_light/style.css b/templates/openda_light/style.css new file mode 100644 index 0000000..6852d3a --- /dev/null +++ b/templates/openda_light/style.css @@ -0,0 +1,482 @@ +/* ---------------------------------------------------------------------------- + +Open DMARC Analyzer - Open Source DMARC Analyzer +Copyright (C) 2022 - John Bradley (userjack6880) + +templates/openda/style.css + CSS file for the Open DMARC Analyzer default template + +Available at: https://github.com/userjack6880/Open-DMARC-Analyzer + +------------------------------------------------------------------------------- + +This file is part of Open DMARC Analyzer. + +Open DMARC Analyzer is free software: you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation, either version 3 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program. If not, see . + +---------------------------------------------------------------------------- */ + +* { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; +} + +body { + -webkit-font-smoothing: antialiased; + font-smooth: antialiased; + text-align: left; + font-family: Sans-serif; + background-color: #d2d9e8; + color: #1f1f1f; +} + +a:link { + text-decoration: none; + color: #3b3b3b; +} + +a:visited { + text-decoration: none; + color: #3b3b3b; +} + +a:active { + text-decoration: none; + color: #6e6e6e; +} + +a:hover { + text-decoration: none; + color: #6e6e6e; +} + +#header { + width: 100%; + margin: 0px auto 0px auto; + padding: 15px; + border: none; + text-align: left; +} + +#controlbar { + width: 100%; + height: 100px; + margin: 0px auto 0px auto; + padding: 15px; + border: none; + text-align: left; +} + +#controlbarleft { + width: calc(100% - 600px); + margin: 0px auto 0px auto; + padding: 0 0 0 30px; + border: none; + text-align: left; + float: left; +} + +#controlbarright { + width: 585px; + margin: 0px auto 0px auto; + padding: 0 30px 0 0; + border: none; + text-align: right; + float: right; +} + +.dov-bar { + width: 100%; + height: 100px; + margin: 30px auto 0 auto; + padding: 15px; + border: none; +} + +.dov-bar-in { + background-color: #e5e9f2; + width: 100%; + height: 100px; + margin: 0 auto 0 auto; + padding: 0; + border: none; + border-radius: 10px; + position: relative; +} + +.dov-bar-in-ip { + width: 100%; + height: 100px; + padding: 0px 20px 0px 20px; + position: relative; +} + +.dov-bar-in-ip > div { + text-align: center; + float: left; + padding: 0px 5px 0px 5px; + position: absolute; + top: 50%; + transform: translateY(-50%); +} + +.geo-left { + width: 500px; + height: 400px; + margin: 0; + padding: 0; + border: none; + text-align: left; + float: left; + position: relative; +} + +.geo-left-inner { + width: 100%; + padding: 15px; + position: absolute; + top: 50%; + transform: translateY(-50%); + font-size: 18px; + font-weight: bold; +} + +.geo-right { + width: calc(100% - 500px); + height: 400px; + margin: 0; + padding: 15px; + border: none; + float: right; + position: relative; +} + +.report-left { + width: 50%; + height: 200px; + margin: 0; + padding: 0; + border: none; + text-align: right; + float: left; + position: relative; +} + +.report-inner { + width: 100%; + padding: 15px; + position: absolute; + top: 50%; + transform: translateY(-50%); + font-size: 18px; +} + +.report-right { + width: 50%; + height: 200px; + margin: 0; + padding: 0; + border: none; + text-align: left; + float: right; + position: relative; +} + +span.dov-bar-small { + font-size: 12px; +} + +h3.dov-bar-in-ip-h3 { + margin: 0; +} + +.dov-bar-in-domain { + width: calc(100% - 400px); + min-width: 600px; + height: 50px; + padding: 10px 10px 10px 20px; + float: left; +} + +.dov-bar-in-dstats-totals { + width: calc(100% - 400px); + min-width: 600px; + height: 50px; + padding: 5px 10px 5px 20px; + float: left; +} + +table.dov { + border: 0; + min-width: 100%; + text-align: left; +} + +tr.dov { + border: 0; +} + +td.dov { + border: 0; + width: 25%; + font-size: 14px; +} + +.dov-bar-in-dstats-alignment { + width: 400px; + height: 100px; + padding: 3px 20px 5px 10px; + float: right; +} + +#overviewbar { + width: 100%; + height: 300px; + margin: 0px auto 0px auto; + padding: 15px; + border: none; +} + +#overviewbarleft { + background-color: #e5e9f2; + width: calc(100% - 430px); + min-width: 600px; + height: 300px; + margin: 0px auto 0px auto; + padding: 0; + border: none; + border-radius: 10px; + float: left; + position: relative; +} + +#overviewbarright { + background-color: #e5e9f2; + width: 400px; + height: 300px; + margin: 0px auto 0px auto; + padding: 40px; + border: none; + border-radius: 10px; + float: right; + position: relative; +} + +#ovbr-in { + position: absolute; + width: 320px; + margin: 0 auto 0 auto; + top: 50%; + transform: translateY(-50%); + text-align: center; + font-weight: bold; +} + +#overviewinnerleft { + width: calc(100% - 500px); + min-width: 100px; + margin: 0px; + padding: 0 10px 0 0; + border: none; + text-align: center; + float: left; + position: absolute; + top: 50%; + transform: translateY(-50%); + font-weight: bold; +} + +#overviewinnerright { + width: 500px; + margin: 0px; + padding: 0 40px 0 20px; + border: none; + float: right; + position: absolute; + top: 50%; + right: 0; + transform: translateY(-50%); + font-size: 24px; + font-weight: bold; +} + +.ovir-left { + width: 50%; + margin: 0; + padding: 0; + text-align: left; + float: left; +} + +.ovir-right { + width: 50%; + margin: 0; + padding: 0; + text-align: right; + float: right; +} + +.overviewtotal { + font-size: 72px; +} + +select { + width: 400px; + margin: 10px; + padding: 5px 10px 5px 10px; + line-height: 24px; + font-size: 15px; + border: 1px solid #bbb; +} + +h1.dov-bar-head { + font-size: 24px; + color: #1f1f1f; + margin: 0; +} + +h1.header { + font-size: 48px; + color: #1f1f1f; +} + +#wrapper { + width: 100%; + margin: 0 auto 0 auto; + padding: 15px; +} + +h2 { + font-size: 24px; + color: #1f1f1f; + margin: 0 0 10px 0; +} + +h2.section { + font-size: 24px; + color: #1f1f1f; + margin: 30px 0px -25px 25px; +} + + +h3 { + font-size: 20px; + color: #1f1f1f; + margin: 10px 0 10px 0; +} + +.centered { + margin: 0px auto 0px auto; +} + +table { + border-collapse: collapse; + border-radius: 15px; + width: 95%; + text-align: center; +} + +table, th, td { + border: 1px solid #1f1f1f; +} + +th, td { + padding: 0; +} + +td { + font-size: 12px; +} + +/* tr:nth-child(1) { */ +thead { + background-color: #1f1f1f; + color: #FFF; +} + +span.pass { + color: #23845b; +} + +span.fail { + color: #EB5160; +} + +span.warn { + color: #F1B077; +} + +span.unknown { + color: #2A3035; +} + +#footer { + width: 100%; + margin: 0px auto 0px auto; + padding: 15px; + font-size: 10px; +} + +.perc-bar { + background-color: #EB5160; + border-radius: 3px; + display: block; + width: 100%; + height: 10px; + position: relative; +} + +.gray-per { + background-color: #8C98A4; + border-radius: 3px; + height: 10px; + position: absolute; + left: 0; +} + +.green-per { + background-color: #708D81; + border-radius: 3px; + height: 10px; + position: absolute; + left: 0; +} + +.perc-text { + color: #738290; + width: 100%; + text-align: center; + position: relative; + font-size: 10px; + height: 20px; + line-height: 20px; + display: block; +} + +.perc-title { + display: inline-block; + padding-bottom: 8px; +} + +.perc-text > span { + display: inline-block; + vertical-align: middle; + line-height: normal; +} + +span.signed { + color: #000; +} \ No newline at end of file