Skip to content

Commit

Permalink
Merge pull request #70 from userjack6880/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
userjack6880 authored Nov 29, 2022
2 parents 4c5cf19 + a099928 commit 718aa39
Show file tree
Hide file tree
Showing 17 changed files with 711 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):**
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/critical_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):**
Expand Down
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 ([email protected]). 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 <Codebase>](https://systemanomaly.com/codebase) project by John Bradley ([email protected])

# Requirements
- Apache 2 or equivalent
- PHP 5 (PHP 7 required for phpWhois)
Expand Down Expand Up @@ -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.

Expand All @@ -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

Expand All @@ -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`.
5 changes: 5 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
15 changes: 6 additions & 9 deletions docs/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
17 changes: 9 additions & 8 deletions docs/SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Binary file added docs/images/oda-screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 34 additions & 16 deletions includes/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
// Versioning -----------------------------------------------------------------
function oda_version() {

echo "1-β1";
echo "1-β2";

}

Expand Down Expand Up @@ -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 "<div id=overviewbar>\n
Expand Down Expand Up @@ -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 "<div class=dov-bar>\n
Expand Down Expand Up @@ -494,14 +512,14 @@ function sender_details($geo_data, $stats, $domain, $dateRange, $ip) {
<td>".$stat['reason']."</td>\n
<td>";
if ($stat['dkimdomain'] != '') {
echo "Signed by <span style='color:#fff'>".$stat['dkimdomain']."</span><br />\n
echo "Signed by <span class=signed>".$stat['dkimdomain']."</span><br />\n
Result: <span class=$dkimresult>$dkimresult</span> |
Alignment: <span class=$dkim_align>$dkim_align</span></td>\n";
}
else {
echo "Not Signed</td>\n";
}
echo " <td>Envelope from <span style='color:#fff'>".$stat['spfdomain']."</span><br />\n
echo " <td>Envelope from <span class=signe'>".$stat['spfdomain']."</span><br />\n
Result: <span class=$spfresult>$spfresult</span> |
Alignment: <span class=$spf_align>$spf_align</span></td>\n
</tr>\n";
Expand Down Expand Up @@ -589,14 +607,14 @@ function report_details($data, $report) {
<td>".$row['reason']."</td>\n
<td>";
if ($row['dkimdomain'] != '') {
echo "Signed by <span style='color:#fff'>".$row['dkimdomain']."</span><br />\n
echo "Signed by <span class=signed>".$row['dkimdomain']."</span><br />\n
Result: <span class=$dkimresult>$dkimresult</span> |
Alignment: <span class=$dkim_align>$dkim_align</span></td>\n";
}
else {
echo "Not Signed</td>\n";
}
echo " <td>Envelope from <span style='color:#fff'>".$row['spfdomain']."</span><br />\n
echo " <td>Envelope from <span class=signed>".$row['spfdomain']."</span><br />\n
Result: <span class=$spfresult>$spfresult</span> |
Alignment: <span class=$spf_align>$spf_align</span></td>\n
</tr>\n";
Expand Down
Binary file added templates/openda/codebase_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion templates/openda/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
</div>
<div id="footer">
<p>
<a href="https://github.com/userjack6880/Open-DMARC-Analyzer">Open DMARC Analyzer</a> <?php oda_version(); ?>
<a href="https://github.com/userjack6880/Open-DMARC-Analyzer">Open DMARC Analyzer</a> <?php oda_version(); ?><br />
<a href="https://systemanomaly.com/codebase"><img src="templates/openda/codebase_logo.png" alt="Anomaly <Codebase>" height="50px"></a>
</p>
</div>

Expand Down
13 changes: 13 additions & 0 deletions templates/openda/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="templates/openda/style.css" />
<style type="text/css">
@media (max-width:1230px) {
#header {
width: 1230px;
}
#controlbar {
width: 1230px;
}
#wrapper {
width: 1230px;
}
}
</style>

<script type="text/javascript">
<?php javascript(); ?>
Expand Down
4 changes: 4 additions & 0 deletions templates/openda/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -476,3 +476,7 @@ span.unknown {
vertical-align: middle;
line-height: normal;
}

span.signed {
color: #fff;
}
Binary file added templates/openda_light/codebase_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions templates/openda_light/footer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/* ----------------------------------------------------------------------------
Open DMARC Analyzer - Open Source DMARC Analyzer
Copyright (C) 2022 - John Bradley (userjack6880)
templates/openda/footer.php
footer 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 <https://www.gnu.org/licenses/>.
---------------------------------------------------------------------------- */

?>

</div>
<div id="footer">
<p>
<a href="https://github.com/userjack6880/Open-DMARC-Analyzer">Open DMARC Analyzer</a> <?php oda_version(); ?><br />
<a href="https://systemanomaly.com/codebase"><img src="templates/openda_light/codebase_logo.png" alt="Anomaly <Codebase>" height="50px"></a>
</p>
</div>

</body>
</html>
63 changes: 63 additions & 0 deletions templates/openda_light/header.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php
/* ----------------------------------------------------------------------------
Open DMARC Analyzer - Open Source DMARC Analyzer
Copyright (C) 2022 - John Bradley (userjack6880)
templates/openda/header.php
header 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 <https://www.gnu.org/licenses/>.
---------------------------------------------------------------------------- */

?>

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="templates/openda_light/style.css" />
<style type="text/css">
@media (max-width:1230px) {
#header {
width: 1230px;
}
#controlbar {
width: 1230px;
}
#wrapper {
width: 1230px;
}
}
</style>

<script type="text/javascript">
<?php javascript(); ?>
</script>
<title><?php page_title($page, $domain); ?></title>
</head>
<body>
<div id="header">
<a href="index.php"><h1 class="header">Open DMARC Analyzer</h1></a>
</div>
<?php control_bar($page, $domain, $dateRange, $ip); ?>
<div id="wrapper">

Loading

0 comments on commit 718aa39

Please sign in to comment.