diff --git a/Packs/PolySwarm/Integrations/PolySwarmV2/PolySwarmV2.py b/Packs/PolySwarm/Integrations/PolySwarmV2/PolySwarmV2.py index 29a7b09cbbbc..c3c0718e07b1 100644 --- a/Packs/PolySwarm/Integrations/PolySwarmV2/PolySwarmV2.py +++ b/Packs/PolySwarm/Integrations/PolySwarmV2/PolySwarmV2.py @@ -4,12 +4,13 @@ """ IMPORTS """ from polyswarm_api.api import PolyswarmAPI +from polyswarm_api import settings as polyswarm_settings import socket import io """ CONSTANTS """ -POLYSWARM_DEMISTO_VERSION = "0.2.0" +POLYSWARM_DEMISTO_VERSION = "2.0.11" ERROR_ENDPOINT = "Error with endpoint: " @@ -28,7 +29,12 @@ def __init__(self): self.config["base_url"] = demisto.params().get("base_url") self.config["polyswarm_community"] = demisto.params().get("polyswarm_community") - self.polyswarm_api = PolyswarmAPI(key=self.config["polyswarm_api_key"], uri=self.config["base_url"]) + polyswarm_ua = f"{polyswarm_settings.DEFAULT_USER_AGENT} xsoar-PolySwarmV2/{POLYSWARM_DEMISTO_VERSION}" + self.polyswarm_api = PolyswarmAPI( + key=self.config["polyswarm_api_key"], + uri=self.config["base_url"], + user_agent=polyswarm_ua, + ) def _get_results( self, object_name: str, title: str, total_scans: int, positives: int, permalink: str, artifact: str, indicator: object diff --git a/Packs/PolySwarm/Integrations/PolySwarmV2/PolySwarmV2.yml b/Packs/PolySwarm/Integrations/PolySwarmV2/PolySwarmV2.yml index b39ff023a3b5..ae68810e0350 100644 --- a/Packs/PolySwarm/Integrations/PolySwarmV2/PolySwarmV2.yml +++ b/Packs/PolySwarm/Integrations/PolySwarmV2/PolySwarmV2.yml @@ -417,7 +417,7 @@ script: script: '-' subtype: python3 type: python - dockerimage: demisto/polyswarm:1.0.0.4447191 + dockerimage: demisto/polyswarm:1.0.0.6911470 fromversion: 5.0.0 tests: - No tests (auto formatted) \ No newline at end of file diff --git a/Packs/PolySwarm/Integrations/PolySwarmV2/PolySwarmV2_test.py b/Packs/PolySwarm/Integrations/PolySwarmV2/PolySwarmV2_test.py index 9b2d0ac3b98d..b66d2fa04338 100644 --- a/Packs/PolySwarm/Integrations/PolySwarmV2/PolySwarmV2_test.py +++ b/Packs/PolySwarm/Integrations/PolySwarmV2/PolySwarmV2_test.py @@ -202,6 +202,11 @@ def test_file(mocker): polyswarm = PolyswarmConnector() + # Verify custom User-Agent header + ua = polyswarm.polyswarm_api.session.headers["User-Agent"] + assert "polyswarm_api/" in ua or "polyswarm-api/" in ua + assert f"xsoar-PolySwarmV2/{PolySwarmV2.POLYSWARM_DEMISTO_VERSION}" in ua + param = {"hash": TEST_HASH_FILE} results = polyswarm.file_reputation(param["hash"]) diff --git a/Packs/PolySwarm/ReleaseNotes/2_0_11.md b/Packs/PolySwarm/ReleaseNotes/2_0_11.md new file mode 100644 index 000000000000..4cc22b15e4b1 --- /dev/null +++ b/Packs/PolySwarm/ReleaseNotes/2_0_11.md @@ -0,0 +1,7 @@ + +#### Integrations + +##### PolySwarm + +- Added a custom User-Agent suffix (`xsoar-PolySwarmV2/{version}`) to all PolySwarm API calls. +- Updated the Docker image to: *demisto/polyswarm:1.0.0.6911470*. diff --git a/Packs/PolySwarm/pack_metadata.json b/Packs/PolySwarm/pack_metadata.json index 2c6ab5ea1a2f..4377db8092c9 100644 --- a/Packs/PolySwarm/pack_metadata.json +++ b/Packs/PolySwarm/pack_metadata.json @@ -2,7 +2,7 @@ "name": "PolySwarm", "description": "Real-time threat intelligence from a crowdsourced network of security experts and antivirus companies.", "support": "partner", - "currentVersion": "2.0.10", + "currentVersion": "2.0.11", "author": "PolySwarm", "url": "https://polyswarm.network/", "email": "support@polyswarm.io",