Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapper Creation Course #155

Draft
wants to merge 96 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
f1eb927
Initial dump
charleshu-8 Jun 10, 2024
4d8eb79
Merge branch 'main' into mapperCreationCourse
charleshu-8 Jun 10, 2024
d4c67dd
Intro
charleshu-8 Jun 10, 2024
4c055fe
Merge branch 'mapperCreationCourse' of https://github.com/mitre/saf-t…
charleshu-8 Jun 10, 2024
cb1b7b5
Background
charleshu-8 Jun 10, 2024
073271b
OHDF overview
charleshu-8 Jun 10, 2024
557e1a4
Merge branch 'main' into mapperCreationCourse
charleshu-8 Jun 10, 2024
51b7dc5
Schema break down
charleshu-8 Jun 10, 2024
3c841c1
Merge branch 'mapperCreationCourse' of https://github.com/mitre/saf-t…
charleshu-8 Jun 10, 2024
0a829d8
Minor edit
charleshu-8 Jun 10, 2024
ae998b5
Outlining, clean up pages
charleshu-8 Jun 10, 2024
a2530ce
Minor changes
charleshu-8 Jun 11, 2024
ac90ec4
OHDF section
charleshu-8 Jun 11, 2024
0aa3889
InspecJS
charleshu-8 Jun 11, 2024
0e40b1b
OHDF intro rewrite
charleshu-8 Jun 12, 2024
c1089f4
Mapper section
charleshu-8 Jun 12, 2024
7f25daa
OHDF schema definition
charleshu-8 Jun 12, 2024
129d8da
Img locale change
charleshu-8 Jun 12, 2024
1dd9ee0
Schema definition
charleshu-8 Jun 12, 2024
7312d3d
Required fields
charleshu-8 Jun 12, 2024
24add33
Major syntax/example overhaul
charleshu-8 Jun 13, 2024
c712fe5
Frameworking
charleshu-8 Jun 13, 2024
199f5e2
Part of getting started section
charleshu-8 Jun 13, 2024
dfabf77
Mapper development progress/wip reworks
charleshu-8 Jun 17, 2024
5ea2ffe
Merge branch 'main' into mapperCreationCourse
charleshu-8 Jun 17, 2024
d116569
Schema mapping
charleshu-8 Jun 18, 2024
c3730a1
Minor wording changes
Rlin232 Jun 18, 2024
c6a78d1
Schema mapping finalization
charleshu-8 Jun 19, 2024
c67e02a
Merge branch 'main' into mapperCreationCourse
charleshu-8 Jun 19, 2024
415a984
Mapping update; mapper progress
charleshu-8 Jun 19, 2024
358320b
Clean up; first half of implementation section
charleshu-8 Jun 19, 2024
69071d6
Title changes; adding clarification to concepts
charleshu-8 Jun 19, 2024
40b6460
Clean up
charleshu-8 Jun 19, 2024
8267ec5
Flat mappings
charleshu-8 Jun 19, 2024
4e57b27
Implementation progress; finalization finished
charleshu-8 Jun 20, 2024
9afa72c
Merge branch 'main' into mapperCreationCourse
charleshu-8 Jun 20, 2024
cb8010e
Mapper implementation
charleshu-8 Jun 20, 2024
2020df7
Mapping a Schema - DbProtect
Rlin232 Jun 20, 2024
567ff30
Practice examples
charleshu-8 Jun 20, 2024
7d89612
Merge
charleshu-8 Jun 20, 2024
929bd00
Appendix - SAF CLI
charleshu-8 Jun 21, 2024
0df31e9
Merge branch 'main' into mapperCreationCourse
charleshu-8 Jun 21, 2024
43a1656
Mapping implementation DbProtect
Rlin232 Jun 21, 2024
e975cf0
Proofreading; CVSS
charleshu-8 Jun 21, 2024
0531cbd
Merge branch 'mapperCreationCourse' of https://github.com/mitre/saf-t…
charleshu-8 Jun 21, 2024
e58fefa
Review changes
charleshu-8 Jun 24, 2024
5a5ce41
Added aside sections for 800-53, CCIs, and RMF
Rlin232 Jun 24, 2024
21da7f2
More context for OHDF within the SAF
Rlin232 Jun 24, 2024
ad56537
Added examples for NIST tags and CCIs
Rlin232 Jun 24, 2024
7aa33cb
Formatting, tone alignment
charleshu-8 Jun 24, 2024
9aca003
Review changes
charleshu-8 Jun 24, 2024
b621f18
Review changes
charleshu-8 Jun 25, 2024
e721dc8
Review changes
charleshu-8 Jun 25, 2024
1156432
REview changes
charleshu-8 Jun 25, 2024
c087c9c
Wording changes to what is a mapper
Rlin232 Jun 25, 2024
7164aeb
Merge branch 'main' into mapperCreationCourse
charleshu-8 Jun 25, 2024
8ebbb6c
Included some graphics in the What is OHDF section
Rlin232 Jun 25, 2024
7f2f323
Markdown table addition
charleshu-8 Jun 25, 2024
023991f
Knowledge check
charleshu-8 Jun 25, 2024
c9b3609
Spelling
charleshu-8 Jun 25, 2024
d43abe2
Review change
charleshu-8 Jun 26, 2024
ea5fcb7
Review changes
charleshu-8 Jun 26, 2024
4442af0
Merge branch 'mapperCreationCourse' of https://github.com/mitre/saf-t…
charleshu-8 Jun 26, 2024
4751096
Review changes
charleshu-8 Jun 26, 2024
23a9ccb
Changes to overview section
Rlin232 Jun 26, 2024
3359312
cleanup
Rlin232 Jun 26, 2024
1a6bd61
Review changes
charleshu-8 Jun 26, 2024
5f21877
Merge branch 'mapperCreationCourse' of https://github.com/mitre/saf-t…
charleshu-8 Jun 26, 2024
e812273
Review changes
charleshu-8 Jun 26, 2024
2744ced
Minor wording changes and clarity fixes
Rlin232 Jun 27, 2024
fc9acaa
Review changes
charleshu-8 Jun 27, 2024
34a5240
Merge branch 'mapperCreationCourse' of https://github.com/mitre/saf-t…
charleshu-8 Jun 27, 2024
e02e7cd
Review change
charleshu-8 Jun 27, 2024
c915fa9
Review changes
charleshu-8 Jun 27, 2024
f9cf57e
Merge branch 'main' into mapperCreationCourse
charleshu-8 Jun 27, 2024
694e954
Review changes
charleshu-8 Jun 28, 2024
e61684f
Merge branch 'main' into mapperCreationCourse
aaronlippold Jun 30, 2024
61c51c4
Review changes
charleshu-8 Jul 1, 2024
2e9f581
Merge branch 'mapperCreationCourse' of https://github.com/mitre/saf-t…
charleshu-8 Jul 1, 2024
d6cd118
Merge branch 'main' into mapperCreationCourse
charleshu-8 Jul 2, 2024
2f3704a
Survey
charleshu-8 Aug 1, 2024
7ba2d57
Merge branch 'main' into mapperCreationCourse
charleshu-8 Aug 1, 2024
6b4a6d8
Added Jfrog to mapper demo section
Rlin232 Aug 15, 2024
0a1a97a
SARIF Mapper demo
Rlin232 Aug 15, 2024
c2aac55
Introduction/basics of OHDF mappers rework
charleshu-8 Aug 20, 2024
bbb6a87
Merge branch 'main' into mapperCreationCourse
charleshu-8 Aug 20, 2024
5e277b3
Merge branch 'main' into mapperCreationCourse
charleshu-8 Aug 20, 2024
291bb74
OHDF schema section rework
charleshu-8 Aug 21, 2024
c0e03d4
OHDF Converters rework
charleshu-8 Aug 23, 2024
9514da9
Merge branch 'main' into mapperCreationCourse
charleshu-8 Aug 23, 2024
8945984
Env set up rework
charleshu-8 Aug 23, 2024
dd0d7eb
Merge branch 'main' into mapperCreationCourse
charleshu-8 Nov 18, 2024
ebd3d1d
Merge branch 'main' into mapperCreationCourse
charleshu-8 Nov 24, 2024
0f9b7d3
Update src/courses/mappers/13.md
aaronlippold Dec 2, 2024
1882b69
Update src/courses/mappers/13.md
aaronlippold Dec 2, 2024
dbcf0e0
Merge branch 'main' into mapperCreationCourse
aaronlippold Dec 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/.vuepress/navbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export default navbar([
{ text: "Beginner Security Automation Developer Class", link: "/courses/beginner/", icon: "creative" },
{ text: "Advanced Security Automation Developer Class", link: "/courses/advanced/", icon: "creative" },
{ text: "Security Guidance Developer Class", link: "/courses/guidance/", icon: "creative" },
{ text: "InSpec Profile Development & Testing", link: "/courses/profile-dev-test/", icon: "creative"}
{ text: "InSpec Profile Development & Testing", link: "/courses/profile-dev-test/", icon: "creative"},
{ text: "OHDF Mapper Development Class", link: "/courses/mappers/", icon: "creative"}
]},
{ text: "Resources",
icon: "book",
Expand Down
9 changes: 8 additions & 1 deletion src/.vuepress/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,19 @@ export default sidebar({
children: "structure",
collapsible: true
},
{
{
icon: "creative",
text: "InSpec Profile Development & Testing",
prefix: "courses/profile-dev-test/",
children: "structure",
collapsible: true
},
{
icon: "creative",
text: "OHDF Mapper Development Class",
prefix: "courses/mappers/",
children: "structure",
collapsible: true
},
],
});
3 changes: 3 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ actions:
- text: InSpec Profile Updating & Development
link: /courses/profile-dev-test/
type: primary
- text: OHDF Mapper Development Class
link: /courses/mappers/
type: primary

