diff --git a/packages/inventory-compliance/src/Fixtures/Fixtures.js b/packages/inventory-compliance/src/Fixtures/Fixtures.js
index 00261667a..fbf77b6f0 100644
--- a/packages/inventory-compliance/src/Fixtures/Fixtures.js
+++ b/packages/inventory-compliance/src/Fixtures/Fixtures.js
@@ -109,7 +109,7 @@ export const profileRules = [
refId: 'xccdf_org.ssgproject.content_rule_service_atd_disabled',
description: 'The at and batch commands can be used to schedule tasks that are meant to be executed only once. This allows delayed execution in a manner similar to cron, except that it is not recurring. The daemon atd keeps track of tasks scheduled via at and batch, and executes them at the specified time. The atd service can be disabled with the following command: $ sudo systemctl disable atd.service',
compliant: true,
- remediationAvailable: false,
+ remediationAvailable: true,
identifier: null
},
{
@@ -129,7 +129,7 @@ export const profileRules = [
refId: 'xccdf_org.ssgproject.content_rule_service_oddjobd_disabled',
description: 'The oddjobd service exists to provide an interface and access control mechanism through which specified privileged tasks can run tasks for unprivileged client applications. Communication with oddjobd through the system message bus. The oddjobd service can be disabled with the following command: $ sudo systemctl disable oddjobd.service',
compliant: true,
- remediationAvailable: false,
+ remediationAvailable: true,
identifier: null
},
{
@@ -149,7 +149,7 @@ export const profileRules = [
refId: 'xccdf_org.ssgproject.content_rule_service_abrtd_disabled',
description: 'The Automatic Bug Reporting Tool (abrtd) daemon collects and reports crash data when an application crash is detected. Using a variety of plugins, abrtd can email crash reports to system administrators, log crash reports to files, or forward crash reports to a centralized issue tracking system such as RHTSupport. The abrtd service can be disabled with the following command: $ sudo systemctl disable abrtd.service',
compliant: true,
- remediationAvailable: false,
+ remediationAvailable: true,
identifier: null
},
{
diff --git a/packages/inventory-compliance/src/SystemRulesTable/SystemRulesTable.js b/packages/inventory-compliance/src/SystemRulesTable/SystemRulesTable.js
index 359c6cc38..83f8b9f52 100644
--- a/packages/inventory-compliance/src/SystemRulesTable/SystemRulesTable.js
+++ b/packages/inventory-compliance/src/SystemRulesTable/SystemRulesTable.js
@@ -29,8 +29,11 @@ export const selectColumns = (columnTitles) => (
);
class SystemRulesTable extends React.Component {
+ remediationAvailableFilter = this.props.remediationAvailableFilter || this.props.remediationsEnabled;
+
config = buildFilterConfig({
selectedFilter: this.props.selectedFilter,
+ remediationAvailableFilter: this.remediationAvailableFilter,
showPassFailFilter: (this.props.columns.filter((c) => (c.title === 'Passed')).length > 0)
});
filterConfigBuilder = new FilterConfigBuilder(this.config);
@@ -47,7 +50,8 @@ class SystemRulesTable extends React.Component {
openIds: [],
activeFilters: this.filterConfigBuilder.initialDefaultState({
selected: this.props.selectedFilter ? [ 'selected' ] : undefined,
- passed: this.props.hidePassed ? 'failed' : undefined
+ passed: this.props.hidePassed ? 'failed' : undefined,
+ remediationAvailable: this.remediationAvailableFilter ? 'true' : undefined
})
};
@@ -403,6 +407,7 @@ SystemRulesTable.propTypes = {
tailoringEnabled: propTypes.bool,
selectedRefIds: propTypes.array,
selectedFilter: propTypes.bool,
+ remediationAvailableFilter: propTypes.bool,
handleSelect: propTypes.func,
columns: propTypes.arrayOf(
propTypes.shape(
@@ -419,6 +424,7 @@ SystemRulesTable.defaultProps = {
profileRules: [{ rules: [] }],
hidePassed: false,
selectedFilter: false,
+ remediationAvailableFilter: false,
remediationsEnabled: true,
tailoringEnabled: false,
selectedRefIds: [],
diff --git a/packages/inventory-compliance/src/SystemRulesTable/SystemRulesTable.test.js b/packages/inventory-compliance/src/SystemRulesTable/SystemRulesTable.test.js
index 08426958a..11b9f562f 100644
--- a/packages/inventory-compliance/src/SystemRulesTable/SystemRulesTable.test.js
+++ b/packages/inventory-compliance/src/SystemRulesTable/SystemRulesTable.test.js
@@ -105,6 +105,23 @@ describe('SystemRulesTable component', () => {
expect(instance.getRules().length).toEqual(1);
});
+ it('should render filtered rows by remediationAvailable', async () => {
+ const wrapper = shallow(
+
+ );
+ const instance = wrapper.instance();
+ expect(instance.getRules().length).toEqual(52);
+ await instance.onFilterUpdate('remediationAvailable', [ 'true' ]);
+ expect(instance.getRules().length).toEqual(3);
+ });
+
it('should render filtered rows by severity', async () => {
const wrapper = shallow(
,
},
Object {
- "title": "No",
+ "title": ,
},
],
"isOpen": false,
@@ -4046,7 +4147,7 @@ exports[`SystemRulesTable component should render sorted rows 2`] = `
"rationale": "The atd service could be used by an unsophisticated insider to carry out activities outside of a normal login session, which could complicate accountability. Furthermore, the need to schedule tasks with at or batch is not common.",
"refId": "xccdf_org.ssgproject.content_rule_service_atd_disabled",
"references": Array [],
- "remediationAvailable": false,
+ "remediationAvailable": true,
"rowKey": "xccdf_org.ssgproject.content_rule_service_atd_disabled-xccdf_org.ssgproject.content_profile_pci-dss",
"severity": "medium",
"title": "Disable At Service (atd)",
@@ -4088,7 +4189,12 @@ exports[`SystemRulesTable component should render sorted rows 2`] = `
/>,
},
Object {
- "title": "No",
+ "title": ,
},
],
"isOpen": false,
@@ -4120,7 +4226,7 @@ exports[`SystemRulesTable component should render sorted rows 2`] = `
"rationale": "Mishandling crash data could expose sensitive information about vulnerabilities in software executing on the system, as well as sensitive information from within a process's address space or registers.",
"refId": "xccdf_org.ssgproject.content_rule_service_abrtd_disabled",
"references": Array [],
- "remediationAvailable": false,
+ "remediationAvailable": true,
"rowKey": "xccdf_org.ssgproject.content_rule_service_abrtd_disabled-xccdf_org.ssgproject.content_profile_pci-dss",
"severity": "medium",
"title": "Disable Automatic Bug Reporting Tool (abrtd)",
@@ -4310,7 +4416,12 @@ exports[`SystemRulesTable component should render sorted rows 2`] = `
/>,
},
Object {
- "title": "No",
+ "title": ,
},
],
"isOpen": false,
@@ -4342,7 +4453,7 @@ exports[`SystemRulesTable component should render sorted rows 2`] = `
"rationale": "The oddjobd service may provide necessary functionality in some environments, and can be disabled if it is not needed. Execution of tasks by privileged programs, on behalf of unprivileged ones, has traditionally been a source of privilege escalation security issues.",
"refId": "xccdf_org.ssgproject.content_rule_service_oddjobd_disabled",
"references": Array [],
- "remediationAvailable": false,
+ "remediationAvailable": true,
"rowKey": "xccdf_org.ssgproject.content_rule_service_oddjobd_disabled-xccdf_org.ssgproject.content_profile_pci-dss",
"severity": "medium",
"title": "Disable Odd Job Daemon (oddjobd)",
@@ -5747,6 +5858,22 @@ exports[`SystemRulesTable component tailoring rules should be able to filter by
"placeholder": "Filter by selected",
"type": "checkbox",
},
+ Object {
+ "filterValues": Object {
+ "items": Array [
+ Object {
+ "label": "Remediation available",
+ "value": "true",
+ },
+ ],
+ "onChange": [Function],
+ "value": Array [],
+ },
+ "id": "remediationavailable",
+ "label": "Remediation available",
+ "placeholder": "Filter by remediation available",
+ "type": "checkbox",
+ },
],
}
}
@@ -6072,6 +6199,22 @@ exports[`SystemRulesTable component tailoring rules should be able to filter by
"placeholder": "Filter by selected",
"type": "checkbox",
},
+ Object {
+ "filterValues": Object {
+ "items": Array [
+ Object {
+ "label": "Remediation available",
+ "value": "true",
+ },
+ ],
+ "onChange": [Function],
+ "value": Array [],
+ },
+ "id": "remediationavailable",
+ "label": "Remediation available",
+ "placeholder": "Filter by remediation available",
+ "type": "checkbox",
+ },
],
}
}
@@ -7030,6 +7173,22 @@ exports[`SystemRulesTable component tailoring rules should be able to show all s
"placeholder": "Filter by selected",
"type": "checkbox",
},
+ Object {
+ "filterValues": Object {
+ "items": Array [
+ Object {
+ "label": "Remediation available",
+ "value": "true",
+ },
+ ],
+ "onChange": [Function],
+ "value": Array [],
+ },
+ "id": "remediationavailable",
+ "label": "Remediation available",
+ "placeholder": "Filter by remediation available",
+ "type": "checkbox",
+ },
],
}
}
diff --git a/packages/inventory-compliance/src/Utilities/FilterBuilderConfigBuilder.js b/packages/inventory-compliance/src/Utilities/FilterBuilderConfigBuilder.js
index 8f4bcaf3c..4c144d6b2 100644
--- a/packages/inventory-compliance/src/Utilities/FilterBuilderConfigBuilder.js
+++ b/packages/inventory-compliance/src/Utilities/FilterBuilderConfigBuilder.js
@@ -76,7 +76,16 @@ export const POLICIES_FILTER_CONFIG = (policies) => ({
))
});
-const buildFilterConfig = ({ showPassFailFilter, policies, selectedFilter }) => {
+export const REMEDIATION_AVAILABLE_FILTER_CONFIG = {
+ type: conditionalFilterType.checkbox,
+ label: 'Remediation available',
+ items: [
+ { label: 'Remediation available', value: 'true' }
+ ],
+ filter: (rules, value) => rules.filter(rule => rule.remediationAvailable)
+};
+
+const buildFilterConfig = ({ showPassFailFilter, policies, selectedFilter, remediationAvailableFilter }) => {
const config = [ ...BASE_FILTER_CONFIGURATION ];
if (showPassFailFilter) {
@@ -91,6 +100,10 @@ const buildFilterConfig = ({ showPassFailFilter, policies, selectedFilter }) =>
config.push(POLICIES_FILTER_CONFIG(policies));
}
+ if (remediationAvailableFilter) {
+ config.push(REMEDIATION_AVAILABLE_FILTER_CONFIG);
+ }
+
return config;
};