From 753029c3edf9b4d3bc6725d19b62fba5937d25c5 Mon Sep 17 00:00:00 2001 From: Michael Wolfenden Date: Fri, 2 May 2025 16:55:40 +0800 Subject: [PATCH] Update to Australian Government Email Protective Marking Standard Release 2024 - Update version from `2018.4` to `2024.1` - Update links in `readme.md` --- readme.md | 38 +++++++++---------- .../Renderer_Email.cs | 2 +- ...Tests.ApplyProtectiveMarkings.verified.txt | 2 +- .../OfficeDocHelperTests.Patch.verified.txt | 10 ++--- src/Tests/ParserTests.Simple.verified.txt | 10 ++--- src/Tests/ParserTests.cs | 6 +-- ...ndererTests.RenderEmailHeader.verified.txt | 2 +- ...erEmailHeaderGenDateWithTicks.verified.txt | 2 +- ...rerTests.RenderEmailHeaderMin.verified.txt | 2 +- ...mples.ApplyProtectiveMarkings.verified.txt | 2 +- ...Samples.RenderEmailHeaderFull.verified.txt | 2 +- ...ples.RenderEmailHeaderMinimum.verified.txt | 2 +- src/Tests/Samples.cs | 6 +-- 13 files changed, 41 insertions(+), 45 deletions(-) diff --git a/readme.md b/readme.md index 6e5996b..66d7f17 100644 --- a/readme.md +++ b/readme.md @@ -3,15 +3,13 @@ [![Build status](https://ci.appveyor.com/api/projects/status/8kjm4utaiq58ok01/branch/master?svg=true)](https://ci.appveyor.com/project/SimonCropp/australianprotectivemarkings) [![NuGet Status](https://img.shields.io/nuget/v/AustralianProtectiveMarkings.svg)](https://www.nuget.org/packages/AustralianProtectiveMarkings/) -A dotnet representation of Protective Markings defined in the [Australian Protective Security Policy Framework](https://www.protectivesecurity.gov.au/publications-library/policy-8-classification-system) +A dotnet representation of Protective Markings defined in the [Australian Government Email Protective Marking Standard](https://www.protectivesecurity.gov.au/system/files/2024-10/australian-government-email-protective-marking-standard.pdf) **See [Milestones](../../milestones?state=closed) for release notes.** Spec: - * [PSPF: Sensitive and classified information](https://www.protectivesecurity.gov.au/system/files/2023-08/annex-f-policy-8-classification-system-pspf.pdf) - * [PSPF: Sensitive and classified information - Annex F (email clarifications)](https://www.protectivesecurity.gov.au/system/files/2023-08/annex-f-policy-8-classification-system-pspf.pdf) - + * [Australian Government Email Protective Marking Standard](https://www.protectivesecurity.gov.au/system/files/2024-10/australian-government-email-protective-marking-standard.pdf) ## NuGet package @@ -36,16 +34,15 @@ All string members follow the convention of: Converts a protected marking to text that should be appended to an email subject line. -See "Subject Field Marking" in [PSPF: Sensitive and classified information - Annex F (email clarifications)](https://www.protectivesecurity.gov.au/system/files/2023-08/annex-f-policy-8-classification-system-pspf.pdf) +See [6.1. Subject Field Marking](https://www.protectivesecurity.gov.au/system/files/2024-10/australian-government-email-protective-marking-standard.pdf#page=5) > In this syntax, the protective marking is placed in the subject field of the message (RFC5322 ‘Subject’). As per -> RFC5322, an Internet email message can have at most one subject field. Allowing for no more than one email protective -> marking in the subject line minimises confusion and potential conflict. +> RFC5322, an Internet email message can have at most one subject field. Allowing for no more than one email +> protective marking in the subject line minimises confusion and potential conflict. > > A Subject Field Marking is less sophisticated than an Internet Message Header Extension as it is possible to -> manipulate an email’s subject during message generation or transport. However, it is easy to apply as a human -> user can construct (and interpret) the protective marking without the need for additional tools. - +> manipulate an email’s subject during message generation or transport. However, it is easy to apply as a human user +> can construct (and interpret) the protective marking without the need for additional tools. ### Minimum content @@ -117,17 +114,16 @@ Results in: Converts a protected marking to text that should be added as the value opf the `X-Protective-Marking` email header. -See "Internet Message Header Extension" in [PSPF: Sensitive and classified information - Annex F (email clarifications)](https://www.protectivesecurity.gov.au/system/files/2022-12/annex-f-pspf-policy8-sensitive-and-classified-information.pdf) +See [6.2. Internet Message Header Extension ](https://www.protectivesecurity.gov.au/system/files/2024-10/australian-government-email-protective-marking-standard.pdf#page=5) > In this syntax, the protective marking is carried as a custom Internet Message Header Extension -> ‘X-Protective-Marking’. Allowing for no more than one ‘X-Protective-Marking’ field minimises confusion and potential -> conflict. +> ‘X-Protective-Marking’. Allowing for no more than one ‘X-Protective-Marking’ field minimises confusion and +> potential conflict. > > Using an Internet Message Header Extension is more sophisticated than a Subject Field Marking. It is designed for -> construction and parsing by email agents (clients, gateways and servers) as they have accessto internet message +> construction and parsing by email agents (clients, gateways and servers) as they have access to internet message > headers. In this way a richer syntax can be used and email agents can perform more complex handling based on -> the protective marking - +> the protective marking. ### Minimum content @@ -148,7 +144,7 @@ Results in: ```txt -VER=2018.4, NS=gov.au, SEC=TOP-SECRET +VER=2024.1, NS=gov.au, SEC=TOP-SECRET ``` snippet source | anchor @@ -189,7 +185,7 @@ Results in: ```txt -VER=2018.4, NS=gov.au, SEC=TOP-SECRET, CAVEAT=C:LOBSTER, CAVEAT=FG:USA caveat, CAVEAT=RI:AGAO, CAVEAT=SH:EXCLUSIVE-FOR person, CAVEAT=RI:REL AFG, EXPIRES=2020-10-01, DOWNTO=OFFICIAL, ACCESS=Legal-Privilege, NOTE=the comments, ORIGIN=a@b.com +VER=2024.1, NS=gov.au, SEC=TOP-SECRET, CAVEAT=C:LOBSTER, CAVEAT=FG:USA caveat, CAVEAT=RI:AGAO, CAVEAT=SH:EXCLUSIVE-FOR person, CAVEAT=RI:REL AFG, EXPIRES=2020-10-01, DOWNTO=OFFICIAL, ACCESS=Legal-Privilege, NOTE=the comments, ORIGIN=a@b.com ``` snippet source | anchor @@ -233,7 +229,7 @@ Results in: To: to@mail.com, Subject: The subject [SEC=TOP-SECRET, CAVEAT=SH:CABINET, CAVEAT=RI:REL AFG, ACCESS=Legal-Privilege], Headers: { - X-Protective-Marking: VER=2018.4, NS=gov.au, SEC=TOP-SECRET, CAVEAT=SH:CABINET, CAVEAT=RI:REL AFG, ACCESS=Legal-Privilege + X-Protective-Marking: VER=2024.1, NS=gov.au, SEC=TOP-SECRET, CAVEAT=SH:CABINET, CAVEAT=RI:REL AFG, ACCESS=Legal-Privilege }, IsBodyHtml: false, Body: The body @@ -339,7 +335,7 @@ var protectiveMarking = Parser.ParseProtectiveMarking("SEC=OFFICIAL:Sensitive"); ```cs -var protectiveMarking = Parser.ParseProtectiveMarking("VER=2018.4, NS=gov.au, SEC=TOP-SECRET, CAVEAT=C:CodeWord, CAVEAT=FG:USA caveat, CAVEAT=RI:AGAO, CAVEAT=SH:CABINET, CAVEAT=SH:EXCLUSIVE-FOR person, CAVEAT=RI:REL AFG/DZA, EXPIRES=2020-10-01, DOWNTO=OFFICIAL, ACCESS=Legal-Privilege, NOTE=the comments, ORIGIN=a@b.com"); +var protectiveMarking = Parser.ParseProtectiveMarking("VER=2024.1, NS=gov.au, SEC=TOP-SECRET, CAVEAT=C:CodeWord, CAVEAT=FG:USA caveat, CAVEAT=RI:AGAO, CAVEAT=SH:CABINET, CAVEAT=SH:EXCLUSIVE-FOR person, CAVEAT=RI:REL AFG/DZA, EXPIRES=2020-10-01, DOWNTO=OFFICIAL, ACCESS=Legal-Privilege, NOTE=the comments, ORIGIN=a@b.com"); ``` snippet source | anchor @@ -391,7 +387,7 @@ For readability, newlines are allowed to delineate key value pairs: ```cs var protectiveMarking = Parser.ParseProtectiveMarking( """ - VER=2018.4, + VER=2024.1, NS=gov.au, SEC=TOP-SECRET, CAVEAT=C:CodeWord, diff --git a/src/AustralianProtectiveMarkings/Renderer_Email.cs b/src/AustralianProtectiveMarkings/Renderer_Email.cs index 22a32bd..ea89069 100644 --- a/src/AustralianProtectiveMarkings/Renderer_Email.cs +++ b/src/AustralianProtectiveMarkings/Renderer_Email.cs @@ -16,7 +16,7 @@ public static string RenderEmailSubjectSuffix(this ProtectiveMarking marking) public static string RenderEmailHeader(this ProtectiveMarking marking) { - var builder = new StringBuilder("VER=2018.4, NS=gov.au, "); + var builder = new StringBuilder("VER=2024.1, NS=gov.au, "); RenderMailClassification(marking, builder); RenderMailCaveats(marking, builder); RenderMailExpiry(marking, builder); diff --git a/src/Tests/MailMessageHelperTests.ApplyProtectiveMarkings.verified.txt b/src/Tests/MailMessageHelperTests.ApplyProtectiveMarkings.verified.txt index 6337e3e..2775bee 100644 --- a/src/Tests/MailMessageHelperTests.ApplyProtectiveMarkings.verified.txt +++ b/src/Tests/MailMessageHelperTests.ApplyProtectiveMarkings.verified.txt @@ -3,7 +3,7 @@ To: to@mail.com, Subject: The subject [SEC=TOP-SECRET], Headers: { - X-Protective-Marking: VER=2018.4, NS=gov.au, SEC=TOP-SECRET + X-Protective-Marking: VER=2024.1, NS=gov.au, SEC=TOP-SECRET }, IsBodyHtml: false, Body: The body diff --git a/src/Tests/OfficeDocHelperTests.Patch.verified.txt b/src/Tests/OfficeDocHelperTests.Patch.verified.txt index f06c8fd..bf0ff38 100644 --- a/src/Tests/OfficeDocHelperTests.Patch.verified.txt +++ b/src/Tests/OfficeDocHelperTests.Patch.verified.txt @@ -1,12 +1,12 @@ { Tests.docs.correctProps.docx: -VER=2018.4, NS=gov.au, SEC=PROTECTED, +VER=2024.1, NS=gov.au, SEC=PROTECTED, Tests.docs.noProps.docx: -VER=2018.4, NS=gov.au, SEC=PROTECTED, +VER=2024.1, NS=gov.au, SEC=PROTECTED, Tests.docs.sample.pptx: -VER=2018.4, NS=gov.au, SEC=PROTECTED, +VER=2024.1, NS=gov.au, SEC=PROTECTED, Tests.docs.sample.xlsx: -VER=2018.4, NS=gov.au, SEC=PROTECTED, +VER=2024.1, NS=gov.au, SEC=PROTECTED, Tests.docs.withProps.docx: -VER=2018.4, NS=gov.au, SEC=PROTECTED +VER=2024.1, NS=gov.au, SEC=PROTECTED } \ No newline at end of file diff --git a/src/Tests/ParserTests.Simple.verified.txt b/src/Tests/ParserTests.Simple.verified.txt index 36f45ff..2177832 100644 --- a/src/Tests/ParserTests.Simple.verified.txt +++ b/src/Tests/ParserTests.Simple.verified.txt @@ -182,13 +182,13 @@ TOPSECRET: TopSecret, Unofficial: Unofficial, UNOFFICIAL: Unofficial, - VER=2018.4: { + VER=2024.1: { Type: Exception, - Message: A single security 'SEC' must be defined. Input: VER=2018.4 + Message: A single security 'SEC' must be defined. Input: VER=2024.1 }, - VER=2018.4, NS=gov.au: { + VER=2024.1, NS=gov.au: { Type: Exception, - Message: A single security 'SEC' must be defined. Input: VER=2018.4, NS=gov.au + Message: A single security 'SEC' must be defined. Input: VER=2024.1, NS=gov.au }, - VER=2018.4, NS=gov.au, SEC=TOP-SECRET: TopSecret + VER=2024.1, NS=gov.au, SEC=TOP-SECRET: TopSecret } \ No newline at end of file diff --git a/src/Tests/ParserTests.cs b/src/Tests/ParserTests.cs index 453cb5e..48f1d76 100644 --- a/src/Tests/ParserTests.cs +++ b/src/Tests/ParserTests.cs @@ -6,9 +6,9 @@ public Task Simple() { var list = new List { - "VER=2018.4", - "VER=2018.4, NS=gov.au", - "VER=2018.4, NS=gov.au, SEC=TOP-SECRET", + "VER=2024.1", + "VER=2024.1, NS=gov.au", + "VER=2024.1, NS=gov.au, SEC=TOP-SECRET", "SEC=TOP-SECRET", "SEC= TOP-SECRET", "SEC=OFFICIAL:Sensitive", diff --git a/src/Tests/RendererTests.RenderEmailHeader.verified.txt b/src/Tests/RendererTests.RenderEmailHeader.verified.txt index 9bdd14d..148db70 100644 --- a/src/Tests/RendererTests.RenderEmailHeader.verified.txt +++ b/src/Tests/RendererTests.RenderEmailHeader.verified.txt @@ -1 +1 @@ -VER=2018.4, NS=gov.au, SEC=TOP-SECRET, CAVEAT=C:LOBSTER, CAVEAT=FG:usa caveat, CAVEAT=RI:AGAO, CAVEAT=SH:CABINET, CAVEAT=SH:EXCLUSIVE-FOR person, CAVEAT=RI:REL AFG/DZA, EXPIRES=2020-10-01, DOWNTO=OFFICIAL, ACCESS=Legal-Privilege, NOTE=the comments, ORIGIN=a@b.com \ No newline at end of file +VER=2024.1, NS=gov.au, SEC=TOP-SECRET, CAVEAT=C:LOBSTER, CAVEAT=FG:usa caveat, CAVEAT=RI:AGAO, CAVEAT=SH:CABINET, CAVEAT=SH:EXCLUSIVE-FOR person, CAVEAT=RI:REL AFG/DZA, EXPIRES=2020-10-01, DOWNTO=OFFICIAL, ACCESS=Legal-Privilege, NOTE=the comments, ORIGIN=a@b.com \ No newline at end of file diff --git a/src/Tests/RendererTests.RenderEmailHeaderGenDateWithTicks.verified.txt b/src/Tests/RendererTests.RenderEmailHeaderGenDateWithTicks.verified.txt index f93d97c..dffb2e0 100644 --- a/src/Tests/RendererTests.RenderEmailHeaderGenDateWithTicks.verified.txt +++ b/src/Tests/RendererTests.RenderEmailHeaderGenDateWithTicks.verified.txt @@ -1 +1 @@ -VER=2018.4, NS=gov.au, SEC=SECRET, EXPIRES=2020-10-01T00:00:00.0000001, DOWNTO=OFFICIAL \ No newline at end of file +VER=2024.1, NS=gov.au, SEC=SECRET, EXPIRES=2020-10-01T00:00:00.0000001, DOWNTO=OFFICIAL \ No newline at end of file diff --git a/src/Tests/RendererTests.RenderEmailHeaderMin.verified.txt b/src/Tests/RendererTests.RenderEmailHeaderMin.verified.txt index 674d65d..f225367 100644 --- a/src/Tests/RendererTests.RenderEmailHeaderMin.verified.txt +++ b/src/Tests/RendererTests.RenderEmailHeaderMin.verified.txt @@ -1 +1 @@ -VER=2018.4, NS=gov.au, SEC=SECRET \ No newline at end of file +VER=2024.1, NS=gov.au, SEC=SECRET \ No newline at end of file diff --git a/src/Tests/Samples.ApplyProtectiveMarkings.verified.txt b/src/Tests/Samples.ApplyProtectiveMarkings.verified.txt index 7b58896..6a80117 100644 --- a/src/Tests/Samples.ApplyProtectiveMarkings.verified.txt +++ b/src/Tests/Samples.ApplyProtectiveMarkings.verified.txt @@ -3,7 +3,7 @@ To: to@mail.com, Subject: The subject [SEC=TOP-SECRET, CAVEAT=SH:CABINET, CAVEAT=RI:REL AFG, ACCESS=Legal-Privilege], Headers: { - X-Protective-Marking: VER=2018.4, NS=gov.au, SEC=TOP-SECRET, CAVEAT=SH:CABINET, CAVEAT=RI:REL AFG, ACCESS=Legal-Privilege + X-Protective-Marking: VER=2024.1, NS=gov.au, SEC=TOP-SECRET, CAVEAT=SH:CABINET, CAVEAT=RI:REL AFG, ACCESS=Legal-Privilege }, IsBodyHtml: false, Body: The body diff --git a/src/Tests/Samples.RenderEmailHeaderFull.verified.txt b/src/Tests/Samples.RenderEmailHeaderFull.verified.txt index 0272a5a..ce034de 100644 --- a/src/Tests/Samples.RenderEmailHeaderFull.verified.txt +++ b/src/Tests/Samples.RenderEmailHeaderFull.verified.txt @@ -1 +1 @@ -VER=2018.4, NS=gov.au, SEC=TOP-SECRET, CAVEAT=C:LOBSTER, CAVEAT=FG:USA caveat, CAVEAT=RI:AGAO, CAVEAT=SH:EXCLUSIVE-FOR person, CAVEAT=RI:REL AFG, EXPIRES=2020-10-01, DOWNTO=OFFICIAL, ACCESS=Legal-Privilege, NOTE=the comments, ORIGIN=a@b.com \ No newline at end of file +VER=2024.1, NS=gov.au, SEC=TOP-SECRET, CAVEAT=C:LOBSTER, CAVEAT=FG:USA caveat, CAVEAT=RI:AGAO, CAVEAT=SH:EXCLUSIVE-FOR person, CAVEAT=RI:REL AFG, EXPIRES=2020-10-01, DOWNTO=OFFICIAL, ACCESS=Legal-Privilege, NOTE=the comments, ORIGIN=a@b.com \ No newline at end of file diff --git a/src/Tests/Samples.RenderEmailHeaderMinimum.verified.txt b/src/Tests/Samples.RenderEmailHeaderMinimum.verified.txt index 6466e01..2012d7b 100644 --- a/src/Tests/Samples.RenderEmailHeaderMinimum.verified.txt +++ b/src/Tests/Samples.RenderEmailHeaderMinimum.verified.txt @@ -1 +1 @@ -VER=2018.4, NS=gov.au, SEC=TOP-SECRET \ No newline at end of file +VER=2024.1, NS=gov.au, SEC=TOP-SECRET \ No newline at end of file diff --git a/src/Tests/Samples.cs b/src/Tests/Samples.cs index 3728408..4788c7d 100644 --- a/src/Tests/Samples.cs +++ b/src/Tests/Samples.cs @@ -137,7 +137,7 @@ public Task ParseEmailHeaderMinimum() { #region ParseEmailHeaderMinimum - var protectiveMarking = Parser.ParseProtectiveMarking("VER=2018.4, NS=gov.au, SEC=OFFICIAL:Sensitive"); + var protectiveMarking = Parser.ParseProtectiveMarking("VER=2024.1, NS=gov.au, SEC=OFFICIAL:Sensitive"); #endregion @@ -177,7 +177,7 @@ public Task ParseEmailHeaderFull() { #region ParseEmailHeaderFull - var protectiveMarking = Parser.ParseProtectiveMarking("VER=2018.4, NS=gov.au, SEC=TOP-SECRET, CAVEAT=C:CodeWord, CAVEAT=FG:USA caveat, CAVEAT=RI:AGAO, CAVEAT=SH:CABINET, CAVEAT=SH:EXCLUSIVE-FOR person, CAVEAT=RI:REL AFG/DZA, EXPIRES=2020-10-01, DOWNTO=OFFICIAL, ACCESS=Legal-Privilege, NOTE=the comments, ORIGIN=a@b.com"); + var protectiveMarking = Parser.ParseProtectiveMarking("VER=2024.1, NS=gov.au, SEC=TOP-SECRET, CAVEAT=C:CodeWord, CAVEAT=FG:USA caveat, CAVEAT=RI:AGAO, CAVEAT=SH:CABINET, CAVEAT=SH:EXCLUSIVE-FOR person, CAVEAT=RI:REL AFG/DZA, EXPIRES=2020-10-01, DOWNTO=OFFICIAL, ACCESS=Legal-Privilege, NOTE=the comments, ORIGIN=a@b.com"); #endregion @@ -217,7 +217,7 @@ public Task ParseEmailHeaderFullNewlines() var protectiveMarking = Parser.ParseProtectiveMarking( """ - VER=2018.4, + VER=2024.1, NS=gov.au, SEC=TOP-SECRET, CAVEAT=C:CodeWord,