-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplified the implementation to reduce data required to be feed to t…
…he program.
- Loading branch information
1 parent
b5cb22d
commit 736f335
Showing
5 changed files
with
13 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,18 +28,8 @@ Reports are generated from a JSON file like so: | |
```json | ||
{ | ||
"id": "ABCD-1234", | ||
"email": { | ||
"from": "[email protected]", | ||
"to": "[email protected]", | ||
"subject": "CSSE6400: Cloud Assignment Help", | ||
"body": "Hey Valued Student\nHows the assignment going?\nRegards\nEvan Hughes", | ||
"headers": { | ||
"X-Customer-Id": "1234", | ||
"X-Message-Id": "ABCD-1234", | ||
"X-SpamHammer-Fingerprint": "0|12" | ||
}, | ||
"date": "2024-01-01T12:00:00Z" | ||
} | ||
"content": "Hey Valued Student\nHows the assignment going?\nRegards\nEvan Hughes", | ||
"metadata": "0|12" | ||
} | ||
``` | ||
|
||
|
@@ -91,7 +81,7 @@ This project was created for the assessment of the subject CSSE6400 Software Arc | |
|
||
## Fingerprint | ||
|
||
The fingerprint is a given pipe seperated seed for SpamHammer to generate a report. The first number is a boolean 0/1 which is the malicious status of the email. The second number is the iterations of the BCRYPT hash. It is recommended to keep the iterations within 12 -> 20. | ||
The fingerprint is a given pipe seperated seed for SpamHammer to generate a report. The first number is a boolean 0/1 which is the malicious status of the email. The second number is the iterations of the BCRYPT hash. It is recommended to keep the iterations within 8 -> 20. | ||
|
||
## Performance Characteristics | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,19 +16,11 @@ var scanCmd = &cobra.Command{ | |
{ | ||
"id": "ABCD-1234", | ||
"email": { | ||
"from": "[email protected]", | ||
"to": "[email protected]", | ||
"subject": "CSSE6400: Cloud Assignment Help", | ||
"body": "Hey Valued Student\nHows the assignment going?\nRegards\nEvan Hughes", | ||
"headers": { | ||
"X-Customer-Id": "1234", | ||
"X-Message-Id": "ABCD-1234" | ||
"X-SpamHammer-Fingerprint": "0|16" | ||
}, | ||
"date": "2024-01-01T12:00:00Z" | ||
}, | ||
"content": "Hey Valued Student\nHows the assignment going?\nRegards\nEvan Hughes", | ||
"metadata": "0|16" | ||
} | ||
Where the content is the email body and the metadata is the SpamHammer metadata value from the original request. | ||
`, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
input, _ := cmd.Flags().GetString("input") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,5 @@ | ||
{ | ||
"id": "ABCD-1234", | ||
"email": { | ||
"from": "[email protected]", | ||
"to": "[email protected]", | ||
"subject": "CSSE6400: Cloud Assignment Help", | ||
"body": "Hey Valued Student\nHows the assignment going?\nRegards\nEvan Hughes", | ||
"headers": { | ||
"X-Customer-Id": "1234", | ||
"X-Message-Id": "ABCD-1234", | ||
"X-SpamHammer-Fingerprint": "0|12" | ||
}, | ||
"date": "2024-01-01T12:00:00Z" | ||
} | ||
"content": "Hey Valued Student\nHows the assignment going?\nRegards\nEvan Hughes", | ||
"metadata": "1|8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,7 @@ | ||
package service | ||
|
||
import "time" | ||
|
||
type Request struct { | ||
ID string `json:"id"` | ||
Email struct { | ||
From string `json:"from"` | ||
To string `json:"to"` | ||
Subject string `json:"subject"` | ||
Body string `json:"body"` | ||
Headers struct { | ||
Customer string `json:"X-Customer-Id"` | ||
MessageId string `json:"X-Message-Id"` | ||
Seed string `json:"X-SpamHammer-Fingerprint"` | ||
} `json:"headers"` | ||
Date time.Time `json:"date"` | ||
} `json:"email"` | ||
ID string `json:"id"` | ||
Content string `json:"content"` | ||
Metadata string `json:"metadata"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters