mihari 5.3.1 → 5.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/frontend/package-lock.json +538 -581
  3. data/frontend/package.json +21 -21
  4. data/frontend/src/ace-config.ts +6 -0
  5. data/frontend/src/components/alert/Form.vue +2 -2
  6. data/frontend/src/components/rule/EditRule.vue +3 -2
  7. data/frontend/src/components/rule/Form.vue +2 -2
  8. data/frontend/src/components/rule/InputForm.vue +18 -59
  9. data/frontend/src/components/rule/YAML.vue +21 -28
  10. data/frontend/src/views/Artifact.vue +3 -8
  11. data/frontend/src/views/EditRule.vue +2 -7
  12. data/frontend/src/views/Rule.vue +3 -8
  13. data/lib/mihari/analyzers/base.rb +6 -0
  14. data/lib/mihari/analyzers/binaryedge.rb +1 -1
  15. data/lib/mihari/analyzers/censys.rb +1 -1
  16. data/lib/mihari/analyzers/onyphe.rb +1 -1
  17. data/lib/mihari/analyzers/rule.rb +4 -7
  18. data/lib/mihari/analyzers/shodan.rb +1 -1
  19. data/lib/mihari/analyzers/urlscan.rb +1 -1
  20. data/lib/mihari/analyzers/virustotal_intelligence.rb +1 -1
  21. data/lib/mihari/analyzers/zoomeye.rb +2 -2
  22. data/lib/mihari/commands/rule.rb +3 -3
  23. data/lib/mihari/commands/search.rb +3 -3
  24. data/lib/mihari/constants.rb +3 -0
  25. data/lib/mihari/emitters/base.rb +2 -2
  26. data/lib/mihari/emitters/misp.rb +3 -3
  27. data/lib/mihari/emitters/slack.rb +1 -1
  28. data/lib/mihari/emitters/the_hive.rb +1 -1
  29. data/lib/mihari/emitters/webhook.rb +1 -1
  30. data/lib/mihari/mixins/configurable.rb +5 -0
  31. data/lib/mihari/mixins/falsepositive.rb +1 -1
  32. data/lib/mihari/mixins/retriable.rb +0 -2
  33. data/lib/mihari/{structs → services}/rule.rb +16 -16
  34. data/lib/mihari/version.rb +1 -1
  35. data/lib/mihari/web/endpoints/rules.rb +9 -8
  36. data/lib/mihari/web/public/assets/index-116033d0.js +1737 -0
  37. data/lib/mihari/web/public/assets/index-33165282.css +1 -0
  38. data/lib/mihari/web/public/assets/mode-yaml-a21faa53.js +8 -0
  39. data/lib/mihari/web/public/index.html +2 -2
  40. data/lib/mihari.rb +3 -2
  41. data/mihari.gemspec +5 -4
  42. metadata +62 -18
  43. data/lib/mihari/web/public/assets/index-b17c40c6.css +0 -1
  44. data/lib/mihari/web/public/assets/index-f740e4f9.js +0 -799
@@ -14,11 +14,12 @@
14
14
  "type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false"
15
15
  },
16
16
  "dependencies": {
17
- "@fortawesome/fontawesome-svg-core": "^6.4.0",
18
- "@fortawesome/free-solid-svg-icons": "^6.4.0",
17
+ "@fortawesome/fontawesome-svg-core": "^6.4.2",
18
+ "@fortawesome/free-solid-svg-icons": "^6.4.2",
19
19
  "@fortawesome/vue-fontawesome": "^3.0.3",
20
- "@vueuse/core": "^10.2.1",
21
- "@vueuse/router": "^10.2.1",
20
+ "@vueuse/core": "^10.3.0",
21
+ "@vueuse/router": "^10.3.0",
22
+ "ace-builds": "^1.23.4",
22
23
  "axios": "^1.4.0",
23
24
  "bulma": "^0.9.4",
24
25
  "bulma-helpers": "^0.4.3",
@@ -32,36 +33,35 @@
32
33
  "vue": "^3.3.4",
33
34
  "vue-concurrency": "4.0.1",
34
35
  "vue-json-pretty": "^2.2.4",
35
- "vue-prism-editor": "^2.0.0-alpha.2",
36
- "vue-router": "^4.2.4"
36
+ "vue-router": "^4.2.4",
37
+ "vue3-ace-editor": "^2.2.3"
37
38
  },
38
39
  "devDependencies": {
39
- "@redocly/cli": "^1.0.0-beta.131",
40
+ "@redocly/cli": "1.0.0",
40
41
  "@rushstack/eslint-patch": "^1.3.2",
41
- "@tsconfig/node20": "^1.0.2",
42
+ "@tsconfig/node20": "^20.1.1",
42
43
  "@types/jsdom": "^21.1.1",
43
- "@types/node": "^20.4.2",
44
- "@types/prismjs": "^1.26.0",
44
+ "@types/node": "^20.4.8",
45
45
  "@types/url-parse": "^1.4.8",
46
- "@typescript-eslint/eslint-plugin": "^6.0.0",
47
- "@typescript-eslint/parser": "^6.0.0",
46
+ "@typescript-eslint/eslint-plugin": "^6.2.1",
47
+ "@typescript-eslint/parser": "^6.2.1",
48
48
  "@vitejs/plugin-vue": "^4.2.3",
49
- "@vue/eslint-config-prettier": "^7.1.0",
49
+ "@vue/eslint-config-prettier": "^8.0.0",
50
50
  "@vue/eslint-config-typescript": "^11.0.3",
51
- "@vue/test-utils": "2.4.0",
51
+ "@vue/test-utils": "2.4.1",
52
52
  "@vue/tsconfig": "^0.4.0",
53
- "eslint": "^8.45.0",
54
- "eslint-config-prettier": "^8.8.0",
53
+ "eslint": "^8.46.0",
54
+ "eslint-config-prettier": "^9.0.0",
55
55
  "eslint-plugin-prettier": "^5.0.0",
56
56
  "eslint-plugin-simple-import-sort": "^10.0.0",
57
- "eslint-plugin-vue": "^9.15.1",
57
+ "eslint-plugin-vue": "^9.16.1",
58
58
  "husky": "^8.0.3",
59
59
  "jsdom": "^22.1.0",
60
60
  "npm-run-all": "^4.1.5",
61
- "prettier": "^3.0.0",
61
+ "prettier": "^3.0.1",
62
62
  "typescript": "~5.1.6",
63
- "vite": "^4.4.4",
64
- "vitest": "^0.33.0",
65
- "vue-tsc": "^1.8.5"
63
+ "vite": "^4.4.9",
64
+ "vitest": "^0.34.1",
65
+ "vue-tsc": "^1.8.8"
66
66
  }
67
67
  }
@@ -0,0 +1,6 @@
1
+ import ace from "ace-builds"
2
+ import modeYamlUrl from "ace-builds/src-min-noconflict/mode-yaml?url"
3
+ import themeMonokaiUrl from "ace-builds/src-min-noconflict/theme-monokai?url"
4
+
5
+ ace.config.setModuleUrl("ace/mode/yaml", modeYamlUrl)
6
+ ace.config.setModuleUrl("ace/theme/monokai", themeMonokaiUrl)
@@ -95,7 +95,7 @@
95
95
  </template>
96
96
 
97
97
  <script lang="ts">
98
- import { defineComponent, type PropType, ref, watch } from "vue"
98
+ import { defineComponent, type PropType, ref, toRef,watch } from "vue"
99
99
  import { useRoute } from "vue-router"
100
100
 
101
101
  import type { AlertSearchParams } from "@/types"
@@ -126,7 +126,7 @@ export default defineComponent({
126
126
 
127
127
  const artifact = ref<string | undefined>(undefined)
128
128
  const fromAt = ref<string | undefined>(undefined)
129
- const tagInput = ref<string | undefined>(props.tag)
129
+ const tagInput = toRef(props, "tag")
130
130
  const ruleId = ref<string | undefined>(undefined)
131
131
  const toAt = ref<string | undefined>(undefined)
132
132
  const asn = ref<number | undefined>(undefined)
@@ -23,7 +23,7 @@
23
23
  </template>
24
24
 
25
25
  <script lang="ts">
26
- import { defineComponent, type PropType, ref } from "vue"
26
+ import { defineComponent, type PropType, toRef } from "vue"
27
27
  import { useRouter } from "vue-router"
28
28
 
29
29
  import { generateUpdateRuleTask } from "@/api-helper"
@@ -46,7 +46,8 @@ export default defineComponent({
46
46
  setup(props) {
47
47
  const router = useRouter()
48
48
 
49
- const yaml = ref(props.rule.yaml)
49
+ const rule = toRef(props, "rule")
50
+ const yaml = toRef(rule.value, "yaml")
50
51
 
51
52
  const updateRuleTask = generateUpdateRuleTask()
52
53
 
@@ -88,7 +88,7 @@
88
88
  </template>
89
89
 
90
90
  <script lang="ts">
91
- import { defineComponent, type PropType, ref, watch } from "vue"
91
+ import { defineComponent, type PropType, ref, toRef,watch } from "vue"
92
92
  import { useRoute } from "vue-router"
93
93
 
94
94
  import type { RuleSearchParams } from "@/types"
@@ -115,7 +115,7 @@ export default defineComponent({
115
115
 
116
116
  const description = ref<string | undefined>(undefined)
117
117
  const fromAt = ref<string | undefined>(undefined)
118
- const tagInput = ref<string | undefined>(props.tag)
118
+ const tagInput = toRef(props, "tag")
119
119
  const title = ref<string | undefined>(undefined)
120
120
  const toAt = ref<string | undefined>(undefined)
121
121
 
@@ -1,31 +1,29 @@
1
1
  <template>
2
- <div class="block my-editor-wrapper" ref="wrapper">
3
- <PrismEditor
4
- class="my-editor"
5
- v-model="yamlInput"
6
- :highlight="highlighter"
7
- line-numbers
8
- ></PrismEditor>
2
+ <div class="block">
3
+ <VAceEditor
4
+ class="vue-ace-editor"
5
+ v-model:value="yamlInput"
6
+ lang="yaml"
7
+ theme="monokai"
8
+ :options="{
9
+ fontSize: 16,
10
+ minLines: 6,
11
+ maxLines: 10000
12
+ }"
13
+ ></VAceEditor>
9
14
  </div>
10
15
  </template>
11
16
 
12
17
  <script lang="ts">
13
- // eslint-disable-next-line simple-import-sort/imports
14
- import "vue-prism-editor/dist/prismeditor.min.css"
18
+ import "@/ace-config"
15
19
 
16
- import { defineComponent, ref, watchEffect } from "vue"
17
- import { PrismEditor } from "vue-prism-editor"
18
-
19
- import Prism from "prismjs"
20
-
21
- import "prismjs/components/prism-yaml"
22
- import "prismjs/plugins/custom-class/prism-custom-class"
23
- import "prismjs/themes/prism-twilight.css"
20
+ import { defineComponent, toRef, watchEffect } from "vue"
21
+ import { VAceEditor } from "vue3-ace-editor"
24
22
 
25
23
  export default defineComponent({
26
24
  name: "RuleInputForm",
27
25
  components: {
28
- PrismEditor
26
+ VAceEditor
29
27
  },
30
28
  props: {
31
29
  yaml: {
@@ -35,52 +33,13 @@ export default defineComponent({
35
33
  },
36
34
  emits: ["update-yaml"],
37
35
  setup(props, context) {
38
- const yamlInput = ref(props.yaml)
39
- const wrapper = ref<HTMLElement | undefined>(undefined)
40
-
41
- Prism.plugins.customClass.map({
42
- number: "prism-number",
43
- tag: "prism-tag"
44
- })
45
-
46
- const highlighter = (code: string) => {
47
- return Prism.highlight(code, Prism.languages.yaml, "yaml")
48
- }
36
+ const yamlInput = toRef(props, "yaml")
49
37
 
50
38
  watchEffect(() => {
51
39
  context.emit("update-yaml", yamlInput.value)
52
-
53
- // TODO: a dirty hack to change the default text color
54
- if (wrapper.value) {
55
- const strings = wrapper.value.querySelectorAll(":not(span.token)")
56
- strings.forEach((string) => {
57
- ;(string as HTMLElement).style.color = "white"
58
- })
59
- }
60
40
  })
61
41
 
62
- return { yamlInput, highlighter, wrapper }
42
+ return { yamlInput }
63
43
  }
64
44
  })
65
45
  </script>
66
-
67
- <style scoped>
68
- .my-editor {
69
- background: hsl(0, 0%, 8%);
70
- font-family:
71
- Fira code,
72
- Fira Mono,
73
- Consolas,
74
- Menlo,
75
- Courier,
76
- monospace;
77
- font-size: 1em;
78
- line-height: 1.5;
79
- padding: 5px;
80
- }
81
-
82
- .my-editor-wrapper {
83
- background: hsl(0, 0%, 8%);
84
- padding: 10px;
85
- }
86
- </style>
@@ -1,44 +1,37 @@
1
1
  <template>
2
- <pre ref="pre" class="line-numbers"><code class="language-yaml">{{ yaml }}</code></pre>
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>
3
16
  </template>
4
17
 
5
18
  <script lang="ts">
6
- // eslint-disable-next-line simple-import-sort/imports
7
- import { defineComponent, onMounted, ref } from "vue"
19
+ import "@/ace-config"
8
20
 
9
- import Prism from "prismjs"
10
-
11
- import "prismjs/components/prism-yaml"
12
- import "prismjs/plugins/custom-class/prism-custom-class"
13
- import "prismjs/plugins/line-numbers/prism-line-numbers.css"
14
- import "prismjs/plugins/line-numbers/prism-line-numbers"
15
- import "prismjs/themes/prism-twilight.css"
21
+ import { defineComponent } from "vue"
22
+ import { VAceEditor } from "vue3-ace-editor"
16
23
 
17
24
  export default defineComponent({
18
25
  name: "YAML",
26
+ components: {
27
+ VAceEditor
28
+ },
19
29
  props: {
20
30
  yaml: {
21
31
  type: String,
22
32
  required: true
23
33
  }
24
34
  },
25
- setup() {
26
- const pre = ref<HTMLElement | undefined>(undefined)
27
-
28
- Prism.plugins.customClass.map({
29
- number: "prism-number",
30
- tag: "prism-tag"
31
- })
32
-
33
- onMounted(() => {
34
- if (pre.value) {
35
- pre.value.querySelectorAll("code").forEach((elem) => {
36
- Prism.highlightElement(elem)
37
- })
38
- }
39
- })
40
-
41
- return { pre }
42
- }
35
+ setup() {}
43
36
  })
44
37
  </script>
@@ -1,10 +1,10 @@
1
1
  <template>
2
- <Artifact :id="artifactId"></Artifact>
2
+ <Artifact :id="id"></Artifact>
3
3
  </template>
4
4
 
5
5
  <script lang="ts">
6
6
  import { useTitle } from "@vueuse/core"
7
- import { defineComponent, onMounted, ref, watch } from "vue"
7
+ import { defineComponent, onMounted, watch } from "vue"
8
8
 
9
9
  import Artifact from "@/components/artifact/ArtifactWrapper.vue"
10
10
 
@@ -20,10 +20,8 @@ export default defineComponent({
20
20
  }
21
21
  },
22
22
  setup(props) {
23
- const artifactId = ref<string>(props.id)
24
-
25
23
  const updateTitle = () => {
26
- useTitle(`Artifact:${artifactId.value} - Mihari`)
24
+ useTitle(`Artifact:${props.id} - Mihari`)
27
25
  }
28
26
 
29
27
  onMounted(() => {
@@ -33,12 +31,9 @@ export default defineComponent({
33
31
  watch(
34
32
  () => props.id,
35
33
  () => {
36
- artifactId.value = props.id
37
34
  updateTitle()
38
35
  }
39
36
  )
40
-
41
- return { artifactId }
42
37
  }
43
38
  })
44
39
  </script>
@@ -4,7 +4,7 @@
4
4
 
5
5
  <script lang="ts">
6
6
  import { useTitle } from "@vueuse/core"
7
- import { defineComponent, onMounted, ref, watch } from "vue"
7
+ import { defineComponent, onMounted, watch } from "vue"
8
8
 
9
9
  import EditRule from "@/components/rule/EditRuleWrapper.vue"
10
10
 
@@ -20,10 +20,8 @@ export default defineComponent({
20
20
  }
21
21
  },
22
22
  setup(props) {
23
- const ruleId = ref<string>(props.id)
24
-
25
23
  const updateTitle = () => {
26
- useTitle(`Edit rule:${ruleId.value} - Mihari`)
24
+ useTitle(`Edit rule:${props.id} - Mihari`)
27
25
  }
28
26
 
29
27
  onMounted(() => {
@@ -33,12 +31,9 @@ export default defineComponent({
33
31
  watch(
34
32
  () => props.id,
35
33
  () => {
36
- ruleId.value = props.id
37
34
  updateTitle()
38
35
  }
39
36
  )
40
-
41
- return { ruleId }
42
37
  }
43
38
  })
44
39
  </script>
@@ -1,10 +1,10 @@
1
1
  <template>
2
- <Rule :id="ruleId"></Rule>
2
+ <Rule :id="id"></Rule>
3
3
  </template>
4
4
 
5
5
  <script lang="ts">
6
6
  import { useTitle } from "@vueuse/core"
7
- import { defineComponent, onMounted, ref, watch } from "vue"
7
+ import { defineComponent, onMounted, watch } from "vue"
8
8
 
9
9
  import Rule from "@/components/rule/RuleWrapper.vue"
10
10
 
@@ -20,10 +20,8 @@ export default defineComponent({
20
20
  }
21
21
  },
22
22
  setup(props) {
23
- const ruleId = ref<string>(props.id)
24
-
25
23
  const updateTitle = () => {
26
- useTitle(`Rule:${ruleId.value} - Mihari`)
24
+ useTitle(`Rule:${props.id} - Mihari`)
27
25
  }
28
26
 
29
27
  onMounted(() => {
@@ -33,12 +31,9 @@ export default defineComponent({
33
31
  watch(
34
32
  () => props.id,
35
33
  () => {
36
- ruleId.value = props.id
37
34
  updateTitle()
38
35
  }
39
36
  )
40
-
41
- return { ruleId }
42
37
  }
43
38
  })
44
39
  </script>
@@ -73,6 +73,12 @@ module Mihari
73
73
 
74
74
  alias_method :source, :class_name
75
75
 
76
+ private
77
+
78
+ def sleep_interval
79
+ sleep(interval) if interval
80
+ end
81
+
76
82
  class << self
77
83
  #
78
84
  # Initialize an analyzer by query params
@@ -64,7 +64,7 @@ module Mihari
64
64
  break if total <= page * PAGE_SIZE
65
65
 
66
66
  # sleep #{interval} seconds to avoid the rate limitation (if it is set)
67
- sleep(interval) if interval
67
+ sleep_interval
68
68
  end
69
69
  responses
70
70
  end
@@ -42,7 +42,7 @@ module Mihari
42
42
  break if cursor.nil? || cursor.empty?
43
43
 
44
44
  # sleep #{interval} seconds to avoid the rate limitation (if it is set)
45
- sleep(interval) if interval
45
+ sleep_interval
46
46
  end
47
47
 
48
48
  artifacts.flatten.uniq(&:data)
@@ -65,7 +65,7 @@ module Mihari
65
65
  break if total <= page * PAGE_SIZE
66
66
 
67
67
  # sleep #{interval} seconds to avoid the rate limitation (if it is set)
68
- sleep(interval) if interval
68
+ sleep_interval
69
69
  end
70
70
  responses
71
71
  end
@@ -37,14 +37,14 @@ module Mihari
37
37
  class Rule
38
38
  include Mixins::FalsePositive
39
39
 
40
- # @return [Mihari::Structs::Rule]
40
+ # @return [Mihari::Services::Rule]
41
41
  attr_reader :rule
42
42
 
43
43
  # @return [Time]
44
44
  attr_reader :base_time
45
45
 
46
46
  #
47
- # @param [Mihari::Structs::Rule] rule
47
+ # @param [Mihari::Services::Rule] rule
48
48
  #
49
49
  def initialize(rule)
50
50
  @rule = rule
@@ -146,11 +146,8 @@ module Mihari
146
146
  def falsepositive?(value)
147
147
  return true if rule.falsepositives.include?(value)
148
148
 
149
- rule.falsepositives.select do |falsepositive|
150
- falsepositive.is_a?(Regexp)
151
- end.any? do |falseposistive|
152
- falseposistive.match?(value)
153
- end
149
+ regexps = rule.falsepositives.select { |fp| fp.is_a?(Regexp) }
150
+ regexps.any? { |fp| fp.match?(value) }
154
151
  end
155
152
 
156
153
  #
@@ -60,7 +60,7 @@ module Mihari
60
60
  break if res.total <= page * PAGE_SIZE
61
61
 
62
62
  # sleep #{interval} seconds to avoid the rate limitation (if it is set)
63
- sleep interval
63
+ sleep_interval
64
64
  rescue JSON::ParserError
65
65
  # ignore JSON::ParserError
66
66
  # ref. https://github.com/ninoseki/mihari/issues/197
@@ -77,7 +77,7 @@ module Mihari
77
77
  search_after = res.results.last.sort.join(",")
78
78
 
79
79
  # sleep #{interval} seconds to avoid the rate limitation (if it is set)
80
- sleep(interval) if interval
80
+ sleep_interval
81
81
  end
82
82
 
83
83
  responses
@@ -53,7 +53,7 @@ module Mihari
53
53
 
54
54
  cursor = response.meta.cursor
55
55
  # sleep #{interval} seconds to avoid the rate limitation (if it is set)
56
- sleep(interval) if interval
56
+ sleep_interval
57
57
  end
58
58
 
59
59
  responses
@@ -104,7 +104,7 @@ module Mihari
104
104
  break if total <= page * PAGE_SIZE
105
105
 
106
106
  # sleep #{interval} seconds to avoid the rate limitation (if it is set)
107
- sleep(interval) if interval
107
+ sleep_interval
108
108
  end
109
109
  convert_responses responses.compact
110
110
  end
@@ -137,7 +137,7 @@ module Mihari
137
137
  break if total <= page * PAGE_SIZE
138
138
 
139
139
  # sleep #{interval} seconds to avoid the rate limitation (if it is set)
140
- sleep(interval) if interval
140
+ sleep_interval
141
141
  end
142
142
  convert_responses responses.compact
143
143
  end
@@ -15,7 +15,7 @@ module Mihari
15
15
  # @param [String] path
16
16
  #
17
17
  def validate(path)
18
- rule = Structs::Rule.from_path_or_id(path)
18
+ rule = Services::Rule.from_path_or_id(path)
19
19
 
20
20
  begin
21
21
  rule.validate!
@@ -44,10 +44,10 @@ module Mihari
44
44
 
45
45
  no_commands do
46
46
  #
47
- # @return [Mihari::Structs::Rule]
47
+ # @return [Mihari::Services::Rule]
48
48
  #
49
49
  def rule_template
50
- Structs::Rule.from_path File.expand_path("../templates/rule.yml.erb", __dir__)
50
+ Services::Rule.from_path File.expand_path("../templates/rule.yml.erb", __dir__)
51
51
  end
52
52
 
53
53
  #
@@ -33,12 +33,12 @@ module Mihari
33
33
  end
34
34
 
35
35
  def update_or_create
36
- rule.model.save
36
+ rule.to_model.save
37
37
  end
38
38
 
39
39
  def run
40
40
  begin
41
- analyzer = rule.analyzer
41
+ analyzer = rule.to_analyzer
42
42
  rescue ConfigurationError => e
43
43
  # if there is a configuration error, output that error without the stack trace
44
44
  Mihari.logger.error e.to_s
@@ -69,7 +69,7 @@ module Mihari
69
69
  #
70
70
  def search(path_or_id)
71
71
  Mihari::Database.with_db_connection do
72
- rule = Structs::Rule.from_path_or_id path_or_id
72
+ rule = Services::Rule.from_path_or_id path_or_id
73
73
 
74
74
  begin
75
75
  rule.validate!
@@ -1,10 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mihari
4
+ # @return [Array<String>]
4
5
  DEFAULT_DATA_TYPES = %w[hash ip domain url mail].freeze
5
6
 
7
+ # @return [Array<Hash>]
6
8
  DEFAULT_EMITTERS = %w[database misp slack the_hive].map { |name| { emitter: name } }.freeze
7
9
 
10
+ # @return [Array<Hash>]
8
11
  DEFAULT_ENRICHERS = %w[whois ipinfo shodan google_public_dns].map { |name| { enricher: name } }.freeze
9
12
 
10
13
  DEFAULT_RETRY_TIMES = 3
@@ -9,12 +9,12 @@ module Mihari
9
9
  # @return [Array<Mihari::Artifact>]
10
10
  attr_reader :artifacts
11
11
 
12
- # @return [Mihari::Structs::Rule]
12
+ # @return [Mihari::Services::Rule]
13
13
  attr_reader :rule
14
14
 
15
15
  #
16
16
  # @param [Array<Mihari::Artifact>] artifacts
17
- # @param [Mihari::Structs::Rule] rule
17
+ # @param [Mihari::Services::Rule] rule
18
18
  # @param [Hash] **_options
19
19
  #
20
20
  def initialize(artifacts:, rule:, **_options)
@@ -12,12 +12,12 @@ module Mihari
12
12
  # @return [Array<Mihari::Artifact>]
13
13
  attr_reader :artifacts
14
14
 
15
- # @return [Mihari::Structs::Rule]
15
+ # @return [Mihari::Services::Rule]
16
16
  attr_reader :rule
17
17
 
18
18
  #
19
19
  # @param [Array<Mihari::Artifact>] artifacts
20
- # @param [Mihari::Structs::Rule] rule
20
+ # @param [Mihari::Services::Rule] rule
21
21
  # @param [Hash] **options
22
22
  #
23
23
  def initialize(artifacts:, rule:, **options)
@@ -47,7 +47,7 @@ module Mihari
47
47
  # Create a MISP event
48
48
  #
49
49
  # @param [Arra<Mihari::Artifact>] artifacts
50
- # @param [Mihari::Structs::Rule] rule
50
+ # @param [Mihari::Services::Rule] rule
51
51
  #
52
52
  # @return [::MISP::Event]
53
53
  #
@@ -133,7 +133,7 @@ module Mihari
133
133
 
134
134
  #
135
135
  # @param [Array<Mihari::Artifact>] artifacts
136
- # @param [Mihari::Structs::Rule] rule
136
+ # @param [Mihari::Services::Rule] rule
137
137
  # @param [Hash] **_options
138
138
  #
139
139
  def initialize(artifacts:, rule:, **options)
@@ -14,7 +14,7 @@ module Mihari
14
14
 
15
15
  #
16
16
  # @param [Array<Mihari::Artifact>] artifacts
17
- # @param [Mihari::Structs::Rule] rule
17
+ # @param [Mihari::Services::Rule] rule
18
18
  # @param [Hash] **options
19
19
  #
20
20
  def initialize(artifacts:, rule:, **options)