Skip to content

Commit 2ff1a09

Browse files
authored
Update documentation for MS Sentinel (#25)
1 parent 3487c7a commit 2ff1a09

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This tool supports the following connectors:
1212
- WebHook
1313
- Slack
1414
- SumoLogic
15+
- MS Sentinel
1516

1617
### Other SIEM Integrations
1718

@@ -168,6 +169,44 @@ if __name__ == '__main__':
168169
sumo.send_events(issue_data, "socket-sync-alerts")
169170
```
170171

172+
### Microsoft Sentinel
173+
174+
The Microsoft Sentinel will use the Workspace ID and Shared Key to send events via the API to MS Sentinel
175+
176+
Initializing Options:
177+
178+
| Option | Required | Default | Description |
179+
|--------------|----------|---------|-----------------------------------------|
180+
| workspace_id | True | None | Microsoft Workspace ID for your Account |
181+
| shared_key | True | None | Microsoft Shared Key for authentication |
182+
183+
```python
184+
import os
185+
from socketsync.core import Core
186+
from socketsync.connectors.sentinel import Sentinel
187+
from datetime import datetime, timezone
188+
start_time = datetime.strptime("2024-09-10 10:00", "%Y-%m-%d %H:%M").replace(tzinfo=timezone.utc)
189+
from_time = int((datetime.now(timezone.utc) - start_time).total_seconds())
190+
191+
192+
if __name__ == '__main__':
193+
socket_org = os.getenv("SOCKET_ORG") or exit(1)
194+
api_key = os.getenv("SOCKET_API_KEY") or exit(1)
195+
http_source_url = os.getenv("SUMO_HTTP_URL")
196+
core = Core(
197+
api_key=api_key,
198+
from_time=from_time,
199+
)
200+
issue_data = core.get_issues()
201+
ms_sentinel_workspace_id = os.getenv("MS_SENTINEL_WORKSPACE_ID", None)
202+
ms_sentinel_shared_key = os.getenv("MS_SENTINEL_SHARED_KEY", None)
203+
if not ms_sentinel_workspace_id or not ms_sentinel_shared_key:
204+
print("MS_SENTINEL_WORKSPACE_ID and MS_SENTINEL_SHARED_KEY must be set.")
205+
exit(1)
206+
sentinel = Sentinel(ms_sentinel_workspace_id, ms_sentinel_shared_key)
207+
sentinel.send_events(issue_data, "SocketSiemConnector")
208+
```
209+
171210
### Panther
172211
The Panther connector requires you to have an HTTP connector setup in the Panther UI. In this example I used a bearer token but this can be overriden by using custom headers if desired.
173212

socketsync/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
__author__ = "socket.dev"
5-
__version__ = "1.0.23"
5+
__version__ = "1.0.24"
66
__all__ = ["log", "__version__", "columns", "default_headers"]
77

88
log = logging.getLogger("socketdev")

0 commit comments

Comments
 (0)