algosec-sdk 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.bumpversion.cfg +1 -1
- data/lib/algosec-sdk/helpers/business_flow_helper.rb +17 -9
- data/lib/algosec-sdk/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56034524fe3048203cf77cd466bc6a5c3a4c8a2c
|
4
|
+
data.tar.gz: aa9cdba1f2bdd438a30671d2e2369b39481f60c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c3424704a4cd59a987fdbec1bad9e8166bef1e55bc0610afeafbb6a63e58b5df73b464ca1ea6e6242173926fd5f3cac66c166118d67ccddddae201c9b858966
|
7
|
+
data.tar.gz: 518c7ce35db30dbc3f752dc0e63371eb61f7cd3e60b80642595e4cfed9ffc169488c92f5508468ff736f6dfe68a45524f6858899bb0771596e033a67a9c9d505
|
data/.bumpversion.cfg
CHANGED
@@ -366,20 +366,14 @@ module ALGOSEC_SDK
|
|
366
366
|
# TODO: Add unitests that objects are being create only once (if the same object is twice in the incoming list)
|
367
367
|
network_object_names = Set.new(network_object_names)
|
368
368
|
ipv4_or_subnet_objects = network_object_names.map do |object_name|
|
369
|
-
|
370
|
-
|
371
|
-
search_result = search_network_object(object_name, NetworkObjectSearchType::EXACT)
|
372
|
-
# If no object was found in search, we'll count this object for creation
|
373
|
-
search_result.empty? ? object_name : nil
|
374
|
-
rescue ArgumentError
|
375
|
-
# The parsed object name was not IP Address or IP Subnet, ignore it
|
376
|
-
nil
|
369
|
+
if get_network_object_type(object_name)
|
370
|
+
search_network_object(object_name, NetworkObjectSearchType::EXACT).empty? ? object_name : nil
|
377
371
|
end
|
378
372
|
end.compact
|
379
373
|
|
380
374
|
# Create all the objects. If the error from the server tells us that the object already exists, ignore the error
|
381
375
|
ipv4_or_subnet_objects.map do |ipv4_or_subnet|
|
382
|
-
create_network_object(
|
376
|
+
create_network_object(get_network_object_type(ipv4_or_subnet), ipv4_or_subnet, ipv4_or_subnet)
|
383
377
|
end.compact
|
384
378
|
end
|
385
379
|
|
@@ -403,5 +397,19 @@ module ALGOSEC_SDK
|
|
403
397
|
end
|
404
398
|
end.compact
|
405
399
|
end
|
400
|
+
|
401
|
+
private
|
402
|
+
|
403
|
+
def get_network_object_type(object_name)
|
404
|
+
# handle IP ranges
|
405
|
+
if object_name.split('-').size == 2
|
406
|
+
object_name.split('-').all? { |ip| !get_network_object_type(ip).nil? } ? NetworkObjectType::RANGE : nil
|
407
|
+
else
|
408
|
+
ip_parse = IPAddress.parse object_name
|
409
|
+
ip_parse.size == 1 ? NetworkObjectType::HOST : NetworkObjectType::RANGE
|
410
|
+
end
|
411
|
+
rescue ArgumentError
|
412
|
+
nil
|
413
|
+
end
|
406
414
|
end
|
407
415
|
end
|
data/lib/algosec-sdk/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: algosec-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Almog Cohen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|