Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #311 from cisagov/AL-add-tlpAmber
Browse files Browse the repository at this point in the history
Update Reports to include TLP:AMber markings
  • Loading branch information
cduhn17 committed Jan 9, 2023
2 parents d3d7439 + e4a123f commit 31f8630
Show file tree
Hide file tree
Showing 4 changed files with 185 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.DS_Store

## Project Specific ##
*.html
*.log
output/
src/pe_reports/*.html
Expand Down
4 changes: 3 additions & 1 deletion src/pe_mailer/pe_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PEMessage(ReportMessage):
"""

Subject = "Posture and Exposure Report - {{report_date}}"
Subject = "Posture and Exposure Report - {{report_date}} (TLP:AMBER)"

TextBody = """Greetings,
Expand All @@ -49,6 +49,8 @@ class PEMessage(ReportMessage):
HtmlBody = """<html>
<head></head>
<body>
<p style="color:#FFC000">TLP:AMBER</p>
<p>Greetings,</p>
<p>The attached Posture and Exposure (P&E) report is the result of a
Expand Down
165 changes: 165 additions & 0 deletions src/pe_reports/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@

height: 6cm;
}
@frame headerCont {
-pdf-frame-content: headerContentCont;
top: 0.625in;
margin-left: 2in;
margin-right: 1in;
height: 1in;
font-size: 10pt;
}
@frame headerCont2 {
-pdf-frame-content: headerContentCont2;
top: 0.625in;
margin-right: 1in;
height: 1in;
font-size: 12pt;
}
}

@page sum {
Expand Down Expand Up @@ -73,6 +88,21 @@

height: 6cm;
}
@frame headerCont {
-pdf-frame-content: headerContentCont;
top: 0.625in;
margin-left: 2in;
margin-right: 1in;
height: 1in;
font-size: 10pt;
}
@frame headerCont2 {
-pdf-frame-content: headerContentCont2;
top: 0.625in;
margin-right: 1in;
height: 1in;
font-size: 12pt;
}

@frame kpi1 {
left: 12.6cm;
Expand Down Expand Up @@ -171,6 +201,21 @@

height: 6cm;
}
@frame headerCont {
-pdf-frame-content: headerContentCont;
top: 0.625in;
margin-left: 2in;
margin-right: 1in;
height: 1in;
font-size: 10pt;
}
@frame headerCont2 {
-pdf-frame-content: headerContentCont2;
top: 0.625in;
margin-right: 1in;
height: 1in;
font-size: 12pt;
}

@frame kpi1 {
left: 2cm;
Expand Down Expand Up @@ -247,6 +292,21 @@
left: 1cm;
height: 6cm;
}
@frame headerCont {
-pdf-frame-content: headerContentCont;
top: 0.625in;
margin-left: 2in;
margin-right: 1in;
height: 1in;
font-size: 10pt;
}
@frame headerCont2 {
-pdf-frame-content: headerContentCont2;
top: 0.625in;
margin-right: 1in;
height: 1in;
font-size: 12pt;
}
@frame kpi1 {
left: 4.3cm;
width: 5.45cm;
Expand Down Expand Up @@ -315,6 +375,21 @@

height: 6cm;
}
@frame headerCont {
-pdf-frame-content: headerContentCont;
top: 0.625in;
margin-left: 2in;
margin-right: 1in;
height: 1in;
font-size: 10pt;
}
@frame headerCont2 {
-pdf-frame-content: headerContentCont2;
top: 0.625in;
margin-right: 1in;
height: 1in;
font-size: 12pt;
}

@frame kpi1 {
left: 2cm;
Expand Down Expand Up @@ -420,6 +495,21 @@

height: 6cm;
}
@frame headerCont {
-pdf-frame-content: headerContentCont;
top: 0.625in;
margin-left: 2in;
margin-right: 1in;
height: 1in;
font-size: 10pt;
}
@frame headerCont2 {
-pdf-frame-content: headerContentCont2;
top: 0.625in;
margin-right: 1in;
height: 1in;
font-size: 12pt;
}

@frame kpi1 {
left: 1.1cm;
Expand Down Expand Up @@ -502,6 +592,21 @@

height: 6cm;
}
@frame headerCont {
-pdf-frame-content: headerContentCont;
top: 0.625in;
margin-left: 2in;
margin-right: 1in;
height: 1in;
font-size: 10pt;
}
@frame headerCont2 {
-pdf-frame-content: headerContentCont2;
top: 0.625in;
margin-right: 1in;
height: 1in;
font-size: 12pt;
}

@frame TableIntro1 {
left: 1.5cm;
Expand Down Expand Up @@ -576,6 +681,21 @@
left: 1cm;
height: 6cm;
}
@frame headerCont {
-pdf-frame-content: headerContentCont;
top: 0.625in;
margin-left: 2in;
margin-right: 1in;
height: 1in;
font-size: 10pt;
}
@frame headerCont2 {
-pdf-frame-content: headerContentCont2;
top: 0.625in;
margin-right: 1in;
height: 1in;
font-size: 12pt;
}

@frame TableIntro1 {
left: 1.5cm;
Expand Down Expand Up @@ -651,6 +771,21 @@

height: 6cm;
}
@frame headerCont {
-pdf-frame-content: headerContentCont;
top: 0.625in;
margin-left: 2in;
margin-right: 1in;
height: 1in;
font-size: 10pt;
}
@frame headerCont2 {
-pdf-frame-content: headerContentCont2;
top: 0.625in;
margin-right: 1in;
height: 1in;
font-size: 12pt;
}

@frame TableIntro1 {
left: 1.5cm;
Expand Down Expand Up @@ -695,6 +830,21 @@

height: 6cm;
}
@frame headerCont {
-pdf-frame-content: headerContentCont;
top: 0.625in;
margin-left: 2in;
margin-right: 1in;
height: 1in;
font-size: 10pt;
}
@frame headerCont2 {
-pdf-frame-content: headerContentCont2;
top: 0.625in;
margin-right: 1in;
height: 1in;
font-size: 12pt;
}

@frame AppendixIntro {
left: 1.5cm;
Expand Down Expand Up @@ -738,6 +888,21 @@

height: 6cm;
}
@frame headerCont {
-pdf-frame-content: headerContentCont;
top: 0.625in;
margin-left: 2in;
margin-right: 1in;
height: 1in;
font-size: 10pt;
}
@frame headerCont2 {
-pdf-frame-content: headerContentCont2;
top: 0.625in;
margin-right: 1in;
height: 1in;
font-size: 12pt;
}

@frame TableIntro1 {
left: 1.5cm;
Expand Down
20 changes: 16 additions & 4 deletions tests/test_pe_mailer_pe_mesage.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def test_four_params_single_recipient(self):
message = PEMessage(pdf, report_date, to)
self.assertEqual(message["From"], "reports@cyber.dhs.gov")
self.assertEqual(
message["Subject"], "Posture and Exposure Report - December 15, 2020"
message["Subject"],
"Posture and Exposure Report - December 15, 2020 (TLP:AMBER)",
)
self.assertEqual(message.get("CC"), None)
self.assertEqual(
Expand Down Expand Up @@ -59,6 +60,8 @@ def test_four_params_single_recipient(self):
html_body = """<html>
<head></head>
<body>
<p style="color:#FFC000">TLP:AMBER</p>
<p>Greetings,</p>
<p>The attached Posture and Exposure (P&E) report is the result of a
Expand Down Expand Up @@ -99,7 +102,8 @@ def test_four_params_multiple_recipients(self):

self.assertEqual(message["From"], "reports@cyber.dhs.gov")
self.assertEqual(
message["Subject"], "Posture and Exposure Report - December 15, 2020"
message["Subject"],
"Posture and Exposure Report - December 15, 2020 (TLP:AMBER)",
)
self.assertEqual(message.get("CC"), None)
self.assertEqual(
Expand Down Expand Up @@ -139,6 +143,8 @@ def test_four_params_multiple_recipients(self):
html_body = """<html>
<head></head>
<body>
<p style="color:#FFC000">TLP:AMBER</p>
<p>Greetings,</p>
<p>The attached Posture and Exposure (P&E) report is the result of a
Expand Down Expand Up @@ -185,7 +191,8 @@ def test_six_params_single_cc(self):

self.assertEqual(message["From"], fm)
self.assertEqual(
message["Subject"], "Posture and Exposure Report - December 15, 2020"
message["Subject"],
"Posture and Exposure Report - December 15, 2020 (TLP:AMBER)",
)
self.assertEqual(message["CC"], "cc@example.com")
self.assertEqual(message["BCC"], "bcc@example.com,bcc2@example.com")
Expand Down Expand Up @@ -223,6 +230,8 @@ def test_six_params_single_cc(self):
html_body = """<html>
<head></head>
<body>
<p style="color:#FFC000">TLP:AMBER</p>
<p>Greetings,</p>
<p>The attached Posture and Exposure (P&E) report is the result of a
Expand Down Expand Up @@ -269,7 +278,8 @@ def test_six_params_multiple_cc(self):

self.assertEqual(message["From"], fm)
self.assertEqual(
message["Subject"], "Posture and Exposure Report - December 15, 2020"
message["Subject"],
"Posture and Exposure Report - December 15, 2020 (TLP:AMBER)",
)
self.assertEqual(message["CC"], "cc@example.com,cc2@example.com")
self.assertEqual(message["BCC"], "bcc@example.com,bcc2@example.com")
Expand Down Expand Up @@ -307,6 +317,8 @@ def test_six_params_multiple_cc(self):
html_body = """<html>
<head></head>
<body>
<p style="color:#FFC000">TLP:AMBER</p>
<p>Greetings,</p>
<p>The attached Posture and Exposure (P&E) report is the result of a
Expand Down

0 comments on commit 31f8630

Please sign in to comment.