Automate Secure Score using Power Automate

Ashish Pandey
3 min readMay 14, 2020

--

Microsoft Secure Score is a measurement of an organization’s security posture, with a higher number indicating more improvement actions taken. Following the Security Score recommendations can protect your organization from threats. From a centralized dashboard in the Microsoft 365 security center, organizations can monitor and work on the security of their Microsoft 365 identities, data, apps, devices, and infrastructure.

Secure Score helps organizations:

Report on the current state of the organization’s security posture.

Improve their security posture by providing discoverability, visibility, guidance, and control.

Compare with benchmarks and establish key performance indicators (KPIs).

Organizations gain access to robust visualizations of metrics and trends, integration with other Microsoft products, score comparison with similar organizations, and much more. The score can also reflect when third-party solutions have addressed recommended actions.

  1. we start publishing an app in Azure
we would need app id,tenant id going further.

from above article we can create and publish app using below URIs

then we need to manage permissions(delegate and app permissions)

in our case we only need below permissions —

https://docs.microsoft.com/en-us/graph/api/securescore-get?view=graph-rest-1.0&tabs=http

lets see how we can get secret of the app as we would need it in the flow.

now we are done creating app so lets see how we can create flow to automate secure score metric and send the report on the email.

  1. create a scheduled flow from from blank

2.then we set re-occurrence and initialize variables we get from our published app.

3. once we are done initializing variables, we call HTTP method to get data from the URI like below

https://graph.microsoft.com/v1.0/security/secureScores?$top=1

4. click save and run and copy the output of this result. we paste that it our next method under generate from the sample.

5. next step is to create a html table from control score arrays and set columns to automatic however you can customize it if you wish to so its up to your choice what all values you want to be appeared in your final table.

after click save and run , check table if it shows the proper data.

6. final step is to create a email connection and HTML formatting.you can use below code if you want of customize it as per requirement.

7. click save and run and you will get an email like below with key seure score metrics and scores across —

Thanks for visiting, hope you can get an overview and modify it if required.

Thanks,

Ashish Pandey

--

--

Ashish Pandey
Ashish Pandey

Written by Ashish Pandey

Senior Data Scientist @Accenture AI

No responses yet