mihari 5.7.0 → 5.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/lib/mihari/actor.rb +10 -4
- data/lib/mihari/commands/alert.rb +6 -4
- data/lib/mihari/commands/search.rb +10 -29
- data/lib/mihari/enrichers/ipinfo.rb +1 -1
- data/lib/mihari/entities/tag.rb +1 -0
- data/lib/mihari/rule.rb +14 -0
- data/lib/mihari/service.rb +12 -2
- data/lib/mihari/services/alert_builder.rb +81 -8
- data/lib/mihari/services/alert_runner.rb +3 -10
- data/lib/mihari/services/rule_builder.rb +8 -10
- data/lib/mihari/services/rule_runner.rb +2 -25
- data/lib/mihari/structs/binaryedge.rb +9 -0
- data/lib/mihari/structs/censys.rb +0 -14
- data/lib/mihari/structs/fofa.rb +3 -0
- data/lib/mihari/structs/google_public_dns.rb +0 -4
- data/lib/mihari/structs/greynoise.rb +0 -6
- data/lib/mihari/structs/hunterhow.rb +0 -6
- data/lib/mihari/structs/ipinfo.rb +0 -2
- data/lib/mihari/structs/onyphe.rb +0 -4
- data/lib/mihari/structs/shodan.rb +0 -2
- data/lib/mihari/structs/urlscan.rb +0 -6
- data/lib/mihari/structs/virustotal_intelligence.rb +0 -8
- data/lib/mihari/version.rb +1 -1
- data/lib/mihari/web/app.rb +20 -17
- data/lib/mihari/web/endpoints/alerts.rb +75 -38
- data/lib/mihari/web/endpoints/artifacts.rb +60 -53
- data/lib/mihari/web/endpoints/ip_addresses.rb +19 -4
- data/lib/mihari/web/endpoints/rules.rb +132 -88
- data/lib/mihari/web/endpoints/tags.rb +15 -13
- data/lib/mihari/web/public/assets/{index-821134e2.js → index-07fafab5.js} +4 -3
- data/lib/mihari/web/public/index.html +1 -1
- data/lib/mihari.rb +0 -1
- data/mihari.gemspec +1 -1
- data/mkdocs.yml +1 -0
- metadata +3 -130
- data/docs/alternatives.md +0 -5
- data/docs/analyzers/binaryedge.md +0 -26
- data/docs/analyzers/censys.md +0 -31
- data/docs/analyzers/circl.md +0 -37
- data/docs/analyzers/crtsh.md +0 -26
- data/docs/analyzers/dnstwister.md +0 -25
- data/docs/analyzers/feed.md +0 -73
- data/docs/analyzers/fofa.md +0 -31
- data/docs/analyzers/greynoise.md +0 -26
- data/docs/analyzers/hunterhow.md +0 -33
- data/docs/analyzers/index.md +0 -104
- data/docs/analyzers/onyphe.md +0 -26
- data/docs/analyzers/otx.md +0 -28
- data/docs/analyzers/passivetotal.md +0 -52
- data/docs/analyzers/pulsedive.md +0 -28
- data/docs/analyzers/securitytrails.md +0 -41
- data/docs/analyzers/shodan.md +0 -26
- data/docs/analyzers/urlscan.md +0 -28
- data/docs/analyzers/virustotal.md +0 -43
- data/docs/analyzers/virustotal_intelligence.md +0 -33
- data/docs/analyzers/zoomeye.md +0 -38
- data/docs/configuration.md +0 -35
- data/docs/emitters/database.md +0 -22
- data/docs/emitters/hive.md +0 -26
- data/docs/emitters/index.md +0 -36
- data/docs/emitters/misp.md +0 -21
- data/docs/emitters/slack.md +0 -21
- data/docs/emitters/webhook.md +0 -63
- data/docs/enrichers/google_public_dns.md +0 -19
- data/docs/enrichers/index.md +0 -35
- data/docs/enrichers/ipinfo.md +0 -26
- data/docs/enrichers/shodan.md +0 -22
- data/docs/enrichers/whois.md +0 -17
- data/docs/github_actions.md +0 -43
- data/docs/index.md +0 -11
- data/docs/installation.md +0 -31
- data/docs/requirements.md +0 -13
- data/docs/rule.md +0 -168
- data/docs/tags.md +0 -3
- data/docs/usage.md +0 -103
- data/frontend/.eslintrc.cjs +0 -22
- data/frontend/.gitignore +0 -31
- data/frontend/.prettierrc.json +0 -8
- data/frontend/README.md +0 -3
- data/frontend/env.d.ts +0 -5
- data/frontend/index.html +0 -21
- data/frontend/package-lock.json +0 -7219
- data/frontend/package.json +0 -67
- data/frontend/public/favicon.ico +0 -0
- data/frontend/scripts/swagger_doc_to_yaml.rb +0 -23
- data/frontend/src/App.vue +0 -27
- data/frontend/src/ace-config.ts +0 -6
- data/frontend/src/api-helper.ts +0 -111
- data/frontend/src/api.ts +0 -105
- data/frontend/src/components/ErrorMessage.vue +0 -31
- data/frontend/src/components/Loading.vue +0 -15
- data/frontend/src/components/Navbar.vue +0 -42
- data/frontend/src/components/Pagination.vue +0 -119
- data/frontend/src/components/alert/Alert.vue +0 -87
- data/frontend/src/components/alert/Alerts.vue +0 -63
- data/frontend/src/components/alert/AlertsWithPagination.vue +0 -90
- data/frontend/src/components/alert/AlertsWrapper.vue +0 -128
- data/frontend/src/components/alert/Form.vue +0 -169
- data/frontend/src/components/artifact/AS.vue +0 -23
- data/frontend/src/components/artifact/Artifact.vue +0 -287
- data/frontend/src/components/artifact/ArtifactTag.vue +0 -64
- data/frontend/src/components/artifact/ArtifactTags.vue +0 -29
- data/frontend/src/components/artifact/ArtifactWrapper.vue +0 -57
- data/frontend/src/components/artifact/CPEs.vue +0 -23
- data/frontend/src/components/artifact/DnsRecords.vue +0 -32
- data/frontend/src/components/artifact/Ports.vue +0 -23
- data/frontend/src/components/artifact/ReverseDnsNames.vue +0 -23
- data/frontend/src/components/artifact/Tags.vue +0 -29
- data/frontend/src/components/artifact/WhoisRecord.vue +0 -44
- data/frontend/src/components/config/Configs.vue +0 -65
- data/frontend/src/components/config/ConfigsWrapper.vue +0 -32
- data/frontend/src/components/link/Link.vue +0 -32
- data/frontend/src/components/link/Links.vue +0 -42
- data/frontend/src/components/rule/EditRule.vue +0 -72
- data/frontend/src/components/rule/EditRuleWrapper.vue +0 -48
- data/frontend/src/components/rule/Form.vue +0 -158
- data/frontend/src/components/rule/InputForm.vue +0 -45
- data/frontend/src/components/rule/NewRule.vue +0 -57
- data/frontend/src/components/rule/Rule.vue +0 -100
- data/frontend/src/components/rule/RuleWrapper.vue +0 -53
- data/frontend/src/components/rule/Rules.vue +0 -84
- data/frontend/src/components/rule/RulesWrapper.vue +0 -121
- data/frontend/src/components/rule/YAML.vue +0 -37
- data/frontend/src/components/tag/Tag.vue +0 -65
- data/frontend/src/components/tag/Tags.vue +0 -37
- data/frontend/src/countries.ts +0 -350
- data/frontend/src/index.ts +0 -20
- data/frontend/src/links/anyrun.ts +0 -19
- data/frontend/src/links/base.ts +0 -14
- data/frontend/src/links/censys.ts +0 -20
- data/frontend/src/links/crtsh.ts +0 -20
- data/frontend/src/links/dnslytics.ts +0 -38
- data/frontend/src/links/greynoise.ts +0 -20
- data/frontend/src/links/index.ts +0 -40
- data/frontend/src/links/intezer.ts +0 -20
- data/frontend/src/links/otx.ts +0 -33
- data/frontend/src/links/securitytrails.ts +0 -38
- data/frontend/src/links/shodan.ts +0 -20
- data/frontend/src/links/urlscan.ts +0 -50
- data/frontend/src/links/virustotal.ts +0 -72
- data/frontend/src/main.ts +0 -41
- data/frontend/src/router/index.ts +0 -57
- data/frontend/src/rule.ts +0 -14
- data/frontend/src/shims-vue.d.ts +0 -6
- data/frontend/src/swagger.yaml +0 -771
- data/frontend/src/types.ts +0 -188
- data/frontend/src/utils.ts +0 -54
- data/frontend/src/views/Alerts.vue +0 -20
- data/frontend/src/views/Artifact.vue +0 -39
- data/frontend/src/views/Configs.vue +0 -20
- data/frontend/src/views/EditRule.vue +0 -39
- data/frontend/src/views/NewRule.vue +0 -26
- data/frontend/src/views/Rule.vue +0 -39
- data/frontend/src/views/Rules.vue +0 -20
- data/frontend/tests/utils.spec.ts +0 -9
- data/frontend/tsconfig.app.json +0 -21
- data/frontend/tsconfig.json +0 -14
- data/frontend/tsconfig.node.json +0 -13
- data/frontend/tsconfig.vitest.json +0 -12
- data/frontend/vite.config.ts +0 -24
- data/frontend/vitest.config.ts +0 -21
- data/lib/mihari/services/alert_proxy.rb +0 -97
@@ -1,84 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div v-if="hasRules">
|
3
|
-
<table class="table is-fullwidth">
|
4
|
-
<tr>
|
5
|
-
<th>ID</th>
|
6
|
-
<th>Title</th>
|
7
|
-
<th>Description</th>
|
8
|
-
<th>Tags</th>
|
9
|
-
</tr>
|
10
|
-
<tr v-for="rule in rules.rules" :key="rule.id">
|
11
|
-
<td>
|
12
|
-
<router-link :to="{ name: 'Rule', params: { id: rule.id } }">{{ rule.id }}</router-link>
|
13
|
-
</td>
|
14
|
-
<td>
|
15
|
-
{{ rule.title }}
|
16
|
-
</td>
|
17
|
-
<td>
|
18
|
-
{{ rule.description }}
|
19
|
-
</td>
|
20
|
-
<td>
|
21
|
-
<Tags :tags="rule.tags" @update-tag="updateTag"></Tags>
|
22
|
-
</td>
|
23
|
-
</tr>
|
24
|
-
</table>
|
25
|
-
</div>
|
26
|
-
<Pagination
|
27
|
-
:currentPage="rules.currentPage"
|
28
|
-
:total="rules.total"
|
29
|
-
:pageSize="rules.pageSize"
|
30
|
-
@update-page="updatePage"
|
31
|
-
></Pagination>
|
32
|
-
<p class="help">({{ rules.total }} results in total, {{ rules.rules.length }} shown)</p>
|
33
|
-
</template>
|
34
|
-
|
35
|
-
<script lang="ts">
|
36
|
-
import { computed, defineComponent, type PropType } from "vue"
|
37
|
-
|
38
|
-
import Pagination from "@/components/Pagination.vue"
|
39
|
-
import Tags from "@/components/tag/Tags.vue"
|
40
|
-
import type { Rules } from "@/types"
|
41
|
-
|
42
|
-
export default defineComponent({
|
43
|
-
name: "RulesItem",
|
44
|
-
props: {
|
45
|
-
rules: {
|
46
|
-
type: Object as PropType<Rules>,
|
47
|
-
required: true
|
48
|
-
}
|
49
|
-
},
|
50
|
-
components: {
|
51
|
-
Pagination,
|
52
|
-
Tags
|
53
|
-
},
|
54
|
-
emits: ["update-page", "refresh-page", "update-tag"],
|
55
|
-
setup(props, context) {
|
56
|
-
const scrollToTop = () => {
|
57
|
-
window.scrollTo({
|
58
|
-
top: 0
|
59
|
-
})
|
60
|
-
}
|
61
|
-
|
62
|
-
const updatePage = (page: number) => {
|
63
|
-
scrollToTop()
|
64
|
-
context.emit("update-page", page)
|
65
|
-
}
|
66
|
-
|
67
|
-
const refreshPage = () => {
|
68
|
-
scrollToTop()
|
69
|
-
context.emit("refresh-page")
|
70
|
-
}
|
71
|
-
|
72
|
-
const updateTag = (tag: string) => {
|
73
|
-
scrollToTop()
|
74
|
-
context.emit("update-tag", tag)
|
75
|
-
}
|
76
|
-
|
77
|
-
const hasRules = computed(() => {
|
78
|
-
return props.rules.rules.length > 0
|
79
|
-
})
|
80
|
-
|
81
|
-
return { updatePage, refreshPage, updateTag, hasRules }
|
82
|
-
}
|
83
|
-
})
|
84
|
-
</script>
|
@@ -1,121 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div class="box mb-6">
|
3
|
-
<FormComponent
|
4
|
-
ref="form"
|
5
|
-
:tags="getTagsTask.last?.value || []"
|
6
|
-
:page="page"
|
7
|
-
:tag="tag"
|
8
|
-
></FormComponent>
|
9
|
-
<hr />
|
10
|
-
<div class="column">
|
11
|
-
<div class="field is-grouped is-grouped-centered">
|
12
|
-
<p class="control">
|
13
|
-
<a class="button is-primary" @click="search">
|
14
|
-
<span class="icon is-small">
|
15
|
-
<font-awesome-icon icon="search"></font-awesome-icon>
|
16
|
-
</span>
|
17
|
-
<span>Search</span>
|
18
|
-
</a>
|
19
|
-
</p>
|
20
|
-
</div>
|
21
|
-
</div>
|
22
|
-
</div>
|
23
|
-
<div v-if="getRulesTask.performCount > 0">
|
24
|
-
<hr />
|
25
|
-
<Loading v-if="getRulesTask.isRunning"></Loading>
|
26
|
-
<ErrorMessage v-if="getRulesTask.isError" :error="getRulesTask.last?.error"></ErrorMessage>
|
27
|
-
<Rules
|
28
|
-
:rules="getRulesTask.last.value"
|
29
|
-
v-if="getRulesTask.last?.value"
|
30
|
-
@refresh-page="refreshPage"
|
31
|
-
@update-page="updatePage"
|
32
|
-
@update-tag="updateTag"
|
33
|
-
></Rules>
|
34
|
-
</div>
|
35
|
-
</template>
|
36
|
-
|
37
|
-
<script lang="ts">
|
38
|
-
import { defineComponent, nextTick, onMounted, ref, watch } from "vue"
|
39
|
-
|
40
|
-
import { generateGetRulesTask, generateGetTagsTask } from "@/api-helper"
|
41
|
-
import ErrorMessage from "@/components/ErrorMessage.vue"
|
42
|
-
import Loading from "@/components/Loading.vue"
|
43
|
-
import FormComponent from "@/components/rule/Form.vue"
|
44
|
-
import Rules from "@/components/rule/Rules.vue"
|
45
|
-
import type { RuleSearchParams } from "@/types"
|
46
|
-
|
47
|
-
export default defineComponent({
|
48
|
-
name: "RulesWrapper",
|
49
|
-
components: {
|
50
|
-
Rules,
|
51
|
-
Loading,
|
52
|
-
FormComponent,
|
53
|
-
ErrorMessage
|
54
|
-
},
|
55
|
-
setup() {
|
56
|
-
const page = ref(1)
|
57
|
-
const tag = ref<string | undefined>(undefined)
|
58
|
-
const form = ref<InstanceType<typeof FormComponent>>()
|
59
|
-
|
60
|
-
const getRulesTask = generateGetRulesTask()
|
61
|
-
const getTagsTask = generateGetTagsTask()
|
62
|
-
|
63
|
-
const getRules = async () => {
|
64
|
-
const params = form.value?.getSearchParams() as RuleSearchParams
|
65
|
-
return await getRulesTask.perform(params)
|
66
|
-
}
|
67
|
-
|
68
|
-
const updatePage = (newPage: number) => {
|
69
|
-
page.value = newPage
|
70
|
-
}
|
71
|
-
|
72
|
-
const resetPage = () => {
|
73
|
-
page.value = 1
|
74
|
-
}
|
75
|
-
|
76
|
-
const search = async () => {
|
77
|
-
// reset page
|
78
|
-
resetPage()
|
79
|
-
|
80
|
-
await getRules()
|
81
|
-
}
|
82
|
-
|
83
|
-
const updateTag = (newTag: string | undefined) => {
|
84
|
-
if (tag.value === newTag) {
|
85
|
-
tag.value = undefined
|
86
|
-
} else {
|
87
|
-
tag.value = newTag
|
88
|
-
}
|
89
|
-
|
90
|
-
nextTick(async () => await search())
|
91
|
-
}
|
92
|
-
|
93
|
-
const refreshPage = async () => {
|
94
|
-
// it is just an alias of search
|
95
|
-
// this function will be invoked when a rule is deleted
|
96
|
-
await search()
|
97
|
-
}
|
98
|
-
|
99
|
-
onMounted(async () => {
|
100
|
-
getTagsTask.perform()
|
101
|
-
await getRules()
|
102
|
-
})
|
103
|
-
|
104
|
-
watch([page, tag], async () => {
|
105
|
-
nextTick(async () => await getRules())
|
106
|
-
})
|
107
|
-
|
108
|
-
return {
|
109
|
-
form,
|
110
|
-
getRulesTask,
|
111
|
-
getTagsTask,
|
112
|
-
page,
|
113
|
-
tag,
|
114
|
-
refreshPage,
|
115
|
-
search,
|
116
|
-
updatePage,
|
117
|
-
updateTag
|
118
|
-
}
|
119
|
-
}
|
120
|
-
})
|
121
|
-
</script>
|
@@ -1,37 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div class="block">
|
3
|
-
<VAceEditor
|
4
|
-
class="vue-ace-editor"
|
5
|
-
:value="yaml"
|
6
|
-
lang="yaml"
|
7
|
-
theme="monokai"
|
8
|
-
:options="{
|
9
|
-
readOnly: true,
|
10
|
-
fontSize: 16,
|
11
|
-
maxLines: 10000,
|
12
|
-
minLines: 6
|
13
|
-
}"
|
14
|
-
></VAceEditor>
|
15
|
-
</div>
|
16
|
-
</template>
|
17
|
-
|
18
|
-
<script lang="ts">
|
19
|
-
import "@/ace-config"
|
20
|
-
|
21
|
-
import { defineComponent } from "vue"
|
22
|
-
import { VAceEditor } from "vue3-ace-editor"
|
23
|
-
|
24
|
-
export default defineComponent({
|
25
|
-
name: "YAML",
|
26
|
-
components: {
|
27
|
-
VAceEditor
|
28
|
-
},
|
29
|
-
props: {
|
30
|
-
yaml: {
|
31
|
-
type: String,
|
32
|
-
required: true
|
33
|
-
}
|
34
|
-
},
|
35
|
-
setup() {}
|
36
|
-
})
|
37
|
-
</script>
|
@@ -1,65 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div class="control" v-if="!isDeleted">
|
3
|
-
<div
|
4
|
-
class="tags has-addons are-medium"
|
5
|
-
v-on:mouseover="showDeleteButton"
|
6
|
-
v-on:mouseleave="hideDeleteButton"
|
7
|
-
>
|
8
|
-
<span class="tag is-info is-light" @click="updateTag">{{ tag.name }}</span>
|
9
|
-
<a class="tag is-delete" v-if="isDeleteButtonEnabled" @click="deleteTag"></a>
|
10
|
-
</div>
|
11
|
-
</div>
|
12
|
-
</template>
|
13
|
-
|
14
|
-
<script lang="ts">
|
15
|
-
import { defineComponent, type PropType, ref } from "vue"
|
16
|
-
|
17
|
-
import { generateDeleteTagTask } from "@/api-helper"
|
18
|
-
import type { Tag } from "@/types"
|
19
|
-
|
20
|
-
export default defineComponent({
|
21
|
-
name: "TagItem",
|
22
|
-
props: {
|
23
|
-
tag: {
|
24
|
-
type: Object as PropType<Tag>,
|
25
|
-
required: true
|
26
|
-
}
|
27
|
-
},
|
28
|
-
setup(props, context) {
|
29
|
-
const isDeleted = ref(false)
|
30
|
-
const isDeleteButtonEnabled = ref(false)
|
31
|
-
|
32
|
-
const deleteTagTask = generateDeleteTagTask()
|
33
|
-
|
34
|
-
const deleteTag = async () => {
|
35
|
-
const result = window.confirm(`Are you sure you want to delete ${props.tag.name}?`)
|
36
|
-
|
37
|
-
if (result) {
|
38
|
-
await deleteTagTask.perform(props.tag.name)
|
39
|
-
isDeleted.value = true
|
40
|
-
}
|
41
|
-
}
|
42
|
-
|
43
|
-
const showDeleteButton = () => {
|
44
|
-
isDeleteButtonEnabled.value = true
|
45
|
-
}
|
46
|
-
|
47
|
-
const hideDeleteButton = () => {
|
48
|
-
isDeleteButtonEnabled.value = false
|
49
|
-
}
|
50
|
-
|
51
|
-
const updateTag = () => {
|
52
|
-
context.emit("update-tag", props.tag.name)
|
53
|
-
}
|
54
|
-
|
55
|
-
return {
|
56
|
-
updateTag,
|
57
|
-
isDeleted,
|
58
|
-
deleteTag,
|
59
|
-
showDeleteButton,
|
60
|
-
hideDeleteButton,
|
61
|
-
isDeleteButtonEnabled
|
62
|
-
}
|
63
|
-
}
|
64
|
-
})
|
65
|
-
</script>
|
@@ -1,37 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div class="field is-grouped is-grouped-multiline">
|
3
|
-
<TagComponent
|
4
|
-
v-for="tag in tags"
|
5
|
-
:tag="tag"
|
6
|
-
:key="tag.name"
|
7
|
-
@update-tag="updateTag"
|
8
|
-
></TagComponent>
|
9
|
-
</div>
|
10
|
-
</template>
|
11
|
-
|
12
|
-
<script lang="ts">
|
13
|
-
import { defineComponent, type PropType } from "vue"
|
14
|
-
|
15
|
-
import TagComponent from "@/components/tag/Tag.vue"
|
16
|
-
import type { Tag } from "@/types"
|
17
|
-
|
18
|
-
export default defineComponent({
|
19
|
-
name: "TagsItem",
|
20
|
-
components: {
|
21
|
-
TagComponent
|
22
|
-
},
|
23
|
-
props: {
|
24
|
-
tags: {
|
25
|
-
type: Array as PropType<Tag[]>,
|
26
|
-
required: true
|
27
|
-
}
|
28
|
-
},
|
29
|
-
setup(_, context) {
|
30
|
-
const updateTag = (tag: string) => {
|
31
|
-
context.emit("update-tag", tag)
|
32
|
-
}
|
33
|
-
|
34
|
-
return { updateTag }
|
35
|
-
}
|
36
|
-
})
|
37
|
-
</script>
|