diff --git a/.eslintignore b/.eslintignore index cc089a8c..1d896dc4 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,5 +1,6 @@ # Ignore programatically generated API slices imageBuilderApi.ts +complianceApi.ts contentSourcesApi.ts rhsmApi.ts provisioningApi.ts diff --git a/api.sh b/api.sh index 0a7df723..418db166 100644 --- a/api.sh +++ b/api.sh @@ -6,6 +6,7 @@ npx @rtk-query/codegen-openapi ./api/config/rhsm.ts & npx @rtk-query/codegen-openapi ./api/config/contentSources.ts & npx @rtk-query/codegen-openapi ./api/config/provisioning.ts & npx @rtk-query/codegen-openapi ./api/config/edge.ts & +npx @rtk-query/codegen-openapi ./api/config/compliance.ts & # Wait for all background jobs to finish wait diff --git a/api/config/compliance.ts b/api/config/compliance.ts new file mode 100644 index 00000000..2efd0b36 --- /dev/null +++ b/api/config/compliance.ts @@ -0,0 +1,13 @@ +import type { ConfigFile } from '@rtk-query/codegen-openapi'; + +const config: ConfigFile = { + schemaFile: '../schema/compliance.json', + apiFile: '../../src/store/emptyComplianceApi.ts', + apiImport: 'emptyComplianceApi', + outputFile: '../../src/store/complianceApi.ts', + exportName: 'complianceApi', + hooks: true, + filterEndpoints: ['listProfiles'], +}; + +export default config; diff --git a/api/schema/compliance.json b/api/schema/compliance.json new file mode 100644 index 00000000..923fb1a1 --- /dev/null +++ b/api/schema/compliance.json @@ -0,0 +1 @@ +{"openapi":"3.0.3","info":{"title":"Cloud Services for RHEL Compliance API V1","version":"v1","description":"This is the API for Cloud Services for RHEL Compliance. You can find out more about Red Hat Cloud Services for RHEL at [https://console.redhat.com/](https://console.redhat.com/)"},"servers":[{"url":"https://{defaultHost}/api/compliance","variables":{"defaultHost":{"default":"console.redhat.com"}}},{"url":"https://{defaultHost}/api/compliance/v1","variables":{"defaultHost":{"default":"console.redhat.com"}}}],"paths":{"/benchmarks":{"get":{"summary":"List all benchmarks","tags":["benchmark"],"description":"Lists all benchmarks requested","operationId":"ListBenchmarks","parameters":[{"name":"X-RH-IDENTITY","in":"header","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"The number of items to return","schema":{"type":"integer","maximum":100,"minimum":1,"default":10}},{"name":"offset","in":"query","required":false,"description":"The number of items to skip before starting to collect the result set","schema":{"type":"integer","minimum":1,"default":1}},{"name":"search","in":"query","required":false,"description":"Query string compliant with scoped_search query language: https://github.com/wvanbergen/scoped_search/wiki/Query-language","schema":{"type":"string"}},{"name":"sort_by","in":"query","required":false,"description":"A string or an array of fields with an optional direction (:asc or :desc) to sort the results.","schema":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}],"items":{"enum":["title","version","title:asc","title:desc","version:asc","version:desc"]}}},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"A comma seperated list of resources to include in the response"}],"responses":{"200":{"description":"lists all benchmarks requested","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"data":[{"id":"0d1d8a42-c21b-4df6-bdcf-8a4baaebfa90","type":"benchmark","attributes":{"ref_id":"xccdf_org.ssgproject.content_benchmark_RHEL-7","title":"Omnis est numquam qui.","version":"100.0.1","description":"Aut blanditiis ut. Tempore dicta eos. Debitis et beatae.","os_major_version":"7","latest_supported_os_minor_versions":[]},"relationships":{"rules":{"data":[{"id":"993b6169-531e-4c6e-8967-dcf69e231c2a","type":"rule"},{"id":"e3148d11-e8f0-4f94-aa40-2af4d1fa4226","type":"rule"}]},"profiles":{"data":[{"id":"cb6a4262-17a4-4b73-b0f1-13254f495841","type":"profile"}]},"value_definitions":{"data":[]}}},{"id":"7ca7b149-73b1-43eb-b65c-f6ebc0e9f1f0","type":"benchmark","attributes":{"ref_id":"xccdf_org.ssgproject.content_benchmark_RHEL-7","title":"Ea beatae omnis itaque.","version":"100.0.2","description":"Itaque ut dolor. Ut aut ut. Pariatur at voluptatem.","os_major_version":"7","latest_supported_os_minor_versions":[]},"relationships":{"rules":{"data":[{"id":"7f936be8-2f3e-4857-bc94-28463206424b","type":"rule"},{"id":"a8c41af2-e374-47f7-ace1-9fd2cc1abbce","type":"rule"}]},"profiles":{"data":[{"id":"f22a1c3f-7ed5-4d48-94f4-a8b0d98234cd","type":"profile"}]},"value_definitions":{"data":[]}}}],"meta":{"total":2,"limit":10,"offset":1,"relationships":true},"links":{"first":"/api/compliance/benchmarks?include=&limit=10&offset=1&relationships=true","last":"/api/compliance/benchmarks?include=&limit=10&offset=1&relationships=true"}},"summary":"","description":""}},"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/metadata"},"links":{"$ref":"#/components/schemas/links"},"data":{"type":"array","items":{"properties":{"type":{"type":"string"},"id":{"$ref":"#/components/schemas/uuid"},"attributes":{"$ref":"#/components/schemas/benchmark"},"relationships":{"$ref":"#/components/schemas/benchmark_relationships"}}}}}}}}}}}},"/benchmarks/{id}":{"get":{"summary":"Retrieve a benchmark","tags":["benchmark"],"description":"Retrieves data for a benchmark","operationId":"ShowBenchmark","parameters":[{"name":"X-RH-IDENTITY","in":"header","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"A comma seperated list of resources to include in the response"}],"responses":{"404":{"description":"benchmark not found","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"errors":["Xccdf::Benchmark not found with ID invalid"]},"summary":"","description":""}}}}},"200":{"description":"retrieves a benchmark","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"data":{"id":"ea3dc27c-7f33-4726-9870-4da6607961fc","type":"benchmark","attributes":{"ref_id":"xccdf_org.ssgproject.content_benchmark_RHEL-7","title":"Aut eos accusamus ut.","version":"100.0.4","description":"Rerum est perferendis. Sit tempora quia. Vel nihil et.","os_major_version":"7","latest_supported_os_minor_versions":[],"rule_tree":[{"type":"rule_group","id":"26818a71-e16c-423b-b663-fbc94209d01a","ref_id":"foo_group_7f79be0c-f091-44d6-aa89-caf320168829","title":"Aut corporis dignissimos vel.","children":[{"type":"rule","id":"929a7184-2355-4c19-9c49-e60500a81553","ref_id":"foo_rule_cefc692e-34ab-46c4-b2b2-372c19591cf2"}]},{"type":"rule_group","id":"dd003c5a-b98b-425d-9279-951baa6cee79","ref_id":"foo_group_47782ed6-39e4-46f6-886a-a3531bd1bc9f","title":"Asperiores ut earum voluptates.","children":[{"type":"rule","id":"e288b76d-c8eb-4d9a-93c4-9beac4283152","ref_id":"foo_rule_8f52c26e-8bdc-42e3-9480-e62b14edf943"}]},{"type":"rule_group","id":"4d6a36f0-c4a2-433e-a096-744036449c06","ref_id":"foo_group_a6314e10-32f9-4b38-a7a3-75f01efb5094","title":"Quasi sed doloribus dolorum.","children":[{"type":"rule","id":"a276f592-4b11-4126-90e1-413ad7f61bcf","ref_id":"foo_rule_cee943f5-9560-421d-9e40-9d149a5b2ba2"}]},{"type":"rule_group","id":"edab302b-87bc-4dab-b080-abbbf8a9f592","ref_id":"foo_group_d98e6085-19e8-4fc8-a5fb-dea00c13eb8e","title":"Nemo doloremque eveniet molestiae.","children":[{"type":"rule","id":"0e43906a-4589-49a1-ad2f-2bee491a81ab","ref_id":"foo_rule_55ef2e9d-6ff4-4f69-b6ac-c4f23263bb88"}]},{"type":"rule_group","id":"cb1896ef-69a3-4dea-a1cd-d7df2d6111d9","ref_id":"foo_group_93ce20bb-4df2-41c7-9f08-39689d39b43b","title":"Molestiae in eaque soluta.","children":[{"type":"rule","id":"9b25b5d1-d34b-4849-b622-d2e643694738","ref_id":"foo_rule_c8a2a362-e760-4548-95d3-cf51f84a04f3"}]},{"type":"rule_group","id":"159630fe-d6ee-4ca1-a9c5-5bb7d6d1ded0","ref_id":"foo_group_d0d48dcd-228f-45a9-88d4-6aa4279bc670","title":"Eum error dolore beatae.","children":[{"type":"rule","id":"868a3cf1-6191-4b6e-b27d-953bc5e4b470","ref_id":"foo_rule_999b449b-cbb2-497d-b9a0-d99748ffcfac"}]},{"type":"rule_group","id":"f8ccb1e6-f7fe-488e-8444-09d310aa7842","ref_id":"foo_group_42b7fc33-3ebe-4215-b327-0798b7efd11c","title":"Blanditiis sed quas non.","children":[{"type":"rule","id":"fca0684e-ce17-48b4-8b45-91e2444f16bc","ref_id":"foo_rule_e4b9549c-dea5-4393-b66f-2770793e3bc3"}]},{"type":"rule_group","id":"4ee974ae-5bab-4349-8484-8c26cf049ecb","ref_id":"foo_group_63d443e2-1f4f-444c-a6dc-49fa39c430cf","title":"Eligendi earum sint ut.","children":[{"type":"rule","id":"659dd83a-8914-47d7-9dd8-d1821a4f0da1","ref_id":"foo_rule_4d6bcd1f-f5ea-4051-b6b4-274f4f39561f"}]},{"type":"rule_group","id":"cf560db4-c3fb-47b6-860a-f426797d29cd","ref_id":"foo_group_d98cc1ad-22ef-4257-9a67-ca0722d0e262","title":"Id assumenda repellat numquam.","children":[{"type":"rule","id":"dd0648ed-d205-4ee0-90e6-eb7ab41234c9","ref_id":"foo_rule_9503e930-2706-46da-948b-f731727bc362"}]},{"type":"rule_group","id":"81452066-d842-426f-bd5e-971cebe54ec4","ref_id":"foo_group_26c4da82-ca84-4dac-a7d3-d8d96e2ccfcd","title":"Debitis suscipit recusandae eos.","children":[{"type":"rule","id":"0cca3360-882a-43c5-b054-fb8ac5dc0175","ref_id":"foo_rule_489cbc8e-8087-4f0e-9a84-6445c8423160"}]}]},"relationships":{"rules":{"data":[{"id":"929a7184-2355-4c19-9c49-e60500a81553","type":"rule"},{"id":"e288b76d-c8eb-4d9a-93c4-9beac4283152","type":"rule"},{"id":"a276f592-4b11-4126-90e1-413ad7f61bcf","type":"rule"},{"id":"0e43906a-4589-49a1-ad2f-2bee491a81ab","type":"rule"},{"id":"9b25b5d1-d34b-4849-b622-d2e643694738","type":"rule"},{"id":"868a3cf1-6191-4b6e-b27d-953bc5e4b470","type":"rule"},{"id":"fca0684e-ce17-48b4-8b45-91e2444f16bc","type":"rule"},{"id":"659dd83a-8914-47d7-9dd8-d1821a4f0da1","type":"rule"},{"id":"dd0648ed-d205-4ee0-90e6-eb7ab41234c9","type":"rule"},{"id":"0cca3360-882a-43c5-b054-fb8ac5dc0175","type":"rule"}]},"profiles":{"data":[{"id":"030c87d8-077b-4755-9510-3e24e417418b","type":"profile"},{"id":"96a6b5b2-3682-4347-b27c-ece0242451e1","type":"profile"}]},"value_definitions":{"data":[]}}}},"summary":"","description":""}},"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/metadata"},"links":{"$ref":"#/components/schemas/links"},"data":{"type":"object","properties":{"type":{"type":"string"},"id":{"$ref":"#/components/schemas/uuid"},"attributes":{"$ref":"#/components/schemas/benchmark"},"relationships":{"$ref":"#/components/schemas/benchmark_relationships"}}}}}}}}}}},"/business_objectives":{"get":{"summary":"List all business_objectives","tags":["business_objective"],"description":"Lists all business_objectives requested","operationId":"ListBusinessObjectives","parameters":[{"name":"X-RH-IDENTITY","in":"header","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"The number of items to return","schema":{"type":"integer","maximum":100,"minimum":1,"default":10}},{"name":"offset","in":"query","required":false,"description":"The number of items to skip before starting to collect the result set","schema":{"type":"integer","minimum":1,"default":1}},{"name":"search","in":"query","required":false,"description":"Query string compliant with scoped_search query language: https://github.com/wvanbergen/scoped_search/wiki/Query-language","schema":{"type":"string"}},{"name":"sort_by","in":"query","required":false,"description":"A string or an array of fields with an optional direction (:asc or :desc) to sort the results.","schema":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}],"items":{"enum":["title","title:asc","title:desc"]}}},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"A comma seperated list of resources to include in the response"}],"responses":{"200":{"description":"lists all business_objectives requested","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"data":[{"id":"350f99c2-b8bd-4f5d-940b-54ab5ffbc8f6","type":"business_objective","attributes":{"title":"Et eligendi et velit."},"relationships":{"profiles":{"data":[{"id":"d23bab8a-a5d3-4e08-af8f-70659c65be31","type":"profile"}]}}},{"id":"57bdc192-d64e-4e4d-9230-27870faa5314","type":"business_objective","attributes":{"title":"Possimus provident doloremque porro."},"relationships":{"profiles":{"data":[{"id":"7e2d3c79-dd93-4279-b364-8f741a2192db","type":"profile"}]}}}],"meta":{"total":2,"limit":10,"offset":1,"sort_by":"title","relationships":true},"links":{"first":"/api/compliance/business_objectives?include=&limit=10&offset=1&relationships=true&sort_by=title","last":"/api/compliance/business_objectives?include=&limit=10&offset=1&relationships=true&sort_by=title"}},"summary":"","description":""}},"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/metadata"},"links":{"$ref":"#/components/schemas/links"},"data":{"type":"array","items":{"properties":{"type":{"type":"string"},"id":{"$ref":"#/components/schemas/uuid"},"attributes":{"$ref":"#/components/schemas/business_objective"}}}}}}}}}}}},"/business_objectives/{id}":{"get":{"summary":"Retrieve a business_objective","tags":["business_objective"],"description":"Retrieves data for a business_objective","operationId":"ShowBusinessObjective","parameters":[{"name":"X-RH-IDENTITY","in":"header","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"A comma seperated list of resources to include in the response"}],"responses":{"404":{"description":"business_objective not found","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"errors":["BusinessObjective not found with ID invalid"]},"summary":"","description":""}}}}},"200":{"description":"retrieves a business_objective","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"data":{"id":"e9e07fec-cda2-44b8-b0be-43e1dc1a879b","type":"business_objective","attributes":{"title":"Explicabo neque sit in."},"relationships":{"profiles":{"data":[{"id":"121e6ea9-39b1-4807-adde-b8b58b7b7aab","type":"profile"}]}}}},"summary":"","description":""}},"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/metadata"},"links":{"$ref":"#/components/schemas/links"},"data":{"type":"object","properties":{"type":{"type":"string"},"id":{"$ref":"#/components/schemas/uuid"},"attributes":{"$ref":"#/components/schemas/business_objective"},"relationships":{"$ref":"#/components/schemas/business_objective_relationships"}}}}}}}}}}},"/profiles":{"get":{"summary":"List all profiles","tags":["profile"],"description":"Lists all profiles requested","operationId":"ListProfiles","parameters":[{"name":"X-RH-IDENTITY","in":"header","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"The number of items to return","schema":{"type":"integer","maximum":100,"minimum":1,"default":10}},{"name":"offset","in":"query","required":false,"description":"The number of items to skip before starting to collect the result set","schema":{"type":"integer","minimum":1,"default":1}},{"name":"search","in":"query","required":false,"description":"Query string compliant with scoped_search query language: https://github.com/wvanbergen/scoped_search/wiki/Query-language","schema":{"type":"string"}},{"name":"sort_by","in":"query","required":false,"description":"A string or an array of fields with an optional direction (:asc or :desc) to sort the results.","schema":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}],"items":{"enum":["name","os_minor_version","score","name:asc","name:desc","os_minor_version:asc","os_minor_version:desc","score:asc","score:desc"]}}},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"A comma seperated list of resources to include in the response"}],"responses":{"200":{"description":"lists all profiles requested filtered by OS","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"data":[{"id":"57b5c27e-83a4-4fd2-8deb-8ca21f56fa0a","type":"profile","attributes":{"ref_id":"xccdf_org.ssgproject.content_profile_0c34c965-cddf-4f16-b93d-950fd251cefe","score":0.42,"parent_profile_id":null,"external":false,"compliance_threshold":100.0,"os_major_version":"7","os_version":"7","policy_profile_id":null,"os_minor_version":"","parent_profile_ref_id":null,"values":{},"name":"Canonical Profile","description":"Canonical (Generated) Profile","canonical":true,"tailored":false,"total_host_count":0,"ssg_version":"100.0.13","compliant_host_count":0,"test_result_host_count":0,"unsupported_host_count":0,"business_objective":null,"policy_type":"Canonical Profile"},"relationships":{"account":{"data":null},"benchmark":{"data":{"id":"a1c20d53-0861-4ebe-8bf2-1d2d5344ca0e","type":"benchmark"}},"parent_profile":{"data":null},"rules":{"data":[]},"hosts":{"data":[{"id":"bbdf9049-8111-4348-bcb7-45ac6052ccb9","type":"host"}]},"test_results":{"data":[{"id":"5facce49-bf5b-445b-b8a9-5532c4b433c7","type":"test_result"}]}}},{"id":"ee5a2278-4fde-4ac7-ad31-351bf6730e0e","type":"profile","attributes":{"ref_id":"xccdf_org.ssgproject.content_profile_e8398575-052b-4682-9553-3937f62ae63d","score":0.68,"parent_profile_id":null,"external":false,"compliance_threshold":100.0,"os_major_version":"7","os_version":"7","policy_profile_id":null,"os_minor_version":"","parent_profile_ref_id":null,"values":{},"name":"Eius dicta consectetur nulla.","description":"Aut voluptatem qui. Id et doloribus. Mollitia placeat omnis.","canonical":true,"tailored":false,"total_host_count":0,"ssg_version":"100.0.14","compliant_host_count":0,"test_result_host_count":0,"unsupported_host_count":0,"business_objective":null,"policy_type":"Eius dicta consectetur nulla."},"relationships":{"account":{"data":null},"benchmark":{"data":{"id":"6858011b-82f8-4652-9f9c-168cfead0cca","type":"benchmark"}},"parent_profile":{"data":null},"rules":{"data":[]},"hosts":{"data":[{"id":"bbdf9049-8111-4348-bcb7-45ac6052ccb9","type":"host"}]},"test_results":{"data":[{"id":"79493be1-653b-4580-a2a8-66f073fe9675","type":"test_result"}]}}},{"id":"47b99e45-1072-4147-bdda-8afd48a7e16c","type":"profile","attributes":{"ref_id":"xccdf_org.ssgproject.content_profile_e8398575-052b-4682-9553-3937f62ae63d","score":0.0,"parent_profile_id":"ee5a2278-4fde-4ac7-ad31-351bf6730e0e","external":false,"compliance_threshold":100.0,"os_major_version":"7","os_version":"7","policy_profile_id":"47b99e45-1072-4147-bdda-8afd48a7e16c","os_minor_version":"","parent_profile_ref_id":"xccdf_org.ssgproject.content_profile_e8398575-052b-4682-9553-3937f62ae63d","values":{"19a3fe08-2bd8-4cae-b177-ba99cc8d8d8c":"efiyop","3201d7c6-6161-492e-bcc6-74f6ce7c2219":"vqmmei","4087ef87-192f-4b4e-8a76-b4c3f3fc7713":"mxdcks","4f27045a-ed07-4aed-b793-6bfab3ddf6fb":"jbigfl","cbbac65b-e4e3-4d37-b89f-365ac3407e1a":"nmfpax"},"name":"Policy for Profile","description":"Policy assigned to Profile","canonical":false,"tailored":false,"total_host_count":0,"ssg_version":"100.0.14","compliant_host_count":0,"test_result_host_count":0,"unsupported_host_count":0,"business_objective":null,"policy_type":"Eius dicta consectetur nulla."},"relationships":{"account":{"data":{"id":"0b03de73-60e3-4829-adef-7945701f886f","type":"account"}},"benchmark":{"data":{"id":"6858011b-82f8-4652-9f9c-168cfead0cca","type":"benchmark"}},"parent_profile":{"data":{"id":"ee5a2278-4fde-4ac7-ad31-351bf6730e0e","type":"profile"}},"rules":{"data":[]},"hosts":{"data":[]},"test_results":{"data":[]}}}],"meta":{"total":3,"search":"os_major_version = 7","limit":10,"offset":1,"sort_by":"score","relationships":true},"links":{"first":"/api/compliance/profiles?include=&limit=10&offset=1&relationships=true&search=os_major_version+%3D+7&sort_by=score","last":"/api/compliance/profiles?include=&limit=10&offset=1&relationships=true&search=os_major_version+%3D+7&sort_by=score"}},"summary":"","description":""}},"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/metadata"},"links":{"$ref":"#/components/schemas/links"},"data":{"type":"array","items":{"properties":{"type":{"type":"string"},"id":{"$ref":"#/components/schemas/uuid"},"attributes":{"$ref":"#/components/schemas/profile"},"relationships":{"$ref":"#/components/schemas/profile_relationships"}}}}}}}}}}},"post":{"summary":"Create a profile","tags":["profile"],"description":"Create a profile with the provided attributes","operationId":"CreateProfile","parameters":[{"name":"X-RH-IDENTITY","in":"header","schema":{"type":"string"}}],"responses":{"201":{"description":"creates a profile","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"data":{"id":"72a272f4-6c64-45e9-b9d6-c05fcb6397e8","type":"profile","attributes":{"ref_id":"xccdf_org.ssgproject.content_profile_52f806f6-aca4-4184-8136-96a0dc2d7297","score":0.0,"parent_profile_id":"9362fe5a-abd9-472a-895b-c38b5d82edb0","external":false,"compliance_threshold":93.5,"os_major_version":"7","os_version":"7","policy_profile_id":"72a272f4-6c64-45e9-b9d6-c05fcb6397e8","os_minor_version":"","parent_profile_ref_id":"xccdf_org.ssgproject.content_profile_52f806f6-aca4-4184-8136-96a0dc2d7297","values":{"07b24d3f-9802-461a-a360-b56b87b7d1e9":"ftgztj","124a20d3-57d7-4ebb-809b-7daab7c28e5c":"gratey","8b2419a2-7fbf-40d7-ab0b-20af454ac73b":"xxsifo"},"name":"A custom name","description":"Canonical (Generated) Profile","canonical":false,"tailored":false,"total_host_count":2,"ssg_version":"100.0.15","compliant_host_count":0,"test_result_host_count":0,"unsupported_host_count":0,"business_objective":"LATAM Expansion","policy_type":"Canonical Profile"},"relationships":{"account":{"data":{"id":"3f281b9e-1aec-4c87-a11b-2c9700bcf9bc","type":"account"}},"benchmark":{"data":{"id":"f16104d7-8e48-48b4-b821-ce6cfaa6939b","type":"benchmark"}},"parent_profile":{"data":{"id":"9362fe5a-abd9-472a-895b-c38b5d82edb0","type":"profile"}},"rules":{"data":[{"id":"a2860465-76af-4c28-8a61-495ad36b84f2","type":"rule"},{"id":"2e6a2bb0-a93d-4cc5-bc79-c2e91e1fb665","type":"rule"}]},"hosts":{"data":[{"id":"05bcbb26-4f6a-4748-b56e-23c0753e0ec4","type":"host"},{"id":"b276550b-5ca1-4491-9c8a-61a4c9ea8041","type":"host"}]},"test_results":{"data":[]}}}},"summary":"","description":""}},"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"type":{"type":"string","example":"profile"},"id":{"$ref":"#/components/schemas/uuid"},"attributes":{"$ref":"#/components/schemas/profile"},"relationships":{"$ref":"#/components/schemas/profile_relationships"}}}}}}}}},"requestBody":{"content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"type":{"type":"string","example":"profile"},"data":{"type":"object","properties":{"type":{"type":"string"},"attributes":{"$ref":"#/components/schemas/profile"},"relationships":{"$ref":"#/components/schemas/profile_relationships"}}}},"example":{"data":{"attributes":{"name":"my custom profile","parent_profile_id":"0105a0f0-7379-4897-a891-f95cfb9ddf9c","description":"This profile contains rules to ensure standard security baseline\\nof a Red Hat Enterprise Linux 7 system. Regardless of your system's workload\\nall of these checks should pass.","compliance_threshold":95.0,"business_objective":"APAC Expansion"},"relationships":{"rules":{"data":[{"id":"cc9afa66-3536-4d2e-bc8e-10111d13ec50","type":"rule"},{"id":"06a19f0e-5c7a-4d54-bc66-e932a96bf954","type":"rule"}]},"hosts":{"data":[{"id":"6c3837ed-edac-4522-83a1-147af958f0f2","type":"host"},{"id":"f896d5e7-e44e-41cb-8e8e-96aab6d895d6","type":"host"}]}}}}}}}}}},"/profiles/{id}":{"get":{"summary":"Retrieve a profile","tags":["profile"],"description":"Retrieves data for a profile","operationId":"ShowProfile","parameters":[{"name":"X-RH-IDENTITY","in":"header","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"A comma seperated list of resources to include in the response"}],"responses":{"404":{"description":"profile not found","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"errors":["Profile not found with ID invalid"]},"summary":"","description":""}}}}},"200":{"description":"retrieves a profile with included benchmark","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"data":{"id":"dd222826-e4ca-4d82-88f6-af31c409c793","type":"profile","attributes":{"ref_id":"xccdf_org.ssgproject.content_profile_20460d4f-7a2b-4fe6-adc9-aa5a64143676","score":0.42,"parent_profile_id":null,"external":false,"compliance_threshold":100.0,"os_major_version":"7","os_version":"7","policy_profile_id":null,"os_minor_version":"","parent_profile_ref_id":null,"values":{"6e765b52-8f85-494a-96a6-abb54d04c5ff":"cfkbjg","8b8dc834-499b-480d-9a6c-b6218fac8c13":"zcqqug","90f11d7a-ccb1-4e15-8197-c06c7c6da785":"silpgy","b1799dc0-08c1-489d-a79a-4cae44520a90":"jckzsf","ebde67c2-78cc-4948-aa09-d50c7eaec683":"tfmuye"},"name":"Canonical Profile","description":"Canonical (Generated) Profile","canonical":true,"tailored":false,"total_host_count":0,"ssg_version":"100.0.19","compliant_host_count":0,"test_result_host_count":0,"unsupported_host_count":0,"business_objective":null,"policy_type":"Canonical Profile"},"relationships":{"account":{"data":{"id":"6e8a0c8b-de2c-45f0-a182-c5ad7acb02f0","type":"account"}},"benchmark":{"data":{"id":"dc4ea8e3-993a-4b08-803c-2c01548e99d8","type":"benchmark"}},"parent_profile":{"data":null},"rules":{"data":[]},"hosts":{"data":[]},"test_results":{"data":[{"id":"3ab20251-6e44-40af-8d53-e513cd9b5bc8","type":"test_result"}]}}},"included":[{"id":"dc4ea8e3-993a-4b08-803c-2c01548e99d8","type":"benchmark","attributes":{"ref_id":"xccdf_org.ssgproject.content_benchmark_RHEL-7","title":"Ut quas officia voluptatem.","version":"100.0.19","description":"Provident omnis officia. Sapiente natus non. Dolorem reiciendis non.","os_major_version":"7","latest_supported_os_minor_versions":[],"rule_tree":[]},"relationships":{}}]},"summary":"","description":""}},"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/metadata"},"links":{"$ref":"#/components/schemas/links"},"data":{"type":"object","properties":{"type":{"type":"string"},"id":{"$ref":"#/components/schemas/uuid"},"attributes":{"$ref":"#/components/schemas/profile"},"relationships":{"$ref":"#/components/schemas/profile_relationships"}}},"included":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"id":{"$ref":"#/components/schemas/uuid"},"attributes":{"$ref":"#/components/schemas/benchmark"},"relationships":{"type":"object","properties":{}}}}}}}}}}}},"patch":{"summary":"Update a profile","tags":["profile"],"description":"Updates a profile","operationId":"UpdateProfile","parameters":[{"name":"X-RH-IDENTITY","in":"header","schema":{"type":"string"}},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"A comma seperated list of resources to include in the response"},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"profile not found","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"errors":["Profile not found with ID invalid"]},"summary":"","description":""}}}}},"200":{"description":"updates a profile","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"data":{"id":"61c7acef-00c8-4983-901b-1e89bb481b05","type":"profile","attributes":{"ref_id":"xccdf_org.ssgproject.content_profile_9126c68f-d495-4b95-84d0-4c424bcf8d5c","score":0.0,"parent_profile_id":"1f32b768-5657-400e-b60c-194d673f150a","external":false,"compliance_threshold":93.5,"os_major_version":"7","os_version":"7","policy_profile_id":"61c7acef-00c8-4983-901b-1e89bb481b05","os_minor_version":"","parent_profile_ref_id":"xccdf_org.ssgproject.content_profile_fdf44f79-849a-4cd0-8474-012be83dda90","values":{},"name":"Policy for Profile","description":"An updated custom description","canonical":false,"tailored":false,"total_host_count":2,"ssg_version":"100.0.22","compliant_host_count":0,"test_result_host_count":0,"unsupported_host_count":0,"business_objective":"APAC Expansion","policy_type":"Canonical Profile"},"relationships":{"account":{"data":{"id":"0d55a5b2-d6a2-4840-a720-989e6a388ffc","type":"account"}},"benchmark":{"data":{"id":"86922b12-252d-43ca-89c6-f1142dfb7fab","type":"benchmark"}},"parent_profile":{"data":{"id":"1f32b768-5657-400e-b60c-194d673f150a","type":"profile"}},"rules":{"data":[{"id":"199e4b38-9b50-492f-8a01-21233e9ec1bc","type":"rule"},{"id":"1a176fcf-a016-4e7e-b740-706575c887d8","type":"rule"},{"id":"51d66295-7425-4f10-bbe7-931e8b97bea1","type":"rule"},{"id":"056b50b2-35fe-445b-b3c0-07f2b8ae3108","type":"rule"},{"id":"856189d3-ed37-4212-862d-a67e07da51ae","type":"rule"}]},"hosts":{"data":[{"id":"fa10987a-317c-4bf2-aabb-5063daef5fcd","type":"host"},{"id":"f1877019-bee5-42ba-91a2-634d9d1d89e1","type":"host"}]},"test_results":{"data":[]}}}},"summary":"","description":""}},"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/metadata"},"links":{"$ref":"#/components/schemas/links"},"data":{"type":"object","properties":{"type":{"type":"string"},"id":{"$ref":"#/components/schemas/uuid"},"attributes":{"$ref":"#/components/schemas/profile"},"relationships":{"$ref":"#/components/schemas/profile_relationships"}}}}}}}}},"requestBody":{"content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"type":{"type":"string","example":"profile"},"data":{"type":"object","properties":{"type":{"type":"string"},"id":{"$ref":"#/components/schemas/uuid"},"attributes":{"$ref":"#/components/schemas/profile"},"relationships":{"$ref":"#/components/schemas/profile_relationships"}}}},"example":{"data":{"attributes":{"description":"This profile contains rules to ensure standard security baseline\\nof a Red Hat Enterprise Linux 7 system. Regardless of your system's workload\\nall of these checks should pass.","compliance_threshold":92.0,"business_objective":"APAC Expansion","values":{"d411821f-d9e4-45cd-9829-7200087ebb11":12,"aac60333-9234-49ad-aac7-40b2b9a46f02":"false"}},"relationships":{"rules":{"data":[{"id":"cc9afa66-3536-4d2e-bc8e-10111d13ec50","type":"rule"},{"id":"06a19f0e-5c7a-4d54-bc66-e932a96bf954","type":"rule"}]},"hosts":{"data":[{"id":"6c3837ed-edac-4522-83a1-147af958f0f2","type":"host"},{"id":"f896d5e7-e44e-41cb-8e8e-96aab6d895d6","type":"host"}]}}}}}}}}},"delete":{"summary":"Destroy a profile","tags":["profile"],"description":"Destroys a profile","operationId":"DestroyProfile","parameters":[{"name":"X-RH-IDENTITY","in":"header","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"A comma seperated list of resources to include in the response"}],"responses":{"404":{"description":"profile not found","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"errors":["Profile not found with ID invalid"]},"summary":"","description":""}}}}},"202":{"description":"destroys a profile","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"data":{"id":"111c3dae-78b6-40c9-8d15-2b061799a73a","type":"profile","attributes":{"ref_id":"xccdf_org.ssgproject.content_profile_3bf96a6f-1009-4a13-a6b9-a1433e0a2e13","score":0.0,"parent_profile_id":"0951195a-2898-414c-805e-fbe1d30e2888","external":false,"compliance_threshold":100.0,"os_major_version":"7","os_version":"7","policy_profile_id":null,"os_minor_version":"","parent_profile_ref_id":"xccdf_org.ssgproject.content_profile_3bf96a6f-1009-4a13-a6b9-a1433e0a2e13","values":{},"name":"Qui quam voluptas inventore.","description":"Nisi eum ducimus. Quia et libero. Sint dolore non.","canonical":false,"tailored":false,"total_host_count":0,"ssg_version":"100.0.25","compliant_host_count":0,"test_result_host_count":0,"unsupported_host_count":0,"business_objective":null,"policy_type":"Quas soluta sint corporis."},"relationships":{"account":{"data":{"id":"4b86d5ae-ce70-497d-96aa-64a124d7b426","type":"account"}},"benchmark":{"data":{"id":"37c8b6c0-a5d4-4bae-b461-098e0a1a58c2","type":"benchmark"}},"parent_profile":{"data":{"id":"0951195a-2898-414c-805e-fbe1d30e2888","type":"profile"}},"rules":{"data":[]},"hosts":{"data":[]},"test_results":{"data":[]}}}},"summary":"","description":""}},"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/metadata"},"links":{"$ref":"#/components/schemas/links"},"data":{"type":"object","properties":{"type":{"type":"string"},"id":{"$ref":"#/components/schemas/uuid"},"attributes":{"$ref":"#/components/schemas/profile"},"relationships":{"$ref":"#/components/schemas/profile_relationships"}}}}}}}}}}},"/rule_results":{"get":{"summary":"List all rule_results","tags":["rule_result"],"description":"Lists all rule_results requested","operationId":"ListRuleResults","parameters":[{"name":"X-RH-IDENTITY","in":"header","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"The number of items to return","schema":{"type":"integer","maximum":100,"minimum":1,"default":10}},{"name":"offset","in":"query","required":false,"description":"The number of items to skip before starting to collect the result set","schema":{"type":"integer","minimum":1,"default":1}},{"name":"search","in":"query","required":false,"description":"Query string compliant with scoped_search query language: https://github.com/wvanbergen/scoped_search/wiki/Query-language","schema":{"type":"string"}},{"name":"sort_by","in":"query","required":false,"description":"A string or an array of fields with an optional direction (:asc or :desc) to sort the results.","schema":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}],"items":{"enum":["result","result:asc","result:desc"]}}},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"A comma seperated list of resources to include in the response"}],"responses":{"200":{"description":"lists all rule_results requested","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"data":[{"id":"0debb846-8155-4f8e-b94a-8ce1c9c8ce00","type":"rule_result","attributes":{"result":"pass"},"relationships":{"host":{"data":{"id":"b700bbb8-3cfb-4d0e-94ec-9f67c2253c33","type":"host"}},"rule":{"data":{"id":"f0c06e37-6561-482b-9e35-2cbd99f8574d","type":"rule"}}}}],"meta":{"total":1,"limit":10,"offset":1,"relationships":true},"links":{"first":"/api/compliance/rule_results?include=&limit=10&offset=1&relationships=true","last":"/api/compliance/rule_results?include=&limit=10&offset=1&relationships=true"}},"summary":"","description":""}},"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/metadata"},"links":{"$ref":"#/components/schemas/links"},"data":{"type":"array","items":{"properties":{"type":{"type":"string"},"id":{"type":"string","format":"uuid"},"attributes":{"$ref":"#/components/schemas/rule_result"},"relationships":{"$ref":"#/components/schemas/rule_result_relationships"}}}}}}}}}}}},"/rules":{"get":{"summary":"List all rules","tags":["rule"],"description":"Lists all rules requested","operationId":"ListRules","parameters":[{"name":"X-RH-IDENTITY","in":"header","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"The number of items to return","schema":{"type":"integer","maximum":100,"minimum":1,"default":10}},{"name":"offset","in":"query","required":false,"description":"The number of items to skip before starting to collect the result set","schema":{"type":"integer","minimum":1,"default":1}},{"name":"search","in":"query","required":false,"description":"Query string compliant with scoped_search query language: https://github.com/wvanbergen/scoped_search/wiki/Query-language","schema":{"type":"string"}},{"name":"sort_by","in":"query","required":false,"description":"A string or an array of fields with an optional direction (:asc or :desc) to sort the results.","schema":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}],"items":{"enum":["title","precedence","severity","remediation_available","title:asc","title:desc","precedence:asc","precedence:desc","severity:asc","severity:desc","remediation_available:asc","remediation_available:desc"]}}},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"A comma seperated list of resources to include in the response"}],"responses":{"200":{"description":"lists all rules requested","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"data":[{"id":"dd373fc7-6dfd-4256-9cc4-491606d9ce68","type":"rule","attributes":{"ref_id":"foo_rule_24c895c4-0f95-45f8-aac9-388dbc88c1a9","title":"Quis unde quia nesciunt.","rationale":"Culpa expedita optio. Nisi rerum quisquam. Accusamus non eum.","description":"Ratione qui minus. Accusamus aliquid rerum. Sit earum maiores.","severity":"high","slug":"foo_rule_24c895c4-0f95-45f8-aac9-388dbc88c1a9","values":["b643860f-737b-4826-a2e5-8b4dcbcc5789","07205f00-c71b-4495-8555-827b731b9c9a","92f92422-82c7-43d5-9129-63aa93741386"],"precedence":1,"remediation_issue_id":null},"relationships":{"benchmark":{"data":{"id":"acbb7126-1225-4a78-a318-54da57ac44b5","type":"benchmark"}},"profiles":{"data":[{"id":"bf231c36-1b51-4873-8461-7037cfd208a7","type":"profile"},{"id":"942aacc9-f729-4d9c-afaa-89fe9393ac95","type":"profile"}]},"rule_identifier":{"data":{"id":"0e4ab546-e19a-497b-a1f7-7ac185bc9e7a","type":"rule_identifier"}}}}],"meta":{"total":1,"limit":10,"offset":1,"relationships":true},"links":{"first":"/api/compliance/rules?include=&limit=10&offset=1&relationships=true","last":"/api/compliance/rules?include=&limit=10&offset=1&relationships=true"}},"summary":"","description":""}},"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/metadata"},"links":{"$ref":"#/components/schemas/links"},"data":{"type":"array","items":{"properties":{"type":{"type":"string"},"id":{"type":"string","format":"uuid"},"attributes":{"$ref":"#/components/schemas/rule"},"relationships":{"$ref":"#/components/schemas/rule_relationships"}}}}}}}}}}}},"/rules/{id}":{"get":{"summary":"Retrieve a rule","tags":["rule"],"description":"Retrieves data for a rule","operationId":"ShowRule","parameters":[{"name":"X-RH-IDENTITY","in":"header","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"A comma seperated list of resources to include in the response"}],"responses":{"404":{"description":"rule not found","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"errors":[" not found with ID "]},"summary":"","description":""}}}}},"200":{"description":"retrieves a rule","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"data":{"id":"eb735be6-e470-4282-9b2b-579e3f3c49eb","type":"rule","attributes":{"ref_id":"foo_rule_edf6f171-9a80-4e38-9411-6db9abb082c2","title":"Est optio praesentium quasi.","rationale":"Eos molestias aut. Aliquid blanditiis vero. Numquam omnis magni.","description":"Dolorem possimus sapiente. Reprehenderit magnam quam. Officia et tempore.","severity":"high","slug":"foo_rule_edf6f171-9a80-4e38-9411-6db9abb082c2","values":["475fe18d-f956-42f4-86d5-28eb81eb2ee6","73299763-fef6-42db-9ece-9146dc60c2b3","8028d1a4-8ab4-4b4a-94c5-4ed0b0d0b16e"],"precedence":1,"remediation_issue_id":null},"relationships":{"benchmark":{"data":{"id":"c29ce472-c705-406c-85c7-bfcfe40800c4","type":"benchmark"}},"profiles":{"data":[{"id":"b3a64f2b-3dc6-46cb-988f-5e2f56123619","type":"profile"},{"id":"cc8059da-8cfe-469b-899c-ecea6f5c2d20","type":"profile"}]},"rule_identifier":{"data":{"id":"6047b37e-16c2-48b9-b30b-2026eeae43eb","type":"rule_identifier"}}}}},"summary":"","description":""}},"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/metadata"},"links":{"$ref":"#/components/schemas/links"},"data":{"type":"object","properties":{"type":{"type":"string"},"id":{"$ref":"#/components/schemas/uuid"},"attributes":{"$ref":"#/components/schemas/rule"},"relationships":{"$ref":"#/components/schemas/rule_relationships"}}}}}}}}}}},"/status":{"get":{"summary":"status","tags":["status"],"description":"Display Compliance status","operationId":"Status","responses":{"200":{"description":"successful status","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"data":{"api":true}},"summary":"","description":""}},"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/status"}}}}}},"500":{"description":"unsuccessful status","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"data":{"api":false}},"summary":"","description":""}},"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/status"}}}}}}}}},"/supported_ssgs":{"get":{"summary":"List all supported SSGs","tags":["supported_ssg"],"description":"List all supported SSGs mapped to RHEL minor version","operationId":"ListSupportedSsgs","parameters":[{"name":"X-RH-IDENTITY","in":"header","schema":{"type":"string"}},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"A comma seperated list of resources to include in the response"}],"responses":{"200":{"description":"lists all supported_ssgs requested","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"data":[{"id":"RHEL-6.6:scap-security-guide-0.1.18-3.el6","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.18-3.el6","version":"0.1.18","os_major_version":"6","os_minor_version":"6","profiles":["C2S","common","CS2","CSCF-RHEL6-MLS","rht-ccp","server","stig-rhel6-server-upstream","test","usgcb-rhel6-server"]}},{"id":"RHEL-6.7:scap-security-guide-0.1.21-3.el6","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.21-3.el6","version":"0.1.21","os_major_version":"6","os_minor_version":"7","profiles":["C2S","common","CS2","CSCF-RHEL6-MLS","rht-ccp","server","stig-rhel6-server-upstream","usgcb-rhel6-server"]}},{"id":"RHEL-6.8:scap-security-guide-0.1.28-2.el6","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.28-2.el6","version":"0.1.28","os_major_version":"6","os_minor_version":"8","profiles":["C2S","common","CS2","CSCF-RHEL6-MLS","nist-cl-il-al","pci-dss","rht-ccp","server","standard","stig-rhel6-server-upstream","usgcb-rhel6-server"]}},{"id":"RHEL-6.9:scap-security-guide-0.1.28-3.el6","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.28-3.el6","version":"0.1.28","os_major_version":"6","os_minor_version":"9","profiles":["C2S","common","CS2","CSCF-RHEL6-MLS","nist-cl-il-al","pci-dss","rht-ccp","server","standard","stig-rhel6-server-upstream","usgcb-rhel6-server"]}},{"id":"RHEL-6.10:scap-security-guide-0.1.28-4.el6","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.28-4.el6","version":"0.1.28","os_major_version":"6","os_minor_version":"10","profiles":["C2S","common","CS2","CSCF-RHEL6-MLS","nist-cl-il-al","pci-dss","rht-ccp","server","standard","stig-rhel6-server-upstream","usgcb-rhel6-server"]}},{"id":"RHEL-7.1:scap-security-guide-0.1.19-2.el7","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.19-2.el7","version":"0.1.19","os_major_version":"7","os_minor_version":"1","profiles":["rht-ccp"]}},{"id":"RHEL-7.2:scap-security-guide-0.1.25-3.el7","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.25-3.el7","version":"0.1.25","os_major_version":"7","os_minor_version":"2","profiles":["common","pci-dss","rht-ccp","standard","stig-rhel7-server-upstream"]}},{"id":"RHEL-7.3:scap-security-guide-0.1.30-5.el7_3","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.30-5.el7_3","version":"0.1.30","os_major_version":"7","os_minor_version":"3","profiles":["C2S","cjis-rhel7-server","common","nist-cl-il-al","ospp-rhel7-server","pci-dss","rht-ccp","standard","stig-rhel7-server-gui-upstream","stig-rhel7-server-upstream","stig-rhel7-workstation-upstream"]}},{"id":"RHEL-7.4:scap-security-guide-0.1.33-6.el7_4","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.33-6.el7_4","version":"0.1.33","os_major_version":"7","os_minor_version":"4","profiles":["C2S","cjis-rhel7-server","common","docker-host","nist-800-171-cui","ospp-rhel7","pci-dss_centric","pci-dss","rht-ccp","standard","stig-rhel7-disa","stig-rhevh-upstream"]}},{"id":"RHEL-7.5:scap-security-guide-0.1.36-10.el7_5","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.36-10.el7_5","version":"0.1.36","os_major_version":"7","os_minor_version":"5","profiles":["C2S","cjis-rhel7-server","common","docker-host","nist-800-171-cui","ospp-rhel7","pci-dss_centric","pci-dss","rht-ccp","standard","stig-rhel7-disa","stig-rhevh-upstream"]}},{"id":"RHEL-7.6:scap-security-guide-0.1.40-13.el7_6","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.40-13.el7_6","version":"0.1.40","os_major_version":"7","os_minor_version":"6","profiles":["C2S","cjis","hipaa","nist-800-171-cui","ospp42","ospp","pci-dss_centric","pci-dss","rht-ccp","standard","stig-rhel7-disa"]}},{"id":"RHEL-7.7:scap-security-guide-0.1.43-13.el7","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.43-13.el7","version":"0.1.43","os_major_version":"7","os_minor_version":"7","profiles":["C2S","cjis","hipaa","nist-800-171-cui","ospp42","ospp","pci-dss_centric","pci-dss","rhelh-vpp","rht-ccp","standard","stig-rhel7-disa"]}},{"id":"RHEL-7.8:scap-security-guide-0.1.46-11.el7","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.46-11.el7","version":"0.1.46","os_major_version":"7","os_minor_version":"8","profiles":["anssi_nt28_enhanced","anssi_nt28_high","anssi_nt28_intermediary","anssi_nt28_minimal","C2S","cjis","cui","e8","hipaa","ncp","ospp","pci-dss_centric","pci-dss","rhelh-stig","rhelh-vpp","rht-ccp","standard","stig"]}},{"id":"RHEL-7.9:scap-security-guide-0.1.49-13.el7","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.49-13.el7","version":"0.1.49","os_major_version":"7","os_minor_version":"9","profiles":["anssi_nt28_enhanced","anssi_nt28_high","anssi_nt28_intermediary","anssi_nt28_minimal","C2S","cis","cjis","cui","e8","hipaa","ncp","ospp","pci-dss_centric","pci-dss","rhelh-stig","rhelh-vpp","rht-ccp","standard","stig"]}},{"id":"RHEL-7.9:scap-security-guide-0.1.52-2.el7_9","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.52-2.el7_9","version":"0.1.52","os_major_version":"7","os_minor_version":"9","profiles":["anssi_nt28_enhanced","anssi_nt28_high","anssi_nt28_intermediary","anssi_nt28_minimal","C2S","cis","cjis","cui","e8","hipaa","ncp","ospp","pci-dss_centric","pci-dss","rhelh-stig","rhelh-vpp","rht-ccp","standard","stig"]}},{"id":"RHEL-7.9:scap-security-guide-0.1.54-7.el7_9","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.54-7.el7_9","version":"0.1.54","os_major_version":"7","os_minor_version":"9","profiles":["anssi_nt28_enhanced","anssi_nt28_high","anssi_nt28_intermediary","anssi_nt28_minimal","C2S","cis","cjis","cui","e8","hipaa","ncp","ospp","pci-dss_centric","pci-dss","rhelh-stig","rhelh-vpp","rht-ccp","standard","stig"]}},{"id":"RHEL-7.9:scap-security-guide-0.1.57-8.el7_9","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.57-8.el7_9","version":"0.1.57","os_major_version":"7","os_minor_version":"9","profiles":["anssi_nt28_enhanced","anssi_nt28_high","anssi_nt28_intermediary","anssi_nt28_minimal","C2S","cis","cis_server_l1","cis_workstation_l1","cis_workstation_l2","cjis","cui","e8","hipaa","ncp","ospp","pci-dss_centric","pci-dss","rhelh-stig","rhelh-vpp","rht-ccp","standard","stig","stig_gui"]}},{"id":"RHEL-8.0:scap-security-guide-0.1.42-11.el8","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.42-11.el8","version":"0.1.42","os_major_version":"8","os_minor_version":"0","profiles":["ospp","pci-dss"]}},{"id":"RHEL-8.1:scap-security-guide-0.1.46-1.el8","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.46-1.el8","version":"0.1.46","os_major_version":"8","os_minor_version":"1","profiles":["ospp","pci-dss"]}},{"id":"RHEL-8.1:scap-security-guide-0.1.47-8.el8_1","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.47-8.el8_1","version":"0.1.47","os_major_version":"8","os_minor_version":"1","profiles":["ospp","pci-dss"]}},{"id":"RHEL-8.2:scap-security-guide-0.1.48-10.el8_2","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.48-10.el8_2","version":"0.1.48","os_major_version":"8","os_minor_version":"2","profiles":["e8","ospp","pci-dss","stig"]}},{"id":"RHEL-8.3:scap-security-guide-0.1.50-16.el8_3","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.50-16.el8_3","version":"0.1.50","os_major_version":"8","os_minor_version":"3","profiles":["cis","cui","e8","hipaa","ospp","pci-dss","stig"]}},{"id":"RHEL-8.4:scap-security-guide-0.1.54-5.el8","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.54-5.el8","version":"0.1.54","os_major_version":"8","os_minor_version":"4","profiles":["anssi_bp28_enhanced","anssi_bp28_intermediary","anssi_bp28_minimal","cis","cui","e8","hipaa","ospp","pci-dss","stig"]}},{"id":"RHEL-8.4:scap-security-guide-0.1.57-10.el8_4","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.57-10.el8_4","version":"0.1.57","os_major_version":"8","os_minor_version":"4","profiles":["anssi_bp28_enhanced","anssi_bp28_high","anssi_bp28_intermediary","anssi_bp28_minimal","cis","cis_server_l1","cis_workstation_l1","cis_workstation_l2","cui","e8","hipaa","ism_o","ospp","pci-dss","stig","stig_gui"]}},{"id":"RHEL-8.4:scap-security-guide-0.1.63-3.el8_4","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.63-3.el8_4","version":"0.1.63","os_major_version":"8","os_minor_version":"4","profiles":["anssi_bp28_enhanced","anssi_bp28_high","anssi_bp28_intermediary","anssi_bp28_minimal","cis","cis_server_l1","cis_workstation_l1","cis_workstation_l2","cui","e8","hipaa","ism_o","ospp","pci-dss","stig","stig_gui"]}},{"id":"RHEL-8.5:scap-security-guide-0.1.57-5.el8","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.57-5.el8","version":"0.1.57","os_major_version":"8","os_minor_version":"5","profiles":["anssi_bp28_enhanced","anssi_bp28_high","anssi_bp28_intermediary","anssi_bp28_minimal","cis","cis_server_l1","cis_workstation_l1","cis_workstation_l2","cui","e8","hipaa","ism_o","ospp","pci-dss","stig","stig_gui"]}},{"id":"RHEL-8.5:scap-security-guide-0.1.57-9.el8_5","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.57-9.el8_5","version":"0.1.57","os_major_version":"8","os_minor_version":"5","profiles":["anssi_bp28_enhanced","anssi_bp28_high","anssi_bp28_intermediary","anssi_bp28_minimal","cis","cis_server_l1","cis_workstation_l1","cis_workstation_l2","cui","e8","hipaa","ism_o","ospp","pci-dss","stig","stig_gui"]}},{"id":"RHEL-8.6:scap-security-guide-0.1.60-9.el8_6","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.60-9.el8_6","version":"0.1.60","os_major_version":"8","os_minor_version":"6","profiles":["anssi_bp28_enhanced","anssi_bp28_high","anssi_bp28_intermediary","anssi_bp28_minimal","cis","cis_server_l1","cis_workstation_l1","cis_workstation_l2","cui","e8","hipaa","ism_o","ospp","pci-dss","stig","stig_gui"]}},{"id":"RHEL-9.0:scap-security-guide-0.1.60-6.el9_0","type":"supported_ssg","attributes":{"package":"scap-security-guide-0.1.60-6.el9_0","version":"0.1.60","os_major_version":"9","os_minor_version":"0","profiles":["anssi_bp28_enhanced","anssi_bp28_high","anssi_bp28_intermediary","anssi_bp28_minimal","cis","cis_server_l1","cis_workstation_l1","cis_workstation_l2","cui","e8","hipaa","ism_o","ospp","pci-dss","stig","stig_gui"]}}],"meta":{"total":29,"revision":"2022-08-18"}},"summary":"","description":""}},"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/metadata"},"data":{"type":"array","items":{"properties":{"type":{"type":"string"},"id":{"type":"string"},"attributes":{"$ref":"#/components/schemas/supported_ssg"}}}}}}}}}}}},"/systems":{"get":{"summary":"List all hosts","tags":["host"],"description":"Lists all hosts requested","operationId":"ListHosts","parameters":[{"name":"X-RH-IDENTITY","in":"header","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"The number of items to return","schema":{"type":"integer","maximum":100,"minimum":1,"default":10}},{"name":"offset","in":"query","required":false,"description":"The number of items to skip before starting to collect the result set","schema":{"type":"integer","minimum":1,"default":1}},{"name":"search","in":"query","required":false,"description":"Query string compliant with scoped_search query language: https://github.com/wvanbergen/scoped_search/wiki/Query-language","schema":{"type":"string"}},{"name":"tags","in":"query","required":false,"description":"A string or an array of tags to narrow down the results against. The namespace, key and value are concatenated using `/` and `=` symbols. In case the values contain symbols used for separators, `/` is replaced with `%2F`, `=` is replaced with `%3D`.

e.g.: `namespace/key=value`, `insights-client/selinux-config=SELINUX%3Denforcing`","schema":{"type":"array","items":{"type":"string"}}},{"name":"sort_by","in":"query","required":false,"description":"A string or an array of fields with an optional direction (:asc or :desc) to sort the results.","schema":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}],"items":{"enum":["name","score","os_major_version","os_minor_version","ssg_version","rules_failed","name:asc","name:desc","score:asc","score:desc","os_major_version:asc","os_major_version:desc","os_minor_version:asc","os_minor_version:desc","ssg_version:asc","ssg_version:desc","rules_failed:asc","rules_failed:desc"]}}},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"A comma seperated list of resources to include in the response"}],"responses":{"200":{"description":"lists all hosts requested","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"data":[{"id":"031842a0-c337-428e-9933-ca741870205f","type":"host","attributes":{"name":"buckridge.co","os_major_version":7,"os_minor_version":9,"last_scanned":"2023-07-27T07:40:06Z","groups":[{"id":"fdb01e61-e86b-4ded-a509-e2963a5a8dfe","name":"ADP"}],"rules_passed":0,"rules_failed":0,"has_policy":true,"culled_timestamp":"2033-08-10T07:40:06Z","stale_timestamp":"2033-07-27T07:40:06Z","stale_warning_timestamp":"2033-08-03T07:40:06Z","updated":"2023-07-27T07:40:06Z","insights_id":"45b7b025-4bf4-48a5-abbd-161c12ece8f4","compliant":false},"relationships":{"test_results":{"data":[{"id":"040d5c5c-6217-47a2-8b0a-f9f106565c02","type":"test_result"}]},"profiles":{"data":[{"id":"d005ae47-ac21-48be-b6b6-ccedf7e23764","type":"profile"}]}}}],"meta":{"total":1,"search":"has_test_results=true or has_policy=true","tags":["foo/bar=baz"],"limit":10,"offset":1,"relationships":true},"links":{"first":"/api/compliance/systems?include=&limit=10&offset=1&relationships=true&search=has_test_results%3Dtrue+or+has_policy%3Dtrue&tags=foo%2Fbar%3Dbaz","last":"/api/compliance/systems?include=&limit=10&offset=1&relationships=true&search=has_test_results%3Dtrue+or+has_policy%3Dtrue&tags=foo%2Fbar%3Dbaz"}},"summary":"","description":""}},"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/metadata"},"links":{"$ref":"#/components/schemas/links"},"data":{"type":"array","items":{"properties":{"type":{"type":"string"},"id":{"$ref":"#/components/schemas/uuid"},"attributes":{"$ref":"#/components/schemas/host"},"relationships":{"$ref":"#/components/schemas/host_relationships"}}}}}}}}}}}},"/systems/{id}":{"get":{"summary":"Retrieve a system","tags":["host"],"description":"Retrieves data for a system","operationId":"ShowHost","parameters":[{"name":"X-RH-IDENTITY","in":"header","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"A comma seperated list of resources to include in the response"}],"responses":{"404":{"description":"system not found","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"errors":["Host not found with ID invalid"]},"summary":"","description":""}}}}},"200":{"description":"retrieves a system","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"data":{"id":"d1f1ab84-61f1-4022-9974-e30296790fa2","type":"host","attributes":{"name":"mosciski.biz","os_major_version":7,"os_minor_version":9,"last_scanned":"2023-07-27T07:40:06Z","groups":[{"id":"e432ac09-7ad4-4a25-8f54-7a8931469252","name":"SCSI"}],"rules_passed":0,"rules_failed":0,"has_policy":true,"culled_timestamp":"2033-08-10T07:40:06Z","stale_timestamp":"2033-07-27T07:40:06Z","stale_warning_timestamp":"2033-08-03T07:40:06Z","updated":"2023-07-27T07:40:06Z","insights_id":"45b7b025-4bf4-48a5-abbd-161c12ece8f4","compliant":false},"relationships":{"test_results":{"data":[{"id":"66d74f45-0dc5-4442-9371-c8967fefe3c1","type":"test_result"}]},"profiles":{"data":[{"id":"dcc6822a-55b4-4554-813e-4ebe868e87b5","type":"profile"}]}}}},"summary":"","description":""}},"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/metadata"},"links":{"$ref":"#/components/schemas/links"},"data":{"type":"object","properties":{"type":{"type":"string"},"id":{"$ref":"#/components/schemas/uuid"},"attributes":{"$ref":"#/components/schemas/host"},"relationships":{"$ref":"#/components/schemas/host_relationships"}}}}}}}}}}},"/value_definitions":{"get":{"summary":"List all value definitions","tags":["value_definition"],"description":"Lists all value definitions requested","operationId":"ListValueDefinitions","parameters":[{"name":"X-RH-IDENTITY","in":"header","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"The number of items to return","schema":{"type":"integer","maximum":100,"minimum":1,"default":10}},{"name":"offset","in":"query","required":false,"description":"The number of items to skip before starting to collect the result set","schema":{"type":"integer","minimum":1,"default":1}},{"name":"search","in":"query","required":false,"description":"Query string compliant with scoped_search query language: https://github.com/wvanbergen/scoped_search/wiki/Query-language","schema":{"type":"string"}},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"A comma seperated list of resources to include in the response"}],"responses":{"200":{"description":"lists all value_definitions requested","content":{"application/vnd.api+json":{"examples":{"Response example":{"value":{"data":[{"id":"4ec53d8c-fcc0-4670-b32e-cf5af9416978","type":"value_definition","attributes":{"ref_id":"foo_value_b0342a12-78a1-408e-9e2f-c493444c2d67","title":"Omnis voluptate neque nostrum.","description":"Iure fuga ad. Consequatur sunt voluptatem. Consequuntur fuga pariatur.","value_type":"boolean","default_value":"true"},"relationships":{"benchmark":{"data":{"id":"c1fb0032-70a4-42b0-9dee-dce0c8a99f7f","type":"benchmark"}}}},{"id":"689c2b3e-51c9-4add-9ce2-0146476bfc82","type":"value_definition","attributes":{"ref_id":"foo_value_d361252d-6b12-493c-af53-ff3dcc6cf538","title":"Neque ut quisquam fugit.","description":"Quia recusandae dicta. Nihil accusantium blanditiis. Vitae consequatur rem.","value_type":"boolean","default_value":"true"},"relationships":{"benchmark":{"data":{"id":"51300e0f-c1cd-4eaf-bff5-0484b066fc82","type":"benchmark"}}}}],"meta":{"total":2,"limit":10,"offset":1,"relationships":true},"links":{"first":"/api/compliance/value_definitions?include=&limit=10&offset=1&relationships=true","last":"/api/compliance/value_definitions?include=&limit=10&offset=1&relationships=true"}},"summary":"","description":""}},"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/metadata"},"links":{"$ref":"#/components/schemas/links"},"data":{"type":"array","items":{"properties":{"type":{"type":"string"},"id":{"type":"string","format":"uuid"},"attributes":{"$ref":"#/components/schemas/value_definition"},"relationships":{"$ref":"#/components/schemas/value_definition_relationships"}}}}}}}}}}}}},"components":{"schemas":{"uuid":{"type":"string","format":"uuid"},"relationship":{"type":"object","properties":{"data":{"type":"object","nullable":true,"properties":{"id":{"$ref":"#/components/schemas/uuid"},"type":{"type":"string"}}}}},"relationship_collection":{"type":"object","properties":{"data":{"type":"array","items":{"properties":{"id":{"$ref":"#/components/schemas/uuid"},"type":{"type":"string"}}}}}},"error":{"type":"object","required":["code","detail","status","title"],"properties":{"status":{"type":"integer","description":"the HTTP status code applicable to this problem, expressed as a string value.","minimum":100,"maximum":600},"code":{"type":"string","description":"an application-specific error code, expressed as a string value."},"title":{"type":"string","description":"a short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization."},"detail":{"type":"string","description":"a human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized."}}},"metadata":{"type":"object","properties":{"filter":{"type":"string","example":"name='Standard System Security Profile for Fedora'"}}},"tags":{"type":"array","items":{"type":"string","example":"insights/environment=production"}},"host":{"type":"object","required":["name"],"properties":{"name":{"type":"string","example":"console.redhat.com"},"compliant":{"type":"boolean","example":true},"has_policy":{"type":"boolean","example":true},"os_major_version":{"type":"integer","example":7,"nullable":true},"os_minor_version":{"type":"integer","example":3,"nullable":true},"last_scanned":{"type":"string","example":"2020-06-04T19:31:55Z"},"rules_passed":{"type":"integer","example":34},"rules_failed":{"type":"integer","example":12},"culled_timestamp":{"type":"string","example":"2020-06-04T19:31:55Z"},"stale_warning_timestamp":{"type":"string","example":"2020-06-04T19:31:55Z"},"stale_timestamp":{"type":"string","example":"2020-06-04T19:31:55Z"},"updated":{"type":"string","example":"2020-06-04T19:31:55Z"},"insights_id":{"type":"string","example":"374399b7-e6ba-49b7-a405-9b620a2bd0b3"},"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","example":"6893cf09-058a-4c66-afb2-fc403a4bf914"},"name":{"type":"string","example":"SCSI"}}}}}},"host_relationships":{"type":"object","properties":{"profiles":{"$ref":"#/components/schemas/relationship_collection"},"test_results":{"$ref":"#/components/schemas/relationship_collection"}}},"links":{"type":"object","properties":{"self":{"type":"string","example":"https://compliance.insights.openshift.org/profiles"}}},"benchmark":{"type":"object","required":["ref_id","title","version"],"properties":{"ref_id":{"type":"string","example":"xccdf_org.ssgproject.content_benchmark_RHEL-7"},"title":{"type":"string","example":"Guide to the Secure Configuration of Red Hat Enterprise Linux 7"},"version":{"type":"string","example":"0.1.46"},"description":{"type":"string"},"os_major_version":{"type":"string"},"latest_supported_os_minor_versions":{"type":"array","items":{"type":"string"}}}},"benchmark_relationships":{"type":"object","properties":{"rules":{"$ref":"#/components/schemas/relationship_collection"},"profiles":{"$ref":"#/components/schemas/relationship_collection"}}},"business_objective":{"type":"object","required":["title"],"properties":{"title":{"type":"string","example":"Guide to the Secure Configuration of Red Hat Enterprise Linux 7"}}},"business_objective_relationships":{"type":"object","properties":{"profiles":{"$ref":"#/components/schemas/relationship_collection"}}},"profile":{"type":"object","required":["parent_profile_id"],"properties":{"name":{"type":"string","example":"my custom profile"},"parent_profile_id":{"type":"string","format":"uuid","nullable":true,"example":"0105a0f0-7379-4897-a891-f95cfb9ddf9c"},"parent_profile_ref_id":{"type":"string","nullable":true,"example":"xccdf_org.ssgproject.content_profile_standard"},"description":{"type":"string","nullable":true,"example":"This profile contains rules to ensure standard security baseline\\nof a Red Hat Enterprise Linux 7 system. Regardless of your system's workload\\nall of these checks should pass."},"compliance_threshold":{"type":"number","example":95.0},"score":{"type":"number","example":63.154762},"business_objective":{"type":"string","example":"APAC Expansion","nullable":true},"canonical":{"type":"boolean","example":true},"ssg_version":{"type":"string","example":"0.1.49"},"values":{"type":"object","example":{"uuid1":"value1","uuid2":"value2"}},"total_host_count":{"type":"integer","example":5},"compliant_host_count":{"type":"integer","example":3},"test_result_host_count":{"type":"integer","example":4},"unsupported_host_count":{"type":"integer","example":3},"external":{"type":"boolean","example":false},"tailored":{"type":"boolean","example":false},"policy_profile_id":{"type":"string","format":"uuid","nullable":true,"example":"374399b7-e6ba-49b7-a405-9b620a2bd0b3"},"os_major_version":{"type":"string","example":"7"},"os_minor_version":{"type":"string","example":"4"},"os_version":{"type":"string","example":"7.4"},"policy_type":{"type":"string","example":"Australian Cyber Security Centre (ACSC) Essential Eight"}}},"profile_relationships":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/relationship"},"benchmark":{"$ref":"#/components/schemas/relationship"},"parent_profile":{"$ref":"#/components/schemas/relationship"},"rules":{"$ref":"#/components/schemas/relationship_collection"},"hosts":{"$ref":"#/components/schemas/relationship_collection"},"test_results":{"$ref":"#/components/schemas/relationship_collection"}}},"rule_result":{"type":"object","required":["result"],"properties":{"result":{"type":"string","example":"passed"}}},"rule_result_relationships":{"type":"object","properties":{"hosts":{"$ref":"#/components/schemas/relationship_collection"},"rules":{"$ref":"#/components/schemas/relationship_collection"}}},"rule":{"type":"object","required":["title","ref_id"],"properties":{"title":{"type":"string","example":"Record Access Events to Audit Log directory"},"ref_id":{"type":"string","example":"xccdf_org.ssgproject.content_rule_directory_access_var_log_audit"},"remediation_issue_id":{"type":"string","nullable":true,"example":"ssg:rhel7|rhelh-stig|xccdf_org.ssgproject.content_rule_no_empty_passwords"},"precedence":{"type":"integer","example":3},"severity":{"type":"string","example":"Low"},"values":{"type":"array","items":{"type":"string"},"example":["uuid1","uuid2"]},"description":{"type":"string","example":"The audit system should collect access audit log directory.\\nThe following audit rule will assure that access to audit log directory are\\ncollected.\\n-a always,exit -F dir=/var/log/audit/ -F perm=r -F auid>=1000-F auid!=unset -F key=access-audit-trail\\nIf theis configured to use the augenrules\\nprogram to read audit rules during daemon startup (the default), add the\\nrule to a file with suffix .rules in the directory\\n/etc/audit/rules.d.\\nIf the auditd daemon is to use the auditctl\\nutility to read audit rules during daemon startup, add the rule to\\n/etc/audit/audit.rules file."},"rationale":{"type":"string","example":"Attempts to read the logs should be recorded, suspicious access to audit log files could be an indicator of malicious activity on a system.\\nAuditing these events could serve as evidence of potential system compromise."}}},"rule_relationships":{"type":"object","properties":{"benchmark":{"$ref":"#/components/schemas/relationship"},"rule_identifier":{"$ref":"#/components/schemas/relationship"},"profiles":{"$ref":"#/components/schemas/relationship_collection"}}},"value_definition":{"type":"object","required":["ref_id","title"],"properties":{"name":{"type":"string","example":"my custom value_definition"},"ref_id":{"type":"string","example":"xccdf_org.ssgproject.content_value_var_polipo_session_bind_all_unreserved_ports"},"title":{"type":"string","nullable":true,"example":"polipo_session_bind_all_unreserved_ports SELinux Boolean"},"description":{"type":"string","nullable":true,"example":"default - Default SELinux boolean setting. on - SELinuxboolean is enabled. off - SELinux boolean is disabled."},"value_type":{"type":"string","example":"boolean"},"default_value":{"type":"string","example":"true"}}},"value_definition_relationships":{"type":"object","properties":{"benchmark":{"$ref":"#/components/schemas/relationship"}}},"status":{"type":"object","properties":{"data":{"type":"object","properties":{"api":{"type":"boolean","example":true}}}}},"supported_ssg":{"type":"object","required":["package","version"],"properties":{"package":{"type":"string","example":"scap-security-guide-0.1.30-5.el7_3"},"version":{"type":"string","example":"0.1.30"},"os_major_version":{"type":"string","example":"7"},"os_minor_version":{"type":"string","example":"3"},"profiles":{"type":"array","items":{"type":"string"}}}}}}} \ No newline at end of file diff --git a/src/constants.js b/src/constants.js index 1fcde262..3f9d48ef 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,3 +1,4 @@ +export const COMPLIANCE_API = '/api/compliance/v1'; export const IMAGE_BUILDER_API = '/api/image-builder/v1'; export const RHSM_API = '/api/rhsm/v2'; export const EDGE_API = '/api/edge/v1'; diff --git a/src/store/complianceApi.ts b/src/store/complianceApi.ts new file mode 100644 index 00000000..657e8b17 --- /dev/null +++ b/src/store/complianceApi.ts @@ -0,0 +1,35 @@ +import { emptyComplianceApi as api } from "./emptyComplianceApi"; +const injectedRtkApi = api.injectEndpoints({ + endpoints: (build) => ({ + listProfiles: build.query({ + query: (queryArg) => ({ + url: `/profiles`, + headers: { "X-RH-IDENTITY": queryArg["X-RH-IDENTITY"] }, + params: { + limit: queryArg.limit, + offset: queryArg.offset, + search: queryArg.search, + sort_by: queryArg.sortBy, + include: queryArg.include, + }, + }), + }), + }), + overrideExisting: false, +}); +export { injectedRtkApi as complianceApi }; +export type ListProfilesApiResponse = unknown; +export type ListProfilesApiArg = { + "X-RH-IDENTITY"?: string; + /** The number of items to return */ + limit?: number; + /** The number of items to skip before starting to collect the result set */ + offset?: number; + /** Query string compliant with scoped_search query language: https://github.com/wvanbergen/scoped_search/wiki/Query-language */ + search?: string; + /** A string or an array of fields with an optional direction (:asc or :desc) to sort the results. */ + sortBy?: string[] | string; + /** A comma seperated list of resources to include in the response */ + include?: string; +}; +export const { useListProfilesQuery } = injectedRtkApi; diff --git a/src/store/emptyComplianceApi.ts b/src/store/emptyComplianceApi.ts new file mode 100644 index 00000000..45498b69 --- /dev/null +++ b/src/store/emptyComplianceApi.ts @@ -0,0 +1,10 @@ +import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'; + +import { COMPLIANCE_API } from '../constants'; + +// initialize an empty api service that we'll inject endpoints into later as needed +export const emptyComplianceApi = createApi({ + reducerPath: 'complianceApi', + baseQuery: fetchBaseQuery({ baseUrl: COMPLIANCE_API }), + endpoints: () => ({}), +}); diff --git a/src/store/index.ts b/src/store/index.ts index bb43882b..1ba39cb4 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -3,6 +3,7 @@ import { configureStore } from '@reduxjs/toolkit'; import promiseMiddleware from 'redux-promise-middleware'; import clonesSlice from './clonesSlice'; +import { complianceApi } from './complianceApi'; import composesSlice from './composesSlice'; import { contentSourcesApi } from './contentSourcesApi'; import { edgeApi } from './edgeApi'; @@ -13,6 +14,7 @@ import { rhsmApi } from './rhsmApi'; export const reducer = { clones: clonesSlice, composes: composesSlice, + [complianceApi.reducerPath]: complianceApi.reducer, [contentSourcesApi.reducerPath]: contentSourcesApi.reducer, [edgeApi.reducerPath]: edgeApi.reducer, [imageBuilderApi.reducerPath]: imageBuilderApi.reducer, @@ -24,6 +26,7 @@ export const reducer = { export const middleware = (getDefaultMiddleware: Function) => getDefaultMiddleware().concat( promiseMiddleware, + complianceApi.middleware, contentSourcesApi.middleware, imageBuilderApi.middleware, rhsmApi.middleware,