diff --git a/requirements.txt b/requirements.txt index dc16312..6f457e0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -# switch back to a released version of compliance-trestle once the jinja tags work is merged and released -compliance-trestle @ git+https://github.com/gsa-tts/compliance-trestle.git@77a6d5d0 +# switch back to a released version of compliance-trestle once the jinja filters/plugins work is merged and released +compliance-trestle @ git+https://github.com/gsa-tts/compliance-trestle.git@576c4369 compliance-trestle-gsa @ git+https://github.com/GSA-TTS/compliance-trestle-gsa.git@39ce4167 diff --git a/templates/ssp-rendering/lato/templates/approvals.md b/templates/ssp-rendering/lato/templates/approvals.md index b4c3d41..b23aaeb 100644 --- a/templates/ssp-rendering/lato/templates/approvals.md +++ b/templates/ssp-rendering/lato/templates/approvals.md @@ -1,49 +1,35 @@ # Approvals -**System Owner** +## System Owner




-{% set owners = ssp_interface.get_parties_for_role(ssp.system_characteristics.responsible_parties, "system-owner") | list %} -{% if owners | count > 0 %} -{{ owners[0].name }} -{% else %} -[Name] -{% endif %} +{% set owner = ssp.system_characteristics.responsible_parties | parties_for_role("system-owner", ssp) | first_or_none %} +{{ owner.name | default('[Name]') }}
System Owner -**Information System Security Officer** +## Information System Security Officer




-{% set isso = ssp_interface.get_parties_for_role(ssp.system_characteristics.responsible_parties, "information-system-security-officer") | list %} -{% if isso | count > 0 %} -{{ isso[0].name }} -{% else %} -[Name] -{% endif %} +{% set isso = ssp.system_characteristics.responsible_parties | parties_for_role("information-system-security-officer", ssp) | first_or_none %} +{{ isso.name | default('[Name]') }}
Information System Security Officer -**Information System Security Manager** +## Information System Security Manager




-{% set issm = ssp_interface.get_parties_for_role(ssp.system_characteristics.responsible_parties, "information-system-security-manager") | list %} -{% if issm | count > 0 %} -{{ issm[0].name }} -{% else %} -[Name] -{% endif %} +{% set issm = ssp.system_characteristics.responsible_parties | parties_for_role("information-system-security-manager", ssp) | first_or_none %} +{{ issm.name | default('[Name]') }}
Information System Security Manager - -
diff --git a/templates/ssp-rendering/lato/templates/frontmatter.md b/templates/ssp-rendering/lato/templates/frontmatter.md index 919c760..e460f20 100644 --- a/templates/ssp-rendering/lato/templates/frontmatter.md +++ b/templates/ssp-rendering/lato/templates/frontmatter.md @@ -1,5 +1,3 @@ -
- # U.S. General Services Administration # {{ ssp.system_characteristics.system_name }} ({{ ssp.system_characteristics.system_name_short }}) @@ -9,42 +7,27 @@ ![GSAIT Logo](./img/gsa_it_logo.png) -
- -
+## Document Prepared By +{% for party in ssp.metadata.responsible_parties | parties_for_role("prepared-by", ssp) %} -Document Prepared By - - -{% for party in ssp_interface.get_parties_for_role(ssp.metadata.responsible_parties, "prepared-by") %} - - - - -{% set address = ssp_interface.first_array_entry(party.addresses) %} -{% set addr_lines = ssp_interface.safe_retrieval(address, "addr_lines", []) %} - - - - - - - - +| | | +| - | - | +| **{{ party.type.value | title }} Name** | {{ party.name }} | +{% set address = party.addresses | first_or_none %} +{% for addr_line in address.addr_lines | as_list %} +| **Address Line {{ loop.index }}** | {{ addr_line }} | +{% endfor %} +{% if address %} +| **City, State Zip** | {{ address.city }}, {{ address.state }} {{ address.postal_code }} | +{% endif %} {% endfor %} - -
{{ party.type.value.title() }} Name{{ party.name }}
Address Line 1{{ addr_lines[0] }}
Address Line 2{{ addr_lines[1] }}
City, State Zip{{ ssp_interface.safe_retrieval(address, "city") }}, {{ ssp_interface.safe_retrieval(address, "state") }} {{ ssp_interface.safe_retrieval(address, "postal_code") }}
- -
-Document Revision History +## Document Revision History -{% set prepared_by = ssp_interface.first_array_entry(ssp_interface.get_parties_for_role(ssp.metadata.responsible_parties, "prepared-by")) %} +{% set prepared_by = ssp.metadata.responsible_parties | parties_for_role("prepared-by", ssp) | first_or_none %} | Date | Comments | Version | Author | | ---- | -------- | ------- | ------ | -{% for revision in ssp_interface.safe_retrieval(ssp.metadata, 'revisions', []) %} -{% set revision_prepared_by = ssp_interface.get_party_by_uuid(control_interface.get_prop(revision, 'prepared-by')) or prepared_by %} +{% for revision in ssp.metadata.revisions | as_list %} +{% set revision_prepared_by = control_interface.get_prop(revision, "prepared-by") | get_party(ssp) | get_default(prepared_by) %} | {{ revision.last_modified.strftime('%Y-%m-%d') if revision.last_modified else '' }} | {{ revision.title }} | {{ revision.version }} | {{ revision_prepared_by.name }} | {% endfor %} - -
diff --git a/templates/ssp-rendering/lato/templates/gsa_template.md.jinja b/templates/ssp-rendering/lato/templates/gsa_template.md.jinja index 5d3c60d..90da9a0 100644 --- a/templates/ssp-rendering/lato/templates/gsa_template.md.jinja +++ b/templates/ssp-rendering/lato/templates/gsa_template.md.jinja @@ -1,11 +1,3 @@ - - {% md_clean_include 'ssp-render/templates/frontmatter.md' heading_level=1 %} {% md_clean_include 'ssp-render/templates/guidance.md' %} @@ -14,8 +6,6 @@ -
- {% md_clean_include 'ssp-render/templates/approvals.md' heading_level=1 %} {% md_clean_include 'ssp-render/templates/section_1.md' heading_level=1 %} diff --git a/templates/ssp-rendering/lato/templates/partials/poc_contact_table.md b/templates/ssp-rendering/lato/templates/partials/poc_contact_table.md index 1d3ebe7..45862f2 100644 --- a/templates/ssp-rendering/lato/templates/partials/poc_contact_table.md +++ b/templates/ssp-rendering/lato/templates/partials/poc_contact_table.md @@ -1,30 +1,14 @@ - - - - - - - - - -{% set organization = ssp_interface.get_party_by_uuid(ssp_interface.first_array_entry(party.member_of_organizations)) %} - - - - - - - - - - - - -
Name{{ party.name }}
Title{{ control_interface.get_prop(party, 'title') }}
Organization{{ ssp_interface.safe_retrieval(organization, "name") }}
Address -{% if organization and organization.addresses %} -{% set address = ssp_interface.first_array_entry(organization.addresses) %} +{% set organization = party.member_of_organizations | first_or_none | get_party(ssp) %} +{% set address = organization.addresses | first_or_none %} +| | | +| - | - | +| **Name** | {{ party.name }} | +| **Title** | {{ control_interface.get_prop(party, 'title') }} | +| **Organization** | {{ organization.name }} | {% if address %} -{{ ssp_interface.safe_retrieval(address, 'addr_lines', []) | join(' ') }} {{ address.city }}, {{ address.state }} {{ address.postal_code }} +| **Address** | {{ address.addr_lines | as_list | join(' ') }} {{ address.city }}, {{ address.state }} {{ address.postal_code }} | +{% else %} +| **Address** | | {% endif %} -{% endif %} -
Phone Number{{ ssp_interface.first_array_entry(party.telephone_numbers, "number") }}
Email Address{{ ssp_interface.first_array_entry(party.email_addresses, "__root__") }}
+| **Phone Number** | {{ (party.telephone_numbers | first_or_none).number }} | +| **Email Address** | {{ (party.email_addresses | first_or_none).__root__ }} | diff --git a/templates/ssp-rendering/lato/templates/section_10.md b/templates/ssp-rendering/lato/templates/section_10.md index d5d55af..faa2edc 100644 --- a/templates/ssp-rendering/lato/templates/section_10.md +++ b/templates/ssp-rendering/lato/templates/section_10.md @@ -35,8 +35,8 @@ Ensure the following elements are incorporated into the data flow diagrams and n The Data Flow Diagram (DFD) below maps out the flow of information traveling within an information system and between infrormation systems. -{% for diagram in ssp_interface.safe_retrieval(ssp.system_characteristics.data_flow, 'diagrams', []) %} -![{{diagram.caption}}]({{ ssp_interface.get_diagram_href(diagram) }}) +{% for diagram in ssp.system_characteristics.data_flow.diagrams | as_list %} +![{{diagram.caption}}]({{ diagram | diagram_href }})
Figure 10-{{loop.index}}. Data Flow Diagram {% endfor %} diff --git a/templates/ssp-rendering/lato/templates/section_3.md b/templates/ssp-rendering/lato/templates/section_3.md index b987e70..20d5d63 100644 --- a/templates/ssp-rendering/lato/templates/section_3.md +++ b/templates/ssp-rendering/lato/templates/section_3.md @@ -2,6 +2,6 @@ The following individual is identified as the System Owner for this system. -{% for party in ssp_interface.get_parties_for_role(ssp.system_characteristics.responsible_parties, "system-owner") %} +{% for party in ssp.system_characteristics.responsible_parties | parties_for_role("system-owner", ssp) %} {% include "ssp-render/templates/partials/poc_contact_table.md" +%} {% endfor +%} diff --git a/templates/ssp-rendering/lato/templates/section_4.md b/templates/ssp-rendering/lato/templates/section_4.md index 41c6b44..3bc587a 100644 --- a/templates/ssp-rendering/lato/templates/section_4.md +++ b/templates/ssp-rendering/lato/templates/section_4.md @@ -2,6 +2,6 @@ The Authorizing Official (AO) for this information system is identified below. -{% for party in ssp_interface.get_parties_for_role(ssp.system_characteristics.responsible_parties, "authorizing-official") %} +{% for party in ssp.system_characteristics.responsible_parties | parties_for_role("authorizing-official", ssp) %} {% include "ssp-render/templates/partials/poc_contact_table.md" +%} {% endfor +%} diff --git a/templates/ssp-rendering/lato/templates/section_5.md b/templates/ssp-rendering/lato/templates/section_5.md index cf3c7a8..24ad8d7 100644 --- a/templates/ssp-rendering/lato/templates/section_5.md +++ b/templates/ssp-rendering/lato/templates/section_5.md @@ -2,12 +2,12 @@ The Information System Security Manager (ISSM) has been appointed and is identified below. -{% for party in ssp_interface.get_parties_for_role(ssp.system_characteristics.responsible_parties, "information-system-security-manager") %} +{% for party in ssp.system_characteristics.responsible_parties | parties_for_role("information-system-security-manager", ssp) %} {% include "ssp-render/templates/partials/poc_contact_table.md" +%} {% endfor +%} The Information System Security Officer (ISSO) has been appointed and is identified below. -{% for party in ssp_interface.get_parties_for_role(ssp.system_characteristics.responsible_parties, "information-system-security-officer") %} +{% for party in ssp.system_characteristics.responsible_parties | parties_for_role("information-system-security-officer", ssp) %} {% include "ssp-render/templates/partials/poc_contact_table.md" +%} {% endfor +%} diff --git a/templates/ssp-rendering/lato/templates/section_6.md b/templates/ssp-rendering/lato/templates/section_6.md index 3527881..897a91d 100644 --- a/templates/ssp-rendering/lato/templates/section_6.md +++ b/templates/ssp-rendering/lato/templates/section_6.md @@ -2,6 +2,6 @@ The individual(s) identified below possess in-depth knowledge of this system and/or its functions and operation. -{% for party in ssp_interface.get_parties_for_role(ssp.system_characteristics.responsible_parties, "system-poc-technical") %} +{% for party in ssp.system_characteristics.responsible_parties | parties_for_role("system-poc-technical", ssp) %} {% include "ssp-render/templates/partials/poc_contact_table.md" +%} {% endfor +%} diff --git a/templates/ssp-rendering/lato/templates/section_9.md b/templates/ssp-rendering/lato/templates/section_9.md index 41f2e14..8c90b7f 100644 --- a/templates/ssp-rendering/lato/templates/section_9.md +++ b/templates/ssp-rendering/lato/templates/section_9.md @@ -59,7 +59,7 @@ The network architecture must follow the criteria listed in CIO-IT Security-19-9 The following architectural diagram provides a visual depiction of the major hardware components of the {{ ssp.system_characteristics.system_name_short }}. -{% for diagram in ssp_interface.safe_retrieval(ssp.system_characteristics.authorization_boundary, 'diagrams', []) %} -![{{diagram.caption}}]({{ ssp_interface.get_diagram_href(diagram) }}) +{% for diagram in ssp.system_characteristics.authorization_boundary.diagrams | as_list %} +![{{diagram.caption}}]({{ diagram | diagram_href }})
Figure 9-{{loop.index}}. Network Diagram {% endfor %}