1
0
mirror of https://github.com/strongdm/comply synced 2024-11-16 21:04:54 +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 a onclick="javascript:show('procedures')" Procedures
li.top-nav.standards li.top-nav.standards
strong strong
a onclick="javascript:show('standards')" Standards a onclick="javascript:show('frameworks')" Frameworks
/ li.top-nav.evidence / li.top-nav.evidence
/ a onclick="javascript:show('evidence')" Evidence Vault / a onclick="javascript:show('evidence')" Evidence Vault
#overview.section.top-nav.container.content #overview.section.top-nav.container.content
@ -79,7 +79,7 @@ html lang=en
p.subtitle.is-3.has-text-centered Control Tracking p.subtitle.is-3.has-text-centered Control Tracking
.column.has-text-centered .column.has-text-centered
div div
p.heading Satisfied Controls p.heading Satisfied Criteria
p.title p.title
{{.Stats.ControlsSatisfied}} {{.Stats.ControlsSatisfied}}
.column.has-text-centered .column.has-text-centered
@ -191,8 +191,8 @@ html lang=en
blockquote blockquote
h3 h3
p p
strong Standards strong Frameworks
| specify the controls satisfied by the compliance program. | specify the Framework Criteria satisfied by the compliance program.
table.table.is-size-4.is-fullwidth table.table.is-size-4.is-fullwidth
thead thead
tr tr

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/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 h1:tlXG832s5pa9x9Gs3Rp2rTvEqjiDEuETUOSfBEiTcns=
github.com/russross/blackfriday v1.5.3-0.20200218234912-41c5fccfd6f6/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= 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/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/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= 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 := tablewriter.NewWriter(os.Stdout)
w.SetHeader([]string{"Standard", "Control", "Satisfied?", "Name"}) w.SetHeader([]string{"Framework", "Control", "Satisfied?", "Name"})
type row struct { type row struct {
standard string standard string
@ -36,7 +36,7 @@ func todoAction(c *cli.Context) error {
satisfied := model.ControlsSatisfied(d) satisfied := model.ControlsSatisfied(d)
var rows []row var rows []row
for _, std := range d.Standards { for _, std := range d.Frameworks {
for id, c := range std.Controls { for id, c := range std.Controls {
sat := "NO" sat := "NO"
if _, ok := satisfied[id]; ok { if _, ok := satisfied[id]; ok {

View File

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

View File

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

View File

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

View File

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

View File

@ -36,14 +36,14 @@ type renderData struct {
Narratives []*model.Document Narratives []*model.Document
Policies []*model.Document Policies []*model.Document
Procedures []*model.Procedure Procedures []*model.Procedure
Standards []*model.Standard Frameworks []*model.Framework
Tickets []*model.Ticket Tickets []*model.Ticket
Controls []*control Controls []*control
Links *model.TicketLinks Links *model.TicketLinks
} }
type control struct { type control struct {
Standard string Framework string
ControlKey string ControlKey string
Name string Name string
Description string Description string
@ -65,12 +65,12 @@ func load() (*model.Data, *renderData, error) {
satisfied := model.ControlsSatisfied(modelData) satisfied := model.ControlsSatisfied(modelData)
controls := make([]*control, 0) controls := make([]*control, 0)
for _, standard := range modelData.Standards { for _, framework := range modelData.Frameworks {
for key, c := range standard.Controls { for key, c := range framework.Controls {
satisfactions, ok := satisfied[key] satisfactions, ok := satisfied[key]
satisfied := ok && len(satisfactions) > 0 satisfied := ok && len(satisfactions) > 0
controls = append(controls, &control{ controls = append(controls, &control{
Standard: standard.Name, Framework: framework.Name,
ControlKey: key, ControlKey: key,
Name: c.Name, Name: c.Name,
Description: c.Description, Description: c.Description,
@ -87,7 +87,7 @@ func load() (*model.Data, *renderData, error) {
rd.Narratives = modelData.Narratives rd.Narratives = modelData.Narratives
rd.Policies = modelData.Policies rd.Policies = modelData.Policies
rd.Procedures = modelData.Procedures rd.Procedures = modelData.Procedures
rd.Standards = modelData.Standards rd.Frameworks = modelData.Frameworks
rd.Tickets = modelData.Tickets rd.Tickets = modelData.Tickets
rd.Links = &model.TicketLinks{} rd.Links = &model.TicketLinks{}
rd.Project = project rd.Project = project
@ -123,7 +123,7 @@ func addStats(modelData *model.Data, renderData *renderData) {
satisfied := model.ControlsSatisfied(modelData) satisfied := model.ControlsSatisfied(modelData)
for _, std := range renderData.Standards { for _, std := range renderData.Frameworks {
stats.ControlsTotal += len(std.Controls) stats.ControlsTotal += len(std.Controls)
for controlKey := range std.Controls { for controlKey := range std.Controls {
if _, ok := satisfied[controlKey]; ok { 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 { for standard, keys := range pol.Satisfies {
rows += fmt.Sprintf("| %s | %s |\n", standard, strings.Join(keys, ", ")) 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 { 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 a onclick="javascript:show('procedures')" Procedures
li.top-nav.standards li.top-nav.standards
strong strong
a onclick="javascript:show('standards')" Standards a onclick="javascript:show('frameworks')" Frameworks
/ li.top-nav.evidence / li.top-nav.evidence
/ a onclick="javascript:show('evidence')" Evidence Vault / a onclick="javascript:show('evidence')" Evidence Vault
#overview.section.top-nav.container.content #overview.section.top-nav.container.content
@ -187,12 +187,12 @@ html lang=en
td On demand td On demand
{{end}} {{end}}
{{end}} {{end}}
#standards.section.top-nav.container.content #frameworks.section.top-nav.container.content
blockquote blockquote
h3 h3
p p
strong Standards strong Framework Targets
| specify the controls satisfied by the compliance program. | specify the Frameworks and Framework Criteria targeted by the compliance program.
table.table.is-size-4.is-fullwidth table.table.is-size-4.is-fullwidth
thead thead
tr tr

View File

@ -10,7 +10,7 @@ Compliance documents are organized as follows:
narratives/ Narratives provide an overview of the organization and the compliance environment. narratives/ Narratives provide an overview of the organization and the compliance environment.
policies/ Policies govern the behavior of employees and contractors. policies/ Policies govern the behavior of employees and contractors.
procedures/ Procedures prescribe specific steps that are taken in response to key events. 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. templates/ Templates control the output format of the HTML Dashboard and PDF assets.
``` ```

View File

@ -1,4 +1,4 @@
# Standards # Frameworks
All `yaml` files in this directory are assumed to conform to https://github.com/opencontrol/schemas/tree/master/kwalify/standard All `yaml` files in this directory are assumed to conform to https://github.com/opencontrol/schemas/tree/master/kwalify/standard

View File

View File

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