Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6603881
Refactor assessment plans and finalize database setup
s0nny78 May 30, 2025
f104ad0
Enhance OSCAL support in PlanOfActionAndMilestones
s0nny78 May 30, 2025
34bca2c
Whitespace
ianmiell May 31, 2025
5c46392
Refactor assessment plans and finalize database setup
s0nny78 May 30, 2025
73bcb14
Enhance OSCAL support in PlanOfActionAndMilestones
s0nny78 May 30, 2025
1d7664d
Whitespace
ianmiell May 31, 2025
f09d744
Initiate generic paom get
s0nny78 Jun 2, 2025
20969d7
Updated OSCAL API for Plan of Action and Milestones
s0nny78 Jun 2, 2025
5ebfc81
Add POAM entities to migrator and update relationships in models
s0nny78 Jun 4, 2025
806c8b9
Refactor POAM data handling for improved efficiency
s0nny78 Jun 5, 2025
f701613
POAM JSON Sample
s0nny78 Jun 6, 2025
d9ab5d7
Refactor POAM data structures for polymorphic relationships
s0nny78 Jun 6, 2025
aa5ab48
Enhance POAM import functionality and API responses
s0nny78 Jun 6, 2025
162091e
Refactor OSCAL import and data structures
s0nny78 Jun 9, 2025
4c439dd
Add polymorphic relationship to ResponsibleParty model
s0nny78 Jun 9, 2025
f2714ee
Refactor ResponsibleParty model to use ResponsiblePartyParties structure
s0nny78 Jun 9, 2025
bfa0a22
Refactor POAM marshaling logic for improved data handling
s0nny78 Jun 9, 2025
2740fb6
Rebase Migrator.go
s0nny78 Jun 10, 2025
5156923
Remove unused POAM fields and entities from migrator
s0nny78 Jun 10, 2025
27759c9
Update logging in ImportOscal function to use structured logging
s0nny78 Jun 10, 2025
84bd119
Enhance OSCAL import functionality by updating test data files
s0nny78 Jun 10, 2025
2497989
Missing some imports
s0nny78 Jun 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions cmd/oscal/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func ImportOscal(cmd *cobra.Command, args []string) {
}

files := []string{
"testdata/fedramp_poam.json",
"testdata/basic-catalog.json",
"testdata/example-ap.json",
"testdata/example-ssp.json",
Expand All @@ -73,11 +74,12 @@ func ImportOscal(cmd *cobra.Command, args []string) {

defer jsonFile.Close()
input := &struct {
ComponentDefinition *oscalTypes_1_1_3.ComponentDefinition `json:"component-definition"`
Catalog *oscalTypes_1_1_3.Catalog `json:"catalog"`
SystemSecurityPlan *oscalTypes_1_1_3.SystemSecurityPlan `json:"system-security-plan"`
AssessmentPlan *oscalTypes_1_1_3.AssessmentPlan `json:"assessment-plan"`
Profile *oscalTypes_1_1_3.Profile `json:"profile"`
ComponentDefinition *oscalTypes_1_1_3.ComponentDefinition `json:"component-definition"`
Catalog *oscalTypes_1_1_3.Catalog `json:"catalog"`
SystemSecurityPlan *oscalTypes_1_1_3.SystemSecurityPlan `json:"system-security-plan"`
AssessmentPlan *oscalTypes_1_1_3.AssessmentPlan `json:"assessment-plan"`
Profile *oscalTypes_1_1_3.Profile `json:"profile"`
PlanOfActionAndMilestones *oscalTypes_1_1_3.PlanOfActionAndMilestones `json:"plan-of-action-and-milestones"`
}{}

err = json.NewDecoder(jsonFile).Decode(input)
Expand Down Expand Up @@ -140,6 +142,24 @@ func ImportOscal(cmd *cobra.Command, args []string) {
continue
}

if input.PlanOfActionAndMilestones != nil {
def := &relational.PlanOfActionAndMilestones{}
def.UnmarshalOscal(*input.PlanOfActionAndMilestones)

// Print what we're going to import
sugar.Infof("Importing POAM with %d risks, %d observations, %d findings",
len(def.Risks), len(def.Observations), len(def.Findings))

// Create with polymorphic entities
out := db.Create(def)
if out.Error != nil {
sugar.Errorf("Error creating POAM: %v", out.Error)
continue
}
fmt.Println("Successfully Created Plan of Action and Milestones", f)
continue
}

sugar.Fatal("File content wasn't understood or mapped: ", f)
}
}
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ services:
environment:
- MONGO_URI=mongodb://mongodb:27017
- APP_PORT=8080
- CCF_DB_DRIVER="postgres"
- CCF_DB_CONNECTION="host=postgres user=postgres password=postgres dbname=ccf port=5432 sslmode=disable"
- CCF_DB_DRIVER=postgres
- CCF_DB_CONNECTION=host=postgres user=postgres password=postgres dbname=ccf port=5432 sslmode=disable
networks:
- continuous-compliance

Expand Down
Loading
Loading