mihari 5.6.2 → 5.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +5 -1
  3. data/README.md +1 -0
  4. data/config.ru +1 -1
  5. data/docs/analyzers/fofa.md +31 -0
  6. data/docs/analyzers/index.md +1 -0
  7. data/frontend/package-lock.json +73 -73
  8. data/frontend/package.json +5 -5
  9. data/frontend/src/components/alert/Form.vue +1 -14
  10. data/frontend/src/components/artifact/AS.vue +2 -8
  11. data/frontend/src/components/artifact/DnsRecords.vue +2 -8
  12. data/frontend/src/components/artifact/ReverseDnsNames.vue +2 -10
  13. data/frontend/src/components/artifact/WhoisRecord.vue +1 -1
  14. data/lib/mihari/actor.rb +14 -4
  15. data/lib/mihari/analyzers/base.rb +13 -12
  16. data/lib/mihari/analyzers/binaryedge.rb +4 -1
  17. data/lib/mihari/analyzers/censys.rb +4 -2
  18. data/lib/mihari/analyzers/circl.rb +4 -1
  19. data/lib/mihari/analyzers/crtsh.rb +4 -1
  20. data/lib/mihari/analyzers/dnstwister.rb +4 -1
  21. data/lib/mihari/analyzers/feed.rb +3 -0
  22. data/lib/mihari/analyzers/fofa.rb +65 -0
  23. data/lib/mihari/analyzers/greynoise.rb +4 -1
  24. data/lib/mihari/analyzers/hunterhow.rb +6 -1
  25. data/lib/mihari/analyzers/onyphe.rb +4 -1
  26. data/lib/mihari/analyzers/otx.rb +4 -1
  27. data/lib/mihari/analyzers/passivetotal.rb +4 -1
  28. data/lib/mihari/analyzers/pulsedive.rb +3 -0
  29. data/lib/mihari/analyzers/securitytrails.rb +4 -1
  30. data/lib/mihari/analyzers/shodan.rb +4 -1
  31. data/lib/mihari/analyzers/urlscan.rb +4 -1
  32. data/lib/mihari/analyzers/virustotal.rb +4 -1
  33. data/lib/mihari/analyzers/virustotal_intelligence.rb +4 -1
  34. data/lib/mihari/analyzers/zoomeye.rb +5 -2
  35. data/lib/mihari/cli/alert.rb +3 -0
  36. data/lib/mihari/cli/base.rb +3 -0
  37. data/lib/mihari/cli/database.rb +3 -0
  38. data/lib/mihari/cli/main.rb +3 -0
  39. data/lib/mihari/cli/rule.rb +3 -0
  40. data/lib/mihari/clients/base.rb +3 -0
  41. data/lib/mihari/clients/binaryedge.rb +5 -2
  42. data/lib/mihari/clients/censys.rb +7 -4
  43. data/lib/mihari/clients/circl.rb +3 -0
  44. data/lib/mihari/clients/crtsh.rb +3 -0
  45. data/lib/mihari/clients/dnstwister.rb +3 -0
  46. data/lib/mihari/clients/fofa.rb +83 -0
  47. data/lib/mihari/clients/greynoise.rb +5 -2
  48. data/lib/mihari/clients/hunterhow.rb +5 -2
  49. data/lib/mihari/clients/misp.rb +3 -0
  50. data/lib/mihari/clients/onyphe.rb +5 -2
  51. data/lib/mihari/clients/otx.rb +3 -0
  52. data/lib/mihari/clients/passivetotal.rb +3 -0
  53. data/lib/mihari/clients/publsedive.rb +4 -1
  54. data/lib/mihari/clients/securitytrails.rb +3 -0
  55. data/lib/mihari/clients/shodan.rb +5 -2
  56. data/lib/mihari/clients/the_hive.rb +3 -0
  57. data/lib/mihari/clients/urlscan.rb +7 -4
  58. data/lib/mihari/clients/virustotal.rb +5 -2
  59. data/lib/mihari/clients/zoomeye.rb +3 -0
  60. data/lib/mihari/commands/alert.rb +5 -14
  61. data/lib/mihari/commands/database.rb +3 -0
  62. data/lib/mihari/commands/rule.rb +10 -1
  63. data/lib/mihari/commands/search.rb +9 -6
  64. data/lib/mihari/commands/version.rb +3 -0
  65. data/lib/mihari/commands/web.rb +4 -1
  66. data/lib/mihari/config.rb +139 -150
  67. data/lib/mihari/constants.rb +1 -1
  68. data/lib/mihari/database.rb +6 -0
  69. data/lib/mihari/emitters/base.rb +13 -11
  70. data/lib/mihari/emitters/database.rb +4 -1
  71. data/lib/mihari/emitters/misp.rb +7 -4
  72. data/lib/mihari/emitters/slack.rb +3 -3
  73. data/lib/mihari/emitters/the_hive.rb +3 -3
  74. data/lib/mihari/emitters/webhook.rb +4 -3
  75. data/lib/mihari/enrichers/base.rb +15 -9
  76. data/lib/mihari/enrichers/google_public_dns.rb +6 -5
  77. data/lib/mihari/enrichers/ipinfo.rb +10 -8
  78. data/lib/mihari/enrichers/shodan.rb +4 -6
  79. data/lib/mihari/enrichers/whois.rb +12 -9
  80. data/lib/mihari/errors.rb +6 -0
  81. data/lib/mihari/feed/parser.rb +3 -0
  82. data/lib/mihari/feed/reader.rb +3 -0
  83. data/lib/mihari/http.rb +6 -0
  84. data/lib/mihari/mixins/autonomous_system.rb +3 -0
  85. data/lib/mihari/mixins/configurable.rb +3 -0
  86. data/lib/mihari/mixins/error_notification.rb +3 -0
  87. data/lib/mihari/mixins/falsepositive.rb +3 -0
  88. data/lib/mihari/mixins/refang.rb +3 -0
  89. data/lib/mihari/mixins/retriable.rb +6 -2
  90. data/lib/mihari/models/alert.rb +7 -4
  91. data/lib/mihari/models/artifact.rb +6 -0
  92. data/lib/mihari/models/autonomous_system.rb +4 -1
  93. data/lib/mihari/models/cpe.rb +4 -1
  94. data/lib/mihari/models/dns.rb +4 -1
  95. data/lib/mihari/models/geolocation.rb +4 -1
  96. data/lib/mihari/models/port.rb +4 -1
  97. data/lib/mihari/models/reverse_dns.rb +4 -1
  98. data/lib/mihari/models/rule.rb +6 -3
  99. data/lib/mihari/models/tag.rb +3 -0
  100. data/lib/mihari/models/tagging.rb +3 -0
  101. data/lib/mihari/models/whois.rb +4 -3
  102. data/lib/mihari/rule.rb +17 -12
  103. data/lib/mihari/schemas/alert.rb +3 -0
  104. data/lib/mihari/schemas/analyzer.rb +11 -0
  105. data/lib/mihari/schemas/emitter.rb +3 -0
  106. data/lib/mihari/schemas/enricher.rb +3 -0
  107. data/lib/mihari/schemas/macros.rb +4 -0
  108. data/lib/mihari/schemas/mixins.rb +5 -0
  109. data/lib/mihari/schemas/rule.rb +3 -0
  110. data/lib/mihari/service.rb +16 -0
  111. data/lib/mihari/services/alert_builder.rb +8 -5
  112. data/lib/mihari/services/alert_proxy.rb +6 -1
  113. data/lib/mihari/services/alert_runner.rb +8 -12
  114. data/lib/mihari/services/rule_builder.rb +8 -5
  115. data/lib/mihari/services/rule_runner.rb +8 -10
  116. data/lib/mihari/structs/binaryedge.rb +13 -28
  117. data/lib/mihari/structs/censys.rb +48 -127
  118. data/lib/mihari/structs/config.rb +19 -30
  119. data/lib/mihari/structs/filters.rb +38 -0
  120. data/lib/mihari/structs/fofa.rb +44 -0
  121. data/lib/mihari/structs/google_public_dns.rb +10 -28
  122. data/lib/mihari/structs/greynoise.rb +33 -84
  123. data/lib/mihari/structs/hunterhow.rb +24 -22
  124. data/lib/mihari/structs/ipinfo.rb +14 -35
  125. data/lib/mihari/structs/onyphe.rb +31 -76
  126. data/lib/mihari/structs/shodan.rb +47 -112
  127. data/lib/mihari/structs/urlscan.rb +24 -63
  128. data/lib/mihari/structs/virustotal_intelligence.rb +20 -56
  129. data/lib/mihari/type_checker.rb +4 -0
  130. data/lib/mihari/types.rb +3 -0
  131. data/lib/mihari/version.rb +1 -1
  132. data/lib/mihari/web/api.rb +15 -10
  133. data/lib/mihari/web/app.rb +59 -54
  134. data/lib/mihari/web/endpoints/alerts.rb +94 -89
  135. data/lib/mihari/web/endpoints/artifacts.rb +115 -110
  136. data/lib/mihari/web/endpoints/configs.rb +18 -13
  137. data/lib/mihari/web/endpoints/ip_addresses.rb +21 -16
  138. data/lib/mihari/web/endpoints/rules.rb +203 -198
  139. data/lib/mihari/web/endpoints/tags.rb +41 -36
  140. data/lib/mihari/web/middleware/connection_adapter.rb +16 -9
  141. data/lib/mihari/web/middleware/error_notification_adapter.rb +17 -10
  142. data/lib/mihari/web/public/assets/{index-28d4c79d.js → index-821134e2.js} +30 -30
  143. data/lib/mihari/web/public/assets/mode-yaml-24faa242.js +8 -0
  144. data/lib/mihari/web/public/index.html +1 -1
  145. data/lib/mihari.rb +24 -5
  146. data/mihari.gemspec +8 -1
  147. data/mkdocs.yml +3 -2
  148. metadata +39 -7
  149. data/lib/mihari/templates/rule.yml.erb +0 -5
  150. data/lib/mihari/web/public/assets/mode-yaml-a21faa53.js +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7136011e523fa8b61ed048932c1ca7e265425a4eaf89c76a5f8052f74c108f17
4
- data.tar.gz: 243dfcbc17341520912a626210a336d0cdd419b011160d4d2f60ddd1f2326c33
3
+ metadata.gz: f226f30917400448aecfc83808609ff3eb180228c2d10d797d3409cc3ecdb9c0
4
+ data.tar.gz: 5ce20637fed160cdecb7d8c22726b44670834843f2e77f5ef235f943a6321701
5
5
  SHA512:
6
- metadata.gz: eade462830cc2258517594564713cd5b612755f359a4efafb40fd16973282785f9a0ad610e3063c9b372ffddcf45e98773e6047f3761547493a68f6bafe25769
7
- data.tar.gz: 7ff869faaaf0782d842e241e476d5b7602d94e3c08ae2588d4fcbe56d0c44bb6b38714db72fa6be5da70ca5989c6803193b0516614af80d2752114783ff3a5bf
6
+ metadata.gz: 3900c2cc6a8ac2010b4579f574be0ce4d620a180dcfadf00c97b7597a7bccd79de9efdfdce402b40f06d7afeaaec0062210796391123e3a145f54d3be4270261
7
+ data.tar.gz: 7655638dd621bf03f0d9178eb2e0ca6bf4d161b6563c266380d3cc8bf37bef692bc06765ef3050aaf7683a0f1be2ca51d8a9d7e7c3f34a9e184389fcd31b2885
data/.rubocop.yml CHANGED
@@ -3,12 +3,16 @@ Style/HashSyntax:
3
3
  Style/StringLiterals:
4
4
  EnforcedStyle: double_quotes
5
5
  Metrics/BlockLength:
6
+ Max: 100
6
7
  Exclude:
7
8
  - "spec/**/*"
8
9
  - "*.gemspec"
9
10
  Metrics/ClassLength:
10
11
  Enabled: false
11
12
  Metrics/MethodLength:
12
- Max: 20
13
+ Max: 50
14
+ Metrics/AbcSize:
15
+ Max: 50
13
16
  require:
14
17
  - rubocop-rspec
18
+ - rubocop-yard
data/README.md CHANGED
@@ -24,6 +24,7 @@ Mihari supports the following services by default.
24
24
  - [CIRCL passive DNS](https://www.circl.lu/services/passive-dns/) / [passive SSL](https://www.circl.lu/services/passive-ssl/)
25
25
  - [crt.sh](https://crt.sh/)
26
26
  - [dnstwister](https://dnstwister.report/)
27
+ - [Fofa](https://en.fofa.info/)
27
28
  - [GreyNoise](https://www.greynoise.io/)
28
29
  - [HunterHow](https://hunter.how/)
29
30
  - [Onyphe](https://onyphe.io)
data/config.ru CHANGED
@@ -3,4 +3,4 @@ require "./lib/mihari"
3
3
  # set rack env as development
4
4
  ENV["RACK_ENV"] ||= "development"
5
5
 
6
- run Mihari::App.instance
6
+ run Mihari::Web::App.instance
@@ -0,0 +1,31 @@
1
+ ---
2
+ tags:
3
+ - Artifact:IP
4
+ ---
5
+
6
+ # Fofa
7
+
8
+ - https://en.fofa.info/
9
+
10
+ This analyzer uses Fofa API (`/api/v1/search/all`) to search. Pagination is supported.
11
+
12
+ ```yaml
13
+ analyzer: fofa
14
+ query: ...
15
+ api_key: ...
16
+ email: ...
17
+ ```
18
+
19
+ ## Components
20
+
21
+ ### Query
22
+
23
+ `query` (`string`) is a search query.
24
+
25
+ ### API Key
26
+
27
+ `api_key` (`string`) is an API key. Optional. Defaults to `ENV[”FOFA_API_KEY"]`.
28
+
29
+ ### Email
30
+
31
+ `email` (`string`) is an email. Optional. Defaults to `ENV[”FOFA_EMAIL"]`.
@@ -6,6 +6,7 @@
6
6
  - [crt.sh](crtsh.md)
7
7
  - [dnstwister](dnstwister.md)
8
8
  - [Feed](feed.md)
9
+ - [Fofa](fofa.md)
9
10
  - [GreyNoise](greynoise.md)
10
11
  - [HunterHow](hunterhow.md)
11
12
  - [Onyphe](onyphe.md)
@@ -13,7 +13,7 @@
13
13
  "@fortawesome/vue-fontawesome": "^3.0.3",
14
14
  "@vueuse/core": "^10.5.0",
15
15
  "@vueuse/router": "^10.5.0",
16
- "ace-builds": "^1.31.0",
16
+ "ace-builds": "^1.31.1",
17
17
  "axios": "^1.6.0",
18
18
  "bulma": "^0.9.4",
19
19
  "bulma-helpers": "^0.4.3",
@@ -28,17 +28,17 @@
28
28
  "vue-concurrency": "4.0.1",
29
29
  "vue-json-pretty": "^2.2.4",
30
30
  "vue-router": "^4.2.5",
31
- "vue3-ace-editor": "^2.2.3"
31
+ "vue3-ace-editor": "^2.2.4"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@redocly/cli": "1.4.0",
35
35
  "@rushstack/eslint-patch": "^1.5.1",
36
36
  "@tsconfig/node20": "^20.1.2",
37
37
  "@types/jsdom": "^21.1.4",
38
- "@types/node": "^20.8.9",
38
+ "@types/node": "^20.8.10",
39
39
  "@types/url-parse": "^1.4.10",
40
- "@typescript-eslint/eslint-plugin": "^6.9.0",
41
- "@typescript-eslint/parser": "^6.9.0",
40
+ "@typescript-eslint/eslint-plugin": "^6.9.1",
41
+ "@typescript-eslint/parser": "^6.9.1",
42
42
  "@vitejs/plugin-vue": "^4.4.0",
43
43
  "@vue/eslint-config-prettier": "^8.0.0",
44
44
  "@vue/eslint-config-typescript": "^12.0.0",
@@ -858,9 +858,9 @@
858
858
  "dev": true
859
859
  },
860
860
  "node_modules/@types/node": {
861
- "version": "20.8.9",
862
- "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.9.tgz",
863
- "integrity": "sha512-UzykFsT3FhHb1h7yD4CA4YhBHq545JC0YnEz41xkipN88eKQtL6rSgocL5tbAP6Ola9Izm/Aw4Ora8He4x0BHg==",
861
+ "version": "20.8.10",
862
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.10.tgz",
863
+ "integrity": "sha512-TlgT8JntpcbmKUFzjhsyhGfP2fsiz1Mv56im6enJ905xG1DAYesxJaeSbGqQmAw8OWPdhyJGhGSQGKRNJ45u9w==",
864
864
  "dev": true,
865
865
  "dependencies": {
866
866
  "undici-types": "~5.26.4"
@@ -901,16 +901,16 @@
901
901
  "integrity": "sha512-v/ZHEj9xh82usl8LMR3GarzFY1IrbXJw5L4QfQhokjRV91q+SelFqxQWSep1ucXEZ22+dSTwLFkXeur25sPIbw=="
902
902
  },
903
903
  "node_modules/@typescript-eslint/eslint-plugin": {
904
- "version": "6.9.0",
905
- "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.9.0.tgz",
906
- "integrity": "sha512-lgX7F0azQwRPB7t7WAyeHWVfW1YJ9NIgd9mvGhfQpRY56X6AVf8mwM8Wol+0z4liE7XX3QOt8MN1rUKCfSjRIA==",
904
+ "version": "6.9.1",
905
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.9.1.tgz",
906
+ "integrity": "sha512-w0tiiRc9I4S5XSXXrMHOWgHgxbrBn1Ro+PmiYhSg2ZVdxrAJtQgzU5o2m1BfP6UOn7Vxcc6152vFjQfmZR4xEg==",
907
907
  "dev": true,
908
908
  "dependencies": {
909
909
  "@eslint-community/regexpp": "^4.5.1",
910
- "@typescript-eslint/scope-manager": "6.9.0",
911
- "@typescript-eslint/type-utils": "6.9.0",
912
- "@typescript-eslint/utils": "6.9.0",
913
- "@typescript-eslint/visitor-keys": "6.9.0",
910
+ "@typescript-eslint/scope-manager": "6.9.1",
911
+ "@typescript-eslint/type-utils": "6.9.1",
912
+ "@typescript-eslint/utils": "6.9.1",
913
+ "@typescript-eslint/visitor-keys": "6.9.1",
914
914
  "debug": "^4.3.4",
915
915
  "graphemer": "^1.4.0",
916
916
  "ignore": "^5.2.4",
@@ -936,15 +936,15 @@
936
936
  }
937
937
  },
938
938
  "node_modules/@typescript-eslint/parser": {
939
- "version": "6.9.0",
940
- "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.9.0.tgz",
941
- "integrity": "sha512-GZmjMh4AJ/5gaH4XF2eXA8tMnHWP+Pm1mjQR2QN4Iz+j/zO04b9TOvJYOX2sCNIQHtRStKTxRY1FX7LhpJT4Gw==",
939
+ "version": "6.9.1",
940
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.9.1.tgz",
941
+ "integrity": "sha512-C7AK2wn43GSaCUZ9do6Ksgi2g3mwFkMO3Cis96kzmgudoVaKyt62yNzJOktP0HDLb/iO2O0n2lBOzJgr6Q/cyg==",
942
942
  "dev": true,
943
943
  "dependencies": {
944
- "@typescript-eslint/scope-manager": "6.9.0",
945
- "@typescript-eslint/types": "6.9.0",
946
- "@typescript-eslint/typescript-estree": "6.9.0",
947
- "@typescript-eslint/visitor-keys": "6.9.0",
944
+ "@typescript-eslint/scope-manager": "6.9.1",
945
+ "@typescript-eslint/types": "6.9.1",
946
+ "@typescript-eslint/typescript-estree": "6.9.1",
947
+ "@typescript-eslint/visitor-keys": "6.9.1",
948
948
  "debug": "^4.3.4"
949
949
  },
950
950
  "engines": {
@@ -964,13 +964,13 @@
964
964
  }
965
965
  },
966
966
  "node_modules/@typescript-eslint/scope-manager": {
967
- "version": "6.9.0",
968
- "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.9.0.tgz",
969
- "integrity": "sha512-1R8A9Mc39n4pCCz9o79qRO31HGNDvC7UhPhv26TovDsWPBDx+Sg3rOZdCELIA3ZmNoWAuxaMOT7aWtGRSYkQxw==",
967
+ "version": "6.9.1",
968
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.9.1.tgz",
969
+ "integrity": "sha512-38IxvKB6NAne3g/+MyXMs2Cda/Sz+CEpmm+KLGEM8hx/CvnSRuw51i8ukfwB/B/sESdeTGet1NH1Wj7I0YXswg==",
970
970
  "dev": true,
971
971
  "dependencies": {
972
- "@typescript-eslint/types": "6.9.0",
973
- "@typescript-eslint/visitor-keys": "6.9.0"
972
+ "@typescript-eslint/types": "6.9.1",
973
+ "@typescript-eslint/visitor-keys": "6.9.1"
974
974
  },
975
975
  "engines": {
976
976
  "node": "^16.0.0 || >=18.0.0"
@@ -981,13 +981,13 @@
981
981
  }
982
982
  },
983
983
  "node_modules/@typescript-eslint/type-utils": {
984
- "version": "6.9.0",
985
- "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.9.0.tgz",
986
- "integrity": "sha512-XXeahmfbpuhVbhSOROIzJ+b13krFmgtc4GlEuu1WBT+RpyGPIA4Y/eGnXzjbDj5gZLzpAXO/sj+IF/x2GtTMjQ==",
984
+ "version": "6.9.1",
985
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.9.1.tgz",
986
+ "integrity": "sha512-eh2oHaUKCK58qIeYp19F5V5TbpM52680sB4zNSz29VBQPTWIlE/hCj5P5B1AChxECe/fmZlspAWFuRniep1Skg==",
987
987
  "dev": true,
988
988
  "dependencies": {
989
- "@typescript-eslint/typescript-estree": "6.9.0",
990
- "@typescript-eslint/utils": "6.9.0",
989
+ "@typescript-eslint/typescript-estree": "6.9.1",
990
+ "@typescript-eslint/utils": "6.9.1",
991
991
  "debug": "^4.3.4",
992
992
  "ts-api-utils": "^1.0.1"
993
993
  },
@@ -1008,9 +1008,9 @@
1008
1008
  }
1009
1009
  },
1010
1010
  "node_modules/@typescript-eslint/types": {
1011
- "version": "6.9.0",
1012
- "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.9.0.tgz",
1013
- "integrity": "sha512-+KB0lbkpxBkBSiVCuQvduqMJy+I1FyDbdwSpM3IoBS7APl4Bu15lStPjgBIdykdRqQNYqYNMa8Kuidax6phaEw==",
1011
+ "version": "6.9.1",
1012
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.9.1.tgz",
1013
+ "integrity": "sha512-BUGslGOb14zUHOUmDB2FfT6SI1CcZEJYfF3qFwBeUrU6srJfzANonwRYHDpLBuzbq3HaoF2XL2hcr01c8f8OaQ==",
1014
1014
  "dev": true,
1015
1015
  "engines": {
1016
1016
  "node": "^16.0.0 || >=18.0.0"
@@ -1021,13 +1021,13 @@
1021
1021
  }
1022
1022
  },
1023
1023
  "node_modules/@typescript-eslint/typescript-estree": {
1024
- "version": "6.9.0",
1025
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.9.0.tgz",
1026
- "integrity": "sha512-NJM2BnJFZBEAbCfBP00zONKXvMqihZCrmwCaik0UhLr0vAgb6oguXxLX1k00oQyD+vZZ+CJn3kocvv2yxm4awQ==",
1024
+ "version": "6.9.1",
1025
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.9.1.tgz",
1026
+ "integrity": "sha512-U+mUylTHfcqeO7mLWVQ5W/tMLXqVpRv61wm9ZtfE5egz7gtnmqVIw9ryh0mgIlkKk9rZLY3UHygsBSdB9/ftyw==",
1027
1027
  "dev": true,
1028
1028
  "dependencies": {
1029
- "@typescript-eslint/types": "6.9.0",
1030
- "@typescript-eslint/visitor-keys": "6.9.0",
1029
+ "@typescript-eslint/types": "6.9.1",
1030
+ "@typescript-eslint/visitor-keys": "6.9.1",
1031
1031
  "debug": "^4.3.4",
1032
1032
  "globby": "^11.1.0",
1033
1033
  "is-glob": "^4.0.3",
@@ -1048,17 +1048,17 @@
1048
1048
  }
1049
1049
  },
1050
1050
  "node_modules/@typescript-eslint/utils": {
1051
- "version": "6.9.0",
1052
- "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.9.0.tgz",
1053
- "integrity": "sha512-5Wf+Jsqya7WcCO8me504FBigeQKVLAMPmUzYgDbWchINNh1KJbxCgVya3EQ2MjvJMVeXl3pofRmprqX6mfQkjQ==",
1051
+ "version": "6.9.1",
1052
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.9.1.tgz",
1053
+ "integrity": "sha512-L1T0A5nFdQrMVunpZgzqPL6y2wVreSyHhKGZryS6jrEN7bD9NplVAyMryUhXsQ4TWLnZmxc2ekar/lSGIlprCA==",
1054
1054
  "dev": true,
1055
1055
  "dependencies": {
1056
1056
  "@eslint-community/eslint-utils": "^4.4.0",
1057
1057
  "@types/json-schema": "^7.0.12",
1058
1058
  "@types/semver": "^7.5.0",
1059
- "@typescript-eslint/scope-manager": "6.9.0",
1060
- "@typescript-eslint/types": "6.9.0",
1061
- "@typescript-eslint/typescript-estree": "6.9.0",
1059
+ "@typescript-eslint/scope-manager": "6.9.1",
1060
+ "@typescript-eslint/types": "6.9.1",
1061
+ "@typescript-eslint/typescript-estree": "6.9.1",
1062
1062
  "semver": "^7.5.4"
1063
1063
  },
1064
1064
  "engines": {
@@ -1073,12 +1073,12 @@
1073
1073
  }
1074
1074
  },
1075
1075
  "node_modules/@typescript-eslint/visitor-keys": {
1076
- "version": "6.9.0",
1077
- "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.9.0.tgz",
1078
- "integrity": "sha512-dGtAfqjV6RFOtIP8I0B4ZTBRrlTT8NHHlZZSchQx3qReaoDeXhYM++M4So2AgFK9ZB0emRPA6JI1HkafzA2Ibg==",
1076
+ "version": "6.9.1",
1077
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.9.1.tgz",
1078
+ "integrity": "sha512-MUaPUe/QRLEffARsmNfmpghuQkW436DvESW+h+M52w0coICHRfD6Np9/K6PdACwnrq1HmuLl+cSPZaJmeVPkSw==",
1079
1079
  "dev": true,
1080
1080
  "dependencies": {
1081
- "@typescript-eslint/types": "6.9.0",
1081
+ "@typescript-eslint/types": "6.9.1",
1082
1082
  "eslint-visitor-keys": "^3.4.1"
1083
1083
  },
1084
1084
  "engines": {
@@ -1204,30 +1204,30 @@
1204
1204
  }
1205
1205
  },
1206
1206
  "node_modules/@volar/language-core": {
1207
- "version": "1.10.7",
1208
- "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-1.10.7.tgz",
1209
- "integrity": "sha512-6+WI7HGqWCsKJ/bms4V45WP7eDeoGxDtLjYPrHB7QkIWVkRLIeGPzzBoonZz9kERM+Kld3W89Y+IlICejVAKhA==",
1207
+ "version": "1.10.10",
1208
+ "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-1.10.10.tgz",
1209
+ "integrity": "sha512-nsV1o3AZ5n5jaEAObrS3MWLBWaGwUj/vAsc15FVNIv+DbpizQRISg9wzygsHBr56ELRH8r4K75vkYNMtsSNNWw==",
1210
1210
  "dev": true,
1211
1211
  "dependencies": {
1212
- "@volar/source-map": "1.10.7"
1212
+ "@volar/source-map": "1.10.10"
1213
1213
  }
1214
1214
  },
1215
1215
  "node_modules/@volar/source-map": {
1216
- "version": "1.10.7",
1217
- "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-1.10.7.tgz",
1218
- "integrity": "sha512-anA254XO0lmmeu0p/kvgPOCkrVpqNIHWMvEkPX70PSk4ntg0iBzN/f0Kip6deXvibl6v14Q3Z8RihWrZwdZEEQ==",
1216
+ "version": "1.10.10",
1217
+ "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-1.10.10.tgz",
1218
+ "integrity": "sha512-GVKjLnifV4voJ9F0vhP56p4+F3WGf+gXlRtjFZsv6v3WxBTWU3ZVeaRaEHJmWrcv5LXmoYYpk/SC25BKemPRkg==",
1219
1219
  "dev": true,
1220
1220
  "dependencies": {
1221
1221
  "muggle-string": "^0.3.1"
1222
1222
  }
1223
1223
  },
1224
1224
  "node_modules/@volar/typescript": {
1225
- "version": "1.10.7",
1226
- "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-1.10.7.tgz",
1227
- "integrity": "sha512-2hvA3vjXVUn1vOpsP/nWLnE5DUmY6YKQhvDRoZVfBrnWwIo0ySxdTUP4XieXGGgSk43xJaeU1zqQS/3Wfm7QgA==",
1225
+ "version": "1.10.10",
1226
+ "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-1.10.10.tgz",
1227
+ "integrity": "sha512-4a2r5bdUub2m+mYVnLu2wt59fuoYWe7nf0uXtGHU8QQ5LDNfzAR0wK7NgDiQ9rcl2WT3fxT2AA9AylAwFtj50A==",
1228
1228
  "dev": true,
1229
1229
  "dependencies": {
1230
- "@volar/language-core": "1.10.7",
1230
+ "@volar/language-core": "1.10.10",
1231
1231
  "path-browserify": "^1.0.1"
1232
1232
  }
1233
1233
  },
@@ -1588,9 +1588,9 @@
1588
1588
  "dev": true
1589
1589
  },
1590
1590
  "node_modules/ace-builds": {
1591
- "version": "1.31.0",
1592
- "resolved": "https://registry.npmjs.org/ace-builds/-/ace-builds-1.31.0.tgz",
1593
- "integrity": "sha512-nitIhcUYA6wyO3lo2WZBPX5fcjllW6XFt4EFyHwcN2Fp70/IZwz8tdw6a0+8udDEwDj/ebt3aWEClIyCs/6qYA=="
1591
+ "version": "1.31.1",
1592
+ "resolved": "https://registry.npmjs.org/ace-builds/-/ace-builds-1.31.1.tgz",
1593
+ "integrity": "sha512-3DnE5bZF6Ji+l4F5acoLk+rV7mxrUt1C4r61Xy9owp5rVM4lj5NL8GJfoX6Jnnbhx6kKV7Vdpb+Tco+0ORTvhg=="
1594
1594
  },
1595
1595
  "node_modules/acorn": {
1596
1596
  "version": "8.11.2",
@@ -2084,9 +2084,9 @@
2084
2084
  }
2085
2085
  },
2086
2086
  "node_modules/core-js": {
2087
- "version": "3.33.1",
2088
- "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.33.1.tgz",
2089
- "integrity": "sha512-qVSq3s+d4+GsqN0teRCJtM6tdEEXyWxjzbhVrCHmBS5ZTM0FS2MOS0D13dUXAWDUN6a+lHI/N1hF9Ytz6iLl9Q==",
2087
+ "version": "3.33.2",
2088
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.33.2.tgz",
2089
+ "integrity": "sha512-XeBzWI6QL3nJQiHmdzbAOiMYqjrb7hwU7A39Qhvd/POSa/t9E1AeZyEZx3fNvp/vtM8zXwhoL0FsiS0hD0pruQ==",
2090
2090
  "dev": true,
2091
2091
  "hasInstallScript": true,
2092
2092
  "funding": {
@@ -5279,9 +5279,9 @@
5279
5279
  "dev": true
5280
5280
  },
5281
5281
  "node_modules/punycode": {
5282
- "version": "2.3.0",
5283
- "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz",
5284
- "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==",
5282
+ "version": "2.3.1",
5283
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
5284
+ "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
5285
5285
  "dev": true,
5286
5286
  "engines": {
5287
5287
  "node": ">=6"
@@ -6949,9 +6949,9 @@
6949
6949
  }
6950
6950
  },
6951
6951
  "node_modules/vue3-ace-editor": {
6952
- "version": "2.2.3",
6953
- "resolved": "https://registry.npmjs.org/vue3-ace-editor/-/vue3-ace-editor-2.2.3.tgz",
6954
- "integrity": "sha512-CkbiZSgIraZCBRa5egRqxDFUow5b949aHMcVgjce09O1n1TIJ8wVR++9mWg6F7lNWH47DkYSu0lwB6OocxUJ7g==",
6952
+ "version": "2.2.4",
6953
+ "resolved": "https://registry.npmjs.org/vue3-ace-editor/-/vue3-ace-editor-2.2.4.tgz",
6954
+ "integrity": "sha512-FZkEyfpbH068BwjhMyNROxfEI8135Sc+x8ouxkMdCNkuj/Tuw83VP/gStFQqZHqljyX9/VfMTCdTqtOnJZGN8g==",
6955
6955
  "dependencies": {
6956
6956
  "resize-observer-polyfill": "^1.5.1"
6957
6957
  },
@@ -19,7 +19,7 @@
19
19
  "@fortawesome/vue-fontawesome": "^3.0.3",
20
20
  "@vueuse/core": "^10.5.0",
21
21
  "@vueuse/router": "^10.5.0",
22
- "ace-builds": "^1.31.0",
22
+ "ace-builds": "^1.31.1",
23
23
  "axios": "^1.6.0",
24
24
  "bulma": "^0.9.4",
25
25
  "bulma-helpers": "^0.4.3",
@@ -34,17 +34,17 @@
34
34
  "vue-concurrency": "4.0.1",
35
35
  "vue-json-pretty": "^2.2.4",
36
36
  "vue-router": "^4.2.5",
37
- "vue3-ace-editor": "^2.2.3"
37
+ "vue3-ace-editor": "^2.2.4"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@redocly/cli": "1.4.0",
41
41
  "@rushstack/eslint-patch": "^1.5.1",
42
42
  "@tsconfig/node20": "^20.1.2",
43
43
  "@types/jsdom": "^21.1.4",
44
- "@types/node": "^20.8.9",
44
+ "@types/node": "^20.8.10",
45
45
  "@types/url-parse": "^1.4.10",
46
- "@typescript-eslint/eslint-plugin": "^6.9.0",
47
- "@typescript-eslint/parser": "^6.9.0",
46
+ "@typescript-eslint/eslint-plugin": "^6.9.1",
47
+ "@typescript-eslint/parser": "^6.9.1",
48
48
  "@vitejs/plugin-vue": "^4.4.0",
49
49
  "@vue/eslint-config-prettier": "^8.0.0",
50
50
  "@vue/eslint-config-typescript": "^12.0.0",
@@ -124,24 +124,11 @@ export default defineComponent({
124
124
 
125
125
  const artifact = ref<string | undefined>(undefined)
126
126
  const fromAt = ref<string | undefined>(undefined)
127
- const tagInput = toRef(props, "tag")
127
+ const tagInput = ref<string | undefined>(props.tag)
128
128
  const ruleId = ref<string | undefined>(undefined)
129
129
  const toAt = ref<string | undefined>(undefined)
130
- const asn = ref<number | undefined>(undefined)
131
- const dnsRecord = ref<string | undefined>(undefined)
132
- const reverseDnsName = ref<string | undefined>(undefined)
133
130
 
134
131
  const updateByQueryParams = () => {
135
- const asn_ = route.query["asn"]
136
- const normalizedAsn = normalizeQueryParam(asn_)
137
- asn.value = normalizedAsn === undefined ? undefined : parseInt(normalizedAsn)
138
-
139
- const dnsRecord_ = route.query["dnsRecord"]
140
- dnsRecord.value = normalizeQueryParam(dnsRecord_)
141
-
142
- const reverseDnsName_ = route.query["reverseDnsName"]
143
- reverseDnsName.value = normalizeQueryParam(reverseDnsName_)
144
-
145
132
  const tag_ = route.query["tag"]
146
133
  if (tagInput.value === undefined) {
147
134
  tagInput.value = normalizeQueryParam(tag_)
@@ -1,14 +1,8 @@
1
1
  <template>
2
2
  <div class="tags are-medium">
3
- <router-link
4
- class="tag"
5
- :to="{
6
- name: 'Alerts',
7
- query: { asn: autonomousSystem.asn }
8
- }"
9
- >
3
+ <span class="tag">
10
4
  {{ autonomousSystem.asn }}
11
- </router-link>
5
+ </span>
12
6
  </div>
13
7
  </template>
14
8
 
@@ -3,15 +3,9 @@
3
3
  <div class="control" v-for="(dnsRecord, index) in dnsRecords" :key="index">
4
4
  <div class="tags has-addons are-medium">
5
5
  <span class="tag is-dark"> {{ dnsRecord.resource }}</span>
6
- <router-link
7
- class="tag"
8
- :to="{
9
- name: 'Alerts',
10
- query: { dnsRecord: dnsRecord.value }
11
- }"
12
- >
6
+ <span class="tag">
13
7
  {{ truncate(dnsRecord.value, 50) }}
14
- </router-link>
8
+ </span>
15
9
  </div>
16
10
  </div>
17
11
  </div>
@@ -1,16 +1,8 @@
1
1
  <template>
2
2
  <div class="tags are-medium">
3
- <router-link
4
- class="tag"
5
- v-for="reverseDnsName in reverseDnsNames"
6
- :key="reverseDnsName.name"
7
- :to="{
8
- name: 'Alerts',
9
- query: { reverseDnsName: reverseDnsName.name }
10
- }"
11
- >
3
+ <span class="tag" v-for="reverseDnsName in reverseDnsNames" :key="reverseDnsName.name">
12
4
  {{ reverseDnsName.name }}
13
- </router-link>
5
+ </span>
14
6
  </div>
15
7
  </template>
16
8
 
@@ -20,7 +20,7 @@
20
20
  </div>
21
21
  <div class="control">
22
22
  <div class="tags has-addons are-medium">
23
- <span class="tag is-dark">Exipres on</span>
23
+ <span class="tag is-dark">Expires on</span>
24
24
  <span class="tag is-light">{{ whoisRecord.expiresOn || "N/A" }}</span>
25
25
  </div>
26
26
  </div>
data/lib/mihari/actor.rb CHANGED
@@ -4,9 +4,7 @@ module Mihari
4
4
  #
5
5
  # Base class for Analyzer, Emitter and Enricher
6
6
  #
7
- class Actor
8
- include Dry::Monads[:result, :try]
9
-
7
+ class Actor < Service
10
8
  include Mixins::Configurable
11
9
  include Mixins::Retriable
12
10
 
@@ -16,7 +14,9 @@ module Mihari
16
14
  #
17
15
  # @param [Hash, nil] options
18
16
  #
19
- def initialize(*_args, options: nil, **_kwargs)
17
+ def initialize(options: nil)
18
+ super()
19
+
20
20
  @options = options || {}
21
21
  end
22
22
 
@@ -57,6 +57,16 @@ module Mihari
57
57
  raise ConfigurationError, message
58
58
  end
59
59
 
60
+ def result
61
+ Try[StandardError] do
62
+ retry_on_error(
63
+ times: retry_times,
64
+ interval: retry_interval,
65
+ exponential_backoff: retry_exponential_backoff
66
+ ) { call }
67
+ end.to_result
68
+ end
69
+
60
70
  class << self
61
71
  #
62
72
  # @return [String]
@@ -2,6 +2,9 @@
2
2
 
3
3
  module Mihari
4
4
  module Analyzers
5
+ #
6
+ # Base class for analyzers
7
+ #
5
8
  class Base < Actor
6
9
  # @return [String]
7
10
  attr_reader :query
@@ -53,22 +56,20 @@ module Mihari
53
56
  # @return [Array<Mihari::Models::Artifact>]
54
57
  #
55
58
  def normalized_artifacts
56
- retry_on_error(times: retry_times, interval: retry_interval, exponential_backoff: retry_exponential_backoff) do
57
- artifacts.compact.sort.map do |artifact|
58
- # No need to set data_type manually
59
- # It is set automatically in #initialize
60
- artifact = artifact.is_a?(Models::Artifact) ? artifact : Models::Artifact.new(data: artifact)
61
- artifact.source = self.class.class_key
62
- artifact
63
- end.select(&:valid?).uniq(&:data)
64
- end
59
+ artifacts.compact.sort.map do |artifact|
60
+ # No need to set data_type manually
61
+ # It is set automatically in #initialize
62
+ artifact = artifact.is_a?(Models::Artifact) ? artifact : Models::Artifact.new(data: artifact)
63
+ artifact.source = self.class.class_key
64
+ artifact
65
+ end.select(&:valid?).uniq(&:data)
65
66
  end
66
67
 
67
68
  #
68
- # @return [Dry::Monads::Result::Success<Array<Mihari::Models::Artifact>>, Dry::Monads::Result::Failure]
69
+ # @return [Array<Mihari::Models::Artifact>]
69
70
  #
70
- def result
71
- Try[StandardError] { normalized_artifacts }.to_result
71
+ def call
72
+ normalized_artifacts
72
73
  end
73
74
 
74
75
  class << self
@@ -2,6 +2,9 @@
2
2
 
3
3
  module Mihari
4
4
  module Analyzers
5
+ #
6
+ # BinaryEdge analyzer
7
+ #
5
8
  class BinaryEdge < Base
6
9
  # @return [String, nil]
7
10
  attr_reader :api_key
@@ -32,7 +35,7 @@ module Mihari
32
35
  # @return [Mihari::Clients::BinaryEdge]
33
36
  #
34
37
  def client
35
- @client ||= Clients::BinaryEdge.new(
38
+ Clients::BinaryEdge.new(
36
39
  api_key: api_key,
37
40
  pagination_interval: pagination_interval,
38
41
  timeout: timeout
@@ -2,6 +2,9 @@
2
2
 
3
3
  module Mihari
4
4
  module Analyzers
5
+ #
6
+ # Censys analyzer
7
+ #
5
8
  class Censys < Base
6
9
  # @return [String, nil]
7
10
  attr_reader :id
@@ -12,7 +15,6 @@ module Mihari
12
15
  #
13
16
  # @param [String] query
14
17
  # @param [hash, nil] options
15
- # @param [String, nil] api_key
16
18
  # @param [String, nil] id
17
19
  # @param [String, nil] secret
18
20
  #
@@ -52,7 +54,7 @@ module Mihari
52
54
  # @return [Mihari::Clients::Censys]
53
55
  #
54
56
  def client
55
- @client ||= Clients::Censys.new(
57
+ Clients::Censys.new(
56
58
  id: id,
57
59
  secret: secret,
58
60
  pagination_interval: pagination_interval,