Documentation ¶
Index ¶
- Constants
- func Checksum(r io.Reader) (sum []byte, err error)
- func ChecksumDir(dir string) (sum []byte, err error)
- type Answer
- type CategorizedTag
- type JobFunction
- type Question
- type Questionnaire
- type RiskMessages
- type Rule
- type RuleSet
- type Section
- type Seed
- type TagCategory
- type Target
- type TargetLabel
- type Thresholds
Constants ¶
const ( RuleSuffix = ".yaml" RuleSetYaml = "ruleset.yaml" RuleSetImage = "image.svg" )
RuleSet constants
const ( KindJobFunction = "jobfunction" KindRuleSet = "ruleset" KindTagCategory = "tagcategory" KindTarget = "target" KindQuestionnaire = "questionnaire" )
Seedable kinds
const (
AllVersions = 0
)
Variables ¶
This section is empty.
Functions ¶
func ChecksumDir ¶
ChecksumDir calculates a checksum for the contents of a directory.
Types ¶
type Answer ¶
type Answer struct { Order uint Text string Risk string Rationale string `yaml:",omitempty" json:",omitempty"` Mitigation string `yaml:",omitempty" json:",omitempty"` ApplyTags []CategorizedTag `yaml:",omitempty" json:",omitempty"` AutoAnswerFor []CategorizedTag `yaml:",omitempty" json:",omitempty"` Selected bool `yaml:",omitempty" json:",omitempty"` AutoAnswered bool `yaml:",omitempty" json:",omitempty"` }
Answer represents an answer to a question in a questionnaire.
type CategorizedTag ¶
CategorizedTag represents a human-readable pair of category and tag.
type JobFunction ¶
JobFunction is a representation of the Hub's JobFunction that is fit for seeding.
type Question ¶
type Question struct { Order uint Text string Explanation string IncludeFor []CategorizedTag `yaml:",omitempty" json:",omitempty"` ExcludeFor []CategorizedTag `yaml:",omitempty" json:",omitempty"` Answers []Answer }
Question represents a question in a questionnaire.
type Questionnaire ¶
type Questionnaire struct { UUID string Name string Description string `yaml:",omitempty" json:",omitempty"` Required bool Sections []Section Thresholds Thresholds RiskMessages RiskMessages `yaml:",omitempty" json:",omitempty"` }
Questionnaire is a representation of the Hub's Questionnaire model that is fit for seeding.
type RiskMessages ¶
RiskMessages contains messages to display for each risk level.
type Rule ¶
type Rule struct { Path string // contains filtered or unexported fields }
Rule seed representation.
func (*Rule) AppendLabel ¶
AppendLabel adds a label to the rule without duplication.
type RuleSet ¶
type RuleSet struct { UUID string `yaml:",omitempty"` Name string `yaml:",omitempty"` Description string `yaml:",omitempty"` Labels []string `yaml:",omitempty"` Directory string `yaml:",omitempty"` Dependencies []string `yaml:",omitempty"` Checksum string `yaml:",omitempty"` Rules []Rule `yaml:"-"` SeedDir string `yaml:"-"` }
RuleSet seed representation.
type Seed ¶
type Seed struct { Kind string Version uint Items []yaml.Node // contains filtered or unexported fields }
Seed document structure.
func ReadFromDir ¶
ReadFromDir reads all seeds from the given directory.
func ReadFromFile ¶
ReadFromFile reads all seeds from the given file.
func (*Seed) DecodeItems ¶
DecodeItems decodes the yaml nodes of the Items slice on the Seed into their proper representations based on the Seed's Kind.
type TagCategory ¶
type TagCategory struct { UUID string Name string Color string Tags []struct { UUID string Name string } }
TagCategory is a representation of the Hub's TagCategory that is fit for seeding.
type Target ¶
type Target struct { UUID string `yaml:",omitempty"` Name string `yaml:",omitempty"` Description string `yaml:",omitempty"` Provider string `yaml:"provider"` ImagePath string `yaml:",omitempty"` Choice bool `yaml:",omitempty"` Labels []TargetLabel `yaml:",omitempty"` SeedDir string `yaml:",omitempty"` }
type TargetLabel ¶
type Thresholds ¶
Thresholds contains the threshold values for determining risk for the questionnaire.