diff --git a/Packs/SuspiciousDomainHunting/ReleaseNotes/1_0_5.md b/Packs/SuspiciousDomainHunting/ReleaseNotes/1_0_5.md new file mode 100644 index 000000000000..37acfdbe5762 --- /dev/null +++ b/Packs/SuspiciousDomainHunting/ReleaseNotes/1_0_5.md @@ -0,0 +1,7 @@ + +#### Scripts + +##### imagecompare + +- Fixed an issue where the script would fail with an ImportError. +- Updated the Docker image to: *demisto/processing-image-file:1.0.0.108564*. diff --git a/Packs/SuspiciousDomainHunting/Scripts/Imagecompare/Imagecompare.py b/Packs/SuspiciousDomainHunting/Scripts/Imagecompare/Imagecompare.py index 50df60fdef14..7e11ee52b180 100644 --- a/Packs/SuspiciousDomainHunting/Scripts/Imagecompare/Imagecompare.py +++ b/Packs/SuspiciousDomainHunting/Scripts/Imagecompare/Imagecompare.py @@ -1,39 +1,39 @@ import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 -from cv2 import cv2 -from skimage.metrics import structural_similarity as compare_ssim +import cv2 +from skimage import metrics def calculate_mse(image_path1, image_path2): # Load the images - img1 = cv2.imread(image_path1) - img2 = cv2.imread(image_path2) + img1 = cv2.imread(image_path1) # pylint: disable=[E1101] + img2 = cv2.imread(image_path2) # pylint: disable=[E1101] # Check if the images are loaded successfully if img1 is None or img2 is None: return None # Calculate Mean Squared Error (MSE) - mse = ((img1 - img2) ** 2).mean() + mse = ((img1 - img2) ** 2).mean() # type: ignore[operator] return mse def calculate_ssim(image_path1, image_path2): # Load the images - img1 = cv2.imread(image_path1) - img2 = cv2.imread(image_path2) + img1 = cv2.imread(image_path1) # pylint: disable=[E1101] + img2 = cv2.imread(image_path2) # pylint: disable=[E1101] # Check if the images are loaded successfully if img1 is None or img2 is None: return None # Convert images to grayscale - img1_gray = cv2.cvtColor(img1, cv2.COLOR_BGR2GRAY) - img2_gray = cv2.cvtColor(img2, cv2.COLOR_BGR2GRAY) + img1_gray = cv2.cvtColor(img1, cv2.COLOR_BGR2GRAY) # pylint: disable=[E1101] + img2_gray = cv2.cvtColor(img2, cv2.COLOR_BGR2GRAY) # pylint: disable=[E1101] # Calculate Structural Similarity Index (SSIM) - ssim = compare_ssim(img1_gray, img2_gray) + ssim = metrics.structural_similarity(img1_gray, img2_gray) return ssim diff --git a/Packs/SuspiciousDomainHunting/Scripts/Imagecompare/Imagecompare.yml b/Packs/SuspiciousDomainHunting/Scripts/Imagecompare/Imagecompare.yml index 0c0854d47fe1..1ff703d26fd5 100644 --- a/Packs/SuspiciousDomainHunting/Scripts/Imagecompare/Imagecompare.yml +++ b/Packs/SuspiciousDomainHunting/Scripts/Imagecompare/Imagecompare.yml @@ -15,7 +15,7 @@ args: scripttarget: 0 subtype: python3 runonce: false -dockerimage: demisto/processing-image-file:1.0.0.89250 +dockerimage: demisto/processing-image-file:1.0.0.108564 runas: DBotWeakRole engineinfo: {} tests: diff --git a/Packs/SuspiciousDomainHunting/pack_metadata.json b/Packs/SuspiciousDomainHunting/pack_metadata.json index 3b2d8bf7586d..70adfba0dcdf 100644 --- a/Packs/SuspiciousDomainHunting/pack_metadata.json +++ b/Packs/SuspiciousDomainHunting/pack_metadata.json @@ -2,7 +2,7 @@ "name": "Suspicious Domain Hunting", "description": "This pack provides all the necessary tools for the Suspicious Domain Hunting use case. It uses the CertStream integration to ingest new SSL certificates and alert for type-squatting domains with SSL certificate, these alerts are then analyzed and mitigated.", "support": "community", - "currentVersion": "1.0.4", + "currentVersion": "1.0.5", "author": "Cortex XSOAR", "url": "https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/bd-p/Cortex_XSOAR_Discussions", "email": "",