You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/courses/delta/03.md
+31-27Lines changed: 31 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,49 +4,48 @@ next: 04.md
4
4
title: 3. Delta Process CLI Tools
5
5
author: Daniel Medina, George Dias
6
6
---
7
+
The [SAF CLI](https://saf-cli.mitre.org/) is a collection of libraries, tools developed by MITRE and the security community
8
+
to streamline security automation for systems and DevOps pipelines. The delta process is one
9
+
of the libraries provided by the SAF CLI.
7
10
8
11
## 3.1 CLI Tools
9
12
10
-
The delta process consists of one or both of the following commands:
11
-
12
-
1. Update Controls for Delta (`update_controls4delta`)
13
-
2. Delta (`delta`)
13
+
The delta process consists of either or both of the following commands:
14
+
1. Updates Controls for Delta
15
+
2. Delta
14
16
15
17
::: note About InSpec Profiles
16
-
When referring to InSpec profiles, there are distinctions:
17
-
18
-
- InSpec profile repository: Contains the controls, code, etc.
19
-
- InSpec profile file: A JSON formatted file containing a profile summary, used as input for the delta process.
18
+
When referring to InSpec Profiles, there are distinctions:
19
+
InSpec profile repository: contains the controls, code, etc.
20
+
InSpec profile file: JSON formatted file containing profile summary, used as input for the delta process.
20
21
:::
21
22
22
23
### 3.2 Update Controls for Delta
23
24
24
-
The `update_controls4delta` process is used to prepare profile controls from one [SRG](./02.md#glossary-of-terms) or [STIG/CIS](./02.md#glossary-of-terms) benchmark baseline to another. The controls are updated based on guidance provided by the appropriate Extensible Configuration Checklist Description Format ([XCCDF](./02.md#glossary-of-terms)).
25
+
The `update_controls4delta` process is used to prepare profile controls from one [SRG](./02.md#glossary-of-terms) or [STIG/CIS](./02.md#glossary-of-terms) benchmark baseline to another. The controls are updated based on guidance provided by the appropriate Extendible Configuration Checklist Description Format ([XCCDF](./02.md#glossary-of-terms)).
25
26
26
-
The `update_controls4delta` process may be the only command needed as it specifically updates existing controls from one baseline to another. Refer to [use cases for running delta](./04.html#use-cases-for-running-delta).
27
+
The `update_controls4delta` process may be the only command needed as it specifically updates existing controls from one baseline to another, refer to [use cases for running delta](./04.html#use-cases-for-running-delta).
27
28
28
29
The process of preparing controls from one baseline to another (baseline X to Y) consists of:
29
30
30
-
1.Providing the directory where baseline X controls are located.
31
-
2. Providing or generating an InSpec JSON formatted file containing all baseline X controls.
32
-
- The JSON file is generated using the [InSpec or Cinc-Auditor] JSON CLI command.
33
-
3.Providing an XCCDF file containing the new baseline Y guidance. The file is obtained from the appropriate site.
34
-
- The baseline Y XCCDF lists all controls appropriate for the provided baseline. It often includes a field (legacy) indicating the control's previous name(s). The process uses this field to map old control names to the new controls.
35
-
- If no mapping is found, then the `delta` process must be invoked to convert the baselines ([see use cases](./04.html#use-cases-for-running-delta)).
31
+
1.The directory where baseline X controls are located is provided.
32
+
3. An InSpec json formatted file containing all baseline X controls is provided or generated.
33
+
a - The json file is generated using the [inspec or cinc-auditor] json CLI command
34
+
3.A XCCDF file containing the new baseline Y guidance is provided. The file is obtained from the appropriate site.
35
+
a - The baseline Y XCCDF lists all controls appropriate for the provided baseline. It also includes (most often) a field (legacy) where it indicates the control's previous name(s). The process uses this field to map old control names to the new controls.
36
+
b - If there is no mapping found, then the `delta` process must be invoked to convert the baselines ([see use cases](./04.html#use-cases-for-running-delta))
36
37
37
-
You can invoke the command as follows:
38
-
39
-
```sh
38
+
You can invoke the command as such:
39
+
```
40
40
saf generate update_controls4delta -X ./baseline_Y_xccdf_guidance_file.xml -J baseline_X_summary.json -c baseline_X_controls_directory
41
41
```
42
42
43
43
Additional capabilities can be obtained using the `-h or --help` flag on the `update_controls4delta` command as such:
44
-
45
-
```sh
44
+
```
46
45
saf generate update_controls4delta --help
47
46
```
48
47
49
-
Renaming of controls can be done either by guidance rules (rule ID, default) or using the group ID. When using rule ID legacy fields contained within the XCCDF are used for identifying the proper mapping for the controls.
48
+
Renaming of controls can be done either by guidance rules (rule ID, default) or using the group ID. When using rule ID legacy fields contained within the XCCDF are used for identifying the proper mapping for the controls.
50
49
51
50
If there is no way to trace controls in baseline X to its corresponding controls in baseline Y, then `update_controls4delta` will not update any controls (no mapping).
52
51
@@ -60,24 +59,29 @@ The `delta` process extends the capabilities of the `update_controls4delta` proc
60
59
b - For controls which a match is found, the describe block (code) within the old control is mapped over to the new control
61
60
3. Detailed logging
62
61
a - report file (.md), mapping statistics (CliProcessOutput.log)
Copy file name to clipboardExpand all lines: src/courses/delta/04.md
+36-12Lines changed: 36 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ There are several situations that warrant the use of the delta process. These ar
19
19
20
20
### 4.1.1 Use Case 1
21
21
22
-
Updated guidances sometimes modifies the control identification (ID) values of a given control. To make these modifications from baseline X to baseline Y, use the update controls process with the provided XCCDF STIG guidance file. The process checks if the new guidance changes the control numbers and updates the internal metadata if necessary.
22
+
Updated guidances sometimes modifies the control identification (ID) values of a given control. To make these modifications from baseline X to baseline Y, use the update controls process with the provided XCCDF STIG guidance file. The process checks if the new guidance changes the control numbers and updates the internal metadata if necessary (testing code is retained).
23
23
24
24
Suppose we want to update our [Windows Server 2019 inspec profile repository](https://github.com/mitre/microsoft-windows-server-2019-stig-baseline/) from [version 1 release 3](https://github.com/mitre/microsoft-windows-server-2019-stig-baseline/releases/tag/1.3.0) to version 3 release 2.
25
25
@@ -35,8 +35,11 @@ Use the `inspec json` command to generate a profile summary of the inspec profil
35
35
36
36
#### Step 3: Run Update Controls
37
37
Use the `update_controls4delta` method using the profile summary file, the STIG guidance file, and the controls directory for the inspec profile as inputs.
38
-
```
39
-
saf generate update_controls4delta -X ./windows-server-2019-v3r2-xccdf.xml -J ./profile.json -c ./microsoft-windows-server-2019-stig-baseline/controls
1.31 controls were skipped, because they are not present in the STIG guidance. This indicates that these controls were deleted in the recent revision.
49
-
2. 272 controls have had their control IDs updated. Any metadata changes have also been made to the controls as well.
50
-
3.0 controls were found to have the correct identification. This indicated that the STIG guidance renamed all mapped controls.
51
-
4.1 new control was found in the STIG guidance. It is important to note that `update_controls4delta` does not generate this control for you.
51
+
1.Thirty-one (31) controls were skipped, because they are not present in the STIG guidance. This indicates that these controls were deleted in the recent revision.
52
+
2.Two-hundred-seventy-two (272) controls have had their control IDs updated. Any metadata changes have also been made to the controls as well.
53
+
3.Zero (0) controls were found to have the correct identification. This indicated that the STIG guidance renamed all mapped controls.
54
+
4.One (1) new control was found in the STIG guidance. It is important to note that `update_controls4delta` does not generate this control for you.
52
55
53
56
**Process:** Run `update_controls4delta`
54
57
@@ -61,26 +64,38 @@ New guidance often contains new controls that weren't previously defined. In thi
61
64
Suppose we want to update our [RedHat Enterprise Linux 8 STIG Baseline](https://github.com/mitre/redhat-enterprise-linux-8-stig-baseline) from [Version 1 Release 14](https://github.com/mitre/redhat-enterprise-linux-8-stig-baseline/releases/tag/v1.14.1) to version 2 release 1.
62
65
63
66
#### Step 1: Collect necessary files
67
+
64
68

69
+
65
70
This include the profile summary JSON file generated used `cinc-auditor json redhat-enterprise-linux-8-stig-baseline > profile.json`
66
71
67
72
#### **OPTIONAL**: Run update_controls4delta
68
73
Running the update controls command on this profile can give us information on what needs to be updated:
1. No existing controls needed to be renamed in the new STIG guidance (366 controls with correct identification, 0 processed files).
75
-
2.9 controls were removed in the updated STIG guidance (9 skipped files).
76
-
3.1 new control was found in the updated STIG guidance.
85
+
2.Nine (9) controls were removed in the updated STIG guidance (9 skipped files).
86
+
3.One (1) new control was found in the updated STIG guidance.
77
87
78
88
From this output, we know that the Delta command needs to be run, because Delta is able to generate files for new controls and make any changes needed to the other controls.
79
89
80
90
#### Step 2: Run Delta
81
91
82
92
Use the `delta` command to perform a delta on the profile and the STIG guidance file:
a. A `controls` directory containing all of the updated and new controls in the STIG guidance file. This does NOT contain removed controls so no further modifications need to be done.
97
115
b. A delta.json file containing a JSON formatted summary of the delta process.
98
116
2.`report.md`: Markdown report containin formatted version of delta.json summary results.
@@ -114,7 +132,13 @@ In this use case, we will be mapping the Windows Server 2019 STIG profile using
114
132
#### Step 2: Run the delta command with fuzzy matching
115
133
116
134
To enable fuzzy matching, use the `-M` flag and specify the controls directory using the `-c` flag:
Copy file name to clipboardExpand all lines: src/courses/delta/README.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,3 +19,12 @@ By the end of this class, you should be able to:
19
19
- Use the delta fuzzy matching system to map controls between two profiles
20
20
- Identify and review delta process history with generated logs and artifacts
21
21
- Format InSpec profile controls appropriately before and/or after executing delta commands
22
+
23
+
### 1.3 Delta Demystify
24
+
Cyber security, the practice of protecting computer systems, networks, and data is an ongoing effort
25
+
that demands importance vigilance of continuous monitoring and notification of vulnerabilities.
26
+
27
+
To effectively established an ongoing monitoring process, we need to know what to check for, and
28
+
update the content being checked as vulnerabilities are identified. The MITRE training class [Beginner Security Automation Developer Class](https://deploy-preview-256--mitre-saf-training.netlify.app/courses/beginner/) provides an insight on how to use InSpec Profiles (a collection of automated tests) to conduct testes based on some security guidances.
29
+
30
+
As long as the testes are based on valid security guidances all is well, but the moment the security guidances change, the tests become obsolete and require new tests or existing tests to be updated, that is where the `delta` process comes in to the rescue.
0 commit comments