library

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Acceptance

type Acceptance struct {
	Threat      string   `json:"threat"`
	Component   string   `json:"component"`
	Details     string   `json:"details"`
	Description string   `json:"description"`
	Custom      struct{} `json:"custom"`
	Source      struct {
		Annotation string `json:"annotation"`
		Code       string `json:"code"`
		Filename   string `json:"filename"`
		Line       int    `json:"line"`
	} `json:"source"`
}

type Component

type Component struct {
	Id          string     `json:"id"`
	RunId       string     `json:"run_id"`
	Name        string     `json:"name"`
	Description string     `json:"description"`
	Paths       [][]string `json:"paths"`
	Custom      struct{}   `json:"custom"`
}

type Connection

type Connection struct {
	SourceComponent      string   `json:"source_component"`
	DestinationComponent string   `json:"destination_component"`
	Direction            string   `json:"direction"`
	Details              string   `json:"details"`
	Description          string   `json:"description"`
	Custom               struct{} `json:"custom"`
	Source               struct {
		Annotation string `json:"annotation"`
		Code       string `json:"code"`
		Filename   string `json:"filename"`
		Line       int    `json:"line"`
	} `json:"source"`
}

type Control

type Control struct {
	Id          string   `json:"id"`
	RunId       string   `json:"run_id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Custom      struct{} `json:"custom"`
}

type Exposure

type Exposure struct {
	Threat      string   `json:"threat"`
	Component   string   `json:"component"`
	Details     string   `json:"details"`
	Description string   `json:"description"`
	Custom      struct{} `json:"custom"`
	Source      struct {
		Annotation string `json:"annotation"`
		Code       string `json:"code"`
		Filename   string `json:"filename"`
		Line       int    `json:"line"`
	} `json:"source"`
}

type Library

type Library struct {
	Components  map[string]Component
	Controls    map[string]Control
	Threats     map[string]Threat
	ThreatModel Threatmodel
}

func (*Library) Parse

func (l *Library) Parse(comment string)

Parse deduces from comment and adds to the library everything that is compatible with the specification.

func (*Library) ReadFiles

func (l *Library) ReadFiles() error

func (*Library) SaveFiles

func (l *Library) SaveFiles()

type Mitigate

type Mitigate struct {
	Control     string   `json:"control"`
	Threat      string   `json:"threat"`
	Component   string   `json:"component"`
	Description string   `json:"description"`
	Custom      struct{} `json:"custom"`
	Source      struct {
		Annotation string `json:"annotation"`
		Code       string `json:"code"`
		Filename   string `json:"filename"`
		Line       int    `json:"line"`
	} `json:"source"`
}

type Review

type Review struct {
	Component   string   `json:"component"`
	Details     string   `json:"details"`
	Description string   `json:"description"`
	Custom      struct{} `json:"custom"`
	Source      struct {
		Annotation string `json:"annotation"`
		Code       string `json:"code"`
		Filename   string `json:"filename"`
		Line       int    `json:"line"`
	} `json:"source"`
}

type Test

type Test struct {
	Component   string   `json:"component"`
	Control     string   `json:"control"`
	Description string   `json:"description"`
	Custom      struct{} `json:"custom"`
	Source      struct {
		Annotation string `json:"annotation"`
		Code       string `json:"code"`
		Filename   string `json:"filename"`
		Line       int    `json:"line"`
	} `json:"source"`
}

type Threat

type Threat struct {
	Id          string   `json:"id"`
	RunId       string   `json:"run_id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Custom      struct{} `json:"custom"`
}

type Threatmodel

type Threatmodel struct {
	Mitigations []Mitigate   `json:"mitigations"`
	Exposures   []Exposure   `json:"exposures"`
	Transfers   []Transfer   `json:"transfers"`
	Acceptances []Acceptance `json:"acceptances"`
	Connections []Connection `json:"connections"`
	Reviews     []Review     `json:"reviews"`
	Tests       []Test       `json:"tests"`
	RunId       string       `json:"run_id"`
}

type Transfer

type Transfer struct {
	Threat               string   `json:"threat"`
	SourceComponent      string   `json:"source_component"`
	DestinationComponent string   `json:"destination_component"`
	Details              string   `json:"details"`
	Description          string   `json:"description"`
	Custom               struct{} `json:"custom"`
	Source               struct {
		Annotation string `json:"annotation"`
		Code       string `json:"code"`
		Filename   string `json:"filename"`
		Line       int    `json:"line"`
	} `json:"source"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL