@postalsys/email-text-tools 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/risk-analysis.js +19 -19
- package/package.json +1 -1
package/lib/risk-analysis.js
CHANGED
|
@@ -20,39 +20,39 @@ I want you to act as are an IT security expert that monitors emails for suspicio
|
|
|
20
20
|
|
|
21
21
|
const USER_PROMPT = `
|
|
22
22
|
Instructions:
|
|
23
|
-
- You are an IT security expert.
|
|
24
|
-
- Your task is to monitor and analyze incoming emails which consist of the message headers, a list of attachments, and text content
|
|
25
|
-
- Your analysis should contain (but is not limited to) the following:
|
|
23
|
+
- You are an IT security expert scanning incoming emails to detect and block fraud attempts.
|
|
24
|
+
- Your task is to monitor and analyze incoming emails, which consist of the message headers, a list of attachments, and text content
|
|
25
|
+
- Your analysis should contain (but is not limited to) the following risk factors:
|
|
26
26
|
- Does the email include links with domain names that contain typos or homoglyphs that might mislead the user about the actual target of the link
|
|
27
|
-
- Does the sender address of the email match the persona or organization the sender email claims to be
|
|
28
|
-
- Does the email promise the user extremely good financial outcome
|
|
27
|
+
- Does the sender address of the email not seem to match the persona or organization the sender email claims to be
|
|
28
|
+
- Does the email promise the user an extremely good financial outcome
|
|
29
29
|
- Does the email promise unclaimed money or goods
|
|
30
30
|
- Does the email offer a vague business opportunity with no specific details
|
|
31
31
|
- Does the email suggest there is a severe penalty if the user does not act as requested
|
|
32
32
|
- Does the email claim that there are technical issues with the user's email account
|
|
33
33
|
- Does the email offer services or activities that are not suitable for underage persons
|
|
34
|
-
- Does the sender email look like a throwaway address
|
|
35
|
-
- Does the sender email look like it might be spoofed
|
|
34
|
+
- Does the sender's email look like a throwaway address
|
|
35
|
+
- Does the sender's email look like it might be spoofed
|
|
36
36
|
- Does the email contain attachments where the name of the attachment might be misleading and suggest a different file format than is actually used
|
|
37
37
|
- Does the email contain attachments that might be executable files
|
|
38
|
-
- Provide a risk score for the email using the following scale: 1 - 5 (where 1 is low
|
|
38
|
+
- Provide a risk score for the email using the following scale: 1 - 5 (where 1 is low risk, and 5 is high risk), taking into account what may happen if a user acts by the instructions given in the email.
|
|
39
39
|
- Provide a short single-sentence assessment text that includes details about issues that increase the risk score, do not disclose details that decrease the risk score or do not affect it.
|
|
40
|
-
- Respond with a JSON formatted structure with numeric risk score as "risk" property
|
|
40
|
+
- Respond with a JSON formatted structure with a numeric risk score as "risk" property and the assessment as the "assessment" property. Do not write any other explanations.
|
|
41
41
|
|
|
42
42
|
Facts:
|
|
43
|
-
- An email consists of message headers, attachments list, and text content
|
|
44
|
-
- An email might contain an "authentication-results" result header that
|
|
45
|
-
- Having a valid SPF, DKIM and DMARC increases the chances that the sender domain name is not spoofed
|
|
46
|
-
- For valid SPF the "authentication-results" header must include "spf=pass"
|
|
47
|
-
- For valid DKIM the "authentication-results" header must include "dkim=pass"
|
|
48
|
-
- For valid DMARC the "authentication-results" header must include "dmarc=pass"
|
|
49
|
-
- For valid ARC the "authentication-results" header must include "arc=pass"
|
|
43
|
+
- An email consists of message headers, an attachments list, and text content
|
|
44
|
+
- An email might contain an "authentication-results" result header that indicates if the message passed SPF, DKIM, ARC, and DMARC checks
|
|
45
|
+
- Having a valid SPF, DKIM, and DMARC increases the chances that the sender domain name is not spoofed
|
|
46
|
+
- For valid SPF, the "authentication-results" header must include "spf=pass"
|
|
47
|
+
- For valid DKIM, the "authentication-results" header must include "dkim=pass"
|
|
48
|
+
- For valid DMARC, the "authentication-results" header must include "dmarc=pass"
|
|
49
|
+
- For valid ARC, the "authentication-results" header must include "arc=pass"
|
|
50
50
|
- Throwaway email addresses might contain a word or a name and more than one number in the username of the email address
|
|
51
51
|
- Throwaway email addresses might use a randomly generated or hex text string as the username of the email address
|
|
52
|
-
- Throwaway email addresses might use free email services like gmail.com, outlook.com, hotmail.com, yahoo.com, aol.com etc
|
|
52
|
+
- Throwaway email addresses might use free email services like gmail.com, outlook.com, hotmail.com, yahoo.com, aol.com, etc
|
|
53
53
|
- The email to analyze is formatted in a JSON format
|
|
54
54
|
- The email structure includes a property "headers" that contains an array of header values.
|
|
55
|
-
- Each header contains
|
|
55
|
+
- Each header contains two properties, "key" as the header field key name and "value" as the header value without the key prefix
|
|
56
56
|
- The email structure includes a property "attachments" that contains an array of attachments.
|
|
57
57
|
- Each attachment includes a "filename" property that describes the file name, "contentType" property that describes the Content-Type value of the attachment
|
|
58
58
|
- The email includes a "text" property for the text content
|
|
@@ -208,8 +208,8 @@ ${JSON.stringify(content)}`;
|
|
|
208
208
|
const response = Object.assign({ id: null, tokens: null }, values, {
|
|
209
209
|
id: data && data.id,
|
|
210
210
|
tokens: data && data.usage && data.usage.total_tokens,
|
|
211
|
-
text: content.text,
|
|
212
211
|
|
|
212
|
+
_text: content.text,
|
|
213
213
|
_time: reqEndTime - reqStartTime,
|
|
214
214
|
_cr: charactersRemoved
|
|
215
215
|
});
|