Skip to content

Commit

Permalink
WIP: Reworked UI
Browse files Browse the repository at this point in the history
New Operations and Details panels implemented in Detections view.

Small consistency change to how YaraRule's check if they already have an ID before generating one.
  • Loading branch information
coreyogburn committed Feb 8, 2024
1 parent b1e8346 commit 3c02be7
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 36 deletions.
69 changes: 34 additions & 35 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1022,8 +1022,8 @@ <h2 id="detection-title" @click="startEdit('detection-title', 'title')" v-if="!i
<!-- Severity -->
<v-select id="detection-severity-create" v-model="detect.severity" :items="getPresets('severity')" persistent-hint :hint="i18n.detectionSeverity"/>

<!-- Engine -->
<v-select id="detection-engine-create" v-model="detect.engine" :items="getPresets('engine')" persistent-hint :hint="i18n.engine" :rules="[rules.required]" v-on:change="onDetectionChange"/>
<!-- Language -->
<v-select id="detection-language-create" v-model="detect.language" :items="getPresets('language')" persistent-hint :hint="i18n.language" :rules="[rules.required]" v-on:change="onDetectionChange"/>

<!-- Reporting -->
<v-checkbox id="detection-reporting-create" class="mt-5" v-model="detect.isReporting" :label="i18n.reporting"/>
Expand Down Expand Up @@ -1074,21 +1074,21 @@ <h2 id="detection-title" @click="startEdit('detection-title', 'title')" v-if="!i
<v-tab-item value="summary">
<div class="col pt-5 summary-backdrop">
<div>
<div class="header">Summary</div>
<div class="header">{{i18n.summary}}</div>
<div v-if="detect.description">
{{detect.description}}
</div>
<div v-else>
{{detect.title}}
</div>
<div class="header">References</div>
<div class="header">{{i18n.references}}</div>
<div>
<div v-for="r in extractedReferences">
<a :href="r.value" v-if="r.type==='url'" target="_blank">{{r.value}}</a>
<span v-else>{{r.value}}</span>
</div>
</div>
<div class="header">Signature</div>
<div class="header">{{i18n.signature}}</div>
<div class="extracted-content">
<pre>{{extractedLogic}}</pre>
</div>
Expand Down Expand Up @@ -1567,45 +1567,27 @@ <h2 id="detection-title" @click="startEdit('detection-title', 'title')" v-if="!i
<v-expansion-panels focusable multiple v-model="panel">
<v-expansion-panel v-if="!isNew()">
<v-expansion-panel-header id="detection-related-playbooks">
<h3>Operations</h3>
<h3>{{ i18n.operations }}</h3>
</v-expansion-panel-header>
<v-expansion-panel-content>
<!-- <v-checkbox id="detection-enabled-edit" v-model="detect.isEnabled" @change="stopEdit(true)" :label="i18n.detectionEnabled"/> -->
<div class="ops-header">
Enabled:
{{ i18n.enabled }}:
</div>
<div class="ops-value">
<span @click="startEdit('detection-enabled', 'isEnabled')" v-if="!isEdit('detection-enabled')">
{{detect.isEnabled ? 'True' : 'False'}}
{{ detect.isEnabled ? 'True' : 'False' }}
</span>
<v-checkbox id="detection-enabled-edit" v-model="detect.isEnabled" v-else @change="stopEdit(true)" />
</div>
<div class="ops-header">
DetectionType:
</div>
<div class="ops-value">
{{detect.engine}}
</div>
<div class="ops-header">
Severity:
</div>
<div class="ops-value">
{{detect.severity}}
</div>
<div class="ops-header" v-if="detect.isCommunity">
Ruleset:
</div>
<div class="ops-value" v-if="detect.isCommunity">
{{detect.ruleset}}
</div>
<!-- <div class="ops-header">
Related-Playbooks:
Related Playbooks:
</div>
<div class="ops-value">
TODO
</div> -->
<div class="ops-header">
Tags:
{{ i18n.tags }}:
</div>
<div class="ops-value">
<div>
Expand All @@ -1617,41 +1599,58 @@ <h3>Operations</h3>
</v-expansion-panel>
<v-expansion-panel v-if="!isNew()">
<v-expansion-panel-header id="detection-related-playbooks">
<h3>Details</h3>
<h3>{{ i18n.details }}</h3>
</v-expansion-panel-header>
<v-expansion-panel-content>
[detail stuff goes here]
<div class="ops-header">
{{ i18n.detectionType }}:
</div>
<div class="ops-value">
{{ detect.engine }}
</div>
<div class="ops-header">
{{ i18n.severity }}:
</div>
<div class="ops-value">
{{ detect.severity }}
</div>
<div class="ops-header" v-if="detect.isCommunity">
{{ i18n.ruleset }}:
</div>
<div class="ops-value" v-if="detect.isCommunity">
{{ detect.ruleset }}
</div>
</v-expansion-panel-content>
</v-expansion-panel>
</v-expansion-panels>
<div class="detect-reference">
<div class="detect-reference" v-if="!isNew()">
<div>
<div class="key">
Detection Id:
{{i18n.detectionId}}:
</div>
<div class="value">
{{ detect.id }}
</div>
</div>
<div>
<div class="key">
Author:
{{ i18n.author }}:
</div>
<div class="value">
{{ detect.author }}
</div>
</div>
<div>
<div class="key">
Created:
{{ i18n.dateCreated }}:
</div>
<div class="value">
{{ detect.createTime | formatDateTime}}
</div>
</div>
<div>
<div class="key">
Updated:
{{ i18n.dateModified }}:
</div>
<div class="value">
{{ detect.updateTime | formatDateTime }}
Expand Down
7 changes: 7 additions & 0 deletions html/js/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,10 @@ const i18n = {
detectionDefaultDescription: 'Detection description not yet provided',
detectionDescription: 'Detection Description',
detectionEnabled: 'Enabled',
detectionId: 'Detection Id',
detectionSeverity: 'Severity',
detectionTitle: 'Detection Title',
detectionType: 'Detection Type',
disable: 'Disable',
disconnected: 'Disconnected from manager',
diskUsageElastic: 'Elastic Storage Used',
Expand Down Expand Up @@ -463,6 +465,7 @@ const i18n = {
jobs: 'PCAP',
keywords: 'Filter Keywords',
kind: 'Kind',
language: 'Language',
last: 'Last',
lastHighstate: 'Last Synchronized',
lastName: 'Last Name',
Expand Down Expand Up @@ -555,6 +558,7 @@ const i18n = {
offline: 'Offline',
online: 'Online',
operation: 'Operation',
operations: 'Operations',
options: 'Options',
order: 'Order',
osUptime: 'OS Uptime',
Expand Down Expand Up @@ -597,6 +601,7 @@ const i18n = {
reason: 'Reason',
reconnecting: 'Attempting to connect to manager',
redisQueueSize: 'Redis Queue Size',
references: 'References',
refresh: 'Refresh',
refreshAttachmentsHelp: 'Refresh to view all recently added attachments for this case.',
refreshCaseHistoryHelp: 'Refresh to view the latest history for this case.',
Expand Down Expand Up @@ -629,6 +634,7 @@ const i18n = {
ruleMinLen: 'The provided value is too short',
ruleMaxLen: 'The provided value is too long',
rulePassBadChars: 'The password must not contain the following characters: " \' $ & !',
ruleset: 'Ruleset',
save: 'Save',
saveSuccess: 'Save successful!',
seconds: 'seconds',
Expand Down Expand Up @@ -749,6 +755,7 @@ const i18n = {
suricataLoss: 'Suricata Loss',
suricataLossAbbr: 'Suri Loss',
swapUsage: 'Swap Usage',
tags: 'Tags',
thresholdType: 'Threshold Type',
throttledLogin: 'Excessive login requests detected. Login requests can resume momentarily.',
time: 'Time',
Expand Down
2 changes: 1 addition & 1 deletion server/modules/strelka/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (md *Metadata) Set(key, value string) {
}

func (rule *YaraRule) GetID() string {
if rule.Meta.Rest["id"] != "" {
if rule.Meta.ID != nil {
return *rule.Meta.ID
}

Expand Down

0 comments on commit 3c02be7

Please sign in to comment.