Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow host address input in MS Graph configuration #1582

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions stix_shifter_modules/azure_sentinel/configuration/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"displayName": "Microsoft Graph Security",
"group": "microsoft"
},
"host": {
"type": "text",
"regex": "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9_:/\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9_:/\\-]*[A-Za-z0-9])$",
"default": "graph.microsoft.com"
},
"port": {
"type": "number",
"default": 443,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ class APIClient:
"""API Client to handle all calls."""
credential = None

def __init__(self, base_uri, connection, configuration):
def __init__(self, connection, configuration):
"""Initialization.
:param connection: dict, connection dict
:param configuration: dict,config dict"""
self.host = base_uri
self.host = connection['host']
self.connection = connection
self.configuration = configuration
self.timeout = connection['options'].get('timeout')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
class Connector(BaseJsonSyncConnector):
api_client = None
max_limit = 1000
base_uri = 'graph.microsoft.com' # Microsoft Graph API has single endpoint
DEFAULT_API_VERSION = 'v1.0'
LEGACY_ALERT = 'security/alerts'
ALERT_V2 = 'security/alerts_v2'
Expand All @@ -22,7 +21,7 @@ def __init__(self, connection, configuration):
self.connector = __name__.split('.')[1]
self.connection = connection
self.configuration = configuration
self.api_client = APIClient(self.base_uri, self.connection, self.configuration)
self.api_client = APIClient(self.connection, self.configuration)

self.legacy_alert = connection['options'].get('alert')
self.alert_v2 = connection['options'].get('alertV2')
Expand Down
Loading