Skip to content

N3 - #4

Merged
Edouard360 merged 577 commits into
masterfrom
n3
Feb 27, 2026
Merged

N3#4
Edouard360 merged 577 commits into
masterfrom
n3

Conversation

@Edouard360

Copy link
Copy Markdown
Collaborator

Required items, please complete

Change(s):

  • See guidance below

Reason for Change(s):

  • See guidance below

Version Updated:

  • Required only for Detections/Analytic Rule templates
  • See guidance below

Testing Completed:

  • See guidance below

Checked that the validations are passing and have addressed any issues that are present:

  • See guidance below

Guidance <- remove section before submitting


Before submitting this PR please ensure that you have read the following sections and filled out the changes, reason for change and testing complete sections:

Thank you for your contribution to the Microsoft Sentinel Github repo.

Details of the code changes in your submitted PR. Providing descriptions for pull requests ensures there is context to changes being made and greatly enhances the code review process. Providing associated Issues that this resolves also easily connects the reason.

Change(s):

  • Updated syntax for XYZ.yaml

Reason for Change(s):

Version updated:

  • Yes
  • Detections/Analytic Rule templates are required to have the version updated

The code should have been tested in a Microsoft Sentinel environment that does not have any custom parsers, functions or tables, so that you validate no incorrect syntax and execution functions properly. If your submission requires a custom parser or function, it must be submitted with the PR.

Testing Completed:

  • Yes/No/Need Help

Note: If updating a detection, you must update the version field.

Before the submission has been made, please look at running the KQL and Yaml Validation Checks locally.
https://github.com/Azure/Azure-Sentinel#run-kql-validation-locally

Checked that the validations are passing and have addressed any issues that are present:

  • Yes/No/Need Help

Note: Let us know if you have tried fixing the validation error and need help.

References:


RamboV and others added 30 commits February 12, 2026 19:32
This reverts commit d3ddbc8.

Changed support url to a valid one
…-instead

[ASIM] Use sentinel-repo-parser-reviewers group instead
* Changes

* Add NetworkCleartext to EventSubType

* Revert "Changes"

This reverts commit 55feb9c.

---------

Co-authored-by: Derrick Lee <derricklee@microsoft.com>
* Work in progress

* fix source

* [ASIM Parsers] Generate deployable ARM templates from KQL function YAML files.

* Add all necessary files

* [ASIM Parsers] Generate deployable ARM templates from KQL function YAML files.

* Fix error in json

* Fix?

* [ASIM Parsers] Generate deployable ARM templates from KQL function YAML files.

* Add changelog to ASIM folder

* [ASIM Parsers] Generate deployable ARM templates from KQL function YAML files.

* Move changelog

* [ASIM Parsers] Generate deployable ARM templates from KQL function YAML files.

* Remove Other as EventType

* [ASIM Parsers] Generate deployable ARM templates from KQL function YAML files.

* Add post-filtering

* [ASIM Parsers] Generate deployable ARM templates from KQL function YAML files.

* Fixes to yaml validation

---------

Co-authored-by: Derrick Lee <derricklee@microsoft.com>
Co-authored-by: github-actions[bot] <>
Implementation of V2 Data Connector for Lumen Defender Threat Feed Solution
…nTemplate.json

- Removed empty title, description, postDeployment, and lastUpdateTime properties
  from playbook metadata blocks (playbook7 and playbook10)
- Regenerated 3.0.4.zip package with the fixes
- Preserves existing 3.0.0.zip as per reviewer feedback
Added 5 new detections for Azure Firewall Sentinel Solution
…ainTemplate

MailRisk Fix CCF mainTemplate.json parameters
Update to support Sentinel data lake
Update to improve daily checks
Updated release notes to reflect the removal of manual deployment steps.
…up to Azure#13603)

Changes in this PR:
- Increased 'count' from 100 to 1000 in both IP Reputation and Malware URLs pollers
  (Cyren IP Rep feed has ~800 indicators, Malware URLs ~200 — all fit in one page)
- Increased 'queryWindowInMin' from 15 to 360 minutes (6 hours)
  (Threat intelligence feeds are relatively static and do not require frequent polling)
- Preserved PersistentToken paging from v3.0.2
- Added 3.0.3.zip package (all previous versions preserved: 3.0.0, 3.0.1, 3.0.2)
- Updated ReleaseNotes.md

Root cause of duplication:
With count=100, the connector made 8+ page requests per poll cycle to fetch all ~800
indicators. Combined with 15-minute polling, this re-ingested the same data 96 times
per day. Observed: 304,000 rows with only 198 unique IPs (1,535:1 duplicate ratio).

Files changed:
- Cyren_PollerConfig.json: count 100→1000, queryWindowInMin 15→360
- Package/mainTemplate.json: Same fixes + version bump to 3.0.3
- Package/3.0.3.zip: Updated package with all changes
- ReleaseNotes.md: Added 3.0.3 entry
dependabot Bot and others added 26 commits February 26, 2026 09:57
Bumps  and [diff](https://github.com/kpdecker/jsdiff). These dependencies needed to be updated together.

Updates `diff` from 5.2.0 to 5.2.2
- [Changelog](https://github.com/kpdecker/jsdiff/blob/master/release-notes.md)
- [Commits](kpdecker/jsdiff@v5.2.0...v5.2.2)

Updates `diff` from 4.0.2 to 4.0.4
- [Changelog](https://github.com/kpdecker/jsdiff/blob/master/release-notes.md)
- [Commits](kpdecker/jsdiff@v5.2.0...v5.2.2)

---
updated-dependencies:
- dependency-name: diff
  dependency-version: 5.2.2
  dependency-type: indirect
- dependency-name: diff
  dependency-version: 4.0.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: v-atulyadav <v-atulyadav@microsoft.com>
…ng_Rare_Custom_Script_Extension_DescriptionUpdate

Updated description_detailed for the Rare_Custom_Script_Extension hunting query of Azure Activity
Add initial release files for DataBahn connector
…s_version_update

Update minimum tls version from 1.0 to 1.2 for Azure storage account
Lookout v3.0.2: Fix DCR transform query and Microsoft Sentinel branding
Added support for Logstash versions 8.19.2, 9.0.8, 9.1.10, and 9.2.4 - 9.2.5, after testing.
Fix IPinfo connectors: runtime pinning, dependency updates, and multi…
…ate-queryperiod

Fix #3524225: Align queryPeriod to match 5d learning window
…tion

Add GitHub Action to remove stale branches
Update README with new Logstash version support
…gration

[IONIX] Migrate to Codeless Connector Framework (CCF)
…-fix

CyrenThreatIntelligence v3.0.4: Fix credential scanner + version alignment
…65d-bugfix

[ASIM] Add Mandatory fields for M365D Registry Parser
@github-actions

Copy link
Copy Markdown

🔒 Security Approval Required

This fork PR requires manual approval before automated testing can run.

For security, a maintainer must:

  1. 📝 Review the code changes carefully
  2. ✅ Verify file types - This PR should only contain .yml, .yaml, or .json files. Check for any executable scripts (.ps1, .py, .sh, .exe, etc.) which are not allowed in this context.
  3. 🏷️ Add the SafeToRun label if the changes are safe to execute

Note: If new commits are added later, simply remove and re-add the SafeToRun label.


🤖 Automated security check • Created: 2026-02-27T23:48:06.101Z
Learn more: GitHub Security Lab - Preventing PWN Requests

)

print(f" Uploading data...")
result = ingest_client.ingest_from_file(temp_path, ingestion_properties=ingestion_props)

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable result is not used.

Copilot Autofix

AI 9 months ago

In general, to fix an unused local variable you either (1) remove the variable and, if needed, keep only the right-hand side expression for its side effects, or (2) rename the variable to an obviously-unused name (like _ or containing unused) if it is intentionally not read. Here, the ingestion call is needed for its side effect, but the return value is not used, so we should remove the result = part.

The best minimal-change fix is to replace result = ingest_client.ingest_from_file(...) with a bare call ingest_client.ingest_from_file(...). This preserves the ingestion behavior, avoids introducing new behavior or dependencies, and removes the unused variable so that the CodeQL warning is resolved. No imports, method signatures, or other parts of the file need to be touched.

Concretely, in Tools/Solutions Analyzer/upload_to_kusto.py, within the function that uploads CSV content (shown around lines 230–272), update line 266 so that it no longer assigns to result, leaving everything else intact.

Suggested changeset 1
Tools/Solutions Analyzer/upload_to_kusto.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/Tools/Solutions Analyzer/upload_to_kusto.py b/Tools/Solutions Analyzer/upload_to_kusto.py
--- a/Tools/Solutions Analyzer/upload_to_kusto.py
+++ b/Tools/Solutions Analyzer/upload_to_kusto.py
@@ -263,7 +263,7 @@
         )
         
         print(f"  Uploading data...")
-        result = ingest_client.ingest_from_file(temp_path, ingestion_properties=ingestion_props)
+        ingest_client.ingest_from_file(temp_path, ingestion_properties=ingestion_props)
         print(f"  Ingestion queued successfully")
         return True
     except Exception as e:
EOF
@@ -263,7 +263,7 @@
)

