Redefined ruleset/rules and ruleset/decoders tab

This commit is contained in:
Jesús Ángel González 2018-01-17 12:50:50 +01:00 committed by Javier Castro
parent 3d0809e3a4
commit 32de79f295
3 changed files with 130 additions and 121 deletions

View File

@ -1,5 +1,5 @@
.ruleset_card_info { .ruleset_card_info {
background-color: #dbf0f7 background-color: rgb(60,174,210);
} }
.ruleset_rules_row_active { .ruleset_rules_row_active {

View File

@ -1,6 +1,9 @@
<div flex ng-if="!loading && globalsubmenuNavItem2 == 'decoders'" ng-controller="decodersController" layout="column" id="rulesContainer" layout-padding layout-align="start space-around"> <div flex ng-if="!loading && globalsubmenuNavItem2 == 'decoders'" ng-controller="decodersController" layout="column" id="rulesContainer"
layout-padding layout-align="start space-around">
<div class='uil-ring-css' ng-show="loading"><div></div></div> <div class='uil-ring-css' ng-show="loading">
<div></div>
</div>
<div ng-show="!loading" layout="row" layout-align="center start"> <div ng-show="!loading" layout="row" layout-align="center start">
<md-card flex class="manager-ruleset-decoders-top-24"> <md-card flex class="manager-ruleset-decoders-top-24">
@ -14,27 +17,16 @@
<div ng-show="!loading" flex layout="column" class="manager-ruleset-decoders-no-padding"> <div ng-show="!loading" flex layout="column" class="manager-ruleset-decoders-no-padding">
<div id="content" layout="row" layout-align="start start" class="manager-ruleset-decoders-top-content"> <div id="content" layout="row" layout-align="start start" class="manager-ruleset-decoders-top-content">
<span layout="row" class="manager-ruleset-decoders-top-span" flex layout-align="space-between center"> <span layout="row" class="manager-ruleset-decoders-top-span" flex layout-align="space-between center">
<md-autocomplete flex <md-autocomplete flex id="Auto" md-input-id="autocomplete" md-select-on-match="true" md-no-cache="noCache" md-selected-item="filter"
id="Auto" md-selected-item-change="decoders.addFilter('search', filter.name)" md-search-text="searchTerm" md-items="decoder in analizeDecoders(searchTerm)"
md-input-id="autocomplete" md-item-text="decoder.name +' '+ decoder.file" md-min-length="0" md-no-asterisk="false" md-menu-class="autocomplete-custom-agents-bar"
md-select-on-match="true" md-search-text-change="analizeDecoders(searchTerm)" placeholder="Search..." lazy-load-data="decodersAutoComplete.nextPage()"
md-no-cache="noCache" md-autofocus="" my-enter="checkEnter(searchTerm)">
md-selected-item="filter"
md-selected-item-change="decoders.addFilter('search', filter.name)"
md-search-text="searchTerm"
md-items="decoder in analizeDecoders(searchTerm)"
md-item-text="decoder.name +' '+ decoder.file"
md-min-length="0"
md-no-asterisk="false"
md-menu-class="autocomplete-custom-agents-bar"
md-search-text-change="analizeDecoders(searchTerm)"
placeholder="Search..."
lazy-load-data="decodersAutoComplete.nextPage()"
md-autofocus=""
my-enter="checkEnter(searchTerm)">
<md-item-template> <md-item-template>
<span class="item-title"> <span class="item-title">
<span><strong md-highlight-text="search" md-highlight-flags="i"> {{decoder.name}} {{decoder.file}}</strong></span> <span>
<strong md-highlight-text="search" md-highlight-flags="i"> {{decoder.file}} - {{decoder.name}} </strong>
</span>
</span> </span>
<span class="item-metadata"> <span class="item-metadata">
<span class="item-metastat"> {{decoder.type}} </span> <span class="item-metastat"> {{decoder.type}} </span>
@ -44,10 +36,12 @@
</md-autocomplete> </md-autocomplete>
</span> </span>
<md-button flex="10" ng-class="(globalsubmenuNavItem2 == 'rules') ? 'button-active' : 'buttonBlueLightRuleset'" ng-click="setRulesTab('rules')" class="md-primary manager-ruleset-decoders-btn"> <md-button flex="10" ng-class="(globalsubmenuNavItem2 == 'rules') ? 'button-active' : 'buttonBlueLightRuleset'" ng-click="setRulesTab('rules')"
class="md-primary manager-ruleset-decoders-btn">
Rules Rules
</md-button> </md-button>
<md-button flex="10" ng-class="(globalsubmenuNavItem2 == 'decoders') ? 'button-active' : 'buttonBlueLightRuleset'" ng-click="setRulesTab('decoders')" class="md-primary manager-ruleset-decoders-btn"> <md-button flex="10" ng-class="(globalsubmenuNavItem2 == 'decoders') ? 'button-active' : 'buttonBlueLightRuleset'" ng-click="setRulesTab('decoders')"
class="md-primary manager-ruleset-decoders-btn">
Decoders Decoders
</md-button> </md-button>
@ -61,68 +55,90 @@
<md-chips readonly="true" ng-show="decoders.hasFilter('search') || decoders.hasFilter('file') || decoders.hasFilter('path')"> <md-chips readonly="true" ng-show="decoders.hasFilter('search') || decoders.hasFilter('file') || decoders.hasFilter('path')">
<md-chip class="wazuh-chip" ng-click="decoders.removeFilter('search', true)" ng-if="decoders.hasFilter('search') && decoders.getFilter('search')"> <md-chip class="wazuh-chip" ng-click="decoders.removeFilter('search', true)" ng-if="decoders.hasFilter('search') && decoders.getFilter('search')">
<span class="bold">Search: {{decoders.getFilter('search')}} <i class="fa fa-times" aria-hidden="true"></i></span> <span class="bold">Search: {{decoders.getFilter('search')}}
<i class="fa fa-times" aria-hidden="true"></i>
</span>
</md-chip> </md-chip>
<md-chip class="wazuh-chip" ng-click="decoders.removeFilter('file', true)" ng-if="decoders.hasFilter('file');"> <md-chip class="wazuh-chip" ng-click="decoders.removeFilter('file', true)" ng-if="decoders.hasFilter('file');">
<span class="bold">File: {{decoders.getFilter('file')}} <i class="fa fa-times" aria-hidden="true"></i></span> <span class="bold">File: {{decoders.getFilter('file')}}
<i class="fa fa-times" aria-hidden="true"></i>
</span>
</md-chip> </md-chip>
<md-chip class="wazuh-chip" ng-click="decoders.removeFilter('path', true)" ng-if="decoders.hasFilter('path');"> <md-chip class="wazuh-chip" ng-click="decoders.removeFilter('path', true)" ng-if="decoders.hasFilter('path');">
<span class="bold">Path: {{decoders.getFilter('path')}} <i class="fa fa-times" aria-hidden="true"></i></span> <span class="bold">Path: {{decoders.getFilter('path')}}
<i class="fa fa-times" aria-hidden="true"></i>
</span>
</md-chip> </md-chip>
</md-chips> </md-chips>
<md-toolbar layout="row" class="md-toolbar-tools manager-ruleset-decoders-mdtoolbar"> <md-toolbar layout="row" class="md-toolbar-tools md-toolbar-tools-groups">
<span flex="20" ng-click="decoders.sort('name')">Name <i class="fa" ng-class="decoders.sortValue === 'name' ? (decoders.sortDir ? 'fa-sort-asc' : 'fa-sort-desc') : 'fa-sort'" aria-hidden="true"></i></span> <span flex="20" ng-click="decoders.sort('name')">Name
<i class="fa" ng-class="decoders.sortValue === 'name' ? (decoders.sortDir ? 'fa-sort-asc' : 'fa-sort-desc') : 'fa-sort'"
aria-hidden="true"></i>
</span>
<span flex="20">Program name</span> <span flex="20">Program name</span>
<span flex="40">Fields</span> <span flex="40">Fields</span>
<span flex="20" ng-click="decoders.sort('file')">File <i class="fa" ng-class="decoders.sortValue === 'file' ? (decoders.sortDir ? 'fa-sort-asc' : 'fa-sort-desc') : 'fa-sort'" aria-hidden="true"></i></span> <span flex="20" ng-click="decoders.sort('file')">File
<i class="fa" ng-class="decoders.sortValue === 'file' ? (decoders.sortDir ? 'fa-sort-asc' : 'fa-sort-desc') : 'fa-sort'"
aria-hidden="true"></i>
</span>
</md-toolbar> </md-toolbar>
<md-content flex layout="column" class="height-300" when-scrolled="decoders.nextPage('')"> <md-content flex layout="column" class="height-300" when-scrolled="decoders.nextPage('')">
<md-list class="agents-preview-table" ng-class-odd="'odd'" ng-class-even="'even'" ng-repeat='decoder in decoders.items | orderBy : decoders.sortValue : decoders.sortDir' ng-class="activeItem === decoder.name+decoder.file+decoder.position ? 'ruleset_rules_row_active' : ''"> <md-list class="agents-preview-table" ng-class-odd="'odd'" ng-class-even="'even'" ng-repeat='decoder in decoders.items | orderBy : decoders.sortValue : decoders.sortDir'
<md-list-item class="rules-item-list" ng-click="closeOther(decoder.name+decoder.file+decoder.position)" ng-class="activeItem === decoder.name+decoder.file+decoder.position ? 'ruleset_rules_row_active' : ''"> ng-class="activeItem === decoder.name+decoder.file+decoder.position ? 'ruleset_rules_row_active' : ''">
<span flex="20">{{decoder.name}}</span> <md-list-item class="rules-item-list" ng-click="closeOther(decoder.name+decoder.file+decoder.position)" ng-class="activeItem === decoder.name+decoder.file+decoder.position ? 'ruleset_rules_row_active' : ''">
<span flex="20">{{decoder.details["program_name"]}}</span> <span flex="20">{{decoder.name}}</span>
<span flex="40">{{ decoder.details["order"] | limitTo: 80 }}{{decoder.details["order"].length > 80 ? '...' : ''}}</span> <span flex="20">{{decoder.details["program_name"]}}</span>
<md-button md-no-ink class="invisibleButton" flex="20" ng-if="$parent.typeFilter == 'all'" ng-click="decodersApplyFilter({type: 'file', value: decoder.file}); $event.stopPropagation();">{{decoder.file}}</md-button> <span flex="40">{{ decoder.details["order"] | limitTo: 80 }}{{decoder.details["order"].length > 80 ? '...' : ''}}</span>
<span flex="20" ng-if="$parent.typeFilter != 'all'">{{decoder.file}}</span> <md-button md-no-ink class="invisibleButton" flex="20" ng-if="$parent.typeFilter == 'all'" ng-click="decodersApplyFilter({type: 'file', value: decoder.file}); $event.stopPropagation();">{{decoder.file}}</md-button>
</md-list-item> <span flex="20" ng-if="$parent.typeFilter != 'all'">{{decoder.file}}</span>
</md-list-item>
<div layout="row" ng-if="activeItem === decoder.name+decoder.file+decoder.position" class="ruleset_card_info manager-ruleset-rules-card-info">
<md-card flex>
<div layout="column" class="md-padding">
<div layout="row">
<div flex>
<h4>
<i class="fa fa-tasks"></i> Overview</h4>
<md-divider></md-divider>
<p>Full path
<span class="md-secondary pull-right">{{decoder.path}}</span>
</p>
<p>Position
<span class="md-secondary pull-right">{{decoder.position}}</span>
</p>
<p ng-show="decoder.details.parent">Parent
<span class="md-secondary pull-right">{{decoder.details.parent}}</span>
</p>
</div>
</div>
</div>
</md-card>
<md-card flex ng-if="detailk != 'parent'">
<div layout="column" class="md-padding">
<div layout="row">
<div flex>
<h4>
<i class="fa fa-cog"></i> Details</h4>
<md-divider></md-divider>
<p ng-repeat="(detailk, detailv) in decoder.details">
{{detailk}}
<span class="md-secondary pull-right" ng-if="(detailk !== 'regex') && (detailk !== 'order')">{{detailv}}</span>
<span class="md-secondary pull-right" ng-if="(detailk === 'regex')" ng-bind-html="colorRegex(detailv)">{{colorRegex(detailv)}}</span>
<span class="md-secondary pull-right" ng-if="(detailk === 'order')" ng-bind-html="colorOrder(detailv)">{{colorOrder(detailv)}}</span>
</p>
</div>
</div>
</div>
</md-card>
</div>
</md-list>
<div layout="row" ng-if="activeItem === decoder.name+decoder.file+decoder.position" ng-class="activeItem === decoder.name+decoder.file+decoder.position ? 'ruleset_rules_row_active' : ''"> </md-content>
<md-card flex>
<md-card-content>
<div layout="column">
<span layout="row">
<p class="manager-status-subtitle">Full path</p>
<p class="text-right">{{decoder.path}}</p>
</span>
<span layout="row">
<p class="manager-status-subtitle">Position</p>
<p class="text-right">{{decoder.position}}</p>
</span>
<span layout="row">
<p class="manager-status-subtitle">Parent</p>
<p class="text-right">{{decoder.details.parent}}</p>
</span>
</div>
</md-card-content>
</md-card>
<md-card flex>
<md-card-content>
<div layout="column" ng-repeat="(detailk, detailv) in decoder.details" ng-if="detailk != 'parent'">
<span layout="row">
<p class="manager-status-subtitle">{{detailk}}</p>
<p class="text-right" ng-if="(detailk !== 'regex') && (detailk !== 'order')">{{detailv}}</p>
<p class="text-right" ng-if="(detailk === 'regex')" ng-bind-html="colorRegex(detailv)">{{colorRegex(detailv)}}</p>
<p class="text-right" ng-if="(detailk === 'order')" ng-bind-html="colorOrder(detailv)">{{colorOrder(detailv)}}</p>
</span>
</div>
</md-card-content>
</md-card>
</md-list>
</md-list>
</md-content>
<md-divider></md-divider> <md-divider></md-divider>
<md-content><md-progress-linear class="md-accent" md-mode="indeterminate" ng-show="decoders.busy"></md-progress-linear></md-content> <md-content>
<md-progress-linear class="md-accent" md-mode="indeterminate" ng-show="decoders.busy"></md-progress-linear>
</md-content>
</div> </div>
</div> </div>

View File

@ -106,7 +106,7 @@
</md-chip> </md-chip>
</md-chips> </md-chips>
<md-toolbar layout="row" class="md-toolbar-tools manager-ruleset-rules-mdtoolbar"> <md-toolbar layout="row" class="md-toolbar-tools md-toolbar-tools-groups">
<span flex="5" ng-click="rules.sort('id')">ID <span flex="5" ng-click="rules.sort('id')">ID
<i class="fa" ng-class="rules.sortValue === 'id' ? (rules.sortDir ? 'fa-sort-asc' : 'fa-sort-desc') : 'fa-sort'" aria-hidden="true"></i> <i class="fa" ng-class="rules.sortValue === 'id' ? (rules.sortDir ? 'fa-sort-asc' : 'fa-sort-desc') : 'fa-sort'" aria-hidden="true"></i>
</span> </span>
@ -126,7 +126,7 @@
<md-content flex layout="column" class="height-300" when-scrolled="rules.nextPage('')"> <md-content flex layout="column" class="height-300" when-scrolled="rules.nextPage('')">
<md-list ng-repeat='rule in rules.items | orderBy : rules.sortValue : rules.sortDir' ng-class-odd="'odd'" ng-class-even="'even'" <md-list ng-repeat='rule in rules.items | orderBy : rules.sortValue : rules.sortDir' ng-class-odd="'odd'" ng-class-even="'even'"
class="agents-preview-table" ng-class="activeItem === rule.id ? 'ruleset_rules_row_active' : ''"> class="agents-groups-preview agents-preview-table" ng-class="activeItem === rule.id ? 'ruleset_rules_row_active' : ''">
<md-list-item class="rules-item-list" ng-click="closeOther(rule.id)" ng-class="activeItem === rule.id ? 'ruleset_rules_row_active' : ''"> <md-list-item class="rules-item-list" ng-click="closeOther(rule.id)" ng-class="activeItem === rule.id ? 'ruleset_rules_row_active' : ''">
<span flex="5">{{rule.id}}</span> <span flex="5">{{rule.id}}</span>
<span flex="15">{{rule.file}}</span> <span flex="15">{{rule.file}}</span>
@ -146,56 +146,49 @@
<div layout="row" ng-if="activeItem === rule.id" class="ruleset_card_info manager-ruleset-rules-card-info"> <div layout="row" ng-if="activeItem === rule.id" class="ruleset_card_info manager-ruleset-rules-card-info">
<md-card flex> <md-card flex>
<md-card-content> <div layout="column" class="md-padding">
<div layout="column"> <div layout="row">
<span layout="row"> <div flex>
<p class="manager-status-subtitle">ID</p> <h4><i class="fa fa-tasks"></i> Overview</h4>
<p>{{rule.id}}</p> <md-divider></md-divider>
</span>
<span layout="row">
<p class="manager-status-subtitle">Description</p>
<p>{{rule.description}}</p> <p>{{rule.description}}</p>
</span> <p>Id <span class="md-secondary pull-right">{{rule.id}}</span></p>
<span layout="row"> <p>Level <span class="md-secondary pull-right listHover" ng-click="rules.addFilter('level', rule.level); $event.stopPropagation();">{{rule.level}}</span></p>
<p class="manager-status-subtitle">Level</p> <p>File <span class="md-secondary pull-right listHover" ng-click="rules.addFilter('file', rule.file); $event.stopPropagation();">{{rule.file}}</span></p>
<p class="listHover" ng-click="rules.addFilter('level', rule.level); $event.stopPropagation();">{{rule.level}}</p> </div>
</span> </div>
<span layout="row"> </div>
<p class="manager-status-subtitle">File</p>
<p class="listHover" ng-click="rules.addFilter('file', rule.file); $event.stopPropagation();">{{rule.file}}</p>
</span>
</div>
</md-card-content>
</md-card> </md-card>
<md-card flex> <md-card flex>
<md-card-content> <div layout="column" class="md-padding">
<h3 class="wazuh-h3" ng-if="rule.groups.length > 0">Groups</h3> <div layout="row" ng-if="rule.groups.length > 0">
<span ng-repeat="group in rule.groups" ng-if="rule.groups.length > 0"> <div flex>
<span layout="row" layout-align="space-between center" ng-click="rules.addFilter('group', group)"> <h4><i class="fa fa-reorder"></i> Groups</h4>
<p class="listHover">{{group}}</p> <md-divider></md-divider>
</span> <p ng-repeat="group in rule.groups"><span class="md-secondary listHover" ng-click="rules.addFilter('group', group)">{{group}}</span><br></p>
<md-divider ng-if="!$last"></md-divider> </div>
</span> </div>
<h3 class="wazuh-h3" ng-if="rule.pci.length > 0">PCI DSS</h3> <div layout="row" ng-if="rule.pci.length > 0">
<span ng-repeat="pci in rule.pci" ng-if="rule.pci.length > 0"> <div flex>
<span layout="row" layout-align="space-between center" ng-click="rules.addFilter('pci', pci)"> <h4><i class="fa fa-shield"></i> PCI DSS</h4>
<p class="listHover">{{pci}}</p> <md-divider></md-divider>
</span> <p ng-repeat="pci in rule.pci"><span class="md-secondary listHover" ng-click="rules.addFilter('pci', pci)">{{pci}}</span><br></p>
<md-divider ng-if="!$last"></md-divider> </div>
</span> </div>
</md-card-content> </div>
</md-card> </md-card>
<md-card flex> <md-card flex>
<md-card-content> <div layout="column" class="md-padding">
<h3 class="wazuh-h3">Extra settings</h3> <div layout="row">
<span ng-repeat="(detailk, detailv) in rule.details"> <div flex>
<span layout="row" layout-align="space-between center"> <h4><i class="fa fa-cog"></i> Extra settings</h4>
<p>{{detailk}}</p> <md-divider></md-divider>
<p class="text-right">{{detailv}}</p> <p ng-repeat="(detailk, detailv) in rule.details">
</span> {{detailk}}<span class="md-secondary pull-right">{{detailv}}</span>
<md-divider ng-if="!$last"></md-divider> </p>
</span> </div>
</md-card-content> </div>
</div>
</md-card> </md-card>
</div> </div>
</md-list> </md-list>