Skip to content

Commit

Permalink
Merge pull request #1069 from ninoseki/v7.4.0
Browse files Browse the repository at this point in the history
v7.4.0
  • Loading branch information
ninoseki authored Mar 2, 2024
2 parents 43838b6 + b7abf34 commit 0f6876e
Show file tree
Hide file tree
Showing 37 changed files with 892 additions and 737 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,11 @@ lib/mihari/web/public/
# Rules & Alerts
rules/
alerts/

# Python Environments
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
1,368 changes: 766 additions & 602 deletions frontend/package-lock.json

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.5.1",
"@fortawesome/free-solid-svg-icons": "^6.5.1",
"@fortawesome/vue-fontawesome": "^3.0.5",
"@vueuse/core": "^10.7.2",
"@vueuse/router": "^10.7.2",
"ace-builds": "^1.32.3",
"@fortawesome/vue-fontawesome": "^3.0.6",
"@vueuse/core": "^10.9.0",
"@vueuse/router": "^10.9.0",
"ace-builds": "^1.32.7",
"axios": "^1.6.7",
"bulma": "^0.9.4",
"bulma-helpers": "^0.4.3",
Expand All @@ -31,38 +31,38 @@
"ts-dedent": "^2.2.0",
"url-parse": "^1.5.10",
"uuidv4": "^6.2.13",
"vue": "^3.4.15",
"vue": "^3.4.21",
"vue-concurrency": "^5.0.0",
"vue-json-pretty": "^2.3.0",
"vue-router": "^4.2.5",
"vue-router": "^4.3.0",
"vue3-ace-editor": "^2.2.4",
"zod": "^3.22.4"
},
"devDependencies": {
"@redocly/cli": "1.7.0",
"@redocly/cli": "1.10.1",
"@rushstack/eslint-patch": "^1.7.2",
"@tsconfig/node20": "^20.1.2",
"@types/jsdom": "^21.1.6",
"@types/node": "^20.11.7",
"@types/node": "^20.11.24",
"@types/url-parse": "^1.4.11",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"@vitejs/plugin-vue": "^5.0.3",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@vitejs/plugin-vue": "^5.0.4",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^12.0.0",
"@vue/test-utils": "2.4.4",
"@vue/tsconfig": "^0.5.1",
"eslint": "^8.56.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-vue": "^9.20.1",
"eslint-plugin-simple-import-sort": "^12.0.0",
"eslint-plugin-vue": "^9.22.0",
"jsdom": "^24.0.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.2.4",
"prettier": "^3.2.5",
"typescript": "~5.3.3",
"vite": "^5.0.12",
"vitest": "^1.2.1",
"vue-tsc": "^1.8.27"
"vite": "^5.1.4",
"vitest": "^1.3.1",
"vue-tsc": "^2.0.1"
}
}
2 changes: 1 addition & 1 deletion frontend/src/components/ErrorMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</div>
<article class="message" v-if="data?.detail">
<div class="message-body">
<VueJsonPretty :data="data.detail"></VueJsonPretty>
<VueJsonPretty :data="data.detail" />
</div>
</article>
</template>
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/alert/Alert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
v-if="error"
:disposable="true"
@dispose="onDisposeError"
></ErrorMessage>
/>
<p>
<ActionButtons :alert="alert" @delete="onDelete" @set-error="onSetError"></ActionButtons>
<ActionButtons :alert="alert" @delete="onDelete" @set-error="onSetError" />
</p>
<router-link class="is-size-4" :to="{ name: 'Alert', params: { id: alert.id } }">{{
alert.id
Expand All @@ -25,13 +25,13 @@
<tr>
<th>Artifacts</th>
<td>
<Artifacts :artifacts="alert.artifacts" @delete="onArtifactsDeleted"></Artifacts>
<Artifacts :artifacts="alert.artifacts" @delete="onArtifactsDeleted" />
</td>
</tr>
<tr v-if="alert.tags.length > 0">
<th>Tags</th>
<td>
<Tags :tags="alert.tags" :navigate-to="'Alerts'"></Tags>
<Tags :tags="alert.tags" :navigate-to="'Alerts'" />
</td>
</tr>
</table>
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/alert/AlertDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
v-if="error"
:disposable="true"
@dispose="onDisposeError"
></ErrorMessage>
/>
<div class="block">
<h2 class="is-size-2">{{ alert.id }}</h2>
<p class="is-clearfix">
Expand All @@ -23,7 +23,7 @@
<tr>
<th>Artifacts</th>
<td>
<Artifacts :artifacts="alert.artifacts" @delete="onArtifactsDeleted"></Artifacts>
<Artifacts :artifacts="alert.artifacts" @delete="onArtifactsDeleted" />
</td>
</tr>
<tr v-if="alert.tags.length > 0">
Expand All @@ -38,7 +38,7 @@
<hr />
<div class="block">
<h2 class="is-size-2 block">Related Alerts</h2>
<Alerts :rule-id="alert.ruleId" :exclude-alert-id="alert.id"></Alerts>
<Alerts :rule-id="alert.ruleId" :exclude-alert-id="alert.id" />
</div>
</template>

Expand Down
14 changes: 5 additions & 9 deletions frontend/src/components/alert/AlertDetailWrapper.vue
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
<template>
<Loading v-if="getAlertTask.isRunning"></Loading>
<ErrorMessage v-if="getAlertTask.isError" :error="getAlertTask.last?.error"></ErrorMessage>
<AlertComponent
:alert="getAlertTask.last.value"
@delete="onDelete"
v-if="getAlertTask.last?.value"
></AlertComponent>
<Loading v-if="getAlertTask.isRunning" />
<ErrorMessage v-if="getAlertTask.isError" :error="getAlertTask.last?.error" />
<Alert :alert="getAlertTask.last.value" @delete="onDelete" v-if="getAlertTask.last?.value" />
</template>

<script lang="ts">
import { defineComponent, onMounted } from "vue"
import { useRouter } from "vue-router"
import { generateGetAlertTask } from "@/api-helper"
import AlertComponent from "@/components/alert/AlertDetail.vue"
import Alert from "@/components/alert/AlertDetail.vue"
import ErrorMessage from "@/components/ErrorMessage.vue"
import Loading from "@/components/Loading.vue"
export default defineComponent({
name: "AlertDetailWrapper",
components: {
AlertComponent,
Alert,
Loading,
ErrorMessage
},
Expand Down
9 changes: 2 additions & 7 deletions frontend/src/components/alert/Alerts.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
<template>
<div v-if="hasAlerts">
<Alert
v-for="alert in alerts.results"
:alert="alert"
:key="alert.id"
@delete="onDelete"
></Alert>
<Alert v-for="alert in alerts.results" :alert="alert" :key="alert.id" @delete="onDelete" />
<Pagination
:total="alerts.total"
:currentPage="alerts.currentPage"
:pageSize="alerts.pageSize"
@update-page="onUpdatePage"
></Pagination>
/>
<p class="help">({{ alerts.total }} results in total, {{ alerts.results.length }} shown)</p>
</div>
<div v-else>
Expand Down
7 changes: 3 additions & 4 deletions frontend/src/components/alert/AlertsWithPagination.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<template>
<Loading v-if="getAlertsTask.isRunning"></Loading>
<ErrorMessage v-if="getAlertsTask.isError" :error="getAlertsTask.last?.error"></ErrorMessage>
<Loading v-if="getAlertsTask.isRunning" />
<ErrorMessage v-if="getAlertsTask.isError" :error="getAlertsTask.last?.error" />
<Alerts
:page="page.toString()"
:alerts="getAlertsTask.last.value"
v-if="getAlertsTask.last?.value"
@update-page="onUpdatePage"
>
</Alerts>
/>
</template>

<script lang="ts">
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/alert/AlertsWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@
</div>
</div>
<div class="block" v-if="getAlertsTask.performCount > 0">
<Loading v-if="getAlertsTask.isRunning"></Loading>
<ErrorMessage v-if="getAlertsTask.isError" :error="getAlertsTask.last?.error"></ErrorMessage>
<Loading v-if="getAlertsTask.isRunning" />
<ErrorMessage v-if="getAlertsTask.isError" :error="getAlertsTask.last?.error" />
<Alerts
:alerts="getAlertsTask.last.value"
v-if="getAlertsTask.last?.value"
:page="page"
@update-page="onUpdatePage"
@refresh="onRefresh"
></Alerts>
/>
</div>
</template>

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/artifact/ActionButtons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<button class="delete" aria-label="close" @click="toggleShowMetadata"></button>
</header>
<section class="modal-card-body">
<VueJsonPretty :data="artifact.metadata"></VueJsonPretty>
<VueJsonPretty :data="artifact.metadata" />
</section>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/artifact/Artifact.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
v-if="error"
:disposable="true"
@dispose="onDisposeError"
></ErrorMessage>
/>
<Message
class="block"
:message="message"
v-if="message"
:disposable="true"
@dispose="onDisposeMessage"
></Message>
/>
<div class="block">
<p>
<ActionButtons
:artifact="artifact"
@delete="onDelete"
@set-error="onSetError"
@set-message="onSetMessage"
></ActionButtons>
/>
</p>
<router-link class="is-size-4" :to="{ name: 'Artifact', params: { id: artifact.id } }">{{
artifact.id
Expand Down Expand Up @@ -53,7 +53,7 @@
<tr v-if="artifact.tags.length > 0">
<th>Tags</th>
<td>
<Tags :tags="artifact.tags" :navigate-to="'Artifacts'"></Tags>
<Tags :tags="artifact.tags" :navigate-to="'Artifacts'" />
</td>
</tr>
</table>
Expand Down
24 changes: 12 additions & 12 deletions frontend/src/components/artifact/ArtifactDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
v-if="error"
:disposable="true"
@dispose="onDisposeError"
></ErrorMessage>
/>
<Message
class="block"
:message="message"
v-if="message"
:disposable="true"
@dispose="onDisposeMessage"
></Message>
/>
<div class="block">
<h2 class="is-size-2">{{ artifact.id }}</h2>
<p class="is-clearfix">
Expand All @@ -21,7 +21,7 @@
@delete="onDelete"
@set-error="onSetError"
@set-message="onSetMessage"
></ActionButtons>
/>
</p>
</div>
<div class="columns">
Expand Down Expand Up @@ -60,43 +60,43 @@
</tr>
<tr v-if="artifact.tags.length > 0">
<th>Tags</th>
<td><Tags :tags="artifact.tags" :navigate-to="'Artifacts'"></Tags></td>
<td><Tags :tags="artifact.tags" :navigate-to="'Artifacts'" />/td></td>
</tr>
</table>
<p class="help">Created at: {{ artifact.createdAt }}</p>
</div>
</div>
<div class="block">
<Links :data="artifact.data" :type="artifact.dataType"></Links>
<Links :data="artifact.data" :type="artifact.dataType" />
</div>
<div class="block">
<div class="block" v-if="artifact.autonomousSystem">
<h4 class="is-size-4 mb-2">AS</h4>
<AS :autonomousSystem="artifact.autonomousSystem"></AS>
<AS :autonomousSystem="artifact.autonomousSystem" />
</div>
<div class="block" v-if="artifact.reverseDnsNames">
<h4 class="is-size-4 mb-2">Reverse DNS</h4>
<ReverseDnsNames :reverseDnsNames="artifact.reverseDnsNames"></ReverseDnsNames>
<ReverseDnsNames :reverseDnsNames="artifact.reverseDnsNames" />
</div>
<div class="block" v-if="artifact.dnsRecords">
<h4 class="is-size-4 mb-2">DNS records</h4>
<DnsRecords :dnsRecords="artifact.dnsRecords"></DnsRecords>
<DnsRecords :dnsRecords="artifact.dnsRecords" />
</div>
<div class="block" v-if="artifact.cpes">
<h4 class="is-size-4 mb-2">CPEs</h4>
<CPEs :cpes="artifact.cpes"></CPEs>
<CPEs :cpes="artifact.cpes" />
</div>
<div class="block" v-if="artifact.vulnerabilities">
<h4 class="is-size-4 mb-2">Vulnerabilities</h4>
<Vulnerabilities :vulnerabilities="artifact.vulnerabilities"></Vulnerabilities>
<Vulnerabilities :vulnerabilities="artifact.vulnerabilities" />
</div>
<div class="block" v-if="artifact.ports">
<h4 class="is-size-4 mb-2">Ports</h4>
<Ports :ports="artifact.ports"></Ports>
<Ports :ports="artifact.ports" />
</div>
<div class="block" v-if="artifact.whoisRecord">
<h4 class="is-size-4 mb-2">Whois record</h4>
<WhoisRecord :whoisRecord="artifact.whoisRecord"></WhoisRecord>
<WhoisRecord :whoisRecord="artifact.whoisRecord" />
</div>
</div>
</template>
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/artifact/ArtifactDetailWrapper.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<template>
<Loading v-if="getArtifactTask.isRunning"></Loading>
<ErrorMessage v-if="getArtifactTask.isError" :error="getArtifactTask.last?.error"></ErrorMessage>
<Loading v-if="getArtifactTask.isRunning" />
<ErrorMessage v-if="getArtifactTask.isError" :error="getArtifactTask.last?.error" />
<Artifact
:artifact="getArtifactTask.last.value"
@refresh="onRefresh"
@delete="onDelete"
v-if="getArtifactTask.last?.value"
></Artifact>
/>
</template>

<script lang="ts">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/artifact/ArtifactTags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:key="artifact.id"
:artifact="artifact"
@delete="onDelete"
></ArtifactTag>
/>
</div>
</template>

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/artifact/Artifacts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
v-for="artifact in artifacts.results"
:key="artifact.id"
@delete="onDelete"
></Artifact>
/>
<Pagination
:total="artifacts.total"
:currentPage="artifacts.currentPage"
:pageSize="artifacts.pageSize"
@update-page="onUpdatePage"
></Pagination>
/>
<p class="help">
({{ artifacts.total }} results in total, {{ artifacts.results.length }} shown)
</p>
Expand Down
Loading

0 comments on commit 0f6876e

Please sign in to comment.