Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support to HIPAA and NIST 800-53 #1488

Merged
merged 4 commits into from
Jun 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
# Values must to be true or false.
#extensions.pci : true
#extensions.gdpr : true
#extensions.hipaa : true
#extensions.nist : true
#extensions.audit : true
#extensions.oscap : false
#extensions.ciscat : false
Expand Down
14 changes: 13 additions & 1 deletion public/controllers/agent/agents.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export class AgentsController {
this.$scope.hostMonitoringTabs = ['general', 'fim', 'syscollector'];
this.$scope.systemAuditTabs = ['pm', 'sca', 'audit', 'oscap', 'ciscat'];
this.$scope.securityTabs = ['vuls', 'virustotal', 'osquery', 'docker'];
this.$scope.complianceTabs = ['pci', 'gdpr'];
this.$scope.complianceTabs = ['pci', 'gdpr', 'hipaa', 'nist'];

/**
* This check if given array of items contais a single given item
Expand Down Expand Up @@ -564,6 +564,18 @@ export class AgentsController {
this.$scope.selectedGdprIndex = 0;
}

if (tab === 'hipaa') {
const hipaaTabs = await this.commonData.getHIPAA();
this.$scope.hipaaTabs = hipaaTabs;
this.$scope.selectedHipaaIndex = 0;
}

if (tab === 'nist') {
const nistTabs = await this.commonData.getNIST();
this.$scope.nistTabs = nistTabs;
this.$scope.selectedNistIndex = 0;
}

if (tab === 'sca') {
try {
this.$scope.loadSca = true;
Expand Down
32 changes: 28 additions & 4 deletions public/controllers/management/rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,30 @@ export function RulesController(
);
$scope.appliedFilters.push(filter);
$scope.$broadcast('wazuhFilter', { filter });
} else if (
term &&
term.startsWith('hipaa:') &&
term.split('hipaa:')[1].trim()
) {
$scope.custom_search = '';
const filter = { name: 'hipaa', value: term.split('hipaa:')[1].trim() };
$scope.appliedFilters = $scope.appliedFilters.filter(
item => item.name !== 'hipaa'
);
$scope.appliedFilters.push(filter);
$scope.$broadcast('wazuhFilter', { filter });
} else if (
term &&
term.startsWith('nist-800-53:') &&
term.split('nist-800-53:')[1].trim()
) {
$scope.custom_search = '';
const filter = { name: 'nist-800-53', value: term.split('nist-800-53:')[1].trim() };
$scope.appliedFilters = $scope.appliedFilters.filter(
item => item.name !== 'nist-800-53'
);
$scope.appliedFilters.push(filter);
$scope.$broadcast('wazuhFilter', { filter });
} else if (
term &&
term.startsWith('file:') &&
Expand Down Expand Up @@ -177,10 +201,10 @@ export function RulesController(
coloredString = coloredString.replace(
/\$\(((?!<\/span>).)*?\)(?!<\/span>)/im,
'<span style="color: ' +
colors[i] +
' ">' +
valuesArray[i] +
'</span>'
colors[i] +
' ">' +
valuesArray[i] +
'</span>'
);
}
}
Expand Down
14 changes: 13 additions & 1 deletion public/controllers/overview/overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class OverviewController {
this.hostMonitoringTabs = ['general', 'fim', 'aws'];
this.systemAuditTabs = ['pm', 'audit', 'oscap', 'ciscat', 'sca'];
this.securityTabs = ['vuls', 'virustotal', 'osquery', 'docker'];
this.complianceTabs = ['pci', 'gdpr'];
this.complianceTabs = ['pci', 'gdpr', 'hipaa', 'nist'];

this.wodlesConfiguration = null;

Expand Down Expand Up @@ -248,6 +248,18 @@ export class OverviewController {
this.selectedGdprIndex = 0;
}

if (newTab === 'hipaa') {
const hipaaTabs = await this.commonData.getHIPAA();
this.hipaaTabs = hipaaTabs;
this.selectedHipaaIndex = 0;
}

if (newTab === 'nist') {
const nistTabs = await this.commonData.getNIST();
this.nistTabs = nistTabs;
this.selectedNistIndex = 0;
}

if (newTab !== 'welcome') this.tabHistory.push(newTab);

if (this.tabHistory.length > 2)
Expand Down
6 changes: 5 additions & 1 deletion public/controllers/settings/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class SettingsController {

this.errorHandler.info(
`API ${
this.apiEntries[index]._source.cluster_info.manager
this.apiEntries[index]._source.cluster_info.manager
} set as default`,
'Settings'
);
Expand Down Expand Up @@ -364,6 +364,8 @@ export class SettingsController {
tmpData.extensions.audit = config['extensions.audit'];
tmpData.extensions.pci = config['extensions.pci'];
tmpData.extensions.gdpr = config['extensions.gdpr'];
tmpData.extensions.hipaa = config['extensions.hipaa'];
tmpData.extensions.nist = config['extensions.nist'];
tmpData.extensions.oscap = config['extensions.oscap'];
tmpData.extensions.ciscat = config['extensions.ciscat'];
tmpData.extensions.aws = config['extensions.aws'];
Expand Down Expand Up @@ -679,6 +681,8 @@ export class SettingsController {
this.extensions.audit = config['extensions.audit'];
this.extensions.pci = config['extensions.pci'];
this.extensions.gdpr = config['extensions.gdpr'];
this.extensions.hipaa = config['extensions.hipaa'];
this.extensions.nist = config['extensions.nist'];
this.extensions.oscap = config['extensions.oscap'];
this.extensions.ciscat = config['extensions.ciscat'];
this.extensions.aws = config['extensions.aws'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

.chips-dropdown .dropdown-menu{
display: block !important;
right: 0;
}

.ui-select-choices-row-inner {
Expand Down
4 changes: 4 additions & 0 deletions public/factories/tab-visualizations.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export class TabVisualizations {
audit: 9,
gdpr: 6,
pci: 6,
hipaa: 6,
nist: 6,
virustotal: 6,
configuration: 0,
osquery: 5,
Expand All @@ -43,6 +45,8 @@ export class TabVisualizations {
audit: 6,
pci: 5,
gdpr: 5,
hipaa: 5,
nist: 5,
aws: 8,
virustotal: 7,
osquery: 5,
Expand Down
42 changes: 42 additions & 0 deletions public/services/common-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ export class CommonData {
audit: { group: 'audit' },
pci: { group: 'pci_dss' },
gdpr: { group: 'gdpr' },
hipaa: { group: 'hipaa' },
nist: { group: 'nist' },
aws: { group: 'amazon' },
virustotal: { group: 'virustotal' },
osquery: { group: 'osquery' },
Expand All @@ -153,6 +155,12 @@ export class CommonData {
} else if (tab === 'gdpr') {
this.removeDuplicateExists('rule.gdpr');
filters.push(filterHandler.gdprQuery());
} else if (tab === 'hipaa') {
this.removeDuplicateExists('rule.hipaa');
filters.push(filterHandler.hipaaQuery());
} else if (tab === 'nist') {
this.removeDuplicateExists('rule.nist_800_53');
filters.push(filterHandler.nistQuery());
} else {
this.removeDuplicateRuleGroups(tabFilters[tab].group);
filters.push(filterHandler.ruleGroupQuery(tabFilters[tab].group));
Expand Down Expand Up @@ -208,6 +216,40 @@ export class CommonData {
}
}

/**
* GET HIPAA
*/
async getHIPAA() {
try {
const hipaaTabs = [];
const data = await this.genericReq.request('GET', '/api/hipaa/all');
if (!data.data) return [];
for (const key in data.data) {
hipaaTabs.push({ title: key, content: data.data[key] });
}
return hipaaTabs;
} catch (error) {
return Promise.reject(error);
}
}

/**
* GET NIST 800-53
*/
async getNIST() {
try {
const nistTabs = [];
const data = await this.genericReq.request('GET', '/api/nist/all');
if (!data.data) return [];
for (const key in data.data) {
nistTabs.push({ title: key, content: data.data[key] });
}
return nistTabs;
} catch (error) {
return Promise.reject(error);
}
}

/**
* Assign given filter
* @param {Object} filterHandler
Expand Down
2 changes: 2 additions & 0 deletions public/services/resolves/get-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export async function getWzConfig($q, genericReq, wazuhConfig) {
'checks.setup': true,
'extensions.pci': true,
'extensions.gdpr': true,
'extensions.hipaa': true,
'extensions.nist': true,
'extensions.audit': true,
'extensions.oscap': false,
'extensions.ciscat': false,
Expand Down
2 changes: 2 additions & 0 deletions public/services/resolves/settings-wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ export function settingsWizard(
audit: config['extensions.audit'],
pci: config['extensions.pci'],
gdpr: config['extensions.gdpr'],
hipaa: config['extensions.hipaa'],
nist: config['extensions.nist'],
oscap: config['extensions.oscap'],
ciscat: config['extensions.ciscat'],
aws: config['extensions.aws'],
Expand Down
104 changes: 104 additions & 0 deletions public/templates/agents/agents-hipaa.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<md-content flex layout="column" ng-if="tab === 'hipaa' && tabView === 'panels'" ng-class="{'no-opacity': resultState !== 'ready' || !rendered}"
layout-align="start">

<!-- View: Panels -->

<div layout="row" layout-align="center stretch">
<md-card flex class="wz-md-card">
<md-tabs md-selected="selectedHipaaIndex" class="wz-md-tab" md-border-bottom md-dynamic-height id="hipaaReq_tab">
<md-tab ng-repeat="tab in hipaaTabs" ng-disabled="tab.disabled" label="{{tab.title}}">
<div class="md-padding">
<span class="wz-headline-title">HIPAA Requirement: {{tab.title}}</span>
<md-divider class="wz-margin-top-10"></md-divider>
<div layout="row" class="wz-padding-top-10 wz-line-height">
<div ng-bind-html="tab.content"></div>
</div>
</div>
</md-tab>
</md-tabs>
</md-card>
</div>

<div layout="row" layout-align="center stretch" class="height-300">
<md-card flex class="wz-md-card" ng-class="{'fullscreen': expandArray[0]}">
<md-card-actions layout="row" layout-align="end center" class="wz-card-actions-vis" ng-dblclick="expand(0)">
<span class="wz-headline-title">Top 5 rule groups</span>
<span flex></span>
<span class="cursor-pointer" ng-click="expand(0)">
<react-component name="EuiIcon" props="{type:'expand'}" />
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis id="Wazuh-App-Agents-HIPAA-Groups" vis-id="'Wazuh-App-Agents-HIPAA-Groups'"></kbn-vis>
</md-card-content>
</md-card>
<md-card flex class="wz-md-card" ng-class="{'fullscreen': expandArray[1]}">
<md-card-actions layout="row" layout-align="end center" class="wz-card-actions-vis" ng-dblclick="expand(1)">
<span class="wz-headline-title">Top 5 rules</span>
<span flex></span>
<span class="cursor-pointer" ng-click="expand(1)">
<react-component name="EuiIcon" props="{type:'expand'}" />
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis id="Wazuh-App-Agents-HIPAA-Rule" vis-id="'Wazuh-App-Agents-HIPAA-Rule'"></kbn-vis>
</md-card-content>
</md-card>
<md-card flex class="wz-md-card" ng-class="{'fullscreen': expandArray[2]}">
<md-card-actions layout="row" layout-align="end center" class="wz-card-actions-vis" ng-dblclick="expand(2)">
<span class="wz-headline-title">Top 5 HIPAA requirements</span>
<span flex></span>
<span class="cursor-pointer" ng-click="expand(2)">
<react-component name="EuiIcon" props="{type:'expand'}" />
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis id="Wazuh-App-Agents-HIPAA-Requirement" vis-id="'Wazuh-App-Agents-HIPAA-Requirement'"></kbn-vis>
</md-card-content>
</md-card>
</div>

<div layout="row" layout-align="center stretch" class="height-300">
<md-card flex="70" class="wz-md-card" ng-class="{'fullscreen': expandArray[3]}">
<md-card-actions layout="row" layout-align="end center" class="wz-card-actions-vis" ng-dblclick="expand(3)">
<span class="wz-headline-title">HIPAA Requirements</span>
<span flex></span>
<span class="cursor-pointer" ng-click="expand(3)">
<react-component name="EuiIcon" props="{type:'expand'}" />
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis id="Wazuh-App-Agents-HIPAA-Requirements" vis-id="'Wazuh-App-Agents-HIPAA-Requirements'">
</kbn-vis>
</md-card-content>
</md-card>
<md-card flex class="wz-md-card" ng-class="{'fullscreen': expandArray[4]}">
<md-card-actions layout="row" layout-align="end center" class="wz-card-actions-vis" ng-dblclick="expand(4)">
<span class="wz-headline-title">Rule level distribution</span>
<span flex></span>
<span class="cursor-pointer" ng-click="expand(4)">
<react-component name="EuiIcon" props="{type:'expand'}" />
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis id="Wazuh-App-Agents-HIPAA-Rule-level-distribution" vis-id="'Wazuh-App-Agents-HIPAA-Rule-level-distribution'"></kbn-vis>
</md-card-content>
</md-card>
</div>

<div layout="row" layout-align="center stretch" class="height-570">
<md-card class="wz-md-card" flex ng-class="{'fullscreen': expandArray[5]}">
<md-card-actions layout="row" layout-align="end center" class="wz-card-actions-vis" ng-dblclick="expand(5)">
<span class="wz-headline-title">Alerts summary</span>
<span flex></span>
<span class="cursor-pointer" ng-click="expand(5)">
<react-component name="EuiIcon" props="{type:'expand'}" />
</span>
</md-card-actions>
<md-card-content class="wazuh-column">
<kbn-vis vis-id="'Wazuh-App-Agents-HIPAA-Last-alerts'"></kbn-vis>
</md-card-content>
</md-card>
</div>

</md-content>
Loading