internal/cloudapi: add OpenSCAP tailoring
Add support to the cloudapi for generating the tailoring file used to customize the OpenSCAP remediation. This allows users to select and unselect rules for the remediation and the `autotailor` stage generates the tailoring file.
This commit is contained in:
parent
360df12548
commit
0ce4ec7fc4
3 changed files with 162 additions and 131 deletions
|
|
@ -212,6 +212,16 @@ func (request *ComposeRequest) GetBlueprintWithCustomizations() (blueprint.Bluep
|
|||
openSCAPCustomization := &blueprint.OpenSCAPCustomization{
|
||||
ProfileID: request.Customizations.Openscap.ProfileId,
|
||||
}
|
||||
if tailoring := request.Customizations.Openscap.Tailoring; tailoring != nil {
|
||||
tailoringCustomizations := blueprint.OpenSCAPTailoringCustomizations{}
|
||||
if tailoring.Selected != nil && len(*tailoring.Selected) > 0 {
|
||||
tailoringCustomizations.Selected = *tailoring.Selected
|
||||
}
|
||||
if tailoring.Unselected != nil && len(*tailoring.Unselected) > 0 {
|
||||
tailoringCustomizations.Unselected = *tailoring.Unselected
|
||||
}
|
||||
openSCAPCustomization.Tailoring = &tailoringCustomizations
|
||||
}
|
||||
if bp.Customizations == nil {
|
||||
bp.Customizations = &blueprint.Customizations{
|
||||
OpenSCAP: openSCAPCustomization,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue