Skip to content

Entra conditional access: Add logging between Fleet proxy (fleetdm.com) and Microsoft #31986

@noahtalerman

Description

@noahtalerman
  • @noahtalerman: Can we please add logs of the communication (requests) between the Fleet proxy and all the Microsoft tools? (Intune, Microsoft Graph, etc.). Why? In dogfood, we're finding that some hosts never get marked as non-compliant while others do.
  • @mikermcneil: Just an idea, but could add sails.log() with an easy to search prefix (assuming debug log level is on)
  • @lucasmrod: Also we will need logging of the Intune group we end up selecting for applying the "conditional access policy". We would like to see which group is assigned the policy. E.g. we deleted the "All company" group, what happens if the proxy used that one to set the policy? But we want to confirm it selected the right group:
    // Use the Microsoft Graph API to retreive the ID of the default "All users" group to assign the policy to.
    let groupResponse = await sails.helpers.http.sendHttpRequest.with({
    method: 'GET',
    url: `https://graph.microsoft.com/v1.0/groups`,
    headers: {
    'Authorization': `Bearer ${graphAccessToken}`
    }
    }).intercept(async (err)=>{
    await MicrosoftComplianceTenant.updateOne({id: informationAboutThisTenant.id}).set({setupError: `${require('util').inspect(err, {depth: null})}`});
    sails.log.warn(`An error occurred when sending a request to find the default "All users" group on a Microsoft compliance tenant. Full error: ${require('util').inspect(err, {depth: 3})}`);
    return {redirect: fleetInstanceUrlToRedirectTo };
    });
    // Get the ID returned in the response.
    let parsedGroupResponse;
    try {
    parsedGroupResponse = JSON.parse(groupResponse.body);
    } catch(err){
    sails.log.warn(`An error occured when parsing the JSON response body returned by the Microsoft graph API for a new Microsoft compliance tenant. full error`, err);
    await MicrosoftComplianceTenant.updateOne({id: informationAboutThisTenant.id}).set({setupError: `${require('util').inspect(err, {depth: null})}`});
    return {redirect: fleetInstanceUrlToRedirectTo };
    }
    let groupId = parsedGroupResponse.value[0].id;

Metadata

Metadata

Assignees

No one assigned

    Labels

    #g-websiteProduct group: Website (fleetdm.com)

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions