mihari 5.2.4 → 5.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -1
  3. data/README.md +0 -10
  4. data/Rakefile +13 -1
  5. data/build_frontend.sh +1 -1
  6. data/frontend/.eslintrc.cjs +22 -0
  7. data/frontend/.gitignore +18 -12
  8. data/frontend/.prettierrc.json +8 -0
  9. data/frontend/env.d.ts +5 -0
  10. data/frontend/package-lock.json +5213 -9655
  11. data/frontend/package.json +38 -25
  12. data/frontend/src/App.vue +5 -5
  13. data/frontend/src/api-helper.ts +38 -40
  14. data/frontend/src/api.ts +40 -40
  15. data/frontend/src/components/ErrorMessage.vue +8 -8
  16. data/frontend/src/components/Loading.vue +4 -4
  17. data/frontend/src/components/Navbar.vue +10 -27
  18. data/frontend/src/components/Pagination.vue +35 -42
  19. data/frontend/src/components/alert/Alert.vue +22 -27
  20. data/frontend/src/components/alert/Alerts.vue +23 -25
  21. data/frontend/src/components/alert/AlertsWithPagination.vue +34 -34
  22. data/frontend/src/components/alert/AlertsWrapper.vue +43 -50
  23. data/frontend/src/components/alert/Form.vue +39 -40
  24. data/frontend/src/components/artifact/AS.vue +7 -7
  25. data/frontend/src/components/artifact/Artifact.vue +69 -86
  26. data/frontend/src/components/artifact/ArtifactTag.vue +21 -27
  27. data/frontend/src/components/artifact/ArtifactTags.vue +8 -8
  28. data/frontend/src/components/artifact/ArtifactWrapper.vue +22 -25
  29. data/frontend/src/components/artifact/CPEs.vue +6 -6
  30. data/frontend/src/components/artifact/DnsRecords.vue +9 -9
  31. data/frontend/src/components/artifact/Ports.vue +6 -6
  32. data/frontend/src/components/artifact/ReverseDnsNames.vue +7 -7
  33. data/frontend/src/components/artifact/Tags.vue +6 -6
  34. data/frontend/src/components/artifact/WhoisRecord.vue +7 -9
  35. data/frontend/src/components/config/Configs.vue +9 -12
  36. data/frontend/src/components/config/ConfigsWrapper.vue +14 -20
  37. data/frontend/src/components/link/Link.vue +7 -7
  38. data/frontend/src/components/link/Links.vue +16 -21
  39. data/frontend/src/components/rule/EditRule.vue +23 -23
  40. data/frontend/src/components/rule/EditRuleWrapper.vue +22 -28
  41. data/frontend/src/components/rule/Form.vue +28 -28
  42. data/frontend/src/components/rule/InputForm.vue +31 -25
  43. data/frontend/src/components/rule/NewRule.vue +19 -19
  44. data/frontend/src/components/rule/Rule.vue +28 -30
  45. data/frontend/src/components/rule/RuleWrapper.vue +24 -31
  46. data/frontend/src/components/rule/Rules.vue +26 -30
  47. data/frontend/src/components/rule/RulesWrapper.vue +40 -43
  48. data/frontend/src/components/rule/YAML.vue +19 -22
  49. data/frontend/src/components/tag/Tag.vue +24 -32
  50. data/frontend/src/components/tag/Tags.vue +11 -11
  51. data/frontend/src/countries.ts +23 -23
  52. data/frontend/src/index.ts +9 -12
  53. data/frontend/src/links/anyrun.ts +10 -10
  54. data/frontend/src/links/base.ts +3 -3
  55. data/frontend/src/links/censys.ts +10 -10
  56. data/frontend/src/links/crtsh.ts +10 -10
  57. data/frontend/src/links/dnslytics.ts +18 -18
  58. data/frontend/src/links/greynoise.ts +10 -10
  59. data/frontend/src/links/index.ts +15 -15
  60. data/frontend/src/links/intezer.ts +10 -10
  61. data/frontend/src/links/otx.ts +14 -14
  62. data/frontend/src/links/securitytrails.ts +15 -15
  63. data/frontend/src/links/shodan.ts +10 -10
  64. data/frontend/src/links/urlscan.ts +19 -19
  65. data/frontend/src/links/virustotal.ts +27 -27
  66. data/frontend/src/main.ts +38 -8
  67. data/frontend/src/router/index.ts +20 -20
  68. data/frontend/src/rule.ts +6 -6
  69. data/frontend/src/shims-vue.d.ts +2 -2
  70. data/frontend/src/types.ts +91 -91
  71. data/frontend/src/utils.ts +23 -29
  72. data/frontend/src/views/Alerts.vue +7 -7
  73. data/frontend/src/views/Artifact.vue +17 -17
  74. data/frontend/src/views/Configs.vue +7 -7
  75. data/frontend/src/views/EditRule.vue +17 -17
  76. data/frontend/src/views/NewRule.vue +10 -10
  77. data/frontend/src/views/Rule.vue +17 -17
  78. data/frontend/src/views/Rules.vue +7 -7
  79. data/frontend/tests/utils.spec.ts +9 -0
  80. data/frontend/tsconfig.app.json +21 -0
  81. data/frontend/tsconfig.json +10 -36
  82. data/frontend/tsconfig.node.json +13 -0
  83. data/frontend/tsconfig.vitest.json +12 -0
  84. data/frontend/vite.config.ts +24 -0
  85. data/frontend/vitest.config.ts +21 -0
  86. data/lefthook.yml +4 -2
  87. data/lib/mihari/analyzers/base.rb +48 -14
  88. data/lib/mihari/analyzers/binaryedge.rb +10 -15
  89. data/lib/mihari/analyzers/censys.rb +12 -15
  90. data/lib/mihari/analyzers/circl.rb +10 -10
  91. data/lib/mihari/analyzers/crtsh.rb +10 -6
  92. data/lib/mihari/analyzers/dnstwister.rb +6 -8
  93. data/lib/mihari/analyzers/feed.rb +21 -10
  94. data/lib/mihari/analyzers/greynoise.rb +10 -20
  95. data/lib/mihari/analyzers/onyphe.rb +9 -14
  96. data/lib/mihari/analyzers/otx.rb +8 -9
  97. data/lib/mihari/analyzers/passivetotal.rb +10 -10
  98. data/lib/mihari/analyzers/pulsedive.rb +21 -31
  99. data/lib/mihari/analyzers/securitytrails.rb +8 -6
  100. data/lib/mihari/analyzers/shodan.rb +8 -13
  101. data/lib/mihari/analyzers/urlscan.rb +15 -20
  102. data/lib/mihari/analyzers/virustotal.rb +16 -26
  103. data/lib/mihari/analyzers/virustotal_intelligence.rb +11 -17
  104. data/lib/mihari/analyzers/zoomeye.rb +12 -17
  105. data/lib/mihari/config.rb +133 -0
  106. data/lib/mihari/constants.rb +3 -0
  107. data/lib/mihari/emitters/slack.rb +13 -3
  108. data/lib/mihari/errors.rb +1 -1
  109. data/lib/mihari/http.rb +2 -3
  110. data/lib/mihari/schemas/analyzer.rb +2 -0
  111. data/lib/mihari/type_checker.rb +6 -6
  112. data/lib/mihari/version.rb +1 -1
  113. data/lib/mihari/web/endpoints/configs.rb +5 -1
  114. data/lib/mihari/web/public/assets/{index-eed1bcd8.css → index-b17c40c6.css} +1 -5
  115. data/lib/mihari/web/public/assets/index-f740e4f9.js +799 -0
  116. data/lib/mihari/web/public/index.html +2 -2
  117. data/lib/mihari/web/public/redoc-static.html +388 -2193
  118. data/lib/mihari.rb +9 -59
  119. data/mihari.gemspec +8 -8
  120. metadata +29 -117
  121. data/frontend/.browserslistrc +0 -3
  122. data/frontend/.eslintrc.js +0 -33
  123. data/frontend/babel.config.js +0 -3
  124. data/frontend/jest.config.js +0 -9
  125. data/frontend/tests/unit/utils.spec.ts +0 -7
  126. data/frontend/vite.config.js +0 -24
  127. data/lib/mihari/web/public/assets/fa-brands-400-20c4a58b.ttf +0 -0
  128. data/lib/mihari/web/public/assets/fa-brands-400-74833209.woff2 +0 -0
  129. data/lib/mihari/web/public/assets/fa-regular-400-528d022d.ttf +0 -0
  130. data/lib/mihari/web/public/assets/fa-regular-400-8e7e5ea1.woff2 +0 -0
  131. data/lib/mihari/web/public/assets/fa-solid-900-67a65763.ttf +0 -0
  132. data/lib/mihari/web/public/assets/fa-solid-900-7152a693.woff2 +0 -0
  133. data/lib/mihari/web/public/assets/fa-v4compatibility-0515a423.ttf +0 -0
  134. data/lib/mihari/web/public/assets/fa-v4compatibility-694a17c3.woff2 +0 -0
  135. data/lib/mihari/web/public/assets/index-ac4e5ffa.js +0 -50
