layer1

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Applicability

type Applicability struct {
	// Inclusion by geographical or legal areas
	Jurisdictions []string `json:"jurisdictions,omitempty" yaml:"jurisdictions,omitempty"`

	// Inclusion by types of technology or technological environments
	TechnologyDomains []string `json:"technology-domains,omitempty" yaml:"technology-domains,omitempty"`

	// Inclusion by industry sectors or verticals
	IndustrySectors []string `json:"industry-sectors,omitempty" yaml:"industry-sectors,omitempty"`
}

type Category

type Category struct {
	Id string `json:"id" yaml:"id"`

	Title string `json:"title" yaml:"title"`

	Description string `json:"description" yaml:"description"`

	Guidelines []Guideline `json:"guidelines,omitempty" yaml:"guidelines,omitempty"`
}

Category represents a logical group of guidelines (i.e. control family)

type DocumentType

type DocumentType string

type GenerateOption added in v0.4.0

type GenerateOption func(opts *generateOpts)

GenerateOption defines an option to tune the behavior of the OSCAL generation methods for Layer 1.

func WithCanonicalHrefFormat added in v0.4.0

func WithCanonicalHrefFormat(canonicalHref string) GenerateOption

WithCanonicalHrefFormat is a GenerateOption that provides an `href` format string for the canonical version of the guidance document. If set, this will be added as a link in the metadata with the rel="canonical" attribute. Ex - https://myguidance.org/versions/%s

func WithOSCALImports added in v0.4.0

func WithOSCALImports(imports map[string]string) GenerateOption

WithOSCALImports is a GenerateOption that provides the `href` to guidance document mappings in OSCAL by mapping unique identifier. If unset, the mapping URL of the guidance document will be used.

func WithVersion added in v0.4.0

func WithVersion(version string) GenerateOption

WithVersion is a GenerateOption that sets the version of the OSCAL Document. If set, this will be used instead of the version in GuidanceDocument.

type GuidanceDocument

type GuidanceDocument struct {
	Metadata Metadata `json:"metadata,omitempty" yaml:"metadata,omitempty"`

	// Introductory text for the document to be used during rendering
	FrontMatter string `json:"front-matter,omitempty" yaml:"front-matter,omitempty"`

	Categories []Category `json:"categories,omitempty" yaml:"categories,omitempty"`

	// For inheriting from other guidance documents to create tailored documents/baselines
	ImportedGuidelines []Mapping `json:"imported-guidelines,omitempty" yaml:"imported-guidelines,omitempty"`

	ImportedPrinciples []Mapping `json:"imported-principles,omitempty" yaml:"imported-principles,omitempty"`
}
Example
tmpl := `
# {{ .Metadata.Title }} ({{ .Metadata.Id }})
---
**Front Matter:** {{ .FrontMatter }}
---
{{ range .Categories }}
### {{ .Title }} ({{ .Id }})
{{ .Description }}
#### Guidelines:
{{ range .Guidelines }}
##### {{ .Title }} ({{ .Id }})
**Objective:** {{ .Objective }}
{{ if .SeeAlso }}
**See Also:** {{ range .SeeAlso }}{{ . }} {{ end }}
{{ end }}
{{ end }}
{{ end }}
`

l1Docs, err := goodAIGFExample()
if err != nil {
	fmt.Printf("error getting testdata: %v\n", err)
	return
}
t, err := template.New("guidance").Parse(tmpl)
if err != nil {
	fmt.Printf("error parsing template: %v\n", err)
	return
}

err = t.Execute(os.Stdout, l1Docs)
if err != nil {
	fmt.Printf("error executing template: %v\n", err)
}
Output:
# AI Governance Framework (FINOS-AIR)
---
**Front Matter:** The following framework has been developed by FINOS (Fintech Open Source Foundation).
---

### Detective (DET)
Detection and Continuous Improvement
#### Guidelines:

##### Human Feedback Loop for AI Systems (AIR-DET-011)
**Objective:** A Human Feedback Loop is a critical detective and continuous improvement mechanism that involves systematically collecting, analyzing, and acting upon feedback provided by human users, subject matter experts (SMEs), or reviewers regarding an AI system’s performance, outputs, or behavior.

**See Also:** AIR-DET-015 AIR-DET-004 AIR-PREV-005

func (*GuidanceDocument) ToOSCALCatalog added in v0.4.0

func (g *GuidanceDocument) ToOSCALCatalog(opts ...GenerateOption) (oscal.Catalog, error)

ToOSCALCatalog creates an OSCAL Catalog from the locally defined guidelines in a given Layer 1 Guidance Document.

func (*GuidanceDocument) ToOSCALProfile added in v0.4.0

func (g *GuidanceDocument) ToOSCALProfile(guidanceDocHref string, opts ...GenerateOption) (oscal.Profile, error)

ToOSCALProfile creates an OSCAL Profile from the imported and local guidelines from Layer 1 Guidance Document with a given location to the OSCAL Catalog for the guidance document.

type Guideline

type Guideline struct {
	Id string `json:"id" yaml:"id"`

	Title string `json:"title" yaml:"title"`

	Objective string `json:"objective,omitempty" yaml:"objective,omitempty"`

	// Maps to fields commonly seen in controls with implementation guidance
	Recommendations []string `json:"recommendations,omitempty" yaml:"recommendations,omitempty"`

	// For control enhancements (ex. AC-2(1) in 800-53)
	// The base-guideline-id is needed to achieve full context for the enhancement
	BaseGuidelineID string `json:"base-guideline-id,omitempty" yaml:"base-guideline-id,omitempty"`

	Rationale *Rationale `json:"rationale,omitempty" yaml:"rationale,omitempty"`

	// Represents individual guideline parts/statements
	GuidelineParts []Part `json:"guideline-parts,omitempty" yaml:"guideline-parts,omitempty"`

	// Crosswalking this guideline to other guidelines in other documents
	GuidelineMappings []Mapping `json:"guideline-mappings,omitempty" yaml:"guideline-mappings,omitempty"`

	// A list for associated key principle ids
	PrincipleMappings []Mapping `json:"principle-mappings,omitempty" yaml:"principle-mappings,omitempty"`

	// This is akin to related controls, but using more explicit terminology
	SeeAlso []string `json:"see-also,omitempty" yaml:"see-also,omitempty"`
}

type Mapping

type Mapping struct {
	ReferenceId string `json:"reference-id" yaml:"reference-id"`

	Entries []MappingEntry `json:"entries,omitempty" yaml:"entries,omitempty"`

	// Adding context about this particular mapping and why it was mapped.
	Remarks string `json:"remarks,omitempty" yaml:"remarks,omitempty"`
}

type MappingEntry

type MappingEntry struct {
	ReferenceId string `json:"reference-id" yaml:"reference-id"`

	Strength int64 `json:"strength" yaml:"strength"`

	Remarks string `json:"remarks,omitempty" yaml:"remarks,omitempty"`
}

type MappingReference

type MappingReference struct {
	Id string `json:"id" yaml:"id"`

	Title string `json:"title" yaml:"title"`

	Version string `json:"version" yaml:"version"`

	Description string `json:"description,omitempty" yaml:"description,omitempty"`

	Issuer string `json:"issuer,omitempty" yaml:"issuer,omitempty"`

	Url string `json:"url,omitempty" yaml:"url,omitempty"`
}

Mapping references is the same from Layer2, but intended for Layer 1 to Layer 1 mappings instead of Layer 2 to Layer 1 mappings.

type Metadata

type Metadata struct {
	Id string `json:"id" yaml:"id"`

	Title string `json:"title" yaml:"title"`

	Description string `json:"description" yaml:"description"`

	Author string `json:"author" yaml:"author"`

	Version string `json:"version,omitempty" yaml:"version,omitempty"`

	LastModified string `json:"last-modified,omitempty" yaml:"last-modified,omitempty"`

	PublicationDate string `json:"publication-date,omitempty" yaml:"publication-date,omitempty"`

	MappingReferences []MappingReference `json:"mapping-references,omitempty" yaml:"mapping-references,omitempty"`

	DocumentType DocumentType `json:"document-type,omitempty" yaml:"document-type,omitempty"`

	Applicability *Applicability `json:"applicability,omitempty" yaml:"applicability,omitempty"`

	Exemptions []string `json:"exemptions,omitempty" yaml:"exemptions,omitempty"`
}

type Outcome

type Outcome struct {
	Title string `json:"title" yaml:"title"`

	Description string `json:"description" yaml:"description"`
}

type Part

type Part struct {
	Id string `json:"id" yaml:"id"`

	Title string `json:"title,omitempty" yaml:"title,omitempty"`

	Text string `json:"text" yaml:"text"`

	Recommendations []string `json:"recommendations,omitempty" yaml:"recommendations,omitempty"`
}

Parts include sub-statements of a guideline that can be assessed individually

type Rationale

type Rationale struct {
	// Negative results expected from the guideline's lack of implementation
	Risks []Risk `json:"risks" yaml:"risks"`

	// Positive results expected from the guideline's implementation
	Outcomes []Outcome `json:"outcomes" yaml:"outcomes"`
}

Rationale provides contextual information to help with development and understanding of guideline intent.

type Risk

type Risk struct {
	Title string `json:"title" yaml:"title"`

	Description string `json:"description" yaml:"description"`
}

Jump to

Keyboard shortcuts

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