Skip to main content
Skip table of contents

Data Security

Feature

Data Security mechanism is available in Germain to -dynamically- make data (a.k.a. “fact” collected by Germain) visible or not to a Germain User.

Each individual “fact” in Germain data model can be secured following a Security Script that your organization can inject into Germain. That Security Script is inserted in:

  • either in a Germain RUM JS’s Init Script, for User Session Replay-related data

  • or in a “rule” for other fact/data (that you configure Germain to collect) and visible at Germain Workspace > Left Menu > Analytics > Rules.

Example of Dynamic Data-driven Security Setting

This client, a financial stock trading platform, needed to dynamically set the visibility of the User Session Replay (that Germain records in real-time and lets them “replay” later), so that a Recorded User Session cannot be replayed by any Team but instead only be replayed by the Teams that are entitled to view them and based on the financial products (Stocks, ETF, etc) that were traded during that recorded user session.

To achieve this, Germain Team helped the client customized Germain RUM JS’s init script with the following logic.

Germain RUM JS’s init script:

Example to add access controls to all facts including replay:

CODE
/**
 * Sets all facts (and the Replay itself) to be visible based on the user being monitored
 *
 * In the example below:
 *  - Application User is an Admin user - Data visible to Germain UX Technical team only
 *  - Application User is a Business user - Data visible to Germain UX Technical team OR Germain UX Business team
 *  - Application User is any other type - Data visible to all Germain UX users
 */
settings.application.metadataProviders['access'] = function(window) {
    // These constants are available from the Teams view in Germain UX
    const technicalTeamAccessId = 't0';
    const businessTeamAccessId = 't1';
    if (isAdminUser(user)) {
        // If the user being collected is an Admin user (within the application being
        // monitored), only allow the Technical Team (in Germain UX) to access the replay
        return technicalTeamAccessId;
    } else if (isBusinessUser(user)) {
        // If the user being collected is a Business user (within the application being monitored),
        // allow the Technical Team (in Germain UX) or Business Team (in Germain UX) to access the replay
        return `${technicalTeamAccessId} || ${businessTeamAccessId}`;
    }
    // Otherwise any Germain UX user can view the replay
    return undefined;
};

function isAdminUser(user) {
    // custom application logic here...
    return user.type === 'Admin';
}

function isBusinessUser(user) {
    // custom application logic here...
    return user.type === 'Business';
}

Example to add access controls to a specific type of fact (in this example UxConsoleEvent), not including replay:

CODE
/**
 * Sets UxConsoleEvents to be visible based on the user being monitored
 *
 * In the example below:
 *  - Application User is an Admin user - Data visible to Germain UX Technical team only
 *  - Application User is a Business user - Data visible to Germain UX Technical team OR Germain UX Business team
 *  - Application User is any other type - Data visible to all Germain UX users
 */
settings.application.factProcessor = (fact) => {
    if (fact.myClassName === 'UxConsoleEvent') {
        // These constants are available from the Teams view in Germain UX
        const technicalTeamAccessId = 't0';
        const businessTeamAccessId = 't1';
        if (isAdminUser(user)) {
            // If the user being collected is an Admin user (within the application being monitored),
            // only allow the Technical Team (in Germain UX) to access this fact
            fact.access = technicalTeamAccessId;
        } else if (isBusinessUser(user)) {
            // If the user being collected is a Business user (within the application being monitored),
            // allow the Technical Team (in Germain UX) or Business Team (in Germain UX) to access this fact
            fact.access = `${technicalTeamAccessId} || ${businessTeamAccessId}`;
        } else {
            // do nothing, this will mean the fact is visible to all Germain UX users
        }
    }
};

function isAdminUser(user) {
    // custom application logic here...
    return user.type === 'Admin';
}

function isBusinessUser(user) {
    // custom application logic here...
    return user.type === 'Business';
}

Notes

  • The isAdminUser and isBusinessUser would be logic based on the monitored application.

  • This logic is completely customisable, above are only examples, the important parts are:

    • In the first example the settings.application.metadataProviders['access'] should return the access expression

    • In the second example, the settings.application.factProcessor should set the fact.access property to the access expression for the fact

  • We support complex syntax for these access expressions:

    • t1 => only members of the Team with accessId t1 can see the data

    • t1 || t2 => members of either Team with accessId t1 OR t2 can see the data

    • t1 && t2 => members must be members of both Teams with accessId t1 AND t2 to be able to see the data

Service: Automation

Feature Availability: 2021.2 or later

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.