wazuh-kibana-app/public/templates/management/ruleset/rules/rules-detail.html
2019-01-30 08:55:39 +01:00

199 lines
11 KiB
HTML

<div ng-if="!loading && viewingDetail" layout="column" class="wz-content">
<!-- Back button and title -->
<div layout="row" layout-align="start center">
<!-- Back button -->
<md-button class="md-icon-button wz-circle-back-button" style="margin: 5px 15px!important;" aria-label="Back to rules list"
tooltip="Back" tooltip-placement="bottom" ng-click="closeDetailView(true)"><i class="fa fa-fw fa-arrow-left"
aria-hidden="true"></i></md-button>
<!-- Rule title -->
<div>
<h5 class="titleSectionIdentifier">Rule</h5>
<h1 class="font-size-18" ng-bind-html="colorRuleArg(currentRule.description)"></h1>
</div>
</div>
<!-- End back button, title and status indicator -->
<!-- Rule information ribbon -->
<div layout="row" class="wz-padding-left-8 wz-padding-right-8">
<md-card flex class="wz-metric-color wz-md-card">
<md-card-content layout="row" class="wz-padding-metric">
<div flex="15" ng-if="currentRule.id" class="wz-text-truncatable">ID: <span class="wz-text-bold">{{currentRule.id}}</span></div>
<div flex="15" ng-if="currentRule.level || currentRule.level == 0" class="wz-text-truncatable">Level:
<span class="wz-text-bold wz-text-link" ng-click="addDetailFilter('level', currentRule.level)"
tooltip="Filter by this level" tooltip-placement="bottom">{{currentRule.level}}</span></div>
<div flex="35" ng-if="currentRule.file" class="wz-text-truncatable">File: <span class="wz-text-bold wz-text-link"
ng-click="addDetailFilter('file', currentRule.file)" tooltip="Filter by this file"
tooltip-placement="bottom">{{currentRule.file}}</span></div>
<div flex="35" ng-if="currentRule.path" class="wz-text-truncatable">Path: <span class="wz-text-bold wz-text-link"
ng-click="addDetailFilter('path', currentRule.path)" tooltip="Filter by this path"
tooltip-placement="bottom">{{currentRule.path}}</span></div>
</md-card-content>
</md-card>
</div>
<!-- End Rule information ribbon -->
<!-- Rest of rule information -->
<div layout="column" layout-align="start">
<div layout="row" class="wz-padding-left-8 wz-padding-right-8" layout-align="start stretch">
<!-- Groups section -->
<md-card ng-if="currentRule.groups.length > 0" flex="50" class="wz-md-card">
<md-card-content>
<span class="wz-headline-title"><i class="fa fa-fw fa-tasks" aria-hidden="true"></i> Groups</span>
<md-divider class="wz-margin-top-10"></md-divider>
<div layout="row" layout-align="start start" layout-wrap>
<md-button class="md-primary wz-text-link" tooltip="Filter by this group" tooltip-placement="bottom"
ng-repeat="item in currentRule.groups" ng-click="addDetailFilter('group', item)">
{{item}}
</md-button>
</div>
</md-card-content>
</md-card>
<!-- End groups section -->
<!-- Details section -->
<md-card flex class="wz-md-card" ng-if="currentRule.details">
<md-card-content>
<span class="wz-headline-title"><i class="fa fa-fw fa-info" aria-hidden="true"></i> Details</span>
<md-divider class="wz-margin-top-10"></md-divider>
<div layout="row" class="wz-padding-top-10" ng-repeat="(key, value) in currentRule.details"
ng-if='!isArray(value)'>
<span class="wz-word-break-rule">{{key}}</span>
<span ng-if="!isObject(value)" class="wz-text-right color-grey">{{value}}</span>
<span ng-if="isObject(value)" class="color-grey">
<span ng-repeat="(key, value) in value">{{key}}: {{value}} <span ng-if="!$last">|</span>
</span>
</span>
</div>
</md-card-content>
</md-card>
<!-- End details section -->
</div>
<div layout="row" class="wz-padding-left-8 wz-padding-right-8" layout-align="start stretch" ng-if="currentRule.pci.length > 0 || currentRule.gdpr.length > 0">
<!-- PCI section -->
<md-card ng-if="currentRule.pci.length > 0" flex="50" class="wz-md-card">
<md-card-content>
<span class="wz-headline-title"><i class="fa fa-fw fa-cogs" aria-hidden="true"></i> PCI</span>
<md-divider class="wz-margin-top-10"></md-divider>
<div layout="row" layout-align="start start" layout-wrap>
<md-button class="md-primary wz-text-link" tooltip="Filter by this requirement"
tooltip-placement="bottom" ng-repeat="item in currentRule.pci" ng-click="addDetailFilter('pci', item)">
{{item}}
</md-button>
</div>
</md-card-content>
</md-card>
<!-- End PCI section -->
<!-- GDPR section -->
<md-card ng-if="currentRule.gdpr.length > 0" flex class="wz-md-card">
<md-card-content>
<span class="wz-headline-title"><i class="fa fa-fw fa-cogs" aria-hidden="true"></i> GDPR</span>
<md-divider class="wz-margin-top-10"></md-divider>
<div layout="row" layout-align="start start" layout-wrap>
<md-button class="md-primary wz-text-link" tooltip="Filter by this requirement"
tooltip-placement="bottom" ng-repeat="item in currentRule.gdpr" ng-click="addDetailFilter('gdpr', item)">
{{item}}
</md-button>
</div>
</md-card-content>
</md-card>
<!-- End GDPR section -->
</div>
<div layout="row" class="wz-padding-left-16" layout-align="start stretch" ng-show="!editingFile" ng-if="isArray(currentRule.details.regex) || isArray(currentRule.details.match) || isArray(currentRule.details.prematch)">
<!-- Regex section -->
<md-card flex class="wz-md-card" ng-if="isArray(currentRule.details.regex)">
<md-card-content>
<span class="wz-headline-title"><i class="fa fa-fw fa-asterisk" aria-hidden="true"></i> Regex</span>
<md-divider class="wz-margin-top-10"></md-divider>
<div ng-repeat="item in currentRule.details.regex">
<div layout="row" class="wz-padding-top-10" layout-wrap>
<span>{{item}}</span>
</div>
</div>
</md-card-content>
</md-card>
<!-- End regex section -->
<!-- Match section -->
<md-card flex class="wz-md-card" ng-if="isArray(currentRule.details.match)">
<md-card-content>
<span class="wz-headline-title"><i class="fa fa-fw fa-retweet" aria-hidden="true"></i> Match</span>
<md-divider class="wz-margin-top-10"></md-divider>
<div ng-repeat="item in currentRule.details.match">
<div layout="row" class="wz-padding-top-10" layout-wrap>
<span>{{item}}</span>
</div>
</div>
</md-card-content>
</md-card>
<!-- End match section -->
<!-- Prematch section -->
<md-card flex class="wz-md-card" ng-if="isArray(currentRule.details.prematch)">
<md-card-content>
<span class="wz-headline-title"><i class="fa fa-fw fa-retweet" aria-hidden="true"></i> Prematch</span>
<md-divider class="wz-margin-top-10"></md-divider>
<div ng-repeat="item in currentRule.details.prematch">
<div layout="row" class="wz-padding-top-10" layout-wrap>
<span>{{item}}</span>
</div>
</div>
</md-card-content>
</md-card>
<!-- End prematch section -->
</div>
<div layout="row" class="md-padding wz-padding-bottom-0" ng-if="!editingFile && currentRule.file && currentRule.path === '/var/ossec/etc/rules' && adminMode">
<button ng-click='editRulesConfig(currentRule)' class='btn btn-primary'><i aria-hidden='true' class='fa fa-fw fa-pencil'></i>
Edit rule file
</button>
</div>
<!-- Related rules section -->
<div ng-show="!editingFile">
<div layout="row" class="md-padding wz-padding-top-10" ng-if="currentRule">
<h1 class="md-headline wz-headline"><i class="fa fa-fw fa-link" aria-hidden="true"></i> Related rules</h1>
</div>
<div layout="row" ng-if="currentRule">
<md-card flex class="wz-md-card _md flex md-margin-h">
<md-card-content>
<wz-table flex path="'/rules'" implicit-filter="[{ name:'file',value: currentRule.file}]" keys="['id',{value:'file',size:2},{value:'description',size:2},{value:'groups',nosortable:true,size:2},{value:'pci',nosortable:true,size:2},{value:'gdpr',nosortable:true},'level']"
allow-click="true">
</wz-table>
</md-card-content>
</md-card>
</div>
<!-- End related rules section -->
</div>
<br>
</div>
<!-- End rest of rule information -->
<!-- XML editor for rules -->
<div layout="column" layout-align="start" ng-show="editingFile">
<div layout="row" class="wz-margin-left-16">
<span ng-click='closeEditingFile()' class='btn btn-info'>Cancel</span>
<button ng-disabled='xmlHasErrors' ng-click='doSaveRuleConfig()' class='btn btn-primary pull-right wz-margin-left-8'>
<span ng-show='!xmlHasErrors'><i aria-hidden='true' class='fa fa-fw fa-save'></i>Save file</span>
<span ng-show='xmlHasErrors' class='btn-danger'><i aria-hidden='true' class='fa fa-fw fa-exclamation-triangle'></i>
XML format error</span>
</button>
</div>
<div class="md-padding md-padding-top-10" ng-if="fetchedXML">
<wz-xml-file-editor file-name='rules' data="fetchedXML" target-name="currentRule.file" valid-fn='xmlIsValid(valid)'>
</wz-xml-file-editor>
</div>
</div>
<!-- XML editor for rules -->
</div>