@@ -19,12 +19,7 @@
19
19
  countryCode || artifact.geolocation?.countryCode
20
20
  }}</span>
21
21
  </h4>
22
- <iframe
23
- class="mb-4"
24
- :src="googleMapSrc"
25
- width="100%"
26
- height="240px"
27
- ></iframe>
22
+ <iframe class="mb-4" :src="googleMapSrc" width="100%" height="240px"></iframe>
28
23
  </div>
29
24
 
30
25
  <div v-if="urlscanLiveshotSrc">
@@ -46,13 +41,10 @@
46
41
  <td>
47
42
  {{ artifact.id }}
48
43
  <span class="buttons is-pulled-right">
49
- <button
50
- class="button is-primary is-light is-small"
51
- @click="enrichArtifact"
52
- >
44
+ <button class="button is-primary is-light is-small" @click="enrichArtifact">
53
45
  <span>Enrich</span>
54
46
  <span class="icon is-small">
55
- <i class="fas fa-lightbulb"></i>
47
+ <font-awesome-icon icon="lightbulb"></font-awesome-icon>
56
48
  </span>
57
49
  </button>
58
50
 
@@ -63,17 +55,14 @@
63
55
  >
64
56
  <span>Metadata</span>
65
57
  <span class="icon is-small">
66
- <i class="fas fa-info-circle"></i>
58
+ <font-awesome-icon icon="info-circle"></font-awesome-icon>
67
59
  </span>
68
60
  </button>
69
61
 
70
- <button
71
- class="button is-light is-small"
72
- @click="deleteArtifact"
73
- >
62
+ <button class="button is-light is-small" @click="deleteArtifact">
74
63
  <span>Delete</span>
75
64
  <span class="icon is-small">
76
- <i class="fas fa-times"></i>
65
+ <font-awesome-icon icon="times"></font-awesome-icon>
77
66
  </span>
78
67
  </button>
79
68
  </span>
@@ -104,14 +93,10 @@
104
93
  <div class="modal-card">
105
94
  <header class="modal-card-head">
106
95
  <p class="modal-card-title">Metadata</p>
107
- <button
108
- class="delete"
109
- aria-label="close"
110
- @click="flipShowMetadata"
111
- ></button>
96
+ <button class="delete" aria-label="close" @click="flipShowMetadata"></button>
112
97
  </header>
113
98
  <section class="modal-card-body">
114
- <VueJsonPretty :data="artifact.metadata"></VueJsonPretty>
99
+ <VueJsonPretty :data="artifact.metadata as any"></VueJsonPretty>
115
100
  </section>
116
101
  </div>
117
102
  </div>
@@ -126,9 +111,7 @@
126
111
 
127
112
  <div class="block" v-if="artifact.reverseDnsNames">
128
113
  <h4 class="is-size-4 mb-2">Reverse DNS</h4>
129
- <ReverseDnsNames
130
- :reverseDnsNames="artifact.reverseDnsNames"
131
- ></ReverseDnsNames>
114
+ <ReverseDnsNames :reverseDnsNames="artifact.reverseDnsNames"></ReverseDnsNames>
132
115
  </div>
133
116
 
134
117
  <div class="block" v-if="artifact.dnsRecords">
@@ -166,38 +149,38 @@
166
149
  </template>
167
150
 
168
151
  <script lang="ts">
169
- import "vue-json-pretty/lib/styles.css";
152
+ import "vue-json-pretty/lib/styles.css"
170
153
 
171
- import { computed, defineComponent, onMounted, PropType, ref } from "vue";
172
- import VueJsonPretty from "vue-json-pretty";
173
- import { useRouter } from "vue-router";
154
+ import { computed, defineComponent, onMounted, type PropType, ref } from "vue"
155
+ import VueJsonPretty from "vue-json-pretty"
156
+ import { useRouter } from "vue-router"
174
157
 
175
158
  import {
176
159
  generateDeleteArtifactTask,
177
160
  generateEnrichArtifactTask,
178
161
  generateGetAlertsTask,
179
- generateGetIPTask,
180
- } from "@/api-helper";
181
- import Alerts from "@/components/alert/AlertsWithPagination.vue";
182
- import AS from "@/components/artifact/AS.vue";
183
- import CPEs from "@/components/artifact/CPEs.vue";
184
- import DnsRecords from "@/components/artifact/DnsRecords.vue";
185
- import Ports from "@/components/artifact/Ports.vue";
186
- import ReverseDnsNames from "@/components/artifact/ReverseDnsNames.vue";
187
- import Tags from "@/components/artifact/Tags.vue";
188
- import WhoisRecord from "@/components/artifact/WhoisRecord.vue";
189
- import Links from "@/components/link/Links.vue";
190
- import Loading from "@/components/Loading.vue";
191
- import { ArtifactWithTags, GCS } from "@/types";
192
- import { getGCSByCountryCode, getGCSByIPInfo } from "@/utils";
162
+ generateGetIPTask
163
+ } from "@/api-helper"
164
+ import Alerts from "@/components/alert/AlertsWithPagination.vue"
165
+ import AS from "@/components/artifact/AS.vue"
166
+ import CPEs from "@/components/artifact/CPEs.vue"
167
+ import DnsRecords from "@/components/artifact/DnsRecords.vue"
168
+ import Ports from "@/components/artifact/Ports.vue"
169
+ import ReverseDnsNames from "@/components/artifact/ReverseDnsNames.vue"
170
+ import Tags from "@/components/artifact/Tags.vue"
171
+ import WhoisRecord from "@/components/artifact/WhoisRecord.vue"
172
+ import Links from "@/components/link/Links.vue"
173
+ import Loading from "@/components/Loading.vue"
174
+ import type { ArtifactWithTags, GCS } from "@/types"
175
+ import { getGCSByCountryCode, getGCSByIPInfo } from "@/utils"
193
176
 
