aikido-zen 1.5.0 → 1.5.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a9cc243a2ca18ad42f75596db9fb9558362371ee68646f2f75997b80dfd9d04
4
- data.tar.gz: 7f9990113775ca615b9b50035a15779e5a9ceb777ad793c164dc6b69c8898732
3
+ metadata.gz: 060fe3aabca1fbc463fc77129a0b535d6c53f2c78bf5c4d9d11c2bdd46d119be
4
+ data.tar.gz: 1fa12dcaed6348cfc9ed836e04c995f2459c46b23c8ba5c529fe5fa0c01da40e
5
5
  SHA512:
6
- metadata.gz: 0f4711a8dacc3597ea2a143cb50e735f3234af4d8fcfa0f3d76bf993de51dc17a19c6967c338119cb0433d2c6a850a363a96a6326259316c9d2fc5d346c3809c
7
- data.tar.gz: 1d85b479341bec9f2a4ad9b9b8bf12bfc71dbd98213a6020b8c03fde0ea3a6cea47c9e1a6c0f5895474c8e8de3cac823d655cf59396c16309640a45c976cb68b
6
+ metadata.gz: c8d1311f2b1ab68a068b5aadf5356f6d092ac9df323030c7143d042e9a9705cf7efa06efcf7f15804c7174f78543ad0d630d53b47d42fce487de8f2eeec344eb
7
+ data.tar.gz: cd12d37d110b93b2603f87897985f1d2e70a98a9438c6bdd8beb7f5adfb0a86a4f179a925528472da8af5d859d88309c61cbdd2aa94baa029636f4cc0870c813
@@ -80,16 +80,8 @@ module Aikido::Zen
80
80
  end
81
81
 
82
82
  if @config.realtime_settings_updates_enabled?
83
- if @api_stream.can_connect?
84
- @api_stream.handle("config-updated") { |event| settings_updated(event) }
85
- @api_stream.start!
86
-
87
- # Use the realtime setting updates endpoint when polling to check
88
- # whether settings should be fetched.
89
- @api_client.should_fetch_settings_endpoint = @config.realtime_settings_updates_endpoint
90
- else
91
- @config.logger.warn("Can't reach #{Aikido::Zen.config.realtime_settings_updates_endpoint}, make sure it's in your outbound firewall allowlist. Realtime config updates won't be available, switched to polling.")
92
- end
83
+ @api_stream.handle("config-updated") { |event| settings_updated(event) }
84
+ @api_stream.start!
93
85
  end
94
86
 
95
87
  poll_for_setting_updates
@@ -27,7 +27,7 @@ module Aikido::Zen
27
27
  @thread = nil
28
28
  @http = nil
29
29
 
30
- endpoint = @config.realtime_settings_updates_endpoint
30
+ endpoint = @config.realtime_endpoint
31
31
 
32
32
  @host = endpoint.host
33
33
  @port = endpoint.port
@@ -37,31 +37,6 @@ module Aikido::Zen
37
37
  @handlers = Concurrent::Array.new
38
38
  end
39
39
 
40
- # @return [Boolean] whether we could connect to the realtime endpoint
41
- def can_connect?
42
- http = Net::HTTP.new(@host, @port)
43
- http.use_ssl = @use_ssl
44
- http.open_timeout = 5
45
- http.write_timeout = 5
46
- http.read_timeout = 5
47
- http.max_retries = 0
48
-
49
- request = Net::HTTP::Get.new("/config")
50
- request["Authorization"] = @token
51
-
52
- begin
53
- http.request(request)
54
-
55
- return true
56
- rescue Timeout::Error, SocketError, IOError, SystemCallError, OpenSSL::OpenSSLError => err
57
- @config.logger.debug("Error probing realtime endpoint: #{err.class}: #{err.message}")
58
- rescue => err
59
- @config.logger.error("Error probing realtime endpoint: #{err.class}: #{err.message}")
60
- end
61
-
62
- false
63
- end
64
-
65
40
  def running?
66
41
  @running.true?
67
42
  end
@@ -221,10 +221,6 @@ module Aikido::Zen
221
221
  attr_accessor :realtime_settings_updates_enabled
222
222
  alias_method :realtime_settings_updates_enabled?, :realtime_settings_updates_enabled
223
223
 
224
- # @return [URI] The HTTP host for realtime settings updates.
225
- # Defaults to +https://zen.aikido.dev+.
226
- attr_reader :realtime_settings_updates_endpoint
227
-
228
224
  def initialize
229
225
  self.insert_middleware_after = ::ActionDispatch::RemoteIp
230
226
  self.disabled = read_boolean_from_env(ENV.fetch("AIKIDO_DISABLE", false)) || read_boolean_from_env(ENV.fetch("AIKIDO_DISABLED", false))
@@ -271,7 +267,6 @@ module Aikido::Zen
271
267
  self.idor_excluded_table_names = []
272
268
  self.idor_max_cache_entries = 1000
273
269
  self.realtime_settings_updates_enabled = false
274
- self.realtime_settings_updates_endpoint = ENV.fetch("AIKIDO_REALTIME_SETTINGS_UPDATES_ENDPOINT", DEFAULT_REALTIME_SETTINGS_UPDATES_BASE_URL)
275
270
  end
276
271
 
277
272
  # Set the base URL for API requests.
@@ -288,13 +283,6 @@ module Aikido::Zen
288
283
  @realtime_endpoint = URI(url)
289
284
  end
290
285
 
291
- # Set the base URL for the realtime settings updates feature.
292
- #
293
- # @param url [String, URI]
294
- def realtime_settings_updates_endpoint=(url)
295
- @realtime_settings_updates_endpoint = URI(url)
296
- end
297
-
298
286
  # Set the logger and configure its severity level according to agent's debug mode
299
287
  # @param logger [::Logger]
300
288
  def logger=(logger)
@@ -364,9 +352,6 @@ module Aikido::Zen
364
352
  # @!visibility private
365
353
  DEFAULT_RUNTIME_BASE_URL = "https://runtime.aikido.dev"
366
354
 
367
- # @!visibility private
368
- DEFAULT_REALTIME_SETTINGS_UPDATES_BASE_URL = "https://zen.aikido.dev"
369
-
370
355
  # @!visibility private
371
356
  DEFAULT_JSON_ENCODER = JSON.method(:dump)
372
357
 
@@ -98,7 +98,9 @@ module Aikido::Zen
98
98
 
99
99
  # @!visibility private
100
100
  def extract_payloads_from(data, source_type, prefix = nil)
101
- if data.respond_to?(:to_hash)
101
+ if data.is_a?(String)
102
+ [Payload.new(data, source_type, prefix.to_s)]
103
+ elsif data.respond_to?(:to_hash)
102
104
  data.to_hash.flat_map do |key, value|
103
105
  extract_payloads_from(value, source_type, [prefix, key].compact.join("."))
104
106
  end
@@ -125,7 +127,7 @@ module Aikido::Zen
125
127
 
126
128
  payloads
127
129
  else
128
- [Payload.new(data, source_type, prefix.to_s)]
130
+ []
129
131
  end
130
132
  end
131
133
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Aikido
4
4
  module Zen
5
- VERSION = "1.5.0"
5
+ VERSION = "1.5.1"
6
6
 
7
7
  # The version of libzen_internals that we build against.
8
8
  LIBZEN_VERSION = "0.1.61"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aikido-zen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aikido Security
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-06-29 00:00:00.000000000 Z
11
+ date: 2026-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby