openscap icon indicating copy to clipboard operation
openscap copied to clipboard

Introduce JSON tailoring import option for `autotailor`

Open evgenyz opened this issue 1 year ago • 3 comments

The --json-tailoring option will provide support for importing https://github.com/ComplianceAsCode/schemas/tree/main/tailoring.

  • [X] Code
  • [X] Docs
  • [x] Finalize schema
  • [x] Test

evgenyz avatar Jan 26 '24 01:01 evgenyz

@ggbecker If I got you right, this is a variation for multiple tailored profiles in a single JSON tailoring:

{
  "profiles": [
    {
      "id": "tailoring_id",
      "title": "Test",
      "base_profile_id": "original_profile_id",
      "rules": {
        "some_rule_id": {
          "evaluate": true,
          "severity": "high"
        },
        "different_rule_id": {
          "role": "unscored"
        }
      },
      "variables": {
        "a_variable_id": {
          "value": "New Value"
        },
        "another_variable_id": {
          "value": 42
        },
        "3rd_variable_id": {
          "option_id": "some_option_id"
        }
      }
    }
  ]
}

evgenyz avatar Feb 06 '24 19:02 evgenyz

@jan-cerny @ggbecker ping.

evgenyz avatar Feb 07 '24 21:02 evgenyz

I've integrated schema changes into PR.

evgenyz avatar Feb 09 '24 14:02 evgenyz

Latest changes include groups override in JSON tailoring.

evgenyz avatar Feb 26 '24 13:02 evgenyz