194
177
  export default defineComponent({
195
178
  name: "ArtifactItem",
196
179
  props: {
197
180
  artifact: {
198
181
  type: Object as PropType<ArtifactWithTags>,
199
- required: true,
200
- },
182
+ required: true
183
+ }
201
184
  },
202
185
  components: {
203
186
  Alerts,
@@ -210,78 +193,76 @@ export default defineComponent({
210
193
  VueJsonPretty,
211
194
  WhoisRecord,
212
195
  CPEs,
213
- Ports,
196
+ Ports
214
197
  },
215
198
  emits: ["refresh"],
216
199
  setup(props, context) {
217
- const googleMapSrc = ref<string | undefined>(undefined);
218
- const countryCode = ref<string | undefined>(undefined);
219
- const showMetadata = ref(false);
200
+ const googleMapSrc = ref<string | undefined>(undefined)
201
+ const countryCode = ref<string | undefined>(undefined)
202
+ const showMetadata = ref(false)
220
203
 
221
- const router = useRouter();
204
+ const router = useRouter()
222
205
 
223
206
  const urlscanLiveshotSrc = computed<string | undefined>(() => {
224
207
  if (props.artifact.dataType === "domain") {
225
- const url = `http://${props.artifact.data}`;
226
- return `https://urlscan.io/liveshot/?url=${url}`;
208
+ const url = `http://${props.artifact.data}`
209
+ return `https://urlscan.io/liveshot/?url=${url}`
227
210
  }
228
211
 
229
212
  if (props.artifact.dataType === "url") {
230
- return `https://urlscan.io/liveshot/?url=${props.artifact.data}`;
213
+ return `https://urlscan.io/liveshot/?url=${props.artifact.data}`
231
214
  }
232
215
 
233
- return undefined;
234
- });
216
+ return undefined
217
+ })
235
218
 
236
219
  const getGoogleMapSrc = (gcs: GCS | undefined): string | undefined => {
237
220
  if (gcs !== undefined) {
238
- return `https://maps.google.co.jp/maps?output=embed&q=${gcs.lat},${gcs.long}&z=3`;
221
+ return `https://maps.google.co.jp/maps?output=embed&q=${gcs.lat},${gcs.long}&z=3`
239
222
  }
240
223
 
241
- return undefined;
242
- };
224
+ return undefined
225
+ }
243
226
 
244
- const getIPInfoTask = generateGetIPTask();
245
- const getAlertsTask = generateGetAlertsTask();
246
- const deleteArtifactTask = generateDeleteArtifactTask();
247
- const enrichArtifactTask = generateEnrichArtifactTask();
227
+ const getIPInfoTask = generateGetIPTask()
228
+ const getAlertsTask = generateGetAlertsTask()
229
+ const deleteArtifactTask = generateDeleteArtifactTask()
230
+ const enrichArtifactTask = generateEnrichArtifactTask()
248
231
 
249
232
  const deleteArtifact = async () => {
250
- const result = window.confirm(
251
- `Are you sure you want to delete ${props.artifact.data}?`
252
- );
233
+ const result = window.confirm(`Are you sure you want to delete ${props.artifact.data}?`)
253
234
 
254
235
  if (result) {
255
- await deleteArtifactTask.perform(props.artifact.id);
256
- router.push("/");
236
+ await deleteArtifactTask.perform(props.artifact.id)
237
+ router.push("/")
257
238
  }
258
- };
239
+ }
259
240
 
260
241
  const enrichArtifact = async () => {
261
- await enrichArtifactTask.perform(props.artifact.id);
262
- context.emit("refresh");
263
- };
242
+ await enrichArtifactTask.perform(props.artifact.id)
243
+ context.emit("refresh")
244
+ }
264
245
 
265
246
  onMounted(async () => {
266
247
  if (props.artifact.dataType === "ip") {
267
- let gcs: GCS | undefined = undefined;
248
+ let gcs: GCS | undefined = undefined
268
249
 
269
250
  if (props.artifact.geolocation === null) {
270
251
  // Use IPInfo if an artifact does not have geolocation
271
- const ipinfo = await getIPInfoTask.perform(props.artifact.data);
272
- gcs = getGCSByIPInfo(ipinfo);
273
- countryCode.value = ipinfo.countryCode;
252
+ const ipinfo = await getIPInfoTask.perform(props.artifact.data)
253
+ gcs = getGCSByIPInfo(ipinfo)
254
+ countryCode.value = ipinfo.countryCode
274
255
  } else {
275
- gcs = getGCSByCountryCode(props.artifact.geolocation.countryCode);
256
+ gcs = getGCSByCountryCode(props.artifact.geolocation.countryCode)
276
257
  }
277
258
 
278
- googleMapSrc.value = getGoogleMapSrc(gcs);
259
+ googleMapSrc.value = getGoogleMapSrc(gcs)
279
260
  }
280
- });
261
+ })
281
262
 
282
263
  const flipShowMetadata = () => {
283
- showMetadata.value = !showMetadata.value;
284
- };
264
+ showMetadata.value = !showMetadata.value
265
+ }
285
266
 
286
267
  return {
287
268
  countryCode,
@@ -292,10 +273,10 @@ export default defineComponent({
292
273
  urlscanLiveshotSrc,
293
274
  deleteArtifact,
294
275
  enrichArtifact,
295
- flipShowMetadata,
296
- };
297
- },
298
- });
276
+ flipShowMetadata
277
+ }
278
+ }
279
+ })
299
280
  </script>
300
281
 
301
282
  <style scoped>
@@ -308,7 +289,9 @@ img.liveshot {
308
289
  object-position: top;
309
290
  display: block;
310
291
  overflow: hidden;
311
- transition: max-height 1s, height 1s;
292
+ transition:
293
+ max-height 1s,
294
+ height 1s;
312
295
  }