highlights:
- header: What You Will Learn
Expand Down
91 changes: 91 additions & 0 deletions src/courses/mappers/02.md
charleshu-8 marked this conversation as resolved.
Show resolved Hide resolved
Amndeep7 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
order: 2
next: 03.md
title: OHDF Background
author: Charles Hu
---

## What is OHDF?

OASIS Heimdall Data Format (OHDF) is a security data format used to normalize generated security data exports from various security tools into a single common data format usable by the Security Automation Framework (SAF) tool suite. The format is defined by the [OHDF schema](https://saf.mitre.org/framework/normalize/ohdf-schema) and its goal is to provide a simple and intuitive means for representing security validation profiles, controls, and results.

You can read more about OHDF [here](https://saf.mitre.org/framework/normalize).

### Why OHDF?

- Many security tools do not provide context to relevant compliance standards for comparison across security tools.​
aaronlippold marked this conversation as resolved.
Show resolved Hide resolved
- Security tools typically generate data in unique formats that require multiple dashboards and utilities to process.​
- OHDF reduces the time it takes to process security assessments, data in disparate locations and inconsistent semantics of a data element between formats.​

- OHDF enables:

- Consistent integration, aggregation, and analysis of security data from all available sources.​
- Preserving data integrity with original source data.
- Maximizing interoperability and data sharing.​
- Facilitating the transformation and transport of data between security/management processes or technologies.​
- Allowing for the mapping and enrichment of security data to relevant compliance standards (GDPR, NIST SP 800-53, PCI-DSS, etc.).

## What Is a Mapper?

A mapper is a design pattern used to correlate (or map) items in two different objects with one another. Mappers are useful in that they allow us to connect items in objects that are nominally different but semantically the same. A result of this is that we can easily transform one object type into another through the use of mappings which define the direct relationship of items in each object type.

Here are some scenarios which demonstrate some key aspects of mappers:

::: details Transferring IDs
Say we have to transfer the credentials of an employee who is moving from Business A to Business B. The data formats the businesses use for IDs are as follows:
```
// Business A
{Name, DoB, Age, Title}

// Business B
{employee, employeeBirthday, employeeAge, jobTitle}
```
How do we transfer John's credentials from Business A to Business B?
```
{Name: 'John Doe', DoB: 10-6-1992, Age: 32, Title: 'Security Technician'}
```

What we can do is create a mapping which correlates the items from Business A's ID scheme to Business B's:
```
{employee: Name, employeeBirthday: DoB, employeeAge: Age, jobTitle: Title}
```

With this, we can then develop a mapper which takes John's credentials from Business A and transforms it to Business B's format as so:
```
{Name: 'John Doe', DoB: 10-6-1992, Age: 32, Title: 'Security Technician'}

||
\ /
\/

MAPPER

||
\ /
\/

{employee: 'John Doe', employeeBirthday: 10-6-1992, employeeAge: 32, jobTitle: 'Security Technician'}
```

The important thing to note here is that mappers rely on underlying mappings which match semantically similar fields between two objects. These matches allow us to correctly convert each item in one object to the other.
:::

::: details Translating a foreign language
Say we are given the job to translate the traditional Chinese sentence '我愛貓' into English.

Without knowledge of the language, this is an impossible task.

However, say we now also had a mapper which utilized the following mapping:
```
{'愛': 'love', '我': 'I', '貓': 'cats'}
```

Now this task becomes much more easier. We can apply this mapper which will translate the sentence from '我愛貓' to 'I love cats' and vice versa.

The important thing to note here is that mappers make translating between two objects trivial, which means that anyone can do it and we can automate mappers to perform object conversions for us.
:::


## What Is an OHDF Mapper?

An OHDF mapper is a mapper that allows the underlying conversion infrastructure found in OHDF Converters to correlate certain objects or values from one overarching security data format to another overarching security data format. In the case of the SAF tool suite, these mappers allow for the conversion of some given security service format to HDF (\*-to-HDF) and vice versa (HDF-to-\*) using the tools provided by the existing conversion infrastructure.
195 changes: 195 additions & 0 deletions src/courses/mappers/03.md
Amndeep7 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
---
order: 3
next: 04.md
title: Understanding the OHDF Schema
author: Charles Hu
---

## An Overview of the OHDF Schema

The OHDF schema is designed to provide a simple, structured, and hierarchal view of security validation results. Any file or object that implements the schema can be broken down into a hierarchy of three structures. These structures are:

1) <i>**Profiles**</i>: This structure contains metadata on the scan target of the original security service export and on the run performed by the security tool. <i>Profiles</i> provide a high-level overview of the security service scan and the targeted system, which are formated in a manner which is digestible and immediately accessible to the assessor.

2) <i>**Controls**</i>: Controls are security standards that are used to prevent, mitigate, and address various security risks to sensitive information and infrastructure. In the case of OHDF, the <i>controls</i> structure is a collection of controls tested for by an external security service to ensure that the target complies with vulnerability and weakness prevention standards. Any given <i>profile</i> contains any number of <i>controls</i> which were tested against the target system during the original security service analysis.

3) <i>**Results**</i>: The <i>results</i> structure contains information on the results of specific tests ran by the security service on the scan target against a security control. These results will always correlate to a certain control and will either report `passed` or `failed` to indicate the test status (other statuses exist but are rare) which cumulatively influence the determined compliance level of the scan target for some set of controls. Any given <i>control</i> contains any number of <i>results</i> which reflect the implemented tests to check if the target system is actually compliant with the control.

## Breaking Down the Formal OHDF Schema

::: note Full OHDF Schema
The following section contains a breakdown of a streamlined version of the OHDF schema. For the full and up-to-date version, see [here](https://saf.mitre.org/framework/normalize/ohdf-schema).
:::

We can break down the formal OHDF schema in the same manner as before by observing each structure in the hierarchy from a top-down view.

1) <i>**Profiles**</i>:
```
profiles: [
0: {
name // Name of profile, usually the original security service tool; should be unique
version // Version of security service tool
sha256 // Checksum of the profile; NOTE: AUTOMATICALLY GENERATED BY HDF CONVERTERS, DO NOT POPULATE
title // Title of security service scan; should be human readable
maintainer // Maintainer
summary // Summary of security service export (e.g., the STIG header)
license // Copyright license
copyright // Copyright holder
copyright_email // Copyright holder's email
supports // Supported platform targets
attributes // Inputs/attributes used in scan
groups // Set of descriptions for the control groups (e.g., control IDs)
controls // Controls substructure (see below)
status // Status of profile (typically 'loaded')
}
... // More items may exist if the security service produces multiple profiles per export
]
```
charleshu-8 marked this conversation as resolved.
Show resolved Hide resolved

2) <i>**Controls**</i>:

```
controls: [
0: {
id // ID of control; used for sorting, should be unique for each unique control
title // Title of control
desc // Description of the control
descriptions // Additional descriptions; usually 'check' and 'fix' text for control
impact // Security severity of control
refs // References to external control documentation
tags // Control tags; typically correlate to existing vulnerability/weakness database (e.g., NIST, CVE, CWE)
code // Control source code for code preservation
source_location // Location of control within source code
results // Results substructure (see below)
}
... // More items may exist if there are multiple controls reported per profile
]
```

3) <i>**Results**</i>:

```
results: [
0: {
status // Pass/fail status of test (other statuses exist but are rare)
code_desc // Test expectations as defined by control
message // Demonstration of expected and actual result of test to justify test status
run_time // Overall runtime of test
start_time // Starting time of test
}
... // More items may exist if there are multiple results tested per control
]
```

These aforementioned structures cumulatively result in the following generalized structure which primarily defines OHDF:

```
// Data fields have been removed for the sake of demonstration
profiles: [
0: {
controls: [
0: {
results: [
0: {
},
...
]
},
...
]
},
...
]
```

There are additional structures in the OHDF schema which are used for metadata/extraneous information storage. These exist alongside the <i>profiles</i> structure on the top level of the HDF schema. The general structure for the top level of the HDF schema is as follows:

```
{
platform: { // Information on the platform producing the export
name // Name of platform export was run on
release // Platform version
target_id // Platform target ID (i.e., further identifying information on platform)
}
version // Platform version
statistics: { // Statistics relating to target scan run
duration // Duration of run
}
profiles // Profiles structure
passthrough: { // Extraneous information storage
auxiliary_data: [ // Storage for unused data from the sample file
0: {
name // Name of auxiliary data source
data // Auxiliary data
}
... // More items may exist if there are multiple auxiliary data sources available
]
raw // Raw data dump of input security service export
}
}
```

## The OHDF Schema

The final OHDF schema is as follows:
```
{
platform: { // required field
name // required field
release // required field
target_id
}
version // required field
statistics: { // required field
duration
}
profiles: [ // required field
0: {
name // required field
version
sha256 // required field
title
maintainer
summary
license
copyright
copyright_email
supports // required field
attributes // required field
groups // required field
controls: [ // required field
0: {
id // required field
title
desc
descriptions
impact // required field
refs // required field
tags // required field
code
source_location // required field
results: [ // required field
0: {
status
code_desc // required field
message
run_time
start_time // required field
}
]
}
]
status
}
]
passthrough: {
auxiliary_data: [
0: {
name
data
}
]
raw
}
}
```
Loading
Loading