oscal-sdk-go
complements the compliance-trestle
SDK by providing the core SDK functionality in Go.
WARNING: This project is currently under initial development. APIs may be changed incompatibly from one commit to another.
Below is a table to show what is currently supported by the SDK.
SDK Functionality | Supported |
---|---|
OSCAL Types with Basic Trestle Extensions | ✔️ |
OSCAL Schema Validation | ❌ |
Target Components Extension | ❌ |
Multiple Parameters per Rule | ❌ |
OSCAL to OSCAL Transformation | ✔️ |
OSCAL Constraints Validation | ❌ |
Add the module as dependency to your project:
go get github.com/oscal-compass/oscal-sdk-go
Extensions
: oscal-compass
uses OSCAL properties to extend OSCAL.
Rules
: Rules are associated with Components and define a mechanism to verify the proper implementation of technical controls.
Settings
: Settings define adjustments to fine-tune pre-defined options in Rules for the implementation of a specific compliance framework.
import (
...
oscalTypes "github.com/defenseunicorns/go-oscal/src/types/oscal-1-1-2"
"github.com/oscal-compass/oscal-sdk-go/generators"
"github.com/oscal-compass/oscal-sdk-go/transformers"
)
func main() {
file, err := os.Open("path-to-my-compdef")
if err != nil {
log.Fatalf("failed to open component definition, %v", err)
}
definition, err := generators.NewComponentDefinition(file)
if err != nil {
log.Fatalf("failed to read component definition, %v", err)
}
if definition != nil {
assessmentPlan, err := transformers.ComponentDefinitionsToAssessmentPlan(context.Background(), []oscalTypes.ComponentDefinition{*definition}, "example-framework")
if err != nil {
log.Fatalf("failed to create assessment plan, %v", err)
}
assessmentPlanJSON, err := json.MarshalIndent(assessmentPlan, "", " ")
if err != nil {
log.Fatalf("failed to marshal assessment plan, %v", err)
}
fmt.Println(assessmentPlanJSON)
}
}
Our project welcomes external contributions. Please see CONTRIBUTING.md
to get started.
Participation in the OSCAL Compass community is governed by the Code of Conduct.
This project leverages go_oscal
to provide Go types for the OSCAL schema.