Skip to content

Instantly share code, notes, and snippets.

View ohsh6o's full-sized avatar
✈️
As of 5 November 2021, I am no longer a contractor in GSA 10x or other projects.

Alexander Stein (Inactive) ohsh6o

✈️
As of 5 November 2021, I am no longer a contractor in GSA 10x or other projects.
View GitHub Profile
@ohsh6o
ohsh6o / rules.html
Created August 13, 2021 21:02
FedRAMP Validation Business Rules
<!DOCTYPE HTML>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>FedRAMP Validation Logic</title><style>caption { font-weight: bold; font-size: large; } thead tr { background-color: #e0e0e0; color: inherit; } thead th { vertical-align: bottom; text-align: left; white-space: normal; } thead td { } tbody tr { vertical-align: top; } tbody th { text-align: left; background-color: #e8e8e8; color: inherit; } tbody tr { background-color: #f0f0f0; color: inherit; } code code { color: inherit; } .highlight { background-color: powderblue; } .highlight-missed { background-color: yellow; } .missing { background-color: orange; } .NB { background-color: thistle; } .FedRAMP-ns { background-color: chartreuse; } .context-item { font-variant: small-caps; } .role-error, .role-fatal { color: red; } .role-warning { color: orange; } blockquote { background: #f9f9f9; border-left: 10px solid #ccc; margin: 1.5em 10px; padding: 0.5em 10px; quotes: "\201C" "\201D" "\2018" "\2019"; width: 50%; } *[ti
@ohsh6o
ohsh6o / gist:644ee4729d9765c2865d61b20a276c68
Created July 23, 2021 01:47
Sample SSP with Dataset Versioning
<?xml version="1.0" encoding="UTF-8"?>
<!--This document used file:/Users/astein/Code/fedramp-automation/dist/content/baselines/rev4/xml/FedRAMP_rev4_LOW-baseline-resolved-profile_catalog.xml as the input.-->
<!--This document used file:/Users/astein/Code/sample-ssp.xsl as the transform.-->
<?xml-model href="https://raw.githubusercontent.com/usnistgov/OSCAL/release-1.0/xml/schema/oscal_complete_schema.xsd" schematypens="http://www.w3.org/2001/XMLSchema" title="OSCAL complete schema"?>
<!--<?xml-model href="file:/Users/gapinski/branches/fedramp-automation/resources/validations/src/ssp.sch" schematypens="http://purl.oclc.org/dsdl/schematron" title="FedRAMP SSP constraints"?>-->
<system-security-plan xmlns="http://csrc.nist.gov/ns/oscal/1.0"
uuid="670fef84-0f43-43cc-b5b9-db779a22a12f">
<metadata>
<title>DRAFT, SAMPLE FedRAMP Rev 4 Low Baseline System Security Plan</title>
<last-modified>2021-07-22T21:46:27.404-04:00</last-modified>
@ohsh6o
ohsh6o / sample_ssp_202107141312.xml
Created July 15, 2021 19:31
Example SSP from 10x ASAP SSP Generator Tool
<?xml version="1.0" encoding="UTF-8"?>
<!--This document used file:/Users/astein/Code/fedramp-automation/baselines/rev4/xml/FedRAMP_rev4_MODERATE-baseline-resolved-profile_catalog.xml as the input.-->
<!--This document used file:/Users/astein/Code/sample-ssp.xsl as the transform.-->
<?xml-model href="https://raw.githubusercontent.com/usnistgov/OSCAL/release-1.0/xml/schema/oscal_complete_schema.xsd" schematypens="http://www.w3.org/2001/XMLSchema" title="OSCAL complete schema"?>
<!--<?xml-model href="file:/Users/gapinski/branches/fedramp-automation/resources/validations/src/ssp.sch" schematypens="http://purl.oclc.org/dsdl/schematron" title="FedRAMP SSP constraints"?>-->
<system-security-plan xmlns="http://csrc.nist.gov/ns/oscal/1.0"
uuid="f735e812-cbe7-4580-ab58-eb1e6b866f0e">
<metadata>
<title>DRAFT, SAMPLE FedRAMP Rev 4 Moderate Baseline System Security Plan</title>
<last-modified>2021-07-14T09:10:56.63-04:00</last-modified>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Modified by the OSCAL 1.0.0 RC1 to OSCAL 1.0.0 RC2 conversion XSLT on 2021-06-15T18:40:33.75-04:00 -->
<system-security-plan xmlns="http://csrc.nist.gov/ns/oscal/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://raw.githubusercontent.com/usnistgov/OSCAL/master/xml/schema/oscal_ssp_schema.xsd"
uuid="ddc99783-7ec1-40a1-83a9-b2d1ef194787">
<metadata>
<title>FedRAMP System Security Plan (SSP)</title>
<published>2020-07-01T00:00:00.00-04:00</published>
<last-modified>2021-06-15T18:40:33.75-04:00</last-modified>
@ohsh6o
ohsh6o / rules.html
Last active June 30, 2021 15:24
FedRAMP Rules Mapping
<!DOCTYPE HTML>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>FedRAMP Rules and Validation Logic</title><style>caption { font-weight: bold; font-size: large; } thead tr { background-color: #e0e0e0; color: inherit; } thead th { vertical-align: bottom; text-align: left; white-space: normal; } thead td { } tbody tr { vertical-align: top; } tbody th { text-align: left; background-color: #e8e8e8; color: inherit; } tbody tr { background-color: #f0f0f0; color: inherit; } code code { color: inherit; } .highlight { background-color: powderblue; } .highlight-missed { background-color: yellow; } .missing { background-color: orange; } .NB { background-color: thistle; } .FedRAMP-ns { background-color: chartreuse; } .context-item { font-variant: small-caps; } .role-error, .role-fatal { color: red; } .role-warning { color: orange; } blockquote { background: #f9f9f9; border-left: 10px solid #ccc; margin: 1.5em 10px; padding: 0.5em 10px; quotes: "\201C" "\201D" "\2018" "\2019"; width: 5
@ohsh6o
ohsh6o / media-types.xql
Created June 9, 2021 14:55
Filtered IANA Registry File Type Listing
xquery version "3.1";
declare namespace iana="http://www.iana.org/assignments";
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
declare option output:method "text";
declare option output:item-separator "&#xa;";
let $registry := doc("https://www.iana.org/assignments/media-types/media-types.xml")/iana:registry
@ohsh6o
ohsh6o / FedRAMP-SSP-OSCAL-Template.xml__ssp.m3.results.xml
Created December 23, 2020 04:10
FedRAMP Automation Schematron Validation Against M3 and RC1 Models
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<svrl:schematron-output xmlns:f="https://fedramp.gov/ns/oscal"
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
xmlns:lv="local-validations"
xmlns:o="http://csrc.nist.gov/ns/oscal/1.0"
xmlns:oscal="http://csrc.nist.gov/ns/oscal/1.0"
xmlns:saxon="http://saxon.sf.net/"
xmlns:schold="http://www.ascc.net/xml/schematron"
xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
@ohsh6o
ohsh6o / FedRAMP-SSP-OSCAL-Template.xml
Last active August 16, 2023 01:00
FedRAMP SSP Schematron Prototyping
<?xml version="1.0" encoding="UTF-8"?>
<system-security-plan xmlns="http://csrc.nist.gov/ns/oscal/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://raw.githubusercontent.com/usnistgov/OSCAL/master/xml/schema/oscal_ssp_schema.xsd"
uuid="2fa78e07-74ef-4cd6-8124-bc0050c0c4df">
<metadata>
<title>FedRAMP System Security Plan (SSP)</title>
<published>2020-07-01T00:00:00.00-04:00</published>
<last-modified>2020-07-01T00:00:00.00-04:00</last-modified>
<version>0.0</version>
@ohsh6o
ohsh6o / basic.py
Last active October 6, 2020 19:08
Schematron Example from stackoverflow.com/q/27150214
from io import StringIO
from lxml import isoschematron
from lxml import etree
def main():
# Example adapted from http://lxml.de/validation.html#id2
# Schema
f = StringIO('''\
<schema xmlns="http://purl.oclc.org/dsdl/schematron" >