Skip to content

Commit 154f827

Browse files
authored
added support for references and updated template (#164)
Signed-off-by: Eddie Knight <knight@linux.com>
1 parent 6adf8bb commit 154f827

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

cmd/baseline.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ type LexiconEntry struct {
4040
Term string `yaml:"term"`
4141
Definition string `yaml:"definition"`
4242
Synonyms []string `yaml:"synonyms"`
43+
References []string `yaml:"references"`
4344
}
4445

4546
func hardcodedCategories() []string {
@@ -192,6 +193,9 @@ func (b *Baseline) Generate() error {
192193
"asLink": func(s string) string {
193194
return asLinkTemplateFunction(s)
194195
},
196+
"subtract": func(a, b int) int {
197+
return a - b
198+
},
195199
}).Parse(string(templateContent))
196200
if err != nil {
197201
return fmt.Errorf("error parsing template: %w", err)

cmd/template.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ The Open Source Project Security (OSPS) Baseline is a set of security criteria t
99
The criteria are organized by maturity level and category.
1010
In the detailed subsections you will find the criterion, rationale, and details notes.
1111

12+
13+
Where possible, we have added control mappings to external frameworks.
14+
These are not guaranteed to be 100% matches, but instead serve as references
15+
when working to meet the corresponding controls.
16+
1217
For more information on the project and to make contributions, visit the [GitHub repo](https://github.com/ossf/security-baseline).
1318

1419
---
@@ -68,10 +73,10 @@ For more information on the project and to make contributions, visit the [GitHub
6873
{{- end }}
6974
**Details:** {{ .Details | addLinks }}
7075
{{ if .ControlMappings }}
71-
**Control Mappings:**
72-
{{ range $key, $value := .ControlMappings }}
73-
- {{ $key }}: {{ $value }}
74-
{{- end }}
76+
| Catalog | Potential Mappings |
77+
| ------- | ------------------ |
78+
{{ range $key, $value := .ControlMappings }}| {{ $key | addLinks }} | {{ $value }} |
79+
{{ end }}
7580
{{- end }}
7681
{{ if .SecurityInsightsValue }}
7782
**Security Insights Value:** {{ .SecurityInsightsValue }}
@@ -85,11 +90,19 @@ For more information on the project and to make contributions, visit the [GitHub
8590

8691
## Lexicon
8792
{{ range .Lexicon }}
93+
8894
### {{ .Term }}
8995

9096
{{ .Definition }}
9197

92-
{{- end }}
98+
{{ if .References }}
99+
**References:**
100+
{{ range .References }}
101+
- {{.}}
102+
{{ end -}}
103+
{{ end -}}
104+
{{ end -}}
105+
93106
---
94107

95108
## Acknowledgments

0 commit comments

Comments
 (0)