soar_auditing_provider 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebfdb8104eec62c09b2cededb46baf15deef4b7d
|
4
|
+
data.tar.gz: 40402d8ca6b5ba7c9fec5af4d1c4176699fac30d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c36e13ea97ff6c23aea46a1f68a01da06dd5de11fe14b8a887852d4de0a3d594cbeb8a482d4e845e22a067b26baa40647f9891eb8f135cfff9647d4897b6a4ff
|
7
|
+
data.tar.gz: dc8575546159d0118be6912b8f31845dfab2eea588817c1cef9038d0cd16120bf4bb35806f0b0c598cee2010cd8abaf83464a9269a69152c92dd16dd420bef29
|
@@ -20,9 +20,9 @@ module SoarAuditingProvider
|
|
20
20
|
|
21
21
|
DEFAULT_FLOW_ID_GENERATOR = -> { SoarFlow::ID::generate_flow_id } unless defined?(DEFAULT_FLOW_ID_GENERATOR)
|
22
22
|
|
23
|
-
attr_accessor :startup_flow_id
|
24
23
|
attr_accessor :service_identifier
|
25
24
|
attr_reader :configuration
|
25
|
+
attr_writer :startup_flow_id
|
26
26
|
|
27
27
|
def initialize(configuration)
|
28
28
|
validate_provider_configuration(configuration)
|
@@ -36,6 +36,10 @@ module SoarAuditingProvider
|
|
36
36
|
initialize_metrics
|
37
37
|
end
|
38
38
|
|
39
|
+
def startup_flow_id
|
40
|
+
@startup_flow_id ||= @flow_id_generator.call
|
41
|
+
end
|
42
|
+
|
39
43
|
def select_auditor(nfrs)
|
40
44
|
select(nfrs)
|
41
45
|
set_audit_level(@configuration['level'].to_sym)
|
@@ -83,7 +87,7 @@ module SoarAuditingProvider
|
|
83
87
|
def audit_exception(exception:, level: :error, flow_id: nil, message: nil)
|
84
88
|
exception_message = "#{exception.class}: #{exception.message}"
|
85
89
|
exception_message = "#{message} - #{exception_message}" if message
|
86
|
-
exception_message = exception_message + ":\n\t" + exception.backtrace.join("\n\t")
|
90
|
+
exception_message = exception_message + ":\n\t" + exception.backtrace.join("\n\t")
|
87
91
|
level = :error if not is_valid_audit_level?(level)
|
88
92
|
send(level,exception_message,flow_id)
|
89
93
|
end
|
@@ -107,8 +111,8 @@ module SoarAuditingProvider
|
|
107
111
|
end
|
108
112
|
|
109
113
|
def exit_cleanup(exception = nil)
|
110
|
-
audit_exception(exception: exception, level: :fatal, flow_id:
|
111
|
-
info("Application exit"
|
114
|
+
audit_exception(exception: exception, level: :fatal, flow_id: startup_flow_id) if exception
|
115
|
+
info("Application exit",startup_flow_id)
|
112
116
|
flush
|
113
117
|
end
|
114
118
|
|
@@ -192,7 +196,7 @@ module SoarAuditingProvider
|
|
192
196
|
{
|
193
197
|
'audit_buffer_overflows' => @buffer_overflow_count,
|
194
198
|
'enqueued_audit_events' => @enqueued_audit_events,
|
195
|
-
'startup_flow_id' =>
|
199
|
+
'startup_flow_id' => startup_flow_id,
|
196
200
|
'startup_timestamp' => @startup_timestamp
|
197
201
|
}
|
198
202
|
end
|
@@ -109,7 +109,7 @@ module SoarAuditingProvider
|
|
109
109
|
|
110
110
|
def print_exception_with_message_to_stderr(notification,exception)
|
111
111
|
message = "#{exception.class}: #{exception.message}"
|
112
|
-
message = message + ":\n\t" + exception.backtrace.join("\n\t")
|
112
|
+
message = message + ":\n\t" + exception.backtrace.join("\n\t")
|
113
113
|
$stderr.puts "#{notification}: #{message}"
|
114
114
|
end
|
115
115
|
|