Registry / security / azure-mgmt-securityinsight

azure-mgmt-securityinsight

JSON →
library1.0.0pypypi✓ verified 85d ago

Official Microsoft Azure SDK for managing Security Insights (Azure Sentinel) resources. Version 1.0.0 requires Python >=3.6 and supports operations on alert rules, bookmarks, incidents, and more.

pip install azure-mgmt-securityinsight
INSTALL
IMPORT
SIG · AZURE-MGMT-SECURIT
A
azure-mgmt-securityinsight
securitypythonv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SecurityInsights
from azure.mgmt.securityinsight import SecurityInsights
from azure.mgmt.securityinsight import SecurityInsight
Class name is plural; singular 'SecurityInsight' does not exist.
SecurityInsightsClient
from azure.mgmt.securityinsight import SecurityInsightsClient

Authenticate using DefaultAzureCredential and list alert rules.

import os from azure.identity import DefaultAzureCredential from azure.mgmt.securityinsight import SecurityInsights subscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', '') resource_group = 'myResourceGroup' workspace_name = 'myWorkspace' client = SecurityInsights(credential=DefaultAzureCredential(), subscription_id=subscription_id) alert_rules = client.alert_rules.list(resource_group_name=resource_group, workspace_name=workspace_name) for rule in alert_rules: print(rule.name)
Debug
Known issues
breakingThe client class name changed from SecurityInsightsClient (preview versions) to SecurityInsights in v1.0.0. Update imports.
fix
Use 'from azure.mgmt.securityinsight import SecurityInsights' instead of SecurityInsightsClient.
affects: <1.0.0
gotchaAll operations require both resource_group_name and workspace_name parameters; the workspace name is not the same as the Log Analytics workspace ID.
fix
Obtain the workspace name (e.g., 'DefaultWorkspace-<GUID>') from Azure Portal.
affects: all
deprecatedThe 'incidents' operations may be deprecated in favor of new operations. Check changelog.
fix
Review migration guides if using incident APIs.
affects: current
Errors
Common errors & fixes
ImportError: cannot import name 'SecurityInsights' from 'azure.mgmt.securityinsight'
Installed an older version (<1.0.0) where the class was named SecurityInsightsClient.
fix
Upgrade to v1.0.0: pip install --upgrade azure-mgmt-securityinsight
AttributeError: 'SecurityInsights' object has no attribute 'alert_rules'
Using an older API version or incorrect client initialization.
fix
Ensure you are using the correct client class (SecurityInsights) and that the package is up-to-date.
Upgrade
Version history
1.0.0latest on PyPI · released Jul 26, 2022
Audit
Dependencies
azure-identityrequiredAuthentication (DefaultAzureCredential)
azure-mgmt-resourceoptionalResource management helper
Agent activity
21 hits · last 30 days
node
18
OpenAI (training)
1
Resources
azure-mgmt-securityinsight — pip install azure-mgmt-securityinsight · libregistry