torizon_audit 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/torizon_audit.rb +15 -11
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2c50971c4656b798f91fc6c5425f9980f87e787dfee2c298c96621935b505923
|
|
4
|
+
data.tar.gz: dffd561304c72e55c5d0d77abc578fc27aeed8c387de97579c6dd186fd719032
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e7081b8c8313196678c72f38c70963a4e8cce844ed0ec35c89b94714206556e927319cab3ca36f5007e6178c252c2aa1383dd6bc247f082b047969222d466f3c
|
|
7
|
+
data.tar.gz: 26cb791aef470cae8b5def32a70f25d5a235989fef4b721105b687c97c52ccfc2ccc619cc3980cd9a8f70cde5b6b593599bce39ce5652219954dc69a81403566
|
data/lib/torizon_audit.rb
CHANGED
|
@@ -128,20 +128,24 @@ class Audit
|
|
|
128
128
|
actions = response["hits"]["hits"].map{ |obj|
|
|
129
129
|
src = obj["_source"]
|
|
130
130
|
{
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
"
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
131
|
+
"time" => DateTime.parse(src.key?("@timestamp") ? src["@timestamp"]: ""),
|
|
132
|
+
"host" => "app.torizon.io",
|
|
133
|
+
"source" => "torizon",
|
|
134
|
+
"event" => {
|
|
135
|
+
"path" => src.key?("uri") ? src["uri"]: "",
|
|
136
|
+
"method" => src.key?("request_method") ? src["request_method"] : "",
|
|
137
|
+
"namespace" => src.key?("namespace") ? src["namespace"]: "",
|
|
138
|
+
"origin_namespace" => src.key?("origin_namespace") ? src["origin_namespace"]: "",
|
|
139
|
+
"status_code" => src.key?("status") ? src["status"]: "",
|
|
140
|
+
"ip" => src.key?("client_addr") ? src["client_addr"]: "",
|
|
141
|
+
"query" => src.key?("query_string") ? src["query_string"]: "",
|
|
142
|
+
"log_id" => obj.key?("_id") ? obj["_id"]: "",
|
|
143
|
+
"action" => self.findAction(src.key?("request_method") ? src["request_method"] : "", src.key?("uri") ? src["uri"]: "")
|
|
144
|
+
}
|
|
141
145
|
}
|
|
142
146
|
}
|
|
143
147
|
if dropUnknownActions
|
|
144
|
-
return actions.select{|req| req["action"] != "Unknown Action"}
|
|
148
|
+
return actions.select{|req| req["event"]["action"] != "Unknown Action"}
|
|
145
149
|
end
|
|
146
150
|
return actions
|
|
147
151
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: torizon_audit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ben Clouser
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-03-
|
|
11
|
+
date: 2023-03-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Fetch user actions from torizon platform
|
|
14
14
|
email: ben.clouser@toradex.com
|