Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,978 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Can we calculate the identity , apps, data & device scores from this data that we obtain from the secure score query using graph api?
"averageComparativeScores": [
{
"basis": "AllTenants",
"averageScore": 53.65,
"appsScore": 30.19,
"appsScoreMax": 81.25,
"dataScore": 0.47,
"dataScoreMax": 3.38,
"deviceScore": 9.04,
"deviceScoreMax": 16.57,
"identityScore": 35.27,
"identityScoreMax": 59.54,
"infrastructureScore": 0,
"infrastructureScoreMax": 0
},
{
"basis": "TotalSeats",
"averageScore": 42.03,
"SeatSizeRangeLowerValue": "1001",
"SeatSizeRangeUpperValue": "10000",
"appsScore": 78.66,
"appsScoreMax": 187.95,
"dataScore": 1.97,
"dataScoreMax": 6.79,
"deviceScore": 96.26,
"deviceScoreMax": 172.91,
"identityScore": 32.03,
"identityScoreMax": 71.01,
"infrastructureScore": 0,
"infrastructureScoreMax": 0
}
Using Logic Apps and the Microsoft Graph API, I was able to calculate security scores for various categories like Apps and Identity. Here's a concise explanation of the process:
MaxScore
and Score
variables to 0.MaxScore
:
if(
equals(mul(float(items('For_each_6')?['scoreInPercentage']), 0.01), 0),
1,
div(
items('For_each_6')?['score'],
mul(float(items('For_each_6')?['scoreInPercentage']), 0.01)
)
)
This expression checks if scoreInPercentage
is 0 to avoid division by zero. If it is, it sets MaxScore
to 1. Otherwise, it calculates MaxScore
by dividing Score
by the percentage converted to a decimal.Score
and scoreInPercentage
are 0 even if there is a MaxScore
.MaxScore
.Score
is 0, retrieve MaxScore
using the API; otherwise, use the calculated value.Score
values and MaxScore
values for each control in the category.Score
by the total MaxScore
to get the percentage for that control category.