-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
102 lines (91 loc) · 3.3 KB
/
main.go
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
package main
import (
"log"
"github.com/alsmola/graphgrc/internal"
)
func main() {
// todo initialize flags
latestScfLink := "https://github.com/securecontrolsframework/securecontrolsframework/raw/main/Secure%20Controls%20Framework%20(SCF)%20-%202023.4.xlsx"
getFile := false
scfControls, err := internal.ReturnSCFControls(latestScfLink, getFile)
if err != nil {
log.Fatal(err)
}
scfControlMappings := internal.GetComplianceControlMappings(scfControls)
for scfControlID, controlMapping := range scfControlMappings {
internal.GenerateSCFMarkdown(scfControls[scfControlID], scfControlID, controlMapping)
}
internal.GenerateSCFIndex(scfControlMappings, scfControls)
soc2Link := "https://raw.githubusercontent.com/prowler-cloud/prowler/main/prowler/compliance/aws/soc2_aws.json"
soc2Framework, err := internal.GetSOC2Controls(soc2Link, getFile)
if err != nil {
log.Fatal(err)
}
for _, requirement := range soc2Framework.Requirements {
err = internal.GenerateSOC2Markdown(requirement, scfControlMappings)
if err != nil {
log.Fatal(err)
}
}
internal.GenerateSOC2Index(soc2Framework)
gdprLink := "https://raw.githubusercontent.com/enterpriseready/enterpriseready/master/content/gdpr/gdpr-abridged.md"
gdprFramework, err := internal.GetGDPRControls(gdprLink, true)
if err != nil {
log.Fatal(err)
}
for _, article := range gdprFramework {
if article.Title != "" {
err = internal.GenerateGDPRMarkdown(article, scfControlMappings)
if err != nil {
log.Fatal(err)
}
}
}
internal.GenerateGDPRIndex(gdprFramework)
iso27001 := internal.Framework("ISO 27001")
iso27002 := internal.Framework("ISO 27002")
iso27001Link := "https://raw.githubusercontent.com/JupiterOne/security-policy-templates/main/templates/standards/iso-iec-27001-2022.json"
iso27001Framework, err := internal.GetISOControls(iso27001, iso27001Link, getFile)
if err != nil {
log.Fatal(err)
}
for _, domain := range iso27001Framework.Domains {
err = internal.GenerateISOMarkdown(iso27001, domain, scfControlMappings)
if err != nil {
log.Fatal(err)
}
}
internal.GenerateISOIndex(iso27001, iso27001Framework)
iso27002Link := "https://raw.githubusercontent.com/JupiterOne/security-policy-templates/main/templates/standards/iso-27002-2022.json"
iso27002Framework, err := internal.GetISOControls(iso27002, iso27002Link, getFile)
if err != nil {
log.Fatal(err)
}
for _, domain := range iso27002Framework.Domains {
err = internal.GenerateISOMarkdown(iso27002, domain, scfControlMappings)
if err != nil {
log.Fatal(err)
}
}
internal.GenerateISOIndex(iso27002, iso27002Framework)
nist80053Link := "https://raw.githubusercontent.com/GSA/fedramp-automation/master/dist/content/rev5/baselines/json/FedRAMP_rev5_MODERATE-baseline-resolved-profile_catalog.json"
nist80053Framework, err := internal.GetNIST80053Controls(nist80053Link, getFile)
if err != nil {
log.Fatal(err)
}
for _, family := range nist80053Framework.Families {
for _, control := range family.Controls {
err = internal.GenerateNIST80053Markdown(control, scfControlMappings)
if err != nil {
log.Fatal(err)
}
for _, subcontrol := range control.Controls {
err = internal.GenerateNIST80053Markdown(subcontrol, scfControlMappings)
if err != nil {
log.Fatal(err)
}
}
}
}
internal.GenerateNIST80053Index(nist80053Framework)
}