Join us Dec. 16 for The Community Hour, our first global virtual User Group event!

Script is failing to fetch data from the sn_sec_int_impl table with non-admin user

Release: Australia
sunnykumar
Tera Contributor

Hi,

The Vulnerability Response application has an issue on a specific instance. The integration scheduled job runs as expected when executed using the admin user, but fails with "Incomplete credentials — integration cannot run." when executed using the non-admin VIF System user.

 

Context

  • Scheduled Job: We create the scheduled job record in the new integration framework table (sn_vul_int_fw_integration) and set Run As to the VIF System user.

  • Working environments: On our DEV, QA, and Cert instances, the scheduled job succeeds when running as the VIF System user with the roles listed below.

  • Failing environment: On the specific instance, the same scheduled job fails with the error above for VIF System, even though the user has the same set of roles:

    • sn_sec_cmn.admin

    • sn_sec_int.admin

    • sn_vul_int_fw.vif_import_admin

    • connection_admin

    • flow_admin

    • x_custom.app_admin

Additional Observations on the Failing Instance

  • Encryption module in picker: In the header picker (below Application Scope and Update Set), an encryption module (global.cm_grc_encryption) appears on the failing that specific instance. Could this cryptographic module be interfering and preventing script access to encrypted data on the sn_sec_int_impl table for VIF System?

  • Implicit snc_internal role: snc_internal is automatically assigned to VIF System on that instance. Could anything related to implicit roles, ACLs, or security/encryption policies be interfering?

Has anyone run into "Incomplete credentials — integration cannot run." on a specific instance when running as a non-admin user? The code is shared below for reference, and any help would be greatly appreciated!

  validateIntegration: function(integrationSysId) {
        try {
            if (!integrationSysId) {
                throw new Error("The integration record sys id passed to Utils is null or undefined.");
            }
            var validatedGr = new GlideRecordSecure("sn_vul_int_fw_integration");
            if (!validatedGr.get(integrationSysId))
                throw new Error("No integration found with sys id:" + integrationSysId);

            this.integrationGr = validatedGr;
            gs.info("Successfully validated the integrationGr");
            return this.integrationGr;
        } catch (e) {
            throw new Error(e.message);
        }
    },

    loadConfigurations: function() {
        try {
            var implUtil = new sn_sec_int.Implementation();
            var config = implUtil.getConfiguration(this.integrationGr.instance + "");

            if (!config) {
                throw new Error("Unable to fetch configurations from the implementation configuration table.");
            }

            if (!config.base_url || !config.api_key || !config.api_key_id) {
                gs.error(
                    "Missing required credentials. " +
                    "Ensure base_url, api_key, " +
                    "key_id are all set on the credential record.");
                throw new Error(METHOD + "Incomplete credentials — integration cannot run.");
            }

            return {
                SERVER_URL: config.base_url,
                API_KEY: config.api_key,
                API_KEY_ID: config.api_key_id,
           };
        } catch (e) {
            throw new Error(e.message);
        }
    },

 

0 REPLIES 0