foreman_openscap 4.1.1 → 4.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/foreman_openscap/policy.css +5 -0
- data/app/controllers/api/v2/compliance/oval_contents_controller.rb +72 -0
- data/app/controllers/api/v2/compliance/oval_policies_controller.rb +111 -0
- data/app/controllers/api/v2/compliance/oval_reports_controller.rb +47 -0
- data/app/controllers/api/v2/compliance/scap_contents_controller.rb +2 -0
- data/app/controllers/concerns/foreman/controller/parameters/oval_content.rb +22 -0
- data/app/controllers/concerns/foreman/controller/parameters/oval_policy.rb +22 -0
- data/app/controllers/concerns/foreman_openscap/hosts_controller_extensions.rb +1 -1
- data/app/graphql/types/cve.rb +17 -0
- data/app/graphql/types/oval_content.rb +17 -0
- data/app/graphql/types/oval_policy.rb +21 -0
- data/app/helpers/arf_reports_helper.rb +7 -24
- data/app/helpers/policies_helper.rb +4 -17
- data/app/mailers/foreman_openscap/policy_mailer.rb +2 -2
- data/app/models/concerns/foreman_openscap/compliance_status_scoped_search.rb +1 -1
- data/app/models/concerns/foreman_openscap/data_stream_content.rb +0 -17
- data/app/models/concerns/foreman_openscap/host_extensions.rb +11 -11
- data/app/models/concerns/foreman_openscap/hostgroup_extensions.rb +3 -5
- data/app/models/concerns/foreman_openscap/inherited_policies.rb +11 -0
- data/app/models/concerns/foreman_openscap/oval_facet_host_extensions.rb +38 -0
- data/app/models/concerns/foreman_openscap/oval_facet_hostgroup_extensions.rb +15 -0
- data/app/models/concerns/foreman_openscap/policy_common.rb +75 -0
- data/app/models/concerns/foreman_openscap/scap_file_content.rb +24 -0
- data/app/models/foreman_openscap/arf_report.rb +2 -2
- data/app/models/foreman_openscap/cve.rb +23 -0
- data/app/models/foreman_openscap/host/oval_facet.rb +14 -0
- data/app/models/foreman_openscap/host_cve.rb +7 -0
- data/app/models/foreman_openscap/hostgroup/oval_facet.rb +14 -0
- data/app/models/foreman_openscap/hostgroup_oval_facet_oval_policy.rb +6 -0
- data/app/models/foreman_openscap/oval_content.rb +26 -0
- data/app/models/foreman_openscap/oval_facet_oval_policy.rb +6 -0
- data/app/models/foreman_openscap/oval_policy.rb +54 -0
- data/app/models/foreman_openscap/oval_status.rb +45 -0
- data/app/models/foreman_openscap/policy.rb +10 -73
- data/app/models/foreman_openscap/scap_content.rb +1 -0
- data/app/models/foreman_openscap/tailoring_file.rb +1 -0
- data/app/services/foreman_openscap/client_config/ansible.rb +39 -6
- data/app/services/foreman_openscap/client_config/base.rb +5 -1
- data/app/services/foreman_openscap/client_config/puppet.rb +2 -1
- data/app/services/foreman_openscap/config_name_service.rb +1 -1
- data/app/services/foreman_openscap/hostgroup_overrider.rb +2 -24
- data/app/services/foreman_openscap/hostgroup_overrider_common.rb +28 -0
- data/app/services/foreman_openscap/lookup_key_overrider.rb +30 -62
- data/app/services/foreman_openscap/lookup_key_overrides_common.rb +63 -0
- data/app/services/foreman_openscap/oval/check_collection.rb +45 -0
- data/app/services/foreman_openscap/oval/configure.rb +80 -0
- data/app/services/foreman_openscap/oval/cves.rb +41 -0
- data/app/services/foreman_openscap/oval/setup.rb +93 -0
- data/app/services/foreman_openscap/oval/setup_check.rb +55 -0
- data/app/services/foreman_openscap/oval/sync_oval_contents.rb +42 -0
- data/app/views/api/v2/compliance/oval_contents/base.json.rabl +6 -0
- data/app/views/api/v2/compliance/oval_contents/create.json.rabl +3 -0
- data/app/views/api/v2/compliance/oval_contents/index.json.rabl +3 -0
- data/app/views/api/v2/compliance/oval_contents/show.json.rabl +3 -0
- data/app/views/api/v2/compliance/oval_contents/sync.json.rabl +3 -0
- data/app/views/api/v2/compliance/oval_contents/sync_result.json.rabl +11 -0
- data/app/views/api/v2/compliance/oval_contents/update.json.rabl +3 -0
- data/app/views/api/v2/compliance/oval_policies/create.json.rabl +3 -0
- data/app/views/api/v2/compliance/oval_policies/index.json.rabl +3 -0
- data/app/views/api/v2/compliance/oval_policies/main.json.rabl +15 -0
- data/app/views/api/v2/compliance/oval_policies/show.json.rabl +3 -0
- data/app/views/api/v2/compliance/policies/base.json.rabl +2 -2
- data/app/views/api/v2/compliance/policies_common/_attrs.json.rabl +2 -0
- data/app/views/arf_reports/_output.html.erb +9 -1
- data/app/views/arf_reports/show.html.erb +1 -1
- data/app/views/arf_reports/show_html.html.erb +1 -0
- data/app/views/compliance_hosts/show.html.erb +1 -8
- data/app/views/job_templates/run_oval_scans.erb +24 -0
- data/app/views/policies/edit.html.erb +3 -2
- data/app/views/policies/show.html.erb +3 -1
- data/app/views/policies/steps/_deployment_options_form.html.erb +2 -2
- data/app/views/scap_contents/edit.html.erb +2 -12
- data/app/views/tailoring_files/edit.html.erb +2 -10
- data/config/initializers/inflections.rb +12 -0
- data/config/routes.rb +19 -0
- data/db/migrate/20201019074925_create_oval_policy.rb +13 -0
- data/db/migrate/20201020113801_create_oval_facet.rb +14 -0
- data/db/migrate/20201021084109_create_hostgroup_oval_facet.rb +14 -0
- data/db/migrate/20201106080924_create_oval_content.rb +12 -0
- data/db/migrate/20201116110256_add_oval_content_to_oval_policy.rb +5 -0
- data/db/migrate/20201120080329_create_cves.rb +13 -0
- data/db/migrate/20201202110213_update_puppet_port_param_type.rb +2 -6
- data/db/migrate/20201217130800_add_has_errata_to_cve.rb +8 -0
- data/db/migrate/20201217161511_add_url_to_oval_content.rb +5 -0
- data/db/migrate/20210409095625_add_oval_policy_reference_to_cve.rb +7 -0
- data/db/seeds.d/75-job_templates.rb +3 -2
- data/lib/foreman_openscap/bulk_upload.rb +2 -2
- data/lib/foreman_openscap/engine.rb +67 -9
- data/lib/foreman_openscap/version.rb +1 -1
- data/lib/tasks/foreman_openscap_tasks.rake +14 -9
- data/locale/de/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/de/foreman_openscap.edit.po +0 -0
- data/locale/de/foreman_openscap.po +215 -17
- data/locale/en_GB/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/en_GB/foreman_openscap.edit.po +0 -0
- data/locale/en_GB/foreman_openscap.po +213 -15
- data/locale/es/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/es/foreman_openscap.edit.po +0 -0
- data/locale/es/foreman_openscap.po +239 -41
- data/locale/foreman_openscap.pot +395 -112
- data/locale/fr/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/fr/foreman_openscap.edit.po +0 -0
- data/locale/fr/foreman_openscap.po +243 -45
- data/locale/gl/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/gl/foreman_openscap.edit.po +0 -0
- data/locale/gl/foreman_openscap.po +213 -15
- data/locale/it/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/it/foreman_openscap.edit.po +0 -0
- data/locale/it/foreman_openscap.po +213 -15
- data/locale/ja/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/ja/foreman_openscap.edit.po +0 -0
- data/locale/ja/foreman_openscap.po +262 -66
- data/locale/ko/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/ko/foreman_openscap.edit.po +0 -0
- data/locale/ko/foreman_openscap.po +214 -16
- data/locale/pt_BR/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/pt_BR/foreman_openscap.edit.po +0 -0
- data/locale/pt_BR/foreman_openscap.po +252 -54
- data/locale/ru/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/ru/foreman_openscap.edit.po +0 -0
- data/locale/ru/foreman_openscap.po +214 -16
- data/locale/sv_SE/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/sv_SE/foreman_openscap.edit.po +0 -0
- data/locale/sv_SE/foreman_openscap.po +213 -15
- data/locale/zh_CN/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/zh_CN/foreman_openscap.edit.po +0 -0
- data/locale/zh_CN/foreman_openscap.po +369 -169
- data/locale/zh_TW/LC_MESSAGES/foreman_openscap.mo +0 -0
- data/locale/zh_TW/foreman_openscap.edit.po +0 -0
- data/locale/zh_TW/foreman_openscap.po +214 -16
- data/package.json +48 -0
- data/test/factories/compliance_host_factory.rb +12 -0
- data/test/factories/oval_content_factory.rb +7 -0
- data/test/factories/oval_policy_factory.rb +9 -0
- data/test/files/oval_contents/ansible-2.9.oval.xml.bz2 +0 -0
- data/test/fixtures/cve_fixtures.rb +104 -0
- data/test/functional/api/v2/compliance/oval_contents_controller_test.rb +39 -0
- data/test/functional/api/v2/compliance/oval_policies_controller_test.rb +141 -0
- data/test/functional/api/v2/compliance/oval_reports_controller_test.rb +32 -0
- data/test/graphql/queries/oval_contents_query_test.rb +35 -0
- data/test/graphql/queries/oval_policies_query_test.rb +35 -0
- data/test/test_plugin_helper.rb +4 -0
- data/test/unit/oval_host_test.rb +45 -0
- data/test/unit/oval_policy_test.rb +133 -0
- data/test/unit/oval_status_test.rb +47 -0
- data/test/unit/services/oval/cves_test.rb +81 -0
- data/test/unit/services/oval/setup_test.rb +87 -0
- data/webpack/components/EmptyState.js +67 -0
- data/webpack/components/IndexLayout.js +35 -0
- data/webpack/components/IndexLayout.scss +3 -0
- data/webpack/components/IndexTable/IndexTableHelper.js +9 -0
- data/webpack/components/IndexTable/index.js +66 -0
- data/webpack/components/RuleSeverity/RuleSeverity.scss +3 -0
- data/webpack/components/RuleSeverity/RuleSeverity.test.js +13 -0
- data/webpack/components/RuleSeverity/__snapshots__/RuleSeverity.test.js.snap +41 -0
- data/webpack/components/RuleSeverity/i_severity-critical.svg +61 -0
- data/webpack/components/RuleSeverity/i_severity-high.svg +61 -0
- data/webpack/components/RuleSeverity/i_severity-low.svg +62 -0
- data/webpack/components/RuleSeverity/i_severity-med.svg +62 -0
- data/webpack/components/RuleSeverity/i_unknown.svg +33 -0
- data/webpack/components/RuleSeverity/index.js +33 -0
- data/webpack/components/withLoading.js +68 -0
- data/webpack/global_index.js +5 -0
- data/webpack/graphql/queries/cves.gql +18 -0
- data/webpack/graphql/queries/ovalContents.gql +11 -0
- data/webpack/graphql/queries/ovalPolicies.gql +12 -0
- data/webpack/graphql/queries/ovalPolicy.gql +21 -0
- data/webpack/helpers/commonHelper.js +1 -0
- data/webpack/helpers/globalIdHelper.js +13 -0
- data/webpack/helpers/pageParamsHelper.js +31 -0
- data/webpack/helpers/pathsHelper.js +22 -0
- data/webpack/helpers/tableHelper.js +9 -0
- data/webpack/index.js +8 -0
- data/webpack/routes/OvalContents/OvalContentsIndex/OvalContentsIndex.js +45 -0
- data/webpack/routes/OvalContents/OvalContentsIndex/OvalContentsTable.js +38 -0
- data/webpack/routes/OvalContents/OvalContentsIndex/__tests__/OvalContentsIndex.fixtures.js +106 -0
- data/webpack/routes/OvalContents/OvalContentsIndex/__tests__/OvalContentsIndex.test.js +75 -0
- data/webpack/routes/OvalContents/OvalContentsIndex/index.js +7 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesIndex/OvalPoliciesIndex.js +46 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesIndex/OvalPoliciesTable.js +44 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesIndex/__tests__/OvalPoliciesIndex.fixtures.js +61 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesIndex/__tests__/OvalPoliciesIndex.test.js +78 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesIndex/index.js +7 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesShow/CvesTab.js +48 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesShow/CvesTable.js +63 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesShow/OvalPoliciesShow.js +79 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesShow/OvalPoliciesShowHelper.js +39 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesShow/__tests__/OvalPoliciesShow.fixtures.js +78 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesShow/__tests__/OvalPoliciesShow.test.js +112 -0
- data/webpack/routes/OvalPolicies/OvalPoliciesShow/index.js +35 -0
- data/webpack/routes/routes.js +28 -0
- data/webpack/testHelper.js +64 -0
- metadata +143 -3
@@ -0,0 +1,39 @@
|
|
1
|
+
import { decodeId } from '../../../helpers/globalIdHelper';
|
2
|
+
import { addSearch } from '../../../helpers/pageParamsHelper';
|
3
|
+
import { newJobPath } from '../../../helpers/pathsHelper';
|
4
|
+
|
5
|
+
export const policySchedule = policy => {
|
6
|
+
switch (policy.period) {
|
7
|
+
case 'weekly':
|
8
|
+
return `Weekly, on ${policy.weekday}`;
|
9
|
+
case 'monthly':
|
10
|
+
return `Monthly, day of month: ${policy.dayOfMonth}`;
|
11
|
+
case 'custom':
|
12
|
+
return `Custom cron: ${policy.cronLine}`;
|
13
|
+
default:
|
14
|
+
return 'Unknown schedule';
|
15
|
+
}
|
16
|
+
};
|
17
|
+
|
18
|
+
const targetingScopedSearchQuery = policy => {
|
19
|
+
const hgIds = policy.hostgroups.nodes.reduce((memo, hg) => {
|
20
|
+
const ids = [decodeId(hg)].concat(hg.descendants.nodes.map(decodeId));
|
21
|
+
return ids.reduce(
|
22
|
+
(acc, id) => (acc.includes(id) ? acc : [...acc, id]),
|
23
|
+
memo
|
24
|
+
);
|
25
|
+
}, []);
|
26
|
+
|
27
|
+
if (hgIds.length === 0) {
|
28
|
+
return '';
|
29
|
+
}
|
30
|
+
|
31
|
+
return `hostgroup_id ^ (${hgIds.join(' ')})`;
|
32
|
+
};
|
33
|
+
|
34
|
+
export const newJobFormPath = (policy, policyId) =>
|
35
|
+
addSearch(newJobPath, {
|
36
|
+
feature: 'foreman_openscap_run_oval_scans',
|
37
|
+
host_ids: targetingScopedSearchQuery(policy),
|
38
|
+
'inputs[oval_policies]': policyId,
|
39
|
+
});
|
@@ -0,0 +1,78 @@
|
|
1
|
+
import { mockFactory } from '../../../../testHelper';
|
2
|
+
import ovalPolicyQuery from '../../../../graphql/queries/ovalPolicy.gql';
|
3
|
+
import cvesQuery from '../../../../graphql/queries/cves.gql';
|
4
|
+
|
5
|
+
const policyDetailMockFactory = mockFactory('ovalPolicy', ovalPolicyQuery);
|
6
|
+
const cvesMockFactory = mockFactory('cves', cvesQuery);
|
7
|
+
|
8
|
+
const ovalPolicy = {
|
9
|
+
id: 'MDE6Rm9yZW1hbk9wZW5zY2FwOjpPdmFsUG9saWN5LTM=',
|
10
|
+
name: 'Third policy',
|
11
|
+
period: 'weekly',
|
12
|
+
cronLine: null,
|
13
|
+
weekday: 'tuesday',
|
14
|
+
dayOfMonth: null,
|
15
|
+
description: 'A very strict policy',
|
16
|
+
hostgroups: {
|
17
|
+
nodes: [
|
18
|
+
{
|
19
|
+
id: 'MDE6SG9zdGdyb3VwLTQ=',
|
20
|
+
name: 'oval hg',
|
21
|
+
descendants: {
|
22
|
+
nodes: [
|
23
|
+
{ id: 'MDE6SG9zdGdyb3VwLTEw' },
|
24
|
+
{ id: 'MDE6SG9zdGdyb3VwLTEy' },
|
25
|
+
{ id: 'MDE6SG9zdGdyb3VwLTEx' },
|
26
|
+
],
|
27
|
+
},
|
28
|
+
},
|
29
|
+
],
|
30
|
+
},
|
31
|
+
};
|
32
|
+
|
33
|
+
const cvesResult = {
|
34
|
+
totalCount: 1,
|
35
|
+
nodes: [
|
36
|
+
{
|
37
|
+
id: 'MDE6Rm9yZW1hbk9wZW5zY2FwOjpDdmUtMjY3',
|
38
|
+
refId: 'CVE-2020-14365',
|
39
|
+
refUrl: 'https://access.redhat.com/security/cve/CVE-2020-14365',
|
40
|
+
definitionId: 'oval:com.redhat.rhsa:def:20203601',
|
41
|
+
hasErrata: true,
|
42
|
+
hosts: {
|
43
|
+
nodes: [
|
44
|
+
{
|
45
|
+
id: 'MDE6SG9zdC0z',
|
46
|
+
name: 'centos-random.example.com',
|
47
|
+
},
|
48
|
+
],
|
49
|
+
},
|
50
|
+
},
|
51
|
+
],
|
52
|
+
};
|
53
|
+
|
54
|
+
export const ovalPolicyId = 3;
|
55
|
+
|
56
|
+
export const pushMock = jest.fn();
|
57
|
+
|
58
|
+
export const historyMock = {
|
59
|
+
location: {
|
60
|
+
search: '',
|
61
|
+
},
|
62
|
+
push: pushMock,
|
63
|
+
};
|
64
|
+
|
65
|
+
export const historyWithSearch = {
|
66
|
+
location: {
|
67
|
+
search: '?page=1&perPage=5',
|
68
|
+
},
|
69
|
+
};
|
70
|
+
|
71
|
+
export const policyDetailMock = policyDetailMockFactory(
|
72
|
+
{ id: ovalPolicy.id },
|
73
|
+
ovalPolicy
|
74
|
+
);
|
75
|
+
export const policyCvesMock = cvesMockFactory(
|
76
|
+
{ search: `oval_policy_id = ${ovalPolicyId}`, first: 5, last: 5 },
|
77
|
+
cvesResult
|
78
|
+
);
|
@@ -0,0 +1,112 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Router } from 'react-router-dom';
|
3
|
+
import { render, screen, waitFor } from '@testing-library/react';
|
4
|
+
import { within } from '@testing-library/dom';
|
5
|
+
import '@testing-library/jest-dom';
|
6
|
+
import userEvent from '@testing-library/user-event';
|
7
|
+
import { createMemoryHistory } from 'history';
|
8
|
+
|
9
|
+
import OvalPoliciesShow from '../index';
|
10
|
+
import {
|
11
|
+
ovalPoliciesShowPath,
|
12
|
+
resolvePath,
|
13
|
+
} from '../../../../helpers/pathsHelper';
|
14
|
+
|
15
|
+
import { withMockedProvider, tick, withRouter } from '../../../../testHelper';
|
16
|
+
import {
|
17
|
+
policyDetailMock,
|
18
|
+
historyMock,
|
19
|
+
historyWithSearch,
|
20
|
+
pushMock,
|
21
|
+
policyCvesMock,
|
22
|
+
ovalPolicyId,
|
23
|
+
} from './OvalPoliciesShow.fixtures';
|
24
|
+
|
25
|
+
const TestComponent = withRouter(withMockedProvider(OvalPoliciesShow));
|
26
|
+
|
27
|
+
describe('OvalPoliciesShow', () => {
|
28
|
+
it('should load details by default and handle tab change', async () => {
|
29
|
+
const { container } = render(
|
30
|
+
<TestComponent
|
31
|
+
history={historyMock}
|
32
|
+
match={{ params: { id: ovalPolicyId }, path: ovalPoliciesShowPath }}
|
33
|
+
mocks={policyDetailMock}
|
34
|
+
/>
|
35
|
+
);
|
36
|
+
expect(screen.getByText('Loading')).toBeInTheDocument();
|
37
|
+
await waitFor(tick);
|
38
|
+
expect(screen.queryByText('Loading')).not.toBeInTheDocument();
|
39
|
+
expect(screen.getByText('Third policy')).toBeInTheDocument();
|
40
|
+
expect(screen.getByText('Weekly, on tuesday')).toBeInTheDocument();
|
41
|
+
expect(screen.getByText('A very strict policy')).toBeInTheDocument();
|
42
|
+
const activeTabHeader = container.querySelector(
|
43
|
+
'.pf-c-tabs__item.pf-m-current'
|
44
|
+
);
|
45
|
+
expect(within(activeTabHeader).getByText('Details')).toBeInTheDocument();
|
46
|
+
userEvent.click(screen.getByRole('button', { name: 'CVEs' }));
|
47
|
+
expect(pushMock).toHaveBeenCalledWith(
|
48
|
+
resolvePath(ovalPoliciesShowPath, {
|
49
|
+
':id': ovalPolicyId,
|
50
|
+
':tab?': 'cves',
|
51
|
+
})
|
52
|
+
);
|
53
|
+
});
|
54
|
+
it('should load details tab when specified in URL', async () => {
|
55
|
+
render(
|
56
|
+
<TestComponent
|
57
|
+
history={historyMock}
|
58
|
+
match={{
|
59
|
+
params: { id: ovalPolicyId, tab: 'details' },
|
60
|
+
path: ovalPoliciesShowPath,
|
61
|
+
}}
|
62
|
+
mocks={policyDetailMock}
|
63
|
+
/>
|
64
|
+
);
|
65
|
+
expect(screen.getByText('Loading')).toBeInTheDocument();
|
66
|
+
await waitFor(tick);
|
67
|
+
expect(screen.queryByText('Loading')).not.toBeInTheDocument();
|
68
|
+
expect(screen.getByText('Weekly, on tuesday')).toBeInTheDocument();
|
69
|
+
});
|
70
|
+
it('should load CVEs tab when specified in URL', async () => {
|
71
|
+
const mocks = policyDetailMock.concat(policyCvesMock);
|
72
|
+
render(
|
73
|
+
<TestComponent
|
74
|
+
history={historyWithSearch}
|
75
|
+
match={{
|
76
|
+
params: { id: ovalPolicyId, tab: 'cves' },
|
77
|
+
path: ovalPoliciesShowPath,
|
78
|
+
}}
|
79
|
+
mocks={mocks}
|
80
|
+
/>
|
81
|
+
);
|
82
|
+
expect(screen.getByText('Loading')).toBeInTheDocument();
|
83
|
+
await waitFor(tick);
|
84
|
+
await waitFor(tick);
|
85
|
+
expect(screen.queryByText('Loading')).not.toBeInTheDocument();
|
86
|
+
expect(screen.getByText('CVE-2020-14365')).toBeInTheDocument();
|
87
|
+
});
|
88
|
+
it('should have button for scanning all hostgroups', async () => {
|
89
|
+
const btnText = 'Scan All Hostgroups';
|
90
|
+
|
91
|
+
const WithProvider = withMockedProvider(OvalPoliciesShow);
|
92
|
+
const history = createMemoryHistory();
|
93
|
+
history.push = jest.fn();
|
94
|
+
|
95
|
+
render(
|
96
|
+
<Router history={history}>
|
97
|
+
<WithProvider
|
98
|
+
history={history}
|
99
|
+
match={{ params: { id: ovalPolicyId }, path: ovalPoliciesShowPath }}
|
100
|
+
mocks={policyDetailMock}
|
101
|
+
/>
|
102
|
+
</Router>
|
103
|
+
);
|
104
|
+
await waitFor(tick);
|
105
|
+
expect(screen.queryByText('Loading')).not.toBeInTheDocument();
|
106
|
+
expect(screen.getByText(btnText)).toBeInTheDocument();
|
107
|
+
userEvent.click(screen.getByRole('button', { name: btnText }));
|
108
|
+
expect(history.push).toHaveBeenCalledWith(
|
109
|
+
'/job_invocations/new?feature=foreman_openscap_run_oval_scans&host_ids=hostgroup_id+%5E+%284+10+12+11%29&inputs%5Boval_policies%5D=3'
|
110
|
+
);
|
111
|
+
});
|
112
|
+
});
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { useQuery } from '@apollo/client';
|
4
|
+
|
5
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
6
|
+
|
7
|
+
import OvalPoliciesShow from './OvalPoliciesShow';
|
8
|
+
import { encodeId } from '../../../helpers/globalIdHelper';
|
9
|
+
|
10
|
+
import ovalPolicy from '../../../graphql/queries/ovalPolicy.gql';
|
11
|
+
|
12
|
+
const WrappedOvalPoliciesShow = props => {
|
13
|
+
const id = encodeId('ForemanOpenscap::OvalPolicy', props.match.params.id);
|
14
|
+
|
15
|
+
const useFetchFn = componentProps =>
|
16
|
+
useQuery(ovalPolicy, { variables: { id } });
|
17
|
+
|
18
|
+
const renameData = data => ({ policy: data.ovalPolicy });
|
19
|
+
|
20
|
+
return (
|
21
|
+
<OvalPoliciesShow
|
22
|
+
{...props}
|
23
|
+
fetchFn={useFetchFn}
|
24
|
+
renameData={renameData}
|
25
|
+
resultPath="ovalPolicy"
|
26
|
+
emptyStateTitle={__('No OVAL Policy found')}
|
27
|
+
/>
|
28
|
+
);
|
29
|
+
};
|
30
|
+
|
31
|
+
WrappedOvalPoliciesShow.propTypes = {
|
32
|
+
match: PropTypes.object.isRequired,
|
33
|
+
};
|
34
|
+
|
35
|
+
export default WrappedOvalPoliciesShow;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import OvalContentsIndex from './OvalContents/OvalContentsIndex';
|
3
|
+
import OvalPoliciesIndex from './OvalPolicies/OvalPoliciesIndex';
|
4
|
+
import OvalPoliciesShow from './OvalPolicies/OvalPoliciesShow';
|
5
|
+
|
6
|
+
import {
|
7
|
+
ovalContentsPath,
|
8
|
+
ovalPoliciesPath,
|
9
|
+
ovalPoliciesShowPath,
|
10
|
+
} from '../helpers/pathsHelper';
|
11
|
+
|
12
|
+
export default [
|
13
|
+
{
|
14
|
+
path: ovalContentsPath,
|
15
|
+
render: props => <OvalContentsIndex {...props} />,
|
16
|
+
exact: true,
|
17
|
+
},
|
18
|
+
{
|
19
|
+
path: ovalPoliciesPath,
|
20
|
+
render: props => <OvalPoliciesIndex {...props} />,
|
21
|
+
exact: true,
|
22
|
+
},
|
23
|
+
{
|
24
|
+
path: ovalPoliciesShowPath,
|
25
|
+
render: props => <OvalPoliciesShow {...props} />,
|
26
|
+
exact: true,
|
27
|
+
},
|
28
|
+
];
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { MockedProvider } from '@apollo/react-testing';
|
3
|
+
import { MemoryRouter } from 'react-router-dom';
|
4
|
+
import { getForemanContext } from 'foremanReact/Root/Context/ForemanContext';
|
5
|
+
|
6
|
+
export const withRouter = Component => props => (
|
7
|
+
<MemoryRouter>
|
8
|
+
<Component {...props} />
|
9
|
+
</MemoryRouter>
|
10
|
+
);
|
11
|
+
|
12
|
+
export const withMockedProvider = Component => props => {
|
13
|
+
const ForemanContext = getForemanContext(ctx);
|
14
|
+
// eslint-disable-next-line react/prop-types
|
15
|
+
const { mocks, ...rest } = props;
|
16
|
+
|
17
|
+
const ctx = {
|
18
|
+
metadata: {
|
19
|
+
UISettings: {
|
20
|
+
perPage: 20,
|
21
|
+
},
|
22
|
+
},
|
23
|
+
};
|
24
|
+
|
25
|
+
return (
|
26
|
+
<ForemanContext.Provider value={ctx}>
|
27
|
+
<MockedProvider mocks={mocks} addTypename={false}>
|
28
|
+
<Component {...rest} />
|
29
|
+
</MockedProvider>
|
30
|
+
</ForemanContext.Provider>
|
31
|
+
);
|
32
|
+
};
|
33
|
+
|
34
|
+
// use to resolve async mock requests for apollo MockedProvider
|
35
|
+
export const tick = () => new Promise(resolve => setTimeout(resolve, 0));
|
36
|
+
|
37
|
+
export const historyMock = {
|
38
|
+
location: {
|
39
|
+
search: '',
|
40
|
+
},
|
41
|
+
};
|
42
|
+
|
43
|
+
export const mockFactory = (resultName, query) => (
|
44
|
+
variables,
|
45
|
+
modelResults,
|
46
|
+
errors = []
|
47
|
+
) => {
|
48
|
+
const mock = {
|
49
|
+
request: {
|
50
|
+
query,
|
51
|
+
variables,
|
52
|
+
},
|
53
|
+
result: {
|
54
|
+
data: {
|
55
|
+
[resultName]: modelResults,
|
56
|
+
},
|
57
|
+
},
|
58
|
+
};
|
59
|
+
|
60
|
+
if (errors.length !== 0) {
|
61
|
+
mock.result.errors = errors;
|
62
|
+
}
|
63
|
+
return [mock];
|
64
|
+
};
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_openscap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- slukasik@redhat.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -45,6 +45,9 @@ files:
|
|
45
45
|
- app/assets/stylesheets/foreman_openscap/reports.css
|
46
46
|
- app/assets/stylesheets/foreman_openscap/scap_breakdown_chart.css
|
47
47
|
- app/controllers/api/v2/compliance/arf_reports_controller.rb
|
48
|
+
- app/controllers/api/v2/compliance/oval_contents_controller.rb
|
49
|
+
- app/controllers/api/v2/compliance/oval_policies_controller.rb
|
50
|
+
- app/controllers/api/v2/compliance/oval_reports_controller.rb
|
48
51
|
- app/controllers/api/v2/compliance/policies_controller.rb
|
49
52
|
- app/controllers/api/v2/compliance/scap_content_profiles_controller.rb
|
50
53
|
- app/controllers/api/v2/compliance/scap_contents_controller.rb
|
@@ -52,6 +55,8 @@ files:
|
|
52
55
|
- app/controllers/arf_reports_controller.rb
|
53
56
|
- app/controllers/compliance_dashboard_controller.rb
|
54
57
|
- app/controllers/compliance_hosts_controller.rb
|
58
|
+
- app/controllers/concerns/foreman/controller/parameters/oval_content.rb
|
59
|
+
- app/controllers/concerns/foreman/controller/parameters/oval_policy.rb
|
55
60
|
- app/controllers/concerns/foreman/controller/parameters/policy.rb
|
56
61
|
- app/controllers/concerns/foreman/controller/parameters/policy_api.rb
|
57
62
|
- app/controllers/concerns/foreman/controller/parameters/scap_content.rb
|
@@ -67,6 +72,9 @@ files:
|
|
67
72
|
- app/controllers/policy_dashboard_controller.rb
|
68
73
|
- app/controllers/scap_contents_controller.rb
|
69
74
|
- app/controllers/tailoring_files_controller.rb
|
75
|
+
- app/graphql/types/cve.rb
|
76
|
+
- app/graphql/types/oval_content.rb
|
77
|
+
- app/graphql/types/oval_policy.rb
|
70
78
|
- app/helpers/arf_report_dashboard_helper.rb
|
71
79
|
- app/helpers/arf_reports_helper.rb
|
72
80
|
- app/helpers/compliance_dashboard_helper.rb
|
@@ -84,14 +92,28 @@ files:
|
|
84
92
|
- app/models/concerns/foreman_openscap/data_stream_content.rb
|
85
93
|
- app/models/concerns/foreman_openscap/host_extensions.rb
|
86
94
|
- app/models/concerns/foreman_openscap/hostgroup_extensions.rb
|
95
|
+
- app/models/concerns/foreman_openscap/inherited_policies.rb
|
87
96
|
- app/models/concerns/foreman_openscap/log_extensions.rb
|
88
97
|
- app/models/concerns/foreman_openscap/openscap_proxy_core_extensions.rb
|
89
98
|
- app/models/concerns/foreman_openscap/openscap_proxy_extensions.rb
|
99
|
+
- app/models/concerns/foreman_openscap/oval_facet_host_extensions.rb
|
100
|
+
- app/models/concerns/foreman_openscap/oval_facet_hostgroup_extensions.rb
|
101
|
+
- app/models/concerns/foreman_openscap/policy_common.rb
|
102
|
+
- app/models/concerns/foreman_openscap/scap_file_content.rb
|
90
103
|
- app/models/concerns/foreman_openscap/smart_proxy_extensions.rb
|
91
104
|
- app/models/foreman_openscap/arf_report.rb
|
92
105
|
- app/models/foreman_openscap/asset.rb
|
93
106
|
- app/models/foreman_openscap/asset_policy.rb
|
94
107
|
- app/models/foreman_openscap/compliance_status.rb
|
108
|
+
- app/models/foreman_openscap/cve.rb
|
109
|
+
- app/models/foreman_openscap/host/oval_facet.rb
|
110
|
+
- app/models/foreman_openscap/host_cve.rb
|
111
|
+
- app/models/foreman_openscap/hostgroup/oval_facet.rb
|
112
|
+
- app/models/foreman_openscap/hostgroup_oval_facet_oval_policy.rb
|
113
|
+
- app/models/foreman_openscap/oval_content.rb
|
114
|
+
- app/models/foreman_openscap/oval_facet_oval_policy.rb
|
115
|
+
- app/models/foreman_openscap/oval_policy.rb
|
116
|
+
- app/models/foreman_openscap/oval_status.rb
|
95
117
|
- app/models/foreman_openscap/policy.rb
|
96
118
|
- app/models/foreman_openscap/policy_arf_report.rb
|
97
119
|
- app/models/foreman_openscap/policy_revision.rb
|
@@ -106,9 +128,17 @@ files:
|
|
106
128
|
- app/services/foreman_openscap/config_name_service.rb
|
107
129
|
- app/services/foreman_openscap/host_report_dashboard/data.rb
|
108
130
|
- app/services/foreman_openscap/hostgroup_overrider.rb
|
131
|
+
- app/services/foreman_openscap/hostgroup_overrider_common.rb
|
109
132
|
- app/services/foreman_openscap/lookup_key_overrider.rb
|
133
|
+
- app/services/foreman_openscap/lookup_key_overrides_common.rb
|
110
134
|
- app/services/foreman_openscap/openscap_proxy_assigned_version_check.rb
|
111
135
|
- app/services/foreman_openscap/openscap_proxy_version_check.rb
|
136
|
+
- app/services/foreman_openscap/oval/check_collection.rb
|
137
|
+
- app/services/foreman_openscap/oval/configure.rb
|
138
|
+
- app/services/foreman_openscap/oval/cves.rb
|
139
|
+
- app/services/foreman_openscap/oval/setup.rb
|
140
|
+
- app/services/foreman_openscap/oval/setup_check.rb
|
141
|
+
- app/services/foreman_openscap/oval/sync_oval_contents.rb
|
112
142
|
- app/services/foreman_openscap/policy_dashboard/data.rb
|
113
143
|
- app/services/foreman_openscap/report_dashboard/data.rb
|
114
144
|
- app/services/proxy_status/openscap_spool.rb
|
@@ -120,12 +150,24 @@ files:
|
|
120
150
|
- app/views/api/v2/compliance/arf_reports/show.json.rabl
|
121
151
|
- app/views/api/v2/compliance/common/_loc.json.rabl
|
122
152
|
- app/views/api/v2/compliance/common/_org.json.rabl
|
153
|
+
- app/views/api/v2/compliance/oval_contents/base.json.rabl
|
154
|
+
- app/views/api/v2/compliance/oval_contents/create.json.rabl
|
155
|
+
- app/views/api/v2/compliance/oval_contents/index.json.rabl
|
156
|
+
- app/views/api/v2/compliance/oval_contents/show.json.rabl
|
157
|
+
- app/views/api/v2/compliance/oval_contents/sync.json.rabl
|
158
|
+
- app/views/api/v2/compliance/oval_contents/sync_result.json.rabl
|
159
|
+
- app/views/api/v2/compliance/oval_contents/update.json.rabl
|
160
|
+
- app/views/api/v2/compliance/oval_policies/create.json.rabl
|
161
|
+
- app/views/api/v2/compliance/oval_policies/index.json.rabl
|
162
|
+
- app/views/api/v2/compliance/oval_policies/main.json.rabl
|
163
|
+
- app/views/api/v2/compliance/oval_policies/show.json.rabl
|
123
164
|
- app/views/api/v2/compliance/policies/base.json.rabl
|
124
165
|
- app/views/api/v2/compliance/policies/children.json.rabl
|
125
166
|
- app/views/api/v2/compliance/policies/create.json.rabl
|
126
167
|
- app/views/api/v2/compliance/policies/index.json.rabl
|
127
168
|
- app/views/api/v2/compliance/policies/main.json.rabl
|
128
169
|
- app/views/api/v2/compliance/policies/show.json.rabl
|
170
|
+
- app/views/api/v2/compliance/policies_common/_attrs.json.rabl
|
129
171
|
- app/views/api/v2/compliance/scap_content_profiles/base.json.rabl
|
130
172
|
- app/views/api/v2/compliance/scap_content_profiles/index.json.rabl
|
131
173
|
- app/views/api/v2/compliance/scap_content_profiles/main.json.rabl
|
@@ -161,6 +203,7 @@ files:
|
|
161
203
|
- app/views/foreman_openscap/policy_mailer/policy_summary.erb
|
162
204
|
- app/views/hosts/select_multiple_openscap_proxy.html.erb
|
163
205
|
- app/views/job_templates/run_openscap_scans.erb
|
206
|
+
- app/views/job_templates/run_oval_scans.erb
|
164
207
|
- app/views/policies/_form.html.erb
|
165
208
|
- app/views/policies/_list.html.erb
|
166
209
|
- app/views/policies/_scap_content_results.html.erb
|
@@ -199,6 +242,7 @@ files:
|
|
199
242
|
- app/views/tailoring_files/index.html.erb
|
200
243
|
- app/views/tailoring_files/new.html.erb
|
201
244
|
- app/views/tailoring_files/welcome.html.erb
|
245
|
+
- config/initializers/inflections.rb
|
202
246
|
- config/routes.rb
|
203
247
|
- db/migrate/20141013172051_create_scaptimony_policies.rb
|
204
248
|
- db/migrate/20141014105333_create_scaptimony_assets.rb
|
@@ -246,7 +290,16 @@ files:
|
|
246
290
|
- db/migrate/20190103093409_add_deployment_option_to_policy.foreman_openscap.rb
|
247
291
|
- db/migrate/20200117135424_migrate_port_overrides_to_int.rb
|
248
292
|
- db/migrate/20200803065041_migrate_port_overrides_for_ansible.rb
|
293
|
+
- db/migrate/20201019074925_create_oval_policy.rb
|
294
|
+
- db/migrate/20201020113801_create_oval_facet.rb
|
295
|
+
- db/migrate/20201021084109_create_hostgroup_oval_facet.rb
|
296
|
+
- db/migrate/20201106080924_create_oval_content.rb
|
297
|
+
- db/migrate/20201116110256_add_oval_content_to_oval_policy.rb
|
298
|
+
- db/migrate/20201120080329_create_cves.rb
|
249
299
|
- db/migrate/20201202110213_update_puppet_port_param_type.rb
|
300
|
+
- db/migrate/20201217130800_add_has_errata_to_cve.rb
|
301
|
+
- db/migrate/20201217161511_add_url_to_oval_content.rb
|
302
|
+
- db/migrate/20210409095625_add_oval_policy_reference_to_cve.rb
|
250
303
|
- db/seeds.d/75-job_templates.rb
|
251
304
|
- db/seeds.d/openscap_feature.rb
|
252
305
|
- db/seeds.d/openscap_policy_notification.rb
|
@@ -261,37 +314,53 @@ files:
|
|
261
314
|
- locale/Makefile
|
262
315
|
- locale/action_names.rb
|
263
316
|
- locale/de/LC_MESSAGES/foreman_openscap.mo
|
317
|
+
- locale/de/foreman_openscap.edit.po
|
264
318
|
- locale/de/foreman_openscap.po
|
265
319
|
- locale/en_GB/LC_MESSAGES/foreman_openscap.mo
|
320
|
+
- locale/en_GB/foreman_openscap.edit.po
|
266
321
|
- locale/en_GB/foreman_openscap.po
|
267
322
|
- locale/es/LC_MESSAGES/foreman_openscap.mo
|
323
|
+
- locale/es/foreman_openscap.edit.po
|
268
324
|
- locale/es/foreman_openscap.po
|
269
325
|
- locale/foreman_openscap.pot
|
270
326
|
- locale/fr/LC_MESSAGES/foreman_openscap.mo
|
327
|
+
- locale/fr/foreman_openscap.edit.po
|
271
328
|
- locale/fr/foreman_openscap.po
|
272
329
|
- locale/gl/LC_MESSAGES/foreman_openscap.mo
|
330
|
+
- locale/gl/foreman_openscap.edit.po
|
273
331
|
- locale/gl/foreman_openscap.po
|
274
332
|
- locale/it/LC_MESSAGES/foreman_openscap.mo
|
333
|
+
- locale/it/foreman_openscap.edit.po
|
275
334
|
- locale/it/foreman_openscap.po
|
276
335
|
- locale/ja/LC_MESSAGES/foreman_openscap.mo
|
336
|
+
- locale/ja/foreman_openscap.edit.po
|
277
337
|
- locale/ja/foreman_openscap.po
|
278
338
|
- locale/ko/LC_MESSAGES/foreman_openscap.mo
|
339
|
+
- locale/ko/foreman_openscap.edit.po
|
279
340
|
- locale/ko/foreman_openscap.po
|
280
341
|
- locale/pt_BR/LC_MESSAGES/foreman_openscap.mo
|
342
|
+
- locale/pt_BR/foreman_openscap.edit.po
|
281
343
|
- locale/pt_BR/foreman_openscap.po
|
282
344
|
- locale/ru/LC_MESSAGES/foreman_openscap.mo
|
345
|
+
- locale/ru/foreman_openscap.edit.po
|
283
346
|
- locale/ru/foreman_openscap.po
|
284
347
|
- locale/sv_SE/LC_MESSAGES/foreman_openscap.mo
|
348
|
+
- locale/sv_SE/foreman_openscap.edit.po
|
285
349
|
- locale/sv_SE/foreman_openscap.po
|
286
350
|
- locale/zanata.xml
|
287
351
|
- locale/zh_CN/LC_MESSAGES/foreman_openscap.mo
|
352
|
+
- locale/zh_CN/foreman_openscap.edit.po
|
288
353
|
- locale/zh_CN/foreman_openscap.po
|
289
354
|
- locale/zh_TW/LC_MESSAGES/foreman_openscap.mo
|
355
|
+
- locale/zh_TW/foreman_openscap.edit.po
|
290
356
|
- locale/zh_TW/foreman_openscap.po
|
357
|
+
- package.json
|
291
358
|
- test/factories/arf_report_factory.rb
|
292
359
|
- test/factories/asset_factory.rb
|
293
360
|
- test/factories/compliance_host_factory.rb
|
294
361
|
- test/factories/compliance_log_factory.rb
|
362
|
+
- test/factories/oval_content_factory.rb
|
363
|
+
- test/factories/oval_policy_factory.rb
|
295
364
|
- test/factories/policy_arf_report_factory.rb
|
296
365
|
- test/factories/policy_factory.rb
|
297
366
|
- test/factories/scap_content_related.rb
|
@@ -300,10 +369,15 @@ files:
|
|
300
369
|
- test/files/arf_report/arf_report.json
|
301
370
|
- test/files/arf_report/arf_report_msg_desc_changed.json
|
302
371
|
- test/files/arf_report/arf_report_msg_value_changed.json
|
372
|
+
- test/files/oval_contents/ansible-2.9.oval.xml.bz2
|
303
373
|
- test/files/scap_contents/ssg-fedora-ds.xml
|
304
374
|
- test/files/tailoring_files/ssg-firefox-ds-tailoring-2.xml
|
305
375
|
- test/files/tailoring_files/ssg-firefox-ds-tailoring.xml
|
376
|
+
- test/fixtures/cve_fixtures.rb
|
306
377
|
- test/functional/api/v2/compliance/arf_reports_controller_test.rb
|
378
|
+
- test/functional/api/v2/compliance/oval_contents_controller_test.rb
|
379
|
+
- test/functional/api/v2/compliance/oval_policies_controller_test.rb
|
380
|
+
- test/functional/api/v2/compliance/oval_reports_controller_test.rb
|
307
381
|
- test/functional/api/v2/compliance/policies_controller_test.rb
|
308
382
|
- test/functional/api/v2/compliance/scap_content_profiles_controller_test.rb
|
309
383
|
- test/functional/api/v2/compliance/scap_contents_controller_test.rb
|
@@ -312,6 +386,8 @@ files:
|
|
312
386
|
- test/functional/arf_reports_controller_test.rb
|
313
387
|
- test/functional/openscap_proxies_controller_test.rb
|
314
388
|
- test/functional/tailoring_files_controller_test.rb
|
389
|
+
- test/graphql/queries/oval_contents_query_test.rb
|
390
|
+
- test/graphql/queries/oval_policies_query_test.rb
|
315
391
|
- test/helpers/arf_report_dashboard_helper_test.rb
|
316
392
|
- test/helpers/policy_dashboard_helper_test.rb
|
317
393
|
- test/lib/foreman_openscap/bulk_upload_test.rb
|
@@ -323,15 +399,65 @@ files:
|
|
323
399
|
- test/unit/concerns/openscap_proxy_extenstions_test.rb
|
324
400
|
- test/unit/message_cleaner_test.rb
|
325
401
|
- test/unit/openscap_host_test.rb
|
402
|
+
- test/unit/oval_host_test.rb
|
403
|
+
- test/unit/oval_policy_test.rb
|
404
|
+
- test/unit/oval_status_test.rb
|
326
405
|
- test/unit/policy_mailer_test.rb
|
327
406
|
- test/unit/policy_test.rb
|
328
407
|
- test/unit/scap_content_test.rb
|
329
408
|
- test/unit/services/config_name_service_test.rb
|
330
409
|
- test/unit/services/hostgroup_overrider_test.rb
|
331
410
|
- test/unit/services/lookup_key_overrider_test.rb
|
411
|
+
- test/unit/services/oval/cves_test.rb
|
412
|
+
- test/unit/services/oval/setup_test.rb
|
332
413
|
- test/unit/services/report_dashboard/data_test.rb
|
333
414
|
- test/unit/services/tailoring_files_proxy_check_test.rb
|
334
415
|
- test/unit/tailoring_file_test.rb
|
416
|
+
- webpack/components/EmptyState.js
|
417
|
+
- webpack/components/IndexLayout.js
|
418
|
+
- webpack/components/IndexLayout.scss
|
419
|
+
- webpack/components/IndexTable/IndexTableHelper.js
|
420
|
+
- webpack/components/IndexTable/index.js
|
421
|
+
- webpack/components/RuleSeverity/RuleSeverity.scss
|
422
|
+
- webpack/components/RuleSeverity/RuleSeverity.test.js
|
423
|
+
- webpack/components/RuleSeverity/__snapshots__/RuleSeverity.test.js.snap
|
424
|
+
- webpack/components/RuleSeverity/i_severity-critical.svg
|
425
|
+
- webpack/components/RuleSeverity/i_severity-high.svg
|
426
|
+
- webpack/components/RuleSeverity/i_severity-low.svg
|
427
|
+
- webpack/components/RuleSeverity/i_severity-med.svg
|
428
|
+
- webpack/components/RuleSeverity/i_unknown.svg
|
429
|
+
- webpack/components/RuleSeverity/index.js
|
430
|
+
- webpack/components/withLoading.js
|
431
|
+
- webpack/global_index.js
|
432
|
+
- webpack/graphql/queries/cves.gql
|
433
|
+
- webpack/graphql/queries/ovalContents.gql
|
434
|
+
- webpack/graphql/queries/ovalPolicies.gql
|
435
|
+
- webpack/graphql/queries/ovalPolicy.gql
|
436
|
+
- webpack/helpers/commonHelper.js
|
437
|
+
- webpack/helpers/globalIdHelper.js
|
438
|
+
- webpack/helpers/pageParamsHelper.js
|
439
|
+
- webpack/helpers/pathsHelper.js
|
440
|
+
- webpack/helpers/tableHelper.js
|
441
|
+
- webpack/index.js
|
442
|
+
- webpack/routes/OvalContents/OvalContentsIndex/OvalContentsIndex.js
|
443
|
+
- webpack/routes/OvalContents/OvalContentsIndex/OvalContentsTable.js
|
444
|
+
- webpack/routes/OvalContents/OvalContentsIndex/__tests__/OvalContentsIndex.fixtures.js
|
445
|
+
- webpack/routes/OvalContents/OvalContentsIndex/__tests__/OvalContentsIndex.test.js
|
446
|
+
- webpack/routes/OvalContents/OvalContentsIndex/index.js
|
447
|
+
- webpack/routes/OvalPolicies/OvalPoliciesIndex/OvalPoliciesIndex.js
|
448
|
+
- webpack/routes/OvalPolicies/OvalPoliciesIndex/OvalPoliciesTable.js
|
449
|
+
- webpack/routes/OvalPolicies/OvalPoliciesIndex/__tests__/OvalPoliciesIndex.fixtures.js
|
450
|
+
- webpack/routes/OvalPolicies/OvalPoliciesIndex/__tests__/OvalPoliciesIndex.test.js
|
451
|
+
- webpack/routes/OvalPolicies/OvalPoliciesIndex/index.js
|
452
|
+
- webpack/routes/OvalPolicies/OvalPoliciesShow/CvesTab.js
|
453
|
+
- webpack/routes/OvalPolicies/OvalPoliciesShow/CvesTable.js
|
454
|
+
- webpack/routes/OvalPolicies/OvalPoliciesShow/OvalPoliciesShow.js
|
455
|
+
- webpack/routes/OvalPolicies/OvalPoliciesShow/OvalPoliciesShowHelper.js
|
456
|
+
- webpack/routes/OvalPolicies/OvalPoliciesShow/__tests__/OvalPoliciesShow.fixtures.js
|
457
|
+
- webpack/routes/OvalPolicies/OvalPoliciesShow/__tests__/OvalPoliciesShow.test.js
|
458
|
+
- webpack/routes/OvalPolicies/OvalPoliciesShow/index.js
|
459
|
+
- webpack/routes/routes.js
|
460
|
+
- webpack/testHelper.js
|
335
461
|
homepage: https://github.com/theforeman/foreman_openscap
|
336
462
|
licenses:
|
337
463
|
- GPL-3.0
|
@@ -358,11 +484,13 @@ summary: Foreman plug-in for displaying OpenSCAP audit reports
|
|
358
484
|
test_files:
|
359
485
|
- test/factories/arf_report_factory.rb
|
360
486
|
- test/factories/asset_factory.rb
|
361
|
-
- test/factories/compliance_host_factory.rb
|
362
487
|
- test/factories/policy_arf_report_factory.rb
|
363
488
|
- test/factories/policy_factory.rb
|
364
489
|
- test/factories/scap_content_related.rb
|
365
490
|
- test/factories/compliance_log_factory.rb
|
491
|
+
- test/factories/compliance_host_factory.rb
|
492
|
+
- test/factories/oval_content_factory.rb
|
493
|
+
- test/factories/oval_policy_factory.rb
|
366
494
|
- test/files/arf_report/arf_report.bz2
|
367
495
|
- test/files/arf_report/arf_report.html
|
368
496
|
- test/files/arf_report/arf_report.json
|
@@ -371,11 +499,15 @@ test_files:
|
|
371
499
|
- test/files/scap_contents/ssg-fedora-ds.xml
|
372
500
|
- test/files/tailoring_files/ssg-firefox-ds-tailoring-2.xml
|
373
501
|
- test/files/tailoring_files/ssg-firefox-ds-tailoring.xml
|
502
|
+
- test/files/oval_contents/ansible-2.9.oval.xml.bz2
|
374
503
|
- test/functional/api/v2/compliance/policies_controller_test.rb
|
375
504
|
- test/functional/api/v2/compliance/scap_content_profiles_controller_test.rb
|
376
505
|
- test/functional/api/v2/compliance/scap_contents_controller_test.rb
|
377
506
|
- test/functional/api/v2/compliance/tailoring_files_controller_test.rb
|
378
507
|
- test/functional/api/v2/compliance/arf_reports_controller_test.rb
|
508
|
+
- test/functional/api/v2/compliance/oval_contents_controller_test.rb
|
509
|
+
- test/functional/api/v2/compliance/oval_policies_controller_test.rb
|
510
|
+
- test/functional/api/v2/compliance/oval_reports_controller_test.rb
|
379
511
|
- test/functional/api/v2/hosts_controller_test.rb
|
380
512
|
- test/functional/arf_reports_controller_test.rb
|
381
513
|
- test/functional/openscap_proxies_controller_test.rb
|
@@ -397,6 +529,14 @@ test_files:
|
|
397
529
|
- test/unit/services/lookup_key_overrider_test.rb
|
398
530
|
- test/unit/services/report_dashboard/data_test.rb
|
399
531
|
- test/unit/services/tailoring_files_proxy_check_test.rb
|
532
|
+
- test/unit/services/oval/cves_test.rb
|
533
|
+
- test/unit/services/oval/setup_test.rb
|
400
534
|
- test/unit/tailoring_file_test.rb
|
401
535
|
- test/unit/policy_test.rb
|
536
|
+
- test/unit/oval_host_test.rb
|
537
|
+
- test/unit/oval_policy_test.rb
|
538
|
+
- test/unit/oval_status_test.rb
|
539
|
+
- test/fixtures/cve_fixtures.rb
|
540
|
+
- test/graphql/queries/oval_contents_query_test.rb
|
541
|
+
- test/graphql/queries/oval_policies_query_test.rb
|
402
542
|
- test/test_plugin_helper.rb
|