Merge pull request #955 from wazuh/issue-951

Implement separate template for Agents' Active response configuration
This commit is contained in:
Jesús Ángel 2018-10-08 12:23:05 +02:00 committed by GitHub
commit bb83a731cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 145 additions and 16 deletions

View File

@ -81,18 +81,6 @@
label="Timeout (in seconds) before reverting"
value="currentConfig['analysis-active_response']['active-response'][selectedItem].timeout">
</wz-config-item>
<wz-config-item
label="Repeated offenders"
value="currentConfig['analysis-active_response']['active-response'][selectedItem].repeated_offenders">
</wz-config-item>
<wz-config-item
label="CA certificate"
value="currentConfig['analysis-active_response']['active-response'][selectedItem].ca_store">
</wz-config-item>
<wz-config-item
label="CA verification"
value="currentConfig['analysis-active_response']['active-response'][selectedItem].ca_verification">
</wz-config-item>
</div>
</div>

View File

@ -0,0 +1,131 @@
<!-- This section contains the main content and the right sidenav -->
<div flex="auto" layout="row" ng-if="!load && configurationSubTab === 'active-response'">
<!-- No configuration section -->
<wz-no-config
flex
error="currentConfig['com-active-response']"
ng-if="currentConfig['com-active-response'] && isString(currentConfig['com-active-response'])"></wz-no-config>
<wz-no-config
flex
error="'not-present'"
ng-if="currentConfig['com-active-response'] && !isString(currentConfig['com-active-response']) && !currentConfig['com-active-response']['active-response']"></wz-no-config>
<!-- End no configuration section -->
<!-- This section is the main content -->
<div flex layout="column" ng-if="currentConfig['com-active-response'] && !isString(currentConfig['com-active-response']) && currentConfig['com-active-response']['active-response']">
<!-- The main card will all the settings -->
<md-card class="wz-md-card" ng-if="!JSONContent && !XMLContent">
<md-card-content>
<div layout="row" layout-align="start center">
<div>
<span class="font-size-16">Active response settings</span>
<div class="wz-margin-top-10">
<span class="md-subheader small">Find here all the Active response settings for this agent</span>
</div>
</div>
<span flex></span>
<span ng-class="JSONContent ? 'wz-text-active' : ''" class="wz-text-link small" ng-click="getJSON()">JSON</span>
<span class="small">&nbsp;&centerdot;&nbsp;</span>
<span ng-class="XMLContent ? 'wz-text-active' : ''" class="wz-text-link small" ng-click="getXML()">XML</span>
</div>
<md-divider class="wz-margin-top-10"></md-divider>
<!-- Configuration block -->
<div class="wz-padding-top-10">
<wz-config-item
label="Active response status"
value="currentConfig['com-active-response']['active-response'] === 'yes' ? 'disabled' : 'enabled'">
</wz-config-item>
<wz-config-item
label="List of timeouts (in minutes) for repeated offenders"
value="currentConfig['com-active-response']['active-response'].repeated_offenders">
</wz-config-item>
<wz-config-item
is-array="true"
label="Use the following list of root CA certificates"
value="currentConfig['com-active-response']['active-response'].ca_store">
</wz-config-item>
<wz-config-item
label="Validate WPKs using root CA certificate"
value="currentConfig['com-active-response']['active-response'].ca_verification">
</wz-config-item>
</div>
<!-- End configuration block -->
</md-card-content>
</md-card>
<!-- End main card with all the settings -->
<!-- JSON card -->
<md-card flex="auto" class="wz-md-card" ng-if="JSONContent">
<md-card-content flex layout="column">
<div layout="row" layout-align="start center">
<div>
<span class="font-size-16">JSON viewer</span>
<div class="wz-margin-top-10">
<span class="md-subheader small">View this configuration in raw JSON format</span>
</div>
</div>
<span flex></span>
<span ng-class="JSONContent ? 'wz-text-active' : ''" class="wz-text-link small" ng-click="getJSON()">JSON</span>
<span class="small">&nbsp;&centerdot;&nbsp;</span>
<span ng-class="XMLContent ? 'wz-text-active' : ''" class="wz-text-link small" ng-click="getXML()">XML</span>
</div>
<md-divider class="wz-margin-top-10"></md-divider>
<!-- The JSON viewer -->
<div flex="auto" class="wz-margin-top-10 wz-code-viewer">
<pre><code wz-dynamic="JSONContent"></code></pre>
</div>
<!-- End JSON viewer -->
</md-card-content>
</md-card>
<!-- End JSON card -->
<!-- XML card -->
<md-card flex="auto" class="wz-md-card" ng-if="XMLContent">
<md-card-content flex layout="column">
<div layout="row" layout-align="start center">
<div>
<span class="font-size-16">XML viewer</span>
<div class="wz-margin-top-10">
<span class="md-subheader small">View this configuration in raw XML format</span>
</div>
</div>
<span flex></span>
<span ng-class="JSONContent ? 'wz-text-active' : ''" class="wz-text-link small" ng-click="getJSON()">JSON</span>
<span class="small">&nbsp;&centerdot;&nbsp;</span>
<span ng-class="XMLContent ? 'wz-text-active' : ''" class="wz-text-link small" ng-click="getXML()">XML</span>
</div>
<md-divider class="wz-margin-top-10"></md-divider>
<!-- The XML viewer -->
<div flex="auto" class="wz-margin-top-10 wz-code-viewer">
<pre>{{ XMLContent }}</pre>
</div>
<!-- End XML viewer -->
</md-card-content>
</md-card>
<!-- End XML card -->
</div>
<!-- End main content section -->
<!-- This section is the right sidenav content -->
<md-sidenav
class="md-sidenav-right"
md-is-locked-open="true">
<md-list>
<md-subheader>More info about this section</md-subheader>
<md-list-item target="_blank" class="wz-text-link" ng-href="https://documentation.wazuh.com/current/user-manual/capabilities/active-response/index.html">Active response documentation</md-list-item>
<md-list-item target="_blank" class="wz-text-link" ng-href="https://documentation.wazuh.com/current/user-manual/reference/ossec-conf/active-response.html">Active response reference</md-list-item>
</md-list>
</md-sidenav>
<!-- End right sidenav section -->
</div>
<!-- End main content and right sidenav section -->

View File

@ -0,0 +1,4 @@
include ./active-response.head
include ./agents-active-response.html
include ./commands.html
include ../../../footer.foot

View File

@ -20,7 +20,7 @@ include ./cis-cat/cis-cat.jade
//- include ./vulnerabilities/vulnerabilities.jade
include ./osquery/osquery.html
include ./inventory/inventory.html
include ./active-response/active-response.jade
include ./active-response/agents-active-response.jade
include ./wazuh-commands/wazuh-commands.html
include ./integrity-monitoring/integrity-monitoring.jade

View File

@ -6,9 +6,9 @@
<span class="font-size-18"> <i class="fa fa-fw fa-cog" aria-hidden="true"></i> Configuration</span>
<span ng-if="isSynchronized" class="wz-agent-status-indicator small teal">SYNCHRONIZED</span>
<span ng-if="!isSynchronized" class="wz-agent-status-indicator small red">NOT SYNCHRONIZED</span>
</div>
</div>
<span class="font-size-18" ng-show="!agent || agent.id === '000'">
<i class="fa fa-fw fa-cog" aria-hidden="true"></i> Configuration</span>
<i class="fa fa-fw fa-cog" aria-hidden="true"></i> Configuration</span>
<span class="md-subheader">Check your Wazuh cluster configuration</span>
</div>
<!-- End headline -->
@ -171,12 +171,18 @@
<p>Gather relevant information about your system OS, hardware, packages, etc.</p>
</div>
</md-list-item>
<md-list-item flex="100" flex-gt-md="50" flex-gt-lg="33" class="md-2-line">
<md-list-item flex="100" flex-gt-md="50" flex-gt-lg="33" class="md-2-line" ng-if="!agent || agent.id === '000'">
<div class="md-list-item-text">
<h3 class="wz-text-link" ng-click="switchConfigTab('active-response',[{component:'analysis',configuration:'command'},{component:'analysis',configuration:'active_response'}])">Active response</h3>
<p>Active threath addressing by inmmediate response</p>
</div>
</md-list-item>
<md-list-item flex="100" flex-gt-md="50" flex-gt-lg="33" class="md-2-line" ng-if="agent && agent.id !== '000'">
<div class="md-list-item-text">
<h3 class="wz-text-link" ng-click="switchConfigTab('active-response',[{component:'com',configuration:'active-response'}])">Active response</h3>
<p>Active threath addressing by inmmediate response</p>
</div>
</md-list-item>
<md-list-item flex="100" flex-gt-md="50" flex-gt-lg="33" class="md-2-line">
<div class="md-list-item-text">
<h3 class="wz-text-link" ng-click="switchWodle('command')">Wazuh commands</h3>