soar_auditing_provider 1.7.0 → 1.8.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: ebfdb8104eec62c09b2cededb46baf15deef4b7d
4
- data.tar.gz: 40402d8ca6b5ba7c9fec5af4d1c4176699fac30d
3
+ metadata.gz: fa21dcc13f23cdb76ed8a5e73fe8a61e55e31613
4
+ data.tar.gz: c9817e2b952fab882ed024dcdc6a41db402f4454
5
5
  SHA512:
6
- metadata.gz: c36e13ea97ff6c23aea46a1f68a01da06dd5de11fe14b8a887852d4de0a3d594cbeb8a482d4e845e22a067b26baa40647f9891eb8f135cfff9647d4897b6a4ff
7
- data.tar.gz: dc8575546159d0118be6912b8f31845dfab2eea588817c1cef9038d0cd16120bf4bb35806f0b0c598cee2010cd8abaf83464a9269a69152c92dd16dd420bef29
6
+ metadata.gz: d09d988d482f05af2a3fef01e46d00e96195ea88411877d71859927ccc149953ea17dd75a847bd74846809991bd08275364d6f3772cfb271485c78f9ce39c3ab
7
+ data.tar.gz: 91a9f79b34e03b04a5167553db5690286681c276b474069503f2e54b981283de7730dc73b4c08164864600e9f0e2f72741e97e8e96ce6f854a9859cc7f918de6
@@ -19,6 +19,7 @@ module SoarAuditingProvider
19
19
  public
20
20
 
21
21
  DEFAULT_FLOW_ID_GENERATOR = -> { SoarFlow::ID::generate_flow_id } unless defined?(DEFAULT_FLOW_ID_GENERATOR)
22
+ DEFAULT_LEVEL = :info unless defined?(DEFAULT_LEVEL)
22
23
 
23
24
  attr_accessor :service_identifier
24
25
  attr_reader :configuration
@@ -42,7 +43,7 @@ module SoarAuditingProvider
42
43
 
43
44
  def select_auditor(nfrs)
44
45
  select(nfrs)
45
- set_audit_level(@configuration['level'].to_sym)
46
+ set_audit_level(configured_audit_level)
46
47
  end
47
48
 
48
49
  def set_audit_level(level)
@@ -81,7 +82,9 @@ module SoarAuditingProvider
81
82
  end
82
83
 
83
84
  def flush(timeout: 1)
84
- @worker.flush(timeout: timeout)
85
+ if @worker
86
+ @worker.flush(timeout: timeout)
87
+ end
85
88
  end
86
89
 
87
90
  def audit_exception(exception:, level: :error, flow_id: nil, message: nil)
@@ -123,10 +126,10 @@ module SoarAuditingProvider
123
126
  end
124
127
 
125
128
  def audit_formatted(level, data)
126
- if 'true' == @configuration['direct_auditor_call']
127
- super_class_caller(level, data)
128
- else
129
+ if @worker
129
130
  enqueue(level, data)
131
+ else
132
+ super_class_caller(level, data)
130
133
  end
131
134
  end
132
135
 
@@ -143,7 +146,7 @@ module SoarAuditingProvider
143
146
  end
144
147
 
145
148
  def validate_provider_configuration(configuration)
146
- raise 'Missing auditing level' if configuration['level'].nil?
149
+ raise 'queue_worker required when direct_auditor_call is false' if configuration['direct_auditor_call'] != 'true' and !configuration['queue_worker']
147
150
  end
148
151
 
149
152
  def format(level, data, flow_identifier)
@@ -151,9 +154,13 @@ module SoarAuditingProvider
151
154
  end
152
155
 
153
156
  def create_auditing_worker
154
- @worker = AuditingWorker.instance
155
- @worker.configure(queue_worker_configuration: @configuration['queue_worker'], auditor_audit_method: method(:super_class_caller))
156
- @worker.start
157
+ if 'true' != @configuration['direct_auditor_call']
158
+ @worker = AuditingWorker.instance
159
+ @worker.configure(queue_worker_configuration: @configuration['queue_worker'], auditor_audit_method: method(:super_class_caller))
160
+ @worker.start
161
+ else
162
+ @worker = nil
163
+ end
157
164
  end
158
165
 
159
166
  def super_class_caller(level, data)
@@ -186,9 +193,13 @@ module SoarAuditingProvider
186
193
  @enqueued_audit_events = 0
187
194
  end
188
195
 
196
+ def configured_audit_level
197
+ (@configuration["level"] || DEFAULT_LEVEL).to_sym
198
+ end
199
+
189
200
  def verbose_status_detail
190
201
  {
191
- 'worker' => @worker.status_detail
202
+ 'worker' => (@worker.status_detail if @worker)
192
203
  }
193
204
  end
194
205
 
@@ -1,3 +1,3 @@
1
1
  module SoarAuditingProvider
2
- VERSION = "1.7.0"
2
+ VERSION = "1.8.0"
3
3
  end
data/sanity/Gemfile CHANGED
@@ -3,5 +3,3 @@ source 'https://rubygems.org'
3
3
  gem 'soar_auditing_provider', :path => "../"
4
4
  gem "log4r_auditor", "~> 1.0.0"
5
5
  gem "soar_flow", "~> 0.1.1"
6
- gem "logstash_auditor", "~> 1.0.1"
7
- gem 'configuration_service-provider-vault'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soar_auditing_provider
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernst van Graan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-02-01 00:00:00.000000000 Z
12
+ date: 2017-02-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -223,3 +223,4 @@ signing_key:
223
223
  specification_version: 4
224
224
  summary: SOAR architecture auditing provider
225
225
  test_files: []
226
+ has_rdoc: