forked from gemaraproj/go-gemara
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchecklist_example_test.go
More file actions
112 lines (107 loc) · 3.2 KB
/
checklist_example_test.go
File metadata and controls
112 lines (107 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
package gemara
import (
"fmt"
)
func ExamplePolicy_ToMarkdownChecklist() {
policy := &Policy{
Metadata: Metadata{
Id: "security-policy-v2.1",
Version: "2.1.0",
Author: Actor{
Name: "Security Team",
Version: "1.0.0",
},
},
Title: "Information Security Policy",
Adherence: Adherence{
AssessmentPlans: []AssessmentPlan{
{
Id: "plan-access-control-monthly",
RequirementId: "AC-01.01",
Frequency: "monthly",
EvaluationMethods: []AcceptedMethod{
{
Type: MethodIntent,
Description: "Run automated access control audit script",
},
{
Type: MethodBehavioral,
Description: "Review access control logs for anomalies",
},
},
EvidenceRequirements: "Access logs, audit report, and review notes",
},
{
Id: "plan-encryption-quarterly",
RequirementId: "SC-02.01",
Frequency: "quarterly",
EvaluationMethods: []AcceptedMethod{
{
Type: MethodIntent,
Description: "Verify encryption is enabled on all data stores",
},
},
EvidenceRequirements: "Configuration scan results and compliance report",
},
{
Id: "plan-backup-automated",
RequirementId: "CP-01.01",
Frequency: "weekly",
EvaluationMethods: []AcceptedMethod{
{
Type: MethodIntent,
Description: "Verify backup jobs completed successfully",
},
},
EvidenceRequirements: "Backup job logs and success reports",
},
{
Id: "plan-backup-manual",
RequirementId: "CP-01.01",
Frequency: "monthly",
EvaluationMethods: []AcceptedMethod{
{
Type: MethodBehavioral,
Description: "Test restore procedure from backup",
},
},
EvidenceRequirements: "Restore test results and documentation",
},
},
},
}
checklist, err := policy.ToMarkdownChecklist()
if err != nil {
fmt.Printf("Error generating checklist: %v\n", err)
return
}
// Print the generated checklist
fmt.Println(checklist)
// Output:
// # Policy Checklist: Information Security Policy (security-policy-v2.1)
//
// **Author:** Security Team (v1.0.0)
//
// ## Assessment Requirement: AC-01.01
//
// - [ ] Run automated access control audit script (monthly) [Plan: plan-access-control-monthly]
// > **Evidence Required:** Access logs, audit report, and review notes
// - [ ] Review access control logs for anomalies (monthly) [Plan: plan-access-control-monthly]
// > **Evidence Required:** Access logs, audit report, and review notes
//
// ---
//
// ## Assessment Requirement: SC-02.01
//
// - [ ] Verify encryption is enabled on all data stores (quarterly) [Plan: plan-encryption-quarterly]
// > **Evidence Required:** Configuration scan results and compliance report
//
// ---
//
// ## Assessment Requirement: CP-01.01
//
// - [ ] Verify backup jobs completed successfully (weekly) [Plan: plan-backup-automated]
// > **Evidence Required:** Backup job logs and success reports
// - [ ] Test restore procedure from backup (monthly) [Plan: plan-backup-manual]
// > **Evidence Required:** Restore test results and documentation
}