mihari 5.7.0 → 5.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -1
  3. data/lib/mihari/actor.rb +10 -4
  4. data/lib/mihari/cli/main.rb +2 -0
  5. data/lib/mihari/clients/base.rb +23 -1
  6. data/lib/mihari/clients/binaryedge.rb +1 -3
  7. data/lib/mihari/clients/censys.rb +1 -2
  8. data/lib/mihari/clients/crtsh.rb +2 -3
  9. data/lib/mihari/clients/dnstwister.rb +1 -2
  10. data/lib/mihari/clients/fofa.rb +1 -3
  11. data/lib/mihari/clients/greynoise.rb +1 -2
  12. data/lib/mihari/clients/hunterhow.rb +1 -2
  13. data/lib/mihari/clients/misp.rb +1 -2
  14. data/lib/mihari/clients/onyphe.rb +1 -2
  15. data/lib/mihari/clients/otx.rb +2 -14
  16. data/lib/mihari/clients/passivetotal.rb +3 -16
  17. data/lib/mihari/clients/publsedive.rb +2 -17
  18. data/lib/mihari/clients/securitytrails.rb +3 -25
  19. data/lib/mihari/clients/shodan.rb +1 -2
  20. data/lib/mihari/clients/the_hive.rb +1 -2
  21. data/lib/mihari/clients/urlscan.rb +1 -2
  22. data/lib/mihari/clients/virustotal.rb +3 -17
  23. data/lib/mihari/clients/zoomeye.rb +9 -19
  24. data/lib/mihari/commands/alert.rb +11 -9
  25. data/lib/mihari/commands/database.rb +4 -1
  26. data/lib/mihari/commands/mixins.rb +11 -0
  27. data/lib/mihari/commands/search.rb +13 -32
  28. data/lib/mihari/constants.rb +1 -1
  29. data/lib/mihari/database.rb +1 -1
  30. data/lib/mihari/enrichers/ipinfo.rb +1 -1
  31. data/lib/mihari/entities/tag.rb +1 -0
  32. data/lib/mihari/http.rb +13 -11
  33. data/lib/mihari/rule.rb +14 -0
  34. data/lib/mihari/service.rb +12 -2
  35. data/lib/mihari/services/alert_builder.rb +81 -8
  36. data/lib/mihari/services/alert_runner.rb +3 -10
  37. data/lib/mihari/services/rule_builder.rb +8 -10
  38. data/lib/mihari/services/rule_runner.rb +2 -25
  39. data/lib/mihari/structs/binaryedge.rb +9 -0
  40. data/lib/mihari/structs/censys.rb +0 -14
  41. data/lib/mihari/structs/fofa.rb +3 -0
  42. data/lib/mihari/structs/google_public_dns.rb +0 -4
  43. data/lib/mihari/structs/greynoise.rb +0 -6
  44. data/lib/mihari/structs/hunterhow.rb +0 -6
  45. data/lib/mihari/structs/ipinfo.rb +0 -2
  46. data/lib/mihari/structs/onyphe.rb +0 -4
  47. data/lib/mihari/structs/shodan.rb +0 -2
  48. data/lib/mihari/structs/urlscan.rb +0 -6
  49. data/lib/mihari/structs/virustotal_intelligence.rb +0 -8
  50. data/lib/mihari/version.rb +1 -1
  51. data/lib/mihari/web/app.rb +20 -17
  52. data/lib/mihari/web/endpoints/alerts.rb +75 -38
  53. data/lib/mihari/web/endpoints/artifacts.rb +60 -53
  54. data/lib/mihari/web/endpoints/ip_addresses.rb +19 -4
  55. data/lib/mihari/web/endpoints/rules.rb +132 -88
  56. data/lib/mihari/web/endpoints/tags.rb +15 -13
  57. data/lib/mihari/web/middleware/error_notification_adapter.rb +8 -3
  58. data/lib/mihari/web/public/assets/{index-821134e2.js → index-ec641cb0.js} +45 -44
  59. data/lib/mihari/web/public/index.html +1 -1
  60. data/lib/mihari/web/public/redoc-static.html +400 -400
  61. data/lib/mihari.rb +0 -2
  62. data/mihari.gemspec +5 -5
  63. data/mkdocs.yml +14 -7
  64. metadata +13 -140
  65. data/docs/alternatives.md +0 -5
  66. data/docs/analyzers/binaryedge.md +0 -26
  67. data/docs/analyzers/censys.md +0 -31
  68. data/docs/analyzers/circl.md +0 -37
  69. data/docs/analyzers/crtsh.md +0 -26
  70. data/docs/analyzers/dnstwister.md +0 -25
  71. data/docs/analyzers/feed.md +0 -73
  72. data/docs/analyzers/fofa.md +0 -31
  73. data/docs/analyzers/greynoise.md +0 -26
  74. data/docs/analyzers/hunterhow.md +0 -33
  75. data/docs/analyzers/index.md +0 -104
  76. data/docs/analyzers/onyphe.md +0 -26
  77. data/docs/analyzers/otx.md +0 -28
  78. data/docs/analyzers/passivetotal.md +0 -52
  79. data/docs/analyzers/pulsedive.md +0 -28
  80. data/docs/analyzers/securitytrails.md +0 -41
  81. data/docs/analyzers/shodan.md +0 -26
  82. data/docs/analyzers/urlscan.md +0 -28
  83. data/docs/analyzers/virustotal.md +0 -43
  84. data/docs/analyzers/virustotal_intelligence.md +0 -33
  85. data/docs/analyzers/zoomeye.md +0 -38
  86. data/docs/configuration.md +0 -35
  87. data/docs/emitters/database.md +0 -22
  88. data/docs/emitters/hive.md +0 -26
  89. data/docs/emitters/index.md +0 -36
  90. data/docs/emitters/misp.md +0 -21
  91. data/docs/emitters/slack.md +0 -21
  92. data/docs/emitters/webhook.md +0 -63
  93. data/docs/enrichers/google_public_dns.md +0 -19
  94. data/docs/enrichers/index.md +0 -35
  95. data/docs/enrichers/ipinfo.md +0 -26
  96. data/docs/enrichers/shodan.md +0 -22
  97. data/docs/enrichers/whois.md +0 -17
  98. data/docs/github_actions.md +0 -43
  99. data/docs/index.md +0 -11
  100. data/docs/installation.md +0 -31
  101. data/docs/requirements.md +0 -13
  102. data/docs/rule.md +0 -168
  103. data/docs/tags.md +0 -3
  104. data/docs/usage.md +0 -103
  105. data/frontend/.eslintrc.cjs +0 -22
  106. data/frontend/.gitignore +0 -31
  107. data/frontend/.prettierrc.json +0 -8
  108. data/frontend/README.md +0 -3
  109. data/frontend/env.d.ts +0 -5
  110. data/frontend/index.html +0 -21
  111. data/frontend/package-lock.json +0 -7219
  112. data/frontend/package.json +0 -67
  113. data/frontend/public/favicon.ico +0 -0
  114. data/frontend/scripts/swagger_doc_to_yaml.rb +0 -23
  115. data/frontend/src/App.vue +0 -27
  116. data/frontend/src/ace-config.ts +0 -6
  117. data/frontend/src/api-helper.ts +0 -111
  118. data/frontend/src/api.ts +0 -105
  119. data/frontend/src/components/ErrorMessage.vue +0 -31
  120. data/frontend/src/components/Loading.vue +0 -15
  121. data/frontend/src/components/Navbar.vue +0 -42
  122. data/frontend/src/components/Pagination.vue +0 -119
  123. data/frontend/src/components/alert/Alert.vue +0 -87
  124. data/frontend/src/components/alert/Alerts.vue +0 -63
  125. data/frontend/src/components/alert/AlertsWithPagination.vue +0 -90
  126. data/frontend/src/components/alert/AlertsWrapper.vue +0 -128
  127. data/frontend/src/components/alert/Form.vue +0 -169
  128. data/frontend/src/components/artifact/AS.vue +0 -23
  129. data/frontend/src/components/artifact/Artifact.vue +0 -287
  130. data/frontend/src/components/artifact/ArtifactTag.vue +0 -64
  131. data/frontend/src/components/artifact/ArtifactTags.vue +0 -29
  132. data/frontend/src/components/artifact/ArtifactWrapper.vue +0 -57
  133. data/frontend/src/components/artifact/CPEs.vue +0 -23
  134. data/frontend/src/components/artifact/DnsRecords.vue +0 -32
  135. data/frontend/src/components/artifact/Ports.vue +0 -23
  136. data/frontend/src/components/artifact/ReverseDnsNames.vue +0 -23
  137. data/frontend/src/components/artifact/Tags.vue +0 -29
  138. data/frontend/src/components/artifact/WhoisRecord.vue +0 -44
  139. data/frontend/src/components/config/Configs.vue +0 -65
  140. data/frontend/src/components/config/ConfigsWrapper.vue +0 -32
  141. data/frontend/src/components/link/Link.vue +0 -32
  142. data/frontend/src/components/link/Links.vue +0 -42
  143. data/frontend/src/components/rule/EditRule.vue +0 -72
  144. data/frontend/src/components/rule/EditRuleWrapper.vue +0 -48
  145. data/frontend/src/components/rule/Form.vue +0 -158
  146. data/frontend/src/components/rule/InputForm.vue +0 -45
  147. data/frontend/src/components/rule/NewRule.vue +0 -57
  148. data/frontend/src/components/rule/Rule.vue +0 -100
  149. data/frontend/src/components/rule/RuleWrapper.vue +0 -53
  150. data/frontend/src/components/rule/Rules.vue +0 -84
  151. data/frontend/src/components/rule/RulesWrapper.vue +0 -121
  152. data/frontend/src/components/rule/YAML.vue +0 -37
  153. data/frontend/src/components/tag/Tag.vue +0 -65
  154. data/frontend/src/components/tag/Tags.vue +0 -37
  155. data/frontend/src/countries.ts +0 -350
  156. data/frontend/src/index.ts +0 -20
  157. data/frontend/src/links/anyrun.ts +0 -19
  158. data/frontend/src/links/base.ts +0 -14
  159. data/frontend/src/links/censys.ts +0 -20
  160. data/frontend/src/links/crtsh.ts +0 -20
  161. data/frontend/src/links/dnslytics.ts +0 -38
  162. data/frontend/src/links/greynoise.ts +0 -20
  163. data/frontend/src/links/index.ts +0 -40
  164. data/frontend/src/links/intezer.ts +0 -20
  165. data/frontend/src/links/otx.ts +0 -33
  166. data/frontend/src/links/securitytrails.ts +0 -38
  167. data/frontend/src/links/shodan.ts +0 -20
  168. data/frontend/src/links/urlscan.ts +0 -50
  169. data/frontend/src/links/virustotal.ts +0 -72
  170. data/frontend/src/main.ts +0 -41
  171. data/frontend/src/router/index.ts +0 -57
  172. data/frontend/src/rule.ts +0 -14
  173. data/frontend/src/shims-vue.d.ts +0 -6
  174. data/frontend/src/swagger.yaml +0 -771
  175. data/frontend/src/types.ts +0 -188
  176. data/frontend/src/utils.ts +0 -54
  177. data/frontend/src/views/Alerts.vue +0 -20
  178. data/frontend/src/views/Artifact.vue +0 -39
  179. data/frontend/src/views/Configs.vue +0 -20
  180. data/frontend/src/views/EditRule.vue +0 -39
  181. data/frontend/src/views/NewRule.vue +0 -26
  182. data/frontend/src/views/Rule.vue +0 -39
  183. data/frontend/src/views/Rules.vue +0 -20
  184. data/frontend/tests/utils.spec.ts +0 -9
  185. data/frontend/tsconfig.app.json +0 -21
  186. data/frontend/tsconfig.json +0 -14
  187. data/frontend/tsconfig.node.json +0 -13
  188. data/frontend/tsconfig.vitest.json +0 -12
  189. data/frontend/vite.config.ts +0 -24
  190. data/frontend/vitest.config.ts +0 -21
  191. data/lib/mihari/mixins/error_notification.rb +0 -21
  192. data/lib/mihari/services/alert_proxy.rb +0 -97
@@ -1,19 +0,0 @@
1
- ---
2
- tags:
3
- - Enrichment:DNS_Record
4
- ---
5
-
6
- # Google Public DNS
7
-
8
- - [https://developers.google.com/speed/public-dns](https://developers.google.com/speed/public-dns)
9
-
10
- This enricher uses Google Public DNS to enrich an URL and domain artifact.
11
-
12
- ```yaml
13
- enricher: google_public_dns
14
- ```
15
-
16
- ## Supported Artifacts
17
-
18
- - URL
19
- - Domain
@@ -1,35 +0,0 @@
1
- # Enrichers
2
-
3
- - [Google Public DNS](google_public_dns.md)
4
- - [IPInfo](ipinfo.md)
5
- - [Shodan](shodan.md)
6
- - [Whois](whois.md)
7
-
8
- ## Options
9
-
10
- All the emitters can have optional `options`.
11
-
12
- ```yaml
13
- enricher: ...
14
- options:
15
- timeout: ...
16
- retry_times: ...
17
- retry_interval: ...
18
- retry_exponential_backoff: ...
19
- ```
20
-
21
- ### Timeout
22
-
23
- `timeout` (`integer`) is an HTTP timeout in seconds. Optional.
24
-
25
- ### Retry Times
26
-
27
- `retry_times` (`integer`) is a number of times of retry when something goes wrong. Optional. Defaults to 3.
28
-
29
- ### Retry Interval
30
-
31
- `retry_interval` (`integer`) is an interval in seconds between retries. Optional. Defaults to 5.
32
-
33
- ### Retry Exponential Backoff
34
-
35
- `retry_exponential_backoff` (`bool`) controls whether to do exponential backoff. Optional. Defaults to `true`.
@@ -1,26 +0,0 @@
1
- ---
2
- tags:
3
- - Enrichment:Autonomous_System
4
- - Enrichment:Geolocation
5
- ---
6
-
7
- # ipinfo.io
8
-
9
- - [https://ipinfo.io/](https://ipinfo.io/)
10
-
11
- This enricher uses ipinfo.io API to enrich an IP artifact.
12
-
13
- ```yaml
14
- enricher: ipinfo
15
- api_key: ...
16
- ```
17
-
18
- ## Components
19
-
20
- ### API Key
21
-
22
- `api_key` (`string`) is an API key. Optional. Defaults to `ENV[”IPINFO_API_KEY”]`.
23
-
24
- ## Supported Artifacts
25
-
26
- - IP address
@@ -1,22 +0,0 @@
1
- ---
2
- tags:
3
- - Enrichment:Port
4
- - Enrichment:CPE
5
- - Enrichment:DNS_Record
6
- ---
7
-
8
- # Shodan (The InternetDB API)
9
-
10
- - [https://www.shodan.io/](https://www.shodan.io/dashboard)
11
-
12
- This enricher uses Shodan InternetDB API to enrich an artifact.
13
-
14
- [https://internetdb.shodan.io/](https://internetdb.shodan.io/)
15
-
16
- ```yaml
17
- enricher: shodan
18
- ```
19
-
20
- ## Supported Artifacts
21
-
22
- - IP address
@@ -1,17 +0,0 @@
1
- ---
2
- tags:
3
- - Enrichment:Whois
4
- ---
5
-
6
- # Whois
7
-
8
- This enricher uses “whois” command to enrich an artifact.
9
-
10
- ```yaml
11
- enricher: whois
12
- ```
13
-
14
- ## Supported Artifacts
15
-
16
- - URL
17
- - Domain
@@ -1,43 +0,0 @@
1
- # GitHub Actions
2
-
3
- GitHub Actions is a good way to run Mihari searches continuously.
4
-
5
- The following is an example of a GitHub Actions workflow to run Mihari.
6
-
7
- ```yaml
8
- name: Mihari searches
9
-
10
- on:
11
- workflow_dispatch:
12
-
13
- jobs:
14
- build:
15
- runs-on: ubuntu-latest
16
- steps:
17
- - uses: actions/checkout@v4
18
- - name: Install dependencies
19
- run: sudo apt-get -yqq install sqlite3 libsqlite3-dev
20
- - name: Set up Ruby 3.2
21
- uses: ruby/setup-ruby@v1
22
- with:
23
- ruby-version: "3.2"
24
- bundler-cache: true
25
- - name: Run Mihari
26
- run: |
27
- mihari search /path/to/rule.yml
28
- ```
29
-
30
- !!! tip
31
-
32
- You need to install `libpq-dev` for PostgreSQL, `libmysqlclient-dev` for MySQL.
33
-
34
- This example assumes that you have `Gemfile` in your repository.
35
-
36
- ```ruby
37
- source "https://rubygems.org"
38
-
39
- gem "pg" # if you use PostgresSQL
40
- gem "mysql2" # if you use MySQL
41
-
42
- gem "mihari"
43
- ```
data/docs/index.md DELETED
@@ -1,11 +0,0 @@
1
- # Mihari
2
-
3
- A query aggregator for OSINT based threat hunting.
4
-
5
- Mihari can aggregate multiple searches across multiple services in a single rule & persist findings in a database.
6
-
7
- - [Requirements](./requirements.md)
8
- - [Installation](./installation.md)
9
- - [How to Write a Rule](./rule.md)
10
- - [Usage](./usage.md)
11
- - [Configuration](./configuration.md)
data/docs/installation.md DELETED
@@ -1,31 +0,0 @@
1
- # Installation
2
-
3
- ## Ruby Gem
4
-
5
- Mihari is packaged as a Ruby Gem. Thus you can install it via `gem` command.
6
-
7
- ```bash
8
- gem install mihari
9
- ```
10
-
11
- Mihari uses SQLite3 as a primary database by default. Thus a gem for SQLite (`sqlite3`) is installed by default.
12
-
13
- If you want to use MySQL or PostgreSQL instead of SQLite3, please install a gem for that by yourself.
14
-
15
- **MySQL**
16
-
17
- ```bash
18
- gem install mysql2
19
- ```
20
-
21
- **PostgreSQL**
22
-
23
- ```bash
24
- gem install pg
25
- ```
26
-
27
- # Docker
28
-
29
- You can built the Docker image by yourself.
30
-
31
- `Dockerfile` is available at [https://github.com/ninoseki/mihari/tree/master/docker](https://github.com/ninoseki/mihari/tree/master/docker).
data/docs/requirements.md DELETED
@@ -1,13 +0,0 @@
1
- # Requirements
2
-
3
- ## Runtime
4
-
5
- Ruby 2.7+ / 3.0+ (tested with 2.7, 3.0, 3.1 and 3.2)
6
-
7
- ## Database
8
-
9
- - SQLite3
10
- - PostgreSQL
11
- - MySQL
12
-
13
- You need to have a database to persistent the data. See [Database](./emitters/database.md) for details.
data/docs/rule.md DELETED
@@ -1,168 +0,0 @@
1
- # How to Write a Rule
2
-
3
- Mihari has [Sigma](https://github.com/SigmaHQ/sigma) like format to describe a set of search queries to express a rule.
4
-
5
- Mihari has three main components to compose a rule.
6
-
7
- ![](https://imgur.com/BBT99BG.png)
8
-
9
- - Analyzers/Queries: a list of queries (analyzers) that builds a list of artifacts
10
- - Enrichers: a list of enrichers that enriches a list of artifacts
11
- - Emitters: a list of emitters that emits a list of artifacts as an alert
12
-
13
- An artifact has five types:
14
-
15
- - IP address (`ip`)
16
- - Domain (`domain`)
17
- - URL (`url`)
18
- - Mail (`mail`)
19
- - Hash (`hash`)
20
-
21
- An alert can have multiple artifacts bundled by a rule.
22
-
23
- !!! note
24
-
25
- A rule is assumed to be executed multiple times continuously. An alert generated by a rule will only have new findings at that time.
26
-
27
- Let's break down the following example:
28
-
29
- ```yaml
30
- id: c7f6968e-dbe1-4612-b0bb-8407a4fe05df
31
- title: Example
32
- description: Mihari rule example
33
- created_on: "2023-01-01"
34
- updated_on: "2023-01-02"
35
- author: ninoseki
36
- references:
37
- - https://github.com/ninoseki/mihari
38
- related:
39
- - 6254bb74-5e5d-42ad-bc1e-231da0293b0f
40
- tags:
41
- - foo
42
- - bar
43
- queries:
44
- - analyzer: shodan
45
- query: ip:1.1.1.1
46
- - analyzer: censys
47
- query: ip:8.8.8.8
48
- enrichers:
49
- - enricher: whois
50
- - enricher: ipinfo
51
- - enricher: shodan
52
- - enricher: google_public_dns
53
- emitters:
54
- - emitter: database
55
- - emitter: misp
56
- - emitter: slack
57
- - emitter: thehive
58
- data_types:
59
- - hash
60
- - ip
61
- - domain
62
- - url
63
- - mail
64
- falsepositives: []
65
- ```
66
-
67
- ## Components
68
-
69
- ### ID
70
-
71
- `id` (`string`) is an unique ID of a rule. UUID v4 is recommended.
72
-
73
- ### Title
74
-
75
- `title` (`string`) is a title of a rule.
76
-
77
- ### Description
78
-
79
- `description` (`string`) is a short description of a rule.
80
-
81
- ### Created/Updated On
82
-
83
- `created_on` (`date`) is a date of a rule creation. Optional.
84
- Also a rule can have `updated_on` that is a date of a rule modification. Optional.
85
-
86
- ### Tags
87
-
88
- `tags` (`array[:string]`) is a list of tags of a rule.
89
-
90
- ### Author
91
-
92
- `author` (`string`) is an author of a rule. Optional.
93
-
94
- ### References
95
-
96
- `references` (`array[:string]`) is a list of a references of a rule. Optional.
97
-
98
- ### Related
99
-
100
- `related` (`array[:string]`) is a list of related rule IDs. Optional.
101
-
102
- ### Queries
103
-
104
- `queries` is a list of queries/analyzers.
105
- See [Analyzers](./analyzers/index.md) to know details of each analyzer.
106
-
107
- ### Enrichers
108
-
109
- `enrichers` is a list of enrichers.
110
- See [Enrichers](./enrichers/index.md) to know details of each enricher.
111
-
112
- Defaults to:
113
-
114
- - `google_public_dns`
115
- - `ipinfo`
116
- - `shodan`
117
- - `whois`
118
-
119
- ### Emitters
120
-
121
- `emitters` is a list of emitters.
122
- See [Emitters](./emitters/index.md) to know details of each emitter.
123
-
124
- Defaults to:
125
-
126
- - `database`
127
-
128
- ### Data Types
129
-
130
- `data_types` (`array[:string]`) is a list of data (artifact) types to allow by a rule. Types not defined in here will be automatically rejected.
131
-
132
- Defaults to:
133
-
134
- - `ip`
135
- - `domain`
136
- - `url`
137
- - `mail`
138
- - `hash`
139
-
140
- ### False positives
141
-
142
- `falsepositives` (`array[:string]`) is a list of false positive values. A string or regexp can be used in here.
143
-
144
- ### Artifact TTL
145
-
146
- `artifact_ttl` (`integer` / alias: `artifact_lifetime`) is an integer value of artifact TTL (Time-To-Live) in seconds.
147
-
148
- Mihari rejects a same artifact in a same rule in general.
149
-
150
- But you may want to get a same artifact after a certain period of time. `artifact_ttl` is for that. If a rule finds a same artifact after `artifact_ttl` seconds have been passed, that artifact will be included in an alert.
151
-
152
- ## How to Run a Rule
153
-
154
- Once you finish writing a rule, you can run the rule by `mihari` CLI.
155
-
156
- !!! note
157
-
158
- You have to initialize the database by `mihari db migrate` if you haven't already done.
159
-
160
- ```bash
161
- mihari search /path/to/rule.yml
162
- ```
163
-
164
- The command outputs an alert to the standard output. Also you can confirm it with a built-in web app.
165
-
166
- ```bash
167
- mihari web
168
- ```
data/docs/tags.md DELETED
@@ -1,3 +0,0 @@
1
- # Tags
2
-
3
- [TAGS]
data/docs/usage.md DELETED
@@ -1,103 +0,0 @@
1
- # Usage
2
-
3
- ```bash
4
- $ mihari
5
- Commands:
6
- mihari --version, -v # Print the version
7
- mihari alert # Sub commands for alert
8
- mihari db # Sub commands for DB
9
- mihari help [COMMAND] # Describe available commands or one specific command
10
- mihari rule # Sub commands for rule
11
- mihari search [PATH_OR_ID] # Search by a rule (Outputs null if there is no new finding)
12
- mihari web # Launch the web app
13
-
14
- Options:
15
- -d, [--debug], [--no-debug] # Sets up debug mode
16
- ```
17
-
18
- ## `mihari db`
19
-
20
- This sub command is for initializing/migrating database.
21
-
22
- ```bash
23
- mihari db migrate
24
- ```
25
-
26
- See [Database](./emitters/database.md) for detailed database configuration.
27
-
28
- ## `mihari rule`
29
-
30
- This sub command is for validating/initializing a rule.
31
-
32
- ```bash
33
- mihari rule init /path/to/rule.yml
34
- mihari rule validate /path/to/rule.yml
35
- ```
36
-
37
- ## `mihari search`
38
-
39
- This is a command for running a rule.
40
-
41
- ```bash
42
- mihari search /path/to/rule.yml
43
- ```
44
-
45
- Mihari asks whether really you want to update a rule if there is a diff by default.
46
-
47
- ```bash
48
- $ mihari search /path/to/rule.yml
49
- There is a diff in the rule. Are you sure you want to overwrite the rule? (y/n)
50
- ```
51
-
52
- It can be suppressed by providing `-f`.
53
-
54
- ```bash
55
- mihari search -f /path/to/rule.yml
56
- ```
57
-
58
- ## `mihari add`
59
-
60
- You may want to add an alert manually. You can do that by this command.
61
-
62
- ```bash
63
- mihari alert /path/to/alert.yml
64
- ```
65
-
66
- ## `mihari web`
67
-
68
- This command is for launching the built-in web app.
69
-
70
- ```bash
71
- mihari web
72
- ```
73
-
74
- It stars the app with `localhost:9292`. You can configure it by providing options.
75
-
76
- ```bash
77
- $ mihari help web
78
- Usage:
79
- mihari web
80
-
81
- Options:
82
- [--port=N] # Hostname to listen on
83
- # Default: 9292
84
- [--host=HOST] # Port to listen on
85
- # Default: localhost
86
- [--threads=THREADS] # min:max threads to use
87
- # Default: 0:5
88
- [--verbose], [--no-verbose] # Report each request
89
- # Default: true
90
- [--worker-timeout=N] # Worker timeout value (in seconds)
91
- # Default: 60
92
- [--hide-config-values], [--no-hide-config-values] # Whether to hide config values or not
93
- # Default: true
94
- [--open], [--no-open] # Whether to open the app in browser or not
95
- # Default: true
96
- [--rack-env=RACK_ENV] # Rack environment
97
- # Default: production
98
- ```
99
-
100
- !!! tip
101
-
102
- The built-in web app offers API to interact with Mihari.
103
- The API docs are available on `/redoc-static.html`
@@ -1,22 +0,0 @@
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 DELETED
@@ -1,31 +0,0 @@
1
- # Logs
2
- logs
3
- *.log
4
- npm-debug.log*
5
- yarn-debug.log*
6
- yarn-error.log*
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/
19
-
20
- # Editor directories and files
21
- .vscode/*
22
- !.vscode/extensions.json
23
- .idea
24
- *.suo
25
- *.ntvs*
26
- *.njsproj
27
- *.sln
28
- *.sw?
29
-
30
- # redoc
31
- public/redoc-static.html
@@ -1,8 +0,0 @@
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/README.md DELETED
@@ -1,3 +0,0 @@
1
- # mihari-frontend
2
-
3
- A frontend app for [Mihari](https://github.com/ninoseki/mihari).
data/frontend/env.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /// <reference types="vite/client" />
2
-
3
- interface ImportMeta {
4
- readonly env: ImportMetaEnv
5
- }
data/frontend/index.html DELETED
@@ -1,21 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
- <meta name="viewport" content="width=device-width,initial-scale=1.0" />
7
- <link rel="icon" href="/favicon.ico" />
8
- <title>Mihari</title>
9
- </head>
10
- <body>
11
- <noscript>
12
- <strong
13
- >We're sorry but Mihari doesn't work properly without JavaScript
14
- enabled. Please enable it to continue.</strong
15
- >
16
- </noscript>
17
- <div id="app"></div>
18
- <script type="module" src="/src/main.ts"></script>
19
- <!-- built files will be auto injected -->
20
- </body>
21
- </html>