soar_auditing_provider 1.7.0 → 1.8.0
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/soar_auditing_provider/auditing_provider.rb +21 -10
 - data/lib/soar_auditing_provider/version.rb +1 -1
 - data/sanity/Gemfile +0 -2
 - metadata +3 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: fa21dcc13f23cdb76ed8a5e73fe8a61e55e31613
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: c9817e2b952fab882ed024dcdc6a41db402f4454
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 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( 
     | 
| 
      
 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 
     | 
| 
      
 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  
     | 
| 
       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 ' 
     | 
| 
      
 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 
     | 
    
         
            -
                   
     | 
| 
       155 
     | 
    
         
            -
             
     | 
| 
       156 
     | 
    
         
            -
             
     | 
| 
      
 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 
     | 
    
         | 
    
        data/sanity/Gemfile
    CHANGED
    
    
    
        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. 
     | 
| 
      
 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- 
     | 
| 
      
 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: 
         
     |