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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af8606455171a48a892d634755c4aff3c7778b101aba5110ffdec248ea558e0c
4
- data.tar.gz: 884ae738ee31ae3ec4fc4326bcc556492b5790e78652007cb6d013bf2f8e77e8
3
+ metadata.gz: 95bcd601b1d5da1ae6321897945e7e0c26403d8e00e838e177961b887201ba92
4
+ data.tar.gz: d0ee081fd7f62c09912a1ec579d0b36506f36812ec7dc3a2b9ee7699885399a3
5
5
  SHA512:
6
- metadata.gz: 4a1f8c7a513339aa1d50c79100f8db1d3f1d74889158f7726582c23fdd42afe4577e4a4a1509540b0fae5a1c68a1b1d19255cb107b9085b465805caca46c2d61
7
- data.tar.gz: 4eb80ab4c57abb29ef09feffbd4ef303b655e7182f9149ddb5e625514ad0d585da39aa01cf1f1cc8494f8320e32bdf07b1aed5ea1e08cf250449b5d210e18675
6
+ metadata.gz: '053815e2ecfac88a95cb894d566f8acc57e8047104108fa79b58c1290d99157a7cf01a068c1aa6b568d27cd02eec0dc541950baf3085aefa5feb985f87754e32'
7
+ data.tar.gz: ac054dfc7e0fb84530ac15da1a14059b6af597ce02464cb1430ad9fd38eacf40a1eefd01cfb3892e5d3c9c58ff8a6f1e7d1f007e27e39782f3fdba3855ffbc56
data/.gitignore CHANGED
@@ -63,4 +63,7 @@ mihari.yml
63
63
 
64
64
  # Rule
65
65
  rule.yml
66
- !lib/mihari/templates/rule.yml
66
+ !lib/mihari/templates/rule.yml
67
+
68
+ # Frontend assets
69
+ lib/mihari/web/public/
data/README.md CHANGED
@@ -9,12 +9,6 @@
9
9
 
10
10
  <p align="center">
11
11
  <img src="https://github.com/ninoseki/mihari/raw/master/images/logo.png"/>
12
- <br/>
13
- <a href="https://tines.io?utm_source=github&utm_medium=sponsorship&utm_campaign=ninoseki">
14
- <img src="https://github.com/ninoseki/mihari/raw/master/images/Tines-Full_Logo-Tines_Black.png"/>
15
- </a>
16
- <br/>
17
- Mihari is proudly supported by <a href="https://tines.io?utm_source=github&utm_medium=sponsorship&utm_campaign=ninoseki">Tines</a>
18
12
  </p>
19
13
 
20
14
  ---
@@ -68,7 +62,3 @@ Mihari supports the following services by default.
68
62
  ## License
69
63
 
70
64
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
71
-
72
- ## Acknowledgement
73
-
74
- Mihari is proudly supported by [Tines.io](https://tines.io?utm_source=github&utm_medium=sponsorship&utm_campaign=ninoseki), The SOAR Platform for Enterprise Security Teams.
data/Rakefile CHANGED
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "bundler/gem_tasks"
4
3
  require "rspec/core/rake_task"
5
4
  require "standard/rake"
6
5
 
@@ -12,3 +11,16 @@ desc "run rackup (via rerun)"
12
11
  task :rackup do
13
12
  sh "rerun --pattern '{Gemfile.lock,lib/**/*.rb,lib/*.rb}' -- rackup config.ru"
14
13
  end
14
+
15
+ def ci?
16
+ ENV.fetch("CI", false)
17
+ end
18
+
19
+ unless ci?
20
+ task :build do
21
+ sh "./build_frontend.sh"
22
+ end
23
+ end
24
+
25
+ # require it later enables doing pre-build step (= build the frontend app)
26
+ require "bundler/gem_tasks"
data/build_frontend.sh CHANGED
@@ -3,7 +3,7 @@
3
3
  CURRENT_DIR=${PWD}
4
4
 
5
5
  cd frontend
6
- npm install
6
+ npm ci
7
7
  npm run build
8
8
 
9
9
  trash -r ${CURRENT_DIR}/lib/mihari/web/public/
@@ -0,0 +1,22 @@
1
+ /* eslint-env node */
2
+ require('@rushstack/eslint-patch/modern-module-resolution')
3
+
4
+ module.exports = {
5
+ root: true,
6
+ extends: [
7
+ 'plugin:vue/vue3-essential',
8
+ 'eslint:recommended',
9
+ '@vue/eslint-config-typescript',
10
+ '@vue/eslint-config-prettier/skip-formatting'
11
+ ],
12
+ plugins: ['simple-import-sort'],
13
+ rules: {
14
+ 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
15
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
16
+ 'simple-import-sort/imports': 'error',
17
+ 'simple-import-sort/exports': 'error'
18
+ },
19
+ parserOptions: {
20
+ ecmaVersion: 'latest'
21
+ }
22
+ }
data/frontend/.gitignore CHANGED
@@ -1,25 +1,31 @@
1
- .DS_Store
2
- node_modules
3
- /dist
4
-
5
-
6
- # local env files
7
- .env.local
8
- .env.*.local
9
-
10
- # Log files
1
+ # Logs
2
+ logs
3
+ *.log
11
4
  npm-debug.log*
12
5
  yarn-debug.log*
13
6
  yarn-error.log*
14
7
  pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ .DS_Store
12
+ dist
13
+ dist-ssr
14
+ coverage
15
+ *.local
16
+
17
+ /cypress/videos/
18
+ /cypress/screenshots/
15
19
 
16
20
  # Editor directories and files
21
+ .vscode/*
22
+ !.vscode/extensions.json
17
23
  .idea
18
- .vscode
19
24
  *.suo
20
25
  *.ntvs*
21
26
  *.njsproj
22
27
  *.sln
23
28
  *.sw?
24
29
 
25
- public/redoc-static.html
30
+ # redoc
31
+ public/redoc-static.html
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/prettierrc",
3
+ "semi": false,
4
+ "tabWidth": 2,
5
+ "singleQuote": false,
6
+ "printWidth": 100,
7
+ "trailingComma": "none"
8
+ }
data/frontend/env.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ interface ImportMeta {
4
+ readonly env: ImportMetaEnv
5
+ }