wazuh-kibana-app/public/templates/ruleset-rules.html
2016-10-14 03:34:56 -07:00

118 lines
6.4 KiB
HTML

<md-content layout="column" flex layout-padding ng-if="!load && submenuNavItem == 'ruleset' && $parent.submenuNavItem2 == 'rules'"
ng-controller="rulesController" layout-align="start space-around">
<md-progress-linear class="md-accent" md-mode="indeterminate" ng-show="load"></md-progress-linear>
<md-virtual-repeat-container layout-align="start start" ng-if="!load" flex layout="column" layout-padding auto-size-container ng-style="autoSizeStyle">
<div flex id="content" layout="row" layout-align="center start">
<span layout="row" style="padding-left: 0px;margin-top: 6px;margin-right: 5px; " flex layout-align="space-between center">
<md-autocomplete flex md-select-on-match="true" md-no-cache="true" md-selected-item="_filter" md-selected-item-change="rulesApplyFilter(_filter)" md-search-text="$parent.search"
md-items="item in filtersSearch($parent.search)" md-item-text="item.value" md-min-length="0" md-no-asterisk="false" md-menu-class="autocomplete-custom-agents-bar"
placeholder="Search for rule file, group or PCI requirement" md-search-text-change="fileSearchFilter(search)">
<md-item-template>
<span class="item-title">
<span><strong md-highlight-text="search" md-highlight-flags="i"> {{item.value}} </strong></span>
</span>
<span class="item-metadata">
<span class="item-metastat" ng-if="item.type != 'pci'"> {{item.type}} </span>
<span class="item-metastat" ng-if="item.type == 'pci'">PCI control</span>
</span>
</md-item-template>
<md-not-found>
No results matching "{{search}}" were found.
</md-not-found>
</md-autocomplete>
</span>
<md-button style="padding: 2px;" flex="10" ng-class="(submenuNavItem2 == 'rules') ? 'button-active' : 'button-disabled'" ng-class="button-disabled" ng-click="setRulesTab('rules')"
class="md-primary">
Rules
</md-button>
<md-button style="padding: 2px;" flex="10" ng-class="(submenuNavItem2 == 'decoders') ? 'button-active' : 'button-disabled'"
ng-class="button-disabled" ng-click="setRulesTab('decoders')" class="md-primary">
Decoders
</md-button>
<md-input-container flex="20" style="margin-top: 6px;margin-bottom: 0;border-radius: 3px;margin-left: 10px;"
class="md-whiteframe-z1">
<md-select style="border: none;" ng-model="statusFilter" ng-change="rulesStatusFilter(statusFilter)" aria-label="Filter by status">
<md-option value="enabled">Enabled</md-option>
<md-option value="disabled">Disabled</md-option>
<md-option value="all">All</md-option>
</md-select>
</md-input-container>
</div>
<md-chips readonly="true" ng-show="rulesHasFilter('search') || rulesHasFilter('file') || rulesHasFilter('group') || rulesHasFilter('pci')">
<md-chip md-colors="::{background: 'primary-100', color: 'background-900'}" ng-click="rulesUnset('search')" ng-if="rulesHasFilter('search')">
<span class="bold">Search: {{rulesGetFilter('search')}} <i class="fa fa-times" aria-hidden="true"></i></span>
</md-chip>
<md-chip md-colors="::{background: 'primary-100', color: 'background-900'}" ng-click="rulesUnset('file')" ng-if="rulesHasFilter('file');">
<span class="bold">File: {{rulesGetFilter('file')}} <i class="fa fa-times" aria-hidden="true"></i></span>
</md-chip>
<md-chip md-colors="::{background: 'primary-100', color: 'background-900'}" ng-click="rulesUnset('group')" ng-if="rulesHasFilter('group');">
<span class="bold">Group: {{rulesGetFilter('group')}} <i class="fa fa-times" aria-hidden="true"></i></span>
</md-chip>
<md-chip md-colors="::{background: 'primary-100', color: 'background-900'}" ng-click="rulesUnset('pci')" ng-if="rulesHasFilter('pci');">
<span>PCI control: {{rulesGetFilter('pci')}} <i class="fa fa-times" aria-hidden="true"></i></span>
</md-chip>
</md-chips>
<md-toolbar layout="row">
<div class="md-toolbar-tools">
<span flex="10" ng-click="setSort('id')">ID
<i class="fa" ng-class="_sort === 'id' ? (_sortOrder ? 'fa-sort-asc' : 'fa-sort-desc') : 'fa-sort'" aria-hidden="true"></i>
</span>
<span flex="60">Description</span>
<span flex="10" ng-click="setSort('level')">Level
<i class="fa" ng-class="_sort === 'level' ? (_sortOrder ? 'fa-sort-asc' : 'fa-sort-desc') : 'fa-sort'" aria-hidden="true"></i>
</span>
<span flex="20">File</span>
</div>
</md-toolbar>
<div md-virtual-repeat="rule in rulesObj" md-on-demand flex layout="column" layout-align="start stretch">
<md-list class="agents-preview-table" ng-class="showDetails[rule.id] ? 'ruleset_rules_row_active' : ''">
<md-list-item ng-class="showDetails[rule.id] ? 'ruleset_rules_row_active' : ''" ng-click=" showDetails[rule.id] = ! showDetails[rule.id]; ">
<span flex="10">{{rule.id}}</span>
<span flex="60">{{rule.description}}</span>
<span flex="10">{{rule.level}}</span>
<md-button md-no-ink class="invisibleButton" flex="20" ng-click="rulesApplyFilter({type: 'file', value: rule.file}); $event.stopPropagation();">{{rule.file}}</md-button>
</md-list-item>
</md-list>
<md-list class="ruleset_rules_row_active" ng-if="showDetails[rule.id]">
<md-list-item>
<span style="font-weight: bold" flex="15">Groups</span>
<span flex="35" layout="column">
<span><a ng-repeat="group in rule.groups" ng-click="rulesApplyFilter({type: 'group', value: group})">{{ group }}, </a></span>
</span>
<span style="font-weight: bold" flex="15" ng-if="rule.pci.length > 0">PCI Requirements</span>
<span flex="35" layout="column" ng-if="rule.pci.length > 0">
<span>
<a ng-repeat="pci in rule.pci" ng-click="rulesApplyFilter({type: 'pci', value: pci})">{{ pci }}, </a>
</span>
</span>
</md-list-item>
<md-list-item ng-repeat="(detailk, detailv) in rule.details">
<span style="font-weight: bold" flex="15">{{detailk}}</span>
<span flex="40">{{detailv}}</span>
</md-list-item>
<md-list-item layout-align="end end">
<span style="font-weight: bold">
<md-button ng-click="openDiscover('generic','rule.sidid:'+rule.id)">
Discover alerts <i class="fa fa-external-link" aria-hidden="true"></i>
</md-button>
</span>
</md-list-item>
</md-list>
<md-divider></md-divider>
</div>
</md-virtual-repeat-container>
</md-content>