Skip to content

Commit

Permalink
Merge pull request #85 from userjack6880/beta4
Browse files Browse the repository at this point in the history
version 2 fixes backport
  • Loading branch information
userjack6880 authored Apr 26, 2023
2 parents 7508ab2 + 07c16a2 commit a0a4e68
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 29 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ 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
[ ] Other
[] Version 1 Beta 4
[] Version 1 Beta 3
[] Other

**Desktop (please complete the following information):**
- OS [e.g. macOS]
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/critical_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ 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
[ ] Other
[] Version 1 Beta 4
[] Version 1 Beta 3
[] Other

**Desktop (please complete the following information):**
- OS [e.g. macOS]
Expand Down
8 changes: 4 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Fixes # (issue)

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
- [] Bug fix (non-breaking change which fixes an issue)
- [] New feature (non-breaking change which adds functionality)
- [] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [] This change requires a documentation update

## How Has This Been Tested?

Expand Down
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Open DMARC Analyzer
![Open DMARC Analyzer Screenshot](docs/images/oda-screenshot.jpg?raw=true)

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 [Open Report Parser](https://github.com/userjack6880/Open-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 3 (1-β3) is an [Anomaly \<Codebase\>](https://systemanomaly.com/codebase) project by John Bradley (john@systemanomaly.com)
Open DMARC Analyzer Version 1 Beta 4 (1-β4) is an [Anomaly \<Codebase\>](https://systemanomaly.com/codebase) project by John Bradley (john@systemanomaly.com)

# Minimum Requirements
- Apache 2 or equivalent
- PHP 5 (PHP 7 required for phpWhois)
- PHP PDO
- MySQL 15.1 or equivalent
- **A database that is pre-populated with data from [rrdmarc](http://www.taugh.com/rddmarc/) or [dmarcts-report-parser](https://github.com/techsneeze/dmarcts-report-parser)**
- **A database that is pre-populated with data from [Open Report Parser](https://github.com/userjack6880/Open-Report-Parser)**

# Dependencies

Expand Down Expand Up @@ -97,17 +97,19 @@ Valid date signifiers are `m`, `w`, and `d` for "month", "week", and "day".

# Latest Changes

## 1-β3
- Tweaks to the `openda` and `openda_light` themes, including table widths and data coloring.
- Issue template fix per issue #78.
## 1-β4
- PostgresSQL validation and fixes backported from future Version 2 Alpha 1 branch.

See `CHANGELOG` under `docs` for full details of all changes.

# Tested System Configurations

| OS | HTTP | PHP | SQL |
| --------------- | ------------- | ------ | --------------- |
| Debian 11.6 | Apache 2.4.52 | 8.2.3 | MariaDB 10.5.18 |
| Debian 11.6 | Apache 2.4.56 | 8.2.5 | MariaDB 10.5.18 |
| Debian 11.6 | Apache 2.4.56 | 8.2.5 | PostgreSQL 13.9 |
| Debian 11.6 | Apache 2.4.56 | 7.4.33 | MariaDB 10.5.18 |
| Debian 11.6 | Apache 2.4.56 | 7.4.33 | PostgreSQL 13.9 |
| CentOS 7.6.1810 | Apache 2.4.6 | 5.4.16 | MariaDB 5.5.65 |

If you have a system configuration not listed, and would like to contribue this data, please [provide feedback](https://github.com/userjack6880/Open-Dmarc-Analyzer/issues).
Expand All @@ -122,9 +124,9 @@ Support will be provided as outlined in the following schedule. For more details

| Version | Support Level | Released | End of Support | End of Life |
| ----------------------------------- | ---------------- | ---------------- | ---------------- | ---------------- |
| Version 1 Beta 3 | Full Support | 19 April 2023 | 1-rc1 Release | TBD |
| Version 1 Beta 2 | Critical Support | 29 November 2022 | 19 April 2023 | 1-rc1 Release |
| Version 1 Beta 1 | End of Life | 4 November 2022 | 29 November 2022 | 19 April 2023 |
| Version 1 Beta 4 | Full Support | 26 April 2023 | 1-rc1 Release | TBD |
| Version 1 Beta 3 | Critical Support | 19 April 2023 | 26 April 2023 | 1-rc1 Release |
| Version 1 Beta 2 | End of Life | 29 November 2022 | 19 April 2023 | 26 April 2023 |

# Contributing

Expand Down
3 changes: 2 additions & 1 deletion config.php.pub
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ define('DB_HOST', 'localhost');
define('DB_USER', 'dmarc');
define('DB_PASS', 'password');
define('DB_NAME', 'dmarc');
define('DB_PORT', '3306'); // default port 3306
define('DB_PORT', '3306'); // default port 3306, 5432 for pgsql
define('DB_TYPE', 'mysql'); // supported mysql and pgsql

// Debug Settings

Expand Down
3 changes: 3 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 1-β4
- PostgresSQL validation and fixes backported from future Version 2 Alpha 1 branch.

## 1-β3
- Tweaks to the `openda` and `openda_light` themes, including table widths and data coloring.
- Issue template fix per issue #78.
Expand Down
5 changes: 3 additions & 2 deletions docs/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ Open DMARC Analyzer Version Security Support

| Version | Supported | End of Life |
| -------------------------- | --------- | ---------------- |
| Version 1 Beta 3 | YES | TBD |
| Version 1 Beta 2 | YES | 1-rc1 Release |
| Version 1 Beta 4 | YES | TBD |
| Version 1 Beta 3 | YES | 1-rc1 Release |
| Version 1 Beta 2 | NO | 26 April 2023 |
| Version 1 Beta 1 | NO | 19 April 2023 |
| Version 1 Feature Complete | NO | 29 November 2022 |
| Version 0 Alpha 9 | NO | 4 November 2022 |
5 changes: 3 additions & 2 deletions docs/SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ Due to the limited time available to developrs to maintain support, dates must b

| Version | Support Level | Released | End of Support | End of Life |
| ----------------------------------- | ---------------- | ---------------- | ---------------- | ---------------- |
| Version 1 Beta 3 | Full Support | 19 April 2023 | 1-rc1 Release | TBD |
| Version 1 Beta 2 | Critical Support | 29 November 2022 | 19 April 2023 | 1-rc1 Release |
| Version 1 Beta 4 | Full Support | 26 April 2023 | 1-rc1 Release | TBD |
| Version 1 Beta 3 | Critical Support | 19 April 2023 | 26 April 2023 | 1-rc1 Release |
| Version 1 Beta 2 | End of Life | 29 November 2022 | 19 April 2023 | 26 April 2023 |
| Version 1 Beta 1 | End of Life | 4 November 2022 | 29 November 2022 | 19 April 2023 |
| 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 |
Expand Down
10 changes: 9 additions & 1 deletion includes/db.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@
// Connect to DB //
function dbConn() {
try {
$pdo = new PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME.";port=".DB_PORT, DB_USER, DB_PASS);
if (DB_TYPE == "pgsql") {
$pdo = new PDO("pgsql:host=".DB_HOST.";dbname=".DB_NAME.";port=".DB_PORT, DB_USER, DB_PASS);
}
elseif (DB_TYPE == "mysql") {
$pdo = new PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME.";port=".DB_PORT, DB_USER, DB_PASS);
}
else {
echo 'Incorrect DB Type: '.DB_TYPE;
}
}
catch (PDOException $e) {
echo 'Connection failed: '.$e->getMessage();
Expand Down
2 changes: 1 addition & 1 deletion includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function dashboard($dateRange,$domain) {
domain, sum(rcount) AS total_messages, policy_p, policy_pct
FROM report_stats
WHERE mindate BETWEEN :startdate AND NOW()
GROUP BY domain
GROUP BY domain, policy_p, policy_pct
) t1
LEFT JOIN (SELECT domain, sum(rcount) AS none
FROM report_stats
Expand Down
2 changes: 1 addition & 1 deletion 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-β3";
echo "1-β4";

}

Expand Down
9 changes: 8 additions & 1 deletion install.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
$statement ='';

echo "opening file...";
$lines = file('mysql.sql');
$lines = file(DB_TYPE.'.sql');
echo " success<br>";

foreach ($lines as $line)
Expand Down Expand Up @@ -89,6 +89,13 @@
echo "FAILED &rarr; mysql.sql<br>";
}

if (unlink('pgsql.sql') == true) {
echo "DELETED &rarr; pgsql.sql<br>";
}
else {
echo "FAILED &rarr; pgsql.sql<br>";
}

if (unlink(__FILE__) == true) {
echo "DELETED &rarr; install.php<br>";
}
Expand Down
8 changes: 8 additions & 0 deletions pgsql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CREATE OR REPLACE VIEW report_stats AS (
SELECT
report.serial, domain, rcount, disposition, reason,
policy_p, policy_pct, dkimdomain, dkimresult, dkim_align,
spfdomain, spfresult, spf_align, mindate, maxdate
FROM report RIGHT JOIN rptrecord
ON report.serial=rptrecord.serial
);

0 comments on commit a0a4e68

Please sign in to comment.