print(f" Uploading data...")
result = ingest_client.ingest_from_file(temp_path, ingestion_properties=ingestion_props)
ingest_client.ingest_from_file(temp_path, ingestion_properties=ingestion_props)
print(f" Ingestion queued successfully")
return True
except Exception as e:
Copilot is powered by AI and may make mistakes. Always verify output.

print(f" Uploading data...")
try:
result = ingest_client.ingest_from_file(str(csv_path), ingestion_properties=ingestion_props)

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable result is not used.

Copilot Autofix

AI 9 months ago

To fix the unused local variable, remove the unnecessary assignment to result while preserving the side effect of calling ingest_client.ingest_from_file(...). This means we keep the ingestion call but do not store its return value.

Concretely, in Tools/Solutions Analyzer/upload_to_kusto.py, inside the function that uploads a CSV file to Kusto (the one where line 215 appears), replace the line:

result = ingest_client.ingest_from_file(str(csv_path), ingestion_properties=ingestion_props)

with a call that is not assigned to any variable:

ingest_client.ingest_from_file(str(csv_path), ingestion_properties=ingestion_props)

No additional imports, methods, or definitions are required. Existing functionality is unchanged: ingestion is still performed, exceptions are still caught and printed, and the function still returns True on success and False on failure.


Suggested changeset 1
Tools/Solutions Analyzer/upload_to_kusto.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/Tools/Solutions Analyzer/upload_to_kusto.py b/Tools/Solutions Analyzer/upload_to_kusto.py
--- a/Tools/Solutions Analyzer/upload_to_kusto.py
+++ b/Tools/Solutions Analyzer/upload_to_kusto.py
@@ -212,7 +212,7 @@
     
     print(f"  Uploading data...")
     try:
-        result = ingest_client.ingest_from_file(str(csv_path), ingestion_properties=ingestion_props)
+        ingest_client.ingest_from_file(str(csv_path), ingestion_properties=ingestion_props)
         print(f"  Ingestion queued successfully")
         return True
     except Exception as e:
EOF
@@ -212,7 +212,7 @@

print(f" Uploading data...")
try:
result = ingest_client.ingest_from_file(str(csv_path), ingestion_properties=ingestion_props)
ingest_client.ingest_from_file(str(csv_path), ingestion_properties=ingestion_props)
print(f" Ingestion queued successfully")
return True
except Exception as e:
Copilot is powered by AI and may make mistakes. Always verify output.
import sys
import tempfile
from pathlib import Path
from typing import List, Tuple, Optional, Dict

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'Dict' is not used.

Copilot Autofix

AI 9 months ago

To fix the problem, remove the unused Dict symbol from the typing import so that only the actually used types remain. This keeps the import clean, preserves all existing functionality, and resolves the CodeQL warning.

Concretely, in Tools/Solutions Analyzer/upload_to_kusto.py at line 34, change from typing import List, Tuple, Optional, Dict to from typing import List, Tuple, Optional. No other code changes are required, because Dict is not referenced elsewhere in the given snippet.

Suggested changeset 1
Tools/Solutions Analyzer/upload_to_kusto.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/Tools/Solutions Analyzer/upload_to_kusto.py b/Tools/Solutions Analyzer/upload_to_kusto.py
--- a/Tools/Solutions Analyzer/upload_to_kusto.py
+++ b/Tools/Solutions Analyzer/upload_to_kusto.py
@@ -31,7 +31,7 @@
 import sys
 import tempfile
 from pathlib import Path
-from typing import List, Tuple, Optional, Dict
+from typing import List, Tuple, Optional
 
 try:
     from azure.kusto.data import KustoClient, KustoConnectionStringBuilder, DataFormat
EOF
@@ -31,7 +31,7 @@
import sys
import tempfile
from pathlib import Path
from typing import List, Tuple, Optional, Dict
from typing import List, Tuple, Optional

try:
from azure.kusto.data import KustoClient, KustoConnectionStringBuilder, DataFormat
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +566 to +571
def _request_with_retry(
self,
method: str,
url: str,
**kwargs
) -> requests.Response:

Check notice

Code scanning / CodeQL

Explicit returns mixed with implicit (fall through) returns Note

Mixing implicit and explicit returns may indicate an error, as implicit returns always return None.
try:
retry_after = int(response.headers['Retry-After'])
self.logger.info(f"Rate limit detected. Retry-After header: {retry_after} seconds")
except (ValueError, TypeError):

Check notice

Code scanning / CodeQL

Empty except Note

'except' clause does nothing but pass and there is no explanatory comment.

Copilot Autofix

AI 9 months ago

In general, empty except blocks should either be removed (letting the exception propagate) or replaced with explicit handling, such as logging, metric updates, or setting a safe fallback value, plus a brief comment if ignoring is intentional. Here, we want to keep the functional behavior: if parsing Retry-After fails, we should still use the exponential backoff branch. That already happens when retry_after remains None, so the main fix is to add logging inside the except block, and possibly an explanatory comment, rather than changing control flow.

Concretely, in GlobalRateLimiter.handle_rate_limit, around lines 324–330, replace the empty except (ValueError, TypeError): pass with an except block that logs a warning or debug message indicating the header value could not be parsed and that exponential backoff will be used instead. This uses the already-present self.logger and does not require any new imports or additional helper methods. No other parts of the file need to change.

Suggested changeset 1
Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/utility/rate_limiter.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/utility/rate_limiter.py b/Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/utility/rate_limiter.py
--- a/Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/utility/rate_limiter.py
+++ b/Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/utility/rate_limiter.py
@@ -327,7 +327,11 @@
                     retry_after = int(response.headers['Retry-After'])
                     self.logger.info(f"Rate limit detected. Retry-After header: {retry_after} seconds")
                 except (ValueError, TypeError):
-                    pass
+                    # Malformed or non-numeric Retry-After header; fall back to exponential backoff.
+                    self.logger.warning(
+                        "Failed to parse Retry-After header %r; falling back to exponential backoff.",
+                        response.headers.get('Retry-After')
+                    )
             
             if retry_after:
                 # Reduce rate limit based on Retry-After
EOF
@@ -327,7 +327,11 @@
retry_after = int(response.headers['Retry-After'])
self.logger.info(f"Rate limit detected. Retry-After header: {retry_after} seconds")
except (ValueError, TypeError):
pass
# Malformed or non-numeric Retry-After header; fall back to exponential backoff.
self.logger.warning(
"Failed to parse Retry-After header %r; falling back to exponential backoff.",
response.headers.get('Retry-After')
)

if retry_after:
# Reduce rate limit based on Retry-After
Copilot is powered by AI and may make mistakes. Always verify output.
if 'Retry-After' in response.headers:
try:
retry_after = int(response.headers['Retry-After'])
except ValueError:

Check notice

Code scanning / CodeQL

Empty except Note

'except' clause does nothing but pass and there is no explanatory comment.

Copilot Autofix

AI 9 months ago

In general, empty except blocks should either be removed (letting the exception propagate) or replaced with explicit handling such as logging, transforming, or re-raising the exception. If an exception is intentionally ignored, there should be a clear comment explaining why, to avoid confusion and to make static analyzers less likely to flag it.

For this specific case, the best fix that preserves existing behavior is to keep the fallback behavior (treat malformed Retry-After as “no header”), but add a small logging statement in the except ValueError: block. This way, the code still uses the exponential backoff when parsing fails, but operators can see that a malformed header was received. We should not change the computed delay logic, and we should not raise the exception, as that would alter the retry behavior. The change is limited to the try/except around retry_after = int(response.headers['Retry-After']) in bloodhound_manager.py, and no new imports or helper methods are needed, since self.logger is already used in the surrounding code.

Concretely, in Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/utility/bloodhound_manager.py, locate the except ValueError: block around line 392–395 and replace the empty body with a log message (e.g., self.logger.warning(...)) explaining that the Retry-After header could not be parsed and that the default backoff will be used.

Suggested changeset 1
Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/utility/bloodhound_manager.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/utility/bloodhound_manager.py b/Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/utility/bloodhound_manager.py
--- a/Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/utility/bloodhound_manager.py
+++ b/Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/utility/bloodhound_manager.py
@@ -392,7 +392,12 @@
                         try:
                             retry_after = int(response.headers['Retry-After'])
                         except ValueError:
-                            pass
+                            # Malformed Retry-After header; fall back to default backoff
+                            self.logger.warning(
+                                "Received non-integer Retry-After header value; "
+                                "falling back to exponential backoff.",
+                                extra={"retry_after_header": response.headers.get("Retry-After")}
+                            )
                     
                     delay = retry_after if retry_after else min(2.0 * (attempt + 1), 60.0)
                     self.logger.warning(
EOF
@@ -392,7 +392,12 @@
try:
retry_after = int(response.headers['Retry-After'])
except ValueError:
pass
# Malformed Retry-After header; fall back to default backoff
self.logger.warning(
"Received non-integer Retry-After header value; "
"falling back to exponential backoff.",
extra={"retry_after_header": response.headers.get("Retry-After")}
)

delay = retry_after if retry_after else min(2.0 * (attempt + 1), 60.0)
self.logger.warning(
Copilot is powered by AI and may make mistakes. Always verify output.
retry_after = int(response.headers['Retry-After'])
if retry_after > 0:
return retry_after
except (ValueError, TypeError):

Check notice

Code scanning / CodeQL

Empty except Note

'except' clause does nothing but pass and there is no explanatory comment.

Copilot Autofix

AI 9 months ago

In general, empty except blocks should either (a) handle the error meaningfully (e.g., by logging, fallback logic, or re‑raising) or (b) clearly document why the exception is safe to ignore. Here, _get_retry_after_delay already defines the fallback behavior (return None on invalid/missing header), so the best fix is to keep that behavior but add logging in the except block to record that an invalid Retry-After header was encountered. This addresses the static analysis complaint, preserves existing functionality, and aids troubleshooting.

Concretely, in Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/utility/bloodhound_manager.py, within _get_retry_after_delay, replace the pass in the except (ValueError, TypeError) block with a logging.debug (or logging.warning if you prefer stronger visibility) message that includes the offending header value. No new imports are needed because logging is already imported at the top of the file. The rest of the function, including returning None after the except, should remain unchanged.

Suggested changeset 1
Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/utility/bloodhound_manager.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/utility/bloodhound_manager.py b/Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/utility/bloodhound_manager.py
--- a/Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/utility/bloodhound_manager.py
+++ b/Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/utility/bloodhound_manager.py
@@ -35,7 +35,10 @@
                 if retry_after > 0:
                     return retry_after
             except (ValueError, TypeError):
-                pass
+                logging.debug(
+                    "Invalid Retry-After header value '%s'; treating as no retry delay.",
+                    response.headers.get('Retry-After'),
+                )
         return None
 
     def _send_to_azure_monitor(self, log_entry, bearer_token, dce_uri, dcr_immutable_id, table_name, max_retries: int = None):
EOF
@@ -35,7 +35,10 @@
if retry_after > 0:
return retry_after
except (ValueError, TypeError):
pass
logging.debug(
"Invalid Retry-After header value '%s'; treating as no retry delay.",
response.headers.get('Retry-After'),
)
return None

def _send_to_azure_monitor(self, log_entry, bearer_token, dce_uri, dcr_immutable_id, table_name, max_retries: int = None):
Copilot is powered by AI and may make mistakes. Always verify output.
@@ -1,9 +1,11 @@
import logging
import time
import datetime
import json

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'json' is not used.

Copilot Autofix

AI 9 months ago

To fix an unused import, you remove the import statement so that the code only depends on modules it actually uses. This improves readability and avoids confusion about nonexistent or removed functionality.

In this file, the single best fix is to delete the import json line near the top of tier_zero_assets_collector.py, leaving the other imports unchanged. No further code changes are required, since no references to json exist in the shown code. Specifically, in Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/azure_functions/tier_zero_assets_collector.py, remove line 4 (import json) and do not add any new imports or functions.

Suggested changeset 1
Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/azure_functions/tier_zero_assets_collector.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/azure_functions/tier_zero_assets_collector.py b/Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/azure_functions/tier_zero_assets_collector.py
--- a/Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/azure_functions/tier_zero_assets_collector.py
+++ b/Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/azure_functions/tier_zero_assets_collector.py
@@ -1,7 +1,6 @@
 import logging
 import time
 import datetime
-import json
 from azure.core.exceptions import ResourceNotFoundError
 
 from ..utility.utils import (
EOF
@@ -1,7 +1,6 @@
import logging
import time
import datetime
import json
from azure.core.exceptions import ResourceNotFoundError

from ..utility.utils import (
Copilot is powered by AI and may make mistakes. Always verify output.
@@ -1,9 +1,11 @@
import logging
import time
import datetime

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'ResourceNotFoundError' is not used.

Copilot Autofix

AI 9 months ago

To fix an unused import, the general solution is to remove the import statement for the symbol that is not used anywhere in the module. This avoids unnecessary dependencies, keeps the code cleaner, and can slightly improve import time.

In this case, the best fix is to delete the line from azure.core.exceptions import ResourceNotFoundError at the top of tier_zero_assets_collector.py. No other code changes are required, because there are no references to ResourceNotFoundError in the shown file. This change preserves existing functionality while resolving the static analysis warning.

You only need to edit Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/azure_functions/tier_zero_assets_collector.py, removing the exact import line 5. No new methods, imports, or definitions are needed.

Suggested changeset 1
Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/azure_functions/tier_zero_assets_collector.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/azure_functions/tier_zero_assets_collector.py b/Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/azure_functions/tier_zero_assets_collector.py
--- a/Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/azure_functions/tier_zero_assets_collector.py
+++ b/Solutions/BloodHound Enterprise/Data Connectors/BloodHoundDataConnector/SharedCode/azure_functions/tier_zero_assets_collector.py
@@ -2,7 +2,6 @@
 import time
 import datetime
 import json
-from azure.core.exceptions import ResourceNotFoundError
 
 from ..utility.utils import (
     load_environment_configs, get_azure_batch_size
EOF
@@ -2,7 +2,6 @@
import time
import datetime
import json
from azure.core.exceptions import ResourceNotFoundError

from ..utility.utils import (
load_environment_configs, get_azure_batch_size
Copilot is powered by AI and may make mistakes. Always verify output.

@olivierfeedly olivierfeedly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@Edouard360
Edouard360 merged commit 6cd9bd6 into master Feb 27, 2026
30 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.