{"id":25332443,"url":"https://github.com/stanfrbd/mde_api","last_synced_at":"2025-06-12T14:36:09.474Z","repository":{"id":213675406,"uuid":"734397767","full_name":"stanfrbd/mde_api","owner":"stanfrbd","description":"Microsoft Defender for Endpoint API Wrapper","archived":false,"fork":false,"pushed_at":"2024-01-18T16:44:05.000Z","size":62,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T04:52:13.966Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stanfrbd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-21T15:22:30.000Z","updated_at":"2023-12-22T09:05:39.000Z","dependencies_parsed_at":"2024-01-18T18:17:51.341Z","dependency_job_id":"3e1f9c55-cc0b-421f-9f29-077e2b88c5d3","html_url":"https://github.com/stanfrbd/mde_api","commit_stats":null,"previous_names":["stanfrbd/mde_api"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stanfrbd%2Fmde_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stanfrbd%2Fmde_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stanfrbd%2Fmde_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stanfrbd%2Fmde_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stanfrbd","download_url":"https://codeload.github.com/stanfrbd/mde_api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247801185,"owners_count":20998331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-14T04:52:15.297Z","updated_at":"2025-04-08T07:45:47.389Z","avatar_url":"https://github.com/stanfrbd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mde_api\n\nThis script helps to get the list of EDR onboarded machines (Windows Servers) in an easy way.\n\nFor a better understanding, refer to the official Microsoft Defender for Endpoint API documentation: https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/api/exposed-apis-list?view=o365-worldwide\n\n## Install dependencies\n\nYou might want to create a [`venv`](https://docs.python.org/3/library/venv.html) before installing the dependencies.\n\n```\npip install -r requirements.txt\n```\n\n## Usage\n\n```\nusage: mde_api.py [-h] {machines,token}\n\nList onboarded machines or token\n\npositional arguments:\n  {machines,token}\n                        Action to perform\n\noptions:\n  -h, --help            show this help message and exit\n```\n\n# Quick start\n\nFollow the instructions to get a working App Registration in Azure Entra ID.\nhttps://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/api/exposed-apis-create-app-webapp?view=o365-worldwide#create-an-app\n\n## Edit the config file\n```\ncp secrets-sample.json secrets.json\n```\n\nThen edit the config with the good values.\n\n| Secret | Explaination |\n|----------|--------------|\n|`tenantId`| Microsoft Tenant ID (?tid=... in MDE console URL) |\n|`appId`| Called `clientId` sometimes |\n|`appSecret`| Your App / Client secret |\n|`proxyUrl`| Your proxy if needed - leave blank if not |\n\n```\n{\n    \"tenantId\": \"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\",\n    \"appId\": \" XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\",\n    \"appSecret\": \"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\",\n    \"proxyUrl\": \"\"\n}\n```\n\n## Execute the script\n\n\u003e Windows\n\n```\nPS C:\\Users\\Me\\Test\u003e python mde_api.py machines\n```\n\n\u003e Linux\n\n```\n$ python3 mde_api.py machines\n```\n\n\u003e Linux  \n\n```\n$ chmod +x mde_api.py\n$ ./mde_api.py machines\n```\n\n## Output\n\n- An Excel (autofiltered) file will be created with datetime.\n\n```\nPS C:\\Users\\Me\\Test\u003e python .\\mde_api.py\n55 fully onboarded, 5 can be onboarded, 5 inactive.\nProcessed 323 API results.\nSuccessfully created 2023-12-21-15_47_24-mde-api-results.xlsx\n```\n\n# Errors\n\nIf the `secrets.json` is not properly filled.\n```\nGeneral error: HTTP error: check your secrets file and App Registration.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstanfrbd%2Fmde_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstanfrbd%2Fmde_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstanfrbd%2Fmde_api/lists"}