cudeso / misp2sentinel

MISP to Sentinel integration
MIT License
60 stars 21 forks source link

Should we have an using MSI check or option in the code? #80

Closed jusso-dev closed 8 months ago

jusso-dev commented 9 months ago

Hey @cudeso seeking your advice if the Azure Function app should be aware that an Managed Service Identity (MSI) is in use?

This specifically relates to the code crafting a request to fetch an "access_token" using client_id and client_secret - https://github.com/cudeso/misp2sentinel/blob/f9e4ef4b3b0dac92d10fee769fbf60d72659bb1a/AzureFunction/MISP2Sentinel/RequestManager.py#L68

We could remove the need for client_id and client_secret all together and just add instructions for users to add an MSI with relevant RBAC applied to get a token using this code:

import MISP2Sentinel.config as config
from MISP2Sentinel.constants import *

scope = config.ms_auth[SCOPE]
credential = DefaultAzureCredential()
credential.get_token('https://management.azure.com/').token
jusso-dev commented 9 months ago

This also appears to be raised here #3

jusso-dev commented 8 months ago

Addressed with PR #86