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

Updated and fixed the paths (microsoft-security-and-compliance) #382

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
18 changes: 9 additions & 9 deletions microsoft-security-and-compliance/1.0.0/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ def get_alerts(self, tenant_id, client_id, client_secret, top):
graph_url = "https://graph.microsoft.com"
session = self.authenticate(tenant_id, client_id, client_secret, graph_url)
if top:
graph_url = f"https://graph.microsoft.com/v1.0/security/alerts?$top={top}"
graph_url = f"https://graph.microsoft.com/v1.0/security/alerts_v2?$top={top}"
else:
graph_url = f"https://graph.microsoft.com/v1.0/security/alerts?$top=10"
graph_url = f"https://graph.microsoft.com/v1.0/security/alerts_v2?$top=10"
ret = session.get(graph_url)
print(ret.status_code)
print(ret.text)
Expand All @@ -105,9 +105,9 @@ def get_alerts_by_severity(self, tenant_id, client_id, client_secret, top, sever
graph_url = "https://graph.microsoft.com"
session = self.authenticate(tenant_id, client_id, client_secret, graph_url)
if top:
graph_url = f"https://graph.microsoft.com/v1.0/security/alerts?$filter=Severity eq '{severity}'&$top={top}"
graph_url = f"https://graph.microsoft.com/v1.0/security/alerts_v2?$filter=Severity eq '{severity}'&$top={top}"
else:
graph_url = f"https://graph.microsoft.com/v1.0/security/alerts?$filter=Severity eq '{severity}'&$top=5"
graph_url = f"https://graph.microsoft.com/v1.0/security/alerts_v2?$filter=Severity eq '{severity}'&$top=5"
ret = session.get(graph_url)
print(ret.status_code)
print(ret.text)
Expand All @@ -129,9 +129,9 @@ def get_alerts_by_vendors(self, tenant_id, client_id, client_secret, vendor, top
graph_url = "https://graph.microsoft.com"
session = self.authenticate(tenant_id, client_id, client_secret, graph_url)
if top:
graph_url = f"https://graph.microsoft.com/v1.0/security/alerts?$filter=vendorInformation/provider eq '{vendor_code[vendor]}'&$top={top}"
graph_url = f"https://graph.microsoft.com/v1.0/security/alerts_v2?$filter=vendorInformation/provider eq '{vendor_code[vendor]}'&$top={top}"
else:
graph_url = f"https://graph.microsoft.com/v1.0/security/alerts?$filter=vendorInformation/provider eq '{vendor_code[vendor]}'&$top=5"
graph_url = f"https://graph.microsoft.com/v1.0/security/alerts_v2?$filter=vendorInformation/provider eq '{vendor_code[vendor]}'&$top=5"
ret = session.get(graph_url)
print(ret.status_code)
print(ret.text)
Expand Down Expand Up @@ -446,7 +446,7 @@ def get_custodian(self, tenant_id, client_id, client_secret, case_id, custodian_
def create_custodian(self, tenant_id, client_id, client_secret, case_id, email, apply_hold_to_sources):
graph_url = "https://graph.microsoft.com"
session = self.authenticate(tenant_id, client_id, client_secret, graph_url)
graph_url = f"https://graph.microsoft.com/beta/compliance/ediscovery/cases/{case_id}/custodians/"
graph_url = f"https://graph.microsoft.com/beta/compliance/ediscovery/cases/{case_id}/custodians"

headers = {
"Content-Type": "application/json",
Expand Down Expand Up @@ -523,7 +523,7 @@ def release_custodian(self, tenant_id, client_id, client_secret,case_id, custodi
def list_legalholds(self, tenant_id, client_id, client_secret,case_id):
graph_url = "https://graph.microsoft.com"
session = self.authenticate(tenant_id, client_id, client_secret, graph_url)
graph_url = f"https://graph.microsoft.com/beta/compliance/ediscovery/cases/{case_id}/legalholds"
graph_url = f"https://graph.microsoft.com/beta/compliance/ediscovery/cases/{case_id}/legalHolds"

ret = session.get(graph_url)
print(ret.status_code)
Expand All @@ -537,7 +537,7 @@ def list_legalholds(self, tenant_id, client_id, client_secret,case_id):
def get_legalhold(self, tenant_id, client_id, client_secret, case_id, legalhold_id):
graph_url = "https://graph.microsoft.com"
session = self.authenticate(tenant_id, client_id, client_secret, graph_url)
graph_url = f"https://graph.microsoft.com/beta/compliance/ediscovery/cases/{case_id}/custodians/{legalhold_id}"
graph_url = f"https://graph.microsoft.com/beta/compliance/ediscovery/cases/{case_id}/legalHolds/{legalhold_id}"

ret = session.get(graph_url)
print(ret.status_code)
Expand Down