1
0
mirror of https://github.com/strongdm/comply synced 2024-12-23 14:07:34 +00:00

Refactor "Standards" to "Frameworks"

This commit is contained in:
Craine Runton 2020-09-15 14:52:22 -05:00
parent dbe49a09b3
commit 84e439e7cc
17 changed files with 180 additions and 106 deletions

View File

@ -66,7 +66,7 @@ html lang=en
a onclick="javascript:show('procedures')" Procedures
li.top-nav.standards
strong
a onclick="javascript:show('standards')" Standards
a onclick="javascript:show('frameworks')" Frameworks
/ li.top-nav.evidence
/ a onclick="javascript:show('evidence')" Evidence Vault
#overview.section.top-nav.container.content
@ -79,7 +79,7 @@ html lang=en
p.subtitle.is-3.has-text-centered Control Tracking
.column.has-text-centered
div
p.heading Satisfied Controls
p.heading Satisfied Criteria
p.title
{{.Stats.ControlsSatisfied}}
.column.has-text-centered
@ -191,8 +191,8 @@ html lang=en
blockquote
h3
p
strong Standards
| specify the controls satisfied by the compliance program.
strong Frameworks
| specify the Framework Criteria satisfied by the compliance program.
table.table.is-size-4.is-fullwidth
thead
tr
@ -234,4 +234,4 @@ html lang=en
show(destination)
}
}
}
}

1
go.sum
View File

@ -430,6 +430,7 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
github.com/rogpeppe/go-internal v1.5.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/russross/blackfriday v1.5.3-0.20200218234912-41c5fccfd6f6 h1:tlXG832s5pa9x9Gs3Rp2rTvEqjiDEuETUOSfBEiTcns=
github.com/russross/blackfriday v1.5.3-0.20200218234912-41c5fccfd6f6/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=

View File

@ -24,7 +24,7 @@ func todoAction(c *cli.Context) error {
}
w := tablewriter.NewWriter(os.Stdout)
w.SetHeader([]string{"Standard", "Control", "Satisfied?", "Name"})
w.SetHeader([]string{"Framework", "Control", "Satisfied?", "Name"})
type row struct {
standard string
@ -36,7 +36,7 @@ func todoAction(c *cli.Context) error {
satisfied := model.ControlsSatisfied(d)
var rows []row
for _, std := range d.Standards {
for _, std := range d.Frameworks {
for id, c := range std.Controls {
sat := "NO"
if _, ok := satisfied[id]; ok {

View File

@ -6,7 +6,7 @@ type Control struct {
Description string `yaml:"description"`
}
type Standard struct {
type Framework struct {
Name string `yaml:"name"`
Controls map[string]Control `yaml:",inline"`
}

View File

@ -30,7 +30,7 @@ func ReadData() (*Data, error) {
if err != nil {
return nil, err
}
standards, err := ReadStandards()
frameworks, err := ReadFrameworks()
if err != nil {
return nil, err
}
@ -40,7 +40,7 @@ func ReadData() (*Data, error) {
Narratives: narratives,
Policies: policies,
Procedures: procedures,
Standards: standards,
Frameworks: frameworks,
}, nil
}
@ -67,27 +67,27 @@ func tickets(rawTickets []string) ([]*Ticket, error) {
return tickets, nil
}
// ReadStandards loads standard definitions from the filesystem.
func ReadStandards() ([]*Standard, error) {
var standards []*Standard
// ReadFrameworks loads standard definitions from the filesystem.
func ReadFrameworks() ([]*Framework, error) {
var frameworks []*Framework
files, err := path.Standards()
files, err := path.Frameworks()
if err != nil {
return nil, errors.Wrap(err, "unable to enumerate paths")
}
for _, f := range files {
s := &Standard{}
s := &Framework{}
sBytes, err := ioutil.ReadFile(f.FullPath)
if err != nil {
return nil, errors.Wrap(err, "unable to read "+f.FullPath)
}
yaml.Unmarshal(sBytes, &s)
standards = append(standards, s)
frameworks = append(frameworks, s)
}
return standards, nil
return frameworks, nil
}
// ReadNarratives loads narrative descriptions from the filesystem.

View File

@ -1,12 +1,12 @@
package model
type Data struct {
Standards []*Standard
Narratives []*Document
Policies []*Document
Procedures []*Procedure
Tickets []*Ticket
Audits []*Audit
Frameworks []*Framework
Narratives []*Document
Policies []*Document
Procedures []*Procedure
Tickets []*Ticket
Audits []*Audit
}
type Revision struct {

View File

@ -15,9 +15,9 @@ type File struct {
Info os.FileInfo
}
// Standards lists all standard files.
func Standards() ([]File, error) {
return filesFor("standards", "yml")
// Frameworks lists all standard files.
func Frameworks() ([]File, error) {
return filesFor("frameworks", "yml")
}
// Narratives lists all narrative files.

View File

@ -36,14 +36,14 @@ type renderData struct {
Narratives []*model.Document
Policies []*model.Document
Procedures []*model.Procedure
Standards []*model.Standard
Frameworks []*model.Framework
Tickets []*model.Ticket
Controls []*control
Links *model.TicketLinks
}
type control struct {
Standard string
Framework string
ControlKey string
Name string
Description string
@ -65,12 +65,12 @@ func load() (*model.Data, *renderData, error) {
satisfied := model.ControlsSatisfied(modelData)
controls := make([]*control, 0)
for _, standard := range modelData.Standards {
for key, c := range standard.Controls {
for _, framework := range modelData.Frameworks {
for key, c := range framework.Controls {
satisfactions, ok := satisfied[key]
satisfied := ok && len(satisfactions) > 0
controls = append(controls, &control{
Standard: standard.Name,
Framework: framework.Name,
ControlKey: key,
Name: c.Name,
Description: c.Description,
@ -87,7 +87,7 @@ func load() (*model.Data, *renderData, error) {
rd.Narratives = modelData.Narratives
rd.Policies = modelData.Policies
rd.Procedures = modelData.Procedures
rd.Standards = modelData.Standards
rd.Frameworks = modelData.Frameworks
rd.Tickets = modelData.Tickets
rd.Links = &model.TicketLinks{}
rd.Project = project
@ -123,7 +123,7 @@ func addStats(modelData *model.Data, renderData *renderData) {
satisfied := model.ControlsSatisfied(modelData)
for _, std := range renderData.Standards {
for _, std := range renderData.Frameworks {
stats.ControlsTotal += len(std.Controls)
for controlKey := range std.Controls {
if _, ok := satisfied[controlKey]; ok {

View File

@ -114,7 +114,7 @@ func preprocessDoc(data *renderData, pol *model.Document, fullPath string) error
for standard, keys := range pol.Satisfies {
rows += fmt.Sprintf("| %s | %s |\n", standard, strings.Join(keys, ", "))
}
satisfiesTable = fmt.Sprintf("|Standard|Controls Satisfied|\n|-------+--------------------------------------------|\n%s\nTable: Control satisfaction\n", rows)
satisfiesTable = fmt.Sprintf("|Framework|Controls Satisfied|\n|-------+--------------------------------------------|\n%s\nTable: Control satisfaction\n", rows)
}
if len(pol.Revisions) > 0 {

File diff suppressed because it is too large Load Diff

View File

View File

@ -66,7 +66,7 @@ html lang=en
a onclick="javascript:show('procedures')" Procedures
li.top-nav.standards
strong
a onclick="javascript:show('standards')" Standards
a onclick="javascript:show('frameworks')" Frameworks
/ li.top-nav.evidence
/ a onclick="javascript:show('evidence')" Evidence Vault
#overview.section.top-nav.container.content
@ -187,12 +187,12 @@ html lang=en
td On demand
{{end}}
{{end}}
#standards.section.top-nav.container.content
#frameworks.section.top-nav.container.content
blockquote
h3
p
strong Standards
| specify the controls satisfied by the compliance program.
strong Framework Targets
| specify the Frameworks and Framework Criteria targeted by the compliance program.
table.table.is-size-4.is-fullwidth
thead
tr
@ -234,4 +234,4 @@ html lang=en
show(destination)
}
}
}
}

View File

@ -10,7 +10,7 @@ Compliance documents are organized as follows:
narratives/ Narratives provide an overview of the organization and the compliance environment.
policies/ Policies govern the behavior of employees and contractors.
procedures/ Procedures prescribe specific steps that are taken in response to key events.
standards/ Standards specify the controls satisfied by the compliance program.
frameworks/ Frameworks specify the control criteria targeted by the compliance program.
templates/ Templates control the output format of the HTML Dashboard and PDF assets.
```
@ -57,4 +57,4 @@ comply build
# publish static site from output/ directory
upload.sh output/
```
```

View File

@ -1,5 +1,5 @@
# Standards
# Frameworks
All `yaml` files in this directory are assumed to conform to https://github.com/opencontrol/schemas/tree/master/kwalify/standard
Adjust the target standard for this project by adding or removing line-items within each file, or adding/removing a standard file entirely.
Adjust the target standard for this project by adding or removing line-items within each file, or adding/removing a standard file entirely.

View File

View File

@ -66,7 +66,7 @@ html lang=en
a onclick="javascript:show('procedures')" Procedures
li.top-nav.standards
strong
a onclick="javascript:show('standards')" Standards
a onclick="javascript:show('frameworks')" Frameworks
/ li.top-nav.evidence
/ a onclick="javascript:show('evidence')" Evidence Vault
#overview.section.top-nav.container.content
@ -187,12 +187,12 @@ html lang=en
td On demand
{{end}}
{{end}}
#standards.section.top-nav.container.content
#frameworks.section.top-nav.container.content
blockquote
h3
p
strong Standards
| specify the controls satisfied by the compliance program.
strong Framework Targets
| specify the Frameworks and Framework Criteria targeted by the compliance program.
table.table.is-size-4.is-fullwidth
thead
tr
@ -234,4 +234,4 @@ html lang=en
show(destination)
}
}
}
}