313
296
 
314
297
  img.liveshot:hover {
@@ -10,61 +10,55 @@
10
10
  :to="{ name: 'Artifact', params: { id: artifact.id } }"
11
11
  >{{ artifact.data }}</router-link
12
12
  >
13
- <span
14
- class="tag is-delete"
15
- v-if="isDeleteButtonEnabled"
16
- @click="deleteArtifact"
17
- ></span>
13
+ <span class="tag is-delete" v-if="isDeleteButtonEnabled" @click="deleteArtifact"></span>
18
14
  </div>
19
15
  </div>
20
16
  </template>
21
17
 
22
18
  <script lang="ts">
23
- import { defineComponent, PropType, ref } from "vue";
19
+ import { defineComponent, type PropType, ref } from "vue"
24
20
 
25
- import { generateDeleteArtifactTask } from "@/api-helper";
26
- import { Artifact } from "@/types";
21
+ import { generateDeleteArtifactTask } from "@/api-helper"
22
+ import type { Artifact } from "@/types"
27
23
 
28
24
  export default defineComponent({
29
25
  name: "ArtifactTag",
30
26
  props: {
31
27
  artifact: {
32
28
  type: Object as PropType<Artifact>,
33
- required: true,
34
- },
29
+ required: true
30
+ }
35
31
  },
36
32
  setup(props) {
37
- const isDeleted = ref(false);
38
- const isDeleteButtonEnabled = ref(false);
33
+ const isDeleted = ref(false)
34
+ const isDeleteButtonEnabled = ref(false)
39
35
 
40
- const deleteArtifactTask = generateDeleteArtifactTask();
36
+ const deleteArtifactTask = generateDeleteArtifactTask()
41
37
 
42
38
  const deleteArtifact = async () => {
43
- const result = window.confirm(
44
- `Are you sure you want to delete ${props.artifact.data}?`
45
- );
39
+ const result = window.confirm(`Are you sure you want to delete ${props.artifact.data}?`)
46
40
 
47
41
  if (result) {
48
- await deleteArtifactTask.perform(props.artifact.id);
49
- isDeleted.value = true;
42
+ await deleteArtifactTask.perform(props.artifact.id)
43
+ isDeleted.value = true
50
44
  }
51
- };
45
+ }
52
46
 
53
47
  const showDeleteButton = () => {
54
- isDeleteButtonEnabled.value = true;
55
- };
48
+ isDeleteButtonEnabled.value = true
49
+ }
56
50
 
57
51
  const hideDeleteButton = () => {
58
- isDeleteButtonEnabled.value = false;
59
- };
52
+ isDeleteButtonEnabled.value = false
53
+ }
60
54
 
61
55
  return {
62
56
  isDeleted,
63
57
  deleteArtifact,
64
58
  showDeleteButton,
65
59
  hideDeleteButton,
66
- isDeleteButtonEnabled,
67
- };
68
- },
69
- });
60
+ isDeleteButtonEnabled
61
+ }
62
+ }
63
+ })
70
64
  </script>
@@ -9,21 +9,21 @@
9
9
  </template>
10
10
 
11
11
  <script lang="ts">
12
- import { defineComponent, PropType } from "vue";
12
+ import { defineComponent, type PropType } from "vue"
13
13
 
14
- import ArtifactComponent from "@/components/artifact/ArtifactTag.vue";
15
- import { Artifact } from "@/types";
14
+ import ArtifactComponent from "@/components/artifact/ArtifactTag.vue"
15
+ import type { Artifact } from "@/types"
16
16
 
17
17
  export default defineComponent({
18
18
  name: "ArtifactTags",
19
19
  components: {
20
- ArtifactComponent,
20
+ ArtifactComponent
21
21
  },
22
22
  props: {
23
23
  artifacts: {
24
24
  type: Array as PropType<Artifact[]>,
25
- required: true,
26
- },
27
- },
28
- });
25
+ required: true
26
+ }
27
+ }
28
+ })
29
29
  </script>
@@ -1,10 +1,7 @@
1
1
  <template>
2
2
  <Loading v-if="getArtifactTask.isRunning"></Loading>
3
3
 
4
- <ErrorMessage
5
- v-if="getArtifactTask.isError"
6
- :error="getArtifactTask.last?.error"
7
- ></ErrorMessage>
4
+ <ErrorMessage v-if="getArtifactTask.isError" :error="getArtifactTask.last?.error"></ErrorMessage>
8
5
 
9
6
  <ArtifactComponent
10
7
  :artifact="getArtifactTask.last.value"
@@ -14,49 +11,49 @@
14
11
  </template>
15
12
 
16
13
  <script lang="ts">
17
- import { defineComponent, onMounted, watch } from "vue";
14
+ import { defineComponent, onMounted, watch } from "vue"
18
15
 
19
- import { generateGetArtifactTask } from "@/api-helper";
20
- import ArtifactComponent from "@/components/artifact/Artifact.vue";
21
- import ErrorMessage from "@/components/ErrorMessage.vue";
22
- import Loading from "@/components/Loading.vue";
16
+ import { generateGetArtifactTask } from "@/api-helper"
17
+ import ArtifactComponent from "@/components/artifact/Artifact.vue"
18
+ import ErrorMessage from "@/components/ErrorMessage.vue"
19
+ import Loading from "@/components/Loading.vue"
23
20
 
24
21
  export default defineComponent({
25
22
  name: "ArtifactWrapper",
26
23
  components: {
27
24
  ArtifactComponent,
28
25
  Loading,
29
- ErrorMessage,
26
+ ErrorMessage
30
27
  },
31
28
  props: {
32
29
  id: {
33
30
  type: String,
34
- required: true,
35
- },
31
+ required: true
32
+ }
36
33
  },
37
34
  setup(props) {
38
- const getArtifactTask = generateGetArtifactTask();
35
+ const getArtifactTask = generateGetArtifactTask()
39
36
 
40
37
  const getArtifact = async () => {
41
- await getArtifactTask.perform(props.id);
42
- };
38
+ await getArtifactTask.perform(props.id)
39
+ }
43
40
 
44
41
  const refresh = async () => {
45
- await getArtifact();
46
- };
42
+ await getArtifact()
43
+ }
47
44
 
48
45
  onMounted(async () => {
49
- await getArtifact();
50
- });
46
+ await getArtifact()
47
+ })
51
48
 
52
49
  watch(props, async () => {
53
- await getArtifact();
54
- });
50
+ await getArtifact()
51
+ })
55
52
 
56
53
  return {
57
54
  getArtifactTask,
58
- refresh,
59
- };
60
- },
61
- });
55
+ refresh
56
+ }
57
+ }
58
+ })
62
59
  </script>
@@ -7,17 +7,17 @@
7
7
  </template>
8
8
 
9
9
  <script lang="ts">
10
- import { defineComponent, PropType } from "vue";
10
+ import { defineComponent, type PropType } from "vue"
11
11
 
12
- import { CPE } from "@/types";
12
+ import type { CPE } from "@/types"
13
13
 
14
14
  export default defineComponent({
15
15
  name: "CPEsItem",
16
16
  props: {
17
17
  cpes: {
18
18
  type: Array as PropType<CPE[]>,
19
- required: true,
20
- },
21
- },
22
- });
19
+ required: true
20
+ }
21
+ }
22
+ })
23
23
  </script>
@@ -7,7 +7,7 @@
7
7
  class="tag"
8
8
  :to="{
9
9
  name: 'Alerts',
10
- query: { dnsRecord: dnsRecord.value },
10
+ query: { dnsRecord: dnsRecord.value }
11
11
  }"
12
12
  >
13
13
  {{ truncate(dnsRecord.value, 50) }}
@@ -18,21 +18,21 @@
18
18
  </template>
19
19
 
20
20
  <script lang="ts">
21
- import truncate from "truncate";
22
- import { defineComponent, PropType } from "vue";
21
+ import truncate from "truncate"
22
+ import { defineComponent, type PropType } from "vue"
23
23
 
24
- import { DnsRecord } from "@/types";
24
+ import type { DnsRecord } from "@/types"
25
25
 
26
26
  export default defineComponent({
27
27
  name: "DnsRecords",
28
28
  props: {
29
29
  dnsRecords: {
30
30
  type: Array as PropType<DnsRecord[]>,
31
- required: true,
32
- },
31
+ required: true
32
+ }
33
33
  },
34
34
  setup() {
35
- return { truncate };
36
- },
37
- });
35
+ return { truncate }
36
+ }
37
+ })
38
38
  </script>
@@ -7,17 +7,17 @@
7
7
  </template>
8
8
 
9
9
  <script lang="ts">
10
- import { defineComponent, PropType } from "vue";
10
+ import { defineComponent, type PropType } from "vue"
11
11
 
12
- import { Port } from "@/types";
12
+ import type { Port } from "@/types"
13
13
 
14
14
  export default defineComponent({
15
15
  name: "PortsItem",
16
16
  props: {
17
17
  ports: {
18
18
  type: Array as PropType<Port[]>,
19
- required: true,
20
- },
21
- },
22
- });
19
+ required: true
20
+ }
21
+ }
22
+ })
23
23
  </script>
@@ -6,7 +6,7 @@
6
6
  :key="reverseDnsName.name"
7
7
  :to="{
8
8
  name: 'Alerts',
9
- query: { reverseDnsName: reverseDnsName.name },
9
+ query: { reverseDnsName: reverseDnsName.name }
10
10
  }"
11
11
  >
12
12
  {{ reverseDnsName.name }}
@@ -15,17 +15,17 @@
15
15
  </template>
16
16
 
17
17
  <script lang="ts">
18
- import { defineComponent, PropType } from "vue";
18
+ import { defineComponent, type PropType } from "vue"
19
19
 
20
- import { ReverseDnsName } from "@/types";
20
+ import type { ReverseDnsName } from "@/types"
21
21
 
22
22
  export default defineComponent({
23
23
  name: "ReverseDnsNames",
24
24
  props: {
25
25
  reverseDnsNames: {
26
26
  type: Array as PropType<ReverseDnsName[]>,
27
- required: true,
28
- },
29
- },
30
- });
27
+ required: true
28
+ }
29
+ }
30
+ })
31
31
  </script>
@@ -6,7 +6,7 @@
6
6
  :key="tag"
7
7
  :to="{
8
8
  name: 'Alerts',
9
- query: { tag: tag },
9
+ query: { tag: tag }
10
10
  }"
11
11
  >
12
12
  {{ tag }}
@@ -15,15 +15,15 @@
15
15
  </template>
16
16
 
17
17
  <script lang="ts">
18
- import { defineComponent, PropType } from "vue";
18
+ import { defineComponent, type PropType } from "vue"
19
19
 
20
20
  export default defineComponent({
21
21
  name: "TagsItem",
22
22
  props: {
23
23
  tags: {
24
24
  type: Array as PropType<string[]>,
25
- required: true,
26
- },
27
- },
28
- });
25
+ required: true
26
+ }
27
+ }
28
+ })
29
29
  </script>
@@ -3,9 +3,7 @@
3
3
  <div class="control">
4
4
  <div class="tags has-addons are-medium">
5
5
  <span class="tag is-dark">Registrar</span>
6
- <span class="tag is-light">{{
7
- whoisRecord.registrar?.name || "N/A"
8
- }}</span>
6
+ <span class="tag is-light">{{ whoisRecord.registrar?.name || "N/A" }}</span>
9
7
  </div>
10
8
  </div>
11
9
 
@@ -33,17 +31,17 @@
33
31
  </template>
34
32
 
35
33
  <script lang="ts">
36
- import { defineComponent, PropType } from "vue";
34
+ import { defineComponent, type PropType } from "vue"
37
35
 
38
- import { WhoisRecord } from "@/types";
36
+ import type { WhoisRecord } from "@/types"
39
37
 
40
38
  export default defineComponent({
41
39
  name: "WhoisRecord",
42
40
  props: {
43
41
  whoisRecord: {
44
42
  type: Object as PropType<WhoisRecord>,
45
- required: true,
46
- },
47
- },
48
- });
43
+ required: true
44
+ }
45
+ }
46
+ })
49
47
  </script>