{ "workflow": { "unique_name": "definition_workflow_01OIGH6Y4K3LG0nP4pAXUfr6wQ8aOtxzWRf", "name": "MSSP-Add-AMP+UMB-Creds", "title": "MSSP-Add-AMP+UMB-Creds", "type": "generic.workflow", "base_type": "workflow", "variables": [ { "schema_id": "datatype.string", "properties": { "value": "empty", "scope": "input", "name": "Umbrella Org ID", "type": "datatype.string", "is_required": false, "is_invisible": false }, "unique_name": "variable_workflow_01OIGJ1EHXFOJ7Uox6bUVdpyjurotbzWNra", "object_type": "variable_workflow" }, { "schema_id": "datatype.string", "properties": { "value": "empty", "scope": "input", "name": "Umbrella API Key", "type": "datatype.string", "is_required": false, "is_invisible": false }, "unique_name": "variable_workflow_01OIGIO6PMGKJ0sSX4RoT47vMuG05nMscfD", "object_type": "variable_workflow" }, { "schema_id": "datatype.string", "properties": { "value": "empty", "scope": "input", "name": "AMP API Client ID", "type": "datatype.string", "is_required": false, "is_invisible": false }, "unique_name": "variable_workflow_01OIGH6XX1X4L7A4eWHuaItn6tf9pKUbUVB", "object_type": "variable_workflow" }, { "schema_id": "datatype.string", "properties": { "value": "empty", "scope": "input", "name": "AMP API Client Secret", "type": "datatype.string", "is_required": false, "is_invisible": false }, "unique_name": "variable_workflow_01OIGH6XX21J44XLHNjYycPCP9tE1MwYrz9", "object_type": "variable_workflow" }, { "schema_id": "datatype.string", "properties": { "value": "", "scope": "input", "name": "Customer Name", "type": "datatype.string", "is_required": true, "is_invisible": false }, "unique_name": "variable_workflow_01OIGH6XX23324joA2pkKMxBKs53iuVkDfj", "object_type": "variable_workflow" }, { "schema_id": "datatype.string", "properties": { "value": "empty", "scope": "input", "name": "Umbrella API Secret", "type": "datatype.string", "is_required": false, "is_invisible": false }, "unique_name": "variable_workflow_01OIGIVWBQ38319gDCP4q0Jj6c7Y3zUHWpJ", "object_type": "variable_workflow" } ], "properties": { "atomic": { "is_atomic": false }, "delete_workflow_instance": false, "description": "RUN EVERY TIME NEW CUSTOMER IS ADDED\n\nMake sure global table is set first as described in install insctructions! This workflow takes in the customer name, AMP API client ID and secret and Umbrella API client ID and secret. It stores them in a global table. This table can be used by other workflows to loop through API credentials of various MSSP customers. Please note that the credentials are base 64 encoded, however are stored in the global table variable. SecureX is secured with MFA, but this still needs to be taken into consideration. ", "display_name": "MSSP-Add-AMP+UMB-Creds", "runtime_user": { "override_target_runtime_user": false, "specify_on_workflow_start": false, "target_default": true }, "target": { "execute_on_target_group": false, "execute_on_workflow_target": false, "no_target": true, "specify_on_workflow_start": false } }, "object_type": "definition_workflow", "actions": [ { "unique_name": "definition_activity_01OIGH7VMCQVP4UQg663MUHbRUCZyJrBgSZ", "name": "Execute Python Script", "title": "Encode AMP API Credentials", "type": "python3.script", "base_type": "activity", "properties": { "action_timeout": 180, "continue_on_failure": false, "display_name": "Encode AMP API Credentials", "script": "import sys, base64\n\napi_client_id = sys.argv[1]\napi_client_secret = sys.argv[2]\n\nconcat_string = api_client_id + \":\" + api_client_secret\nstring_bytes = concat_string.encode(\"ascii\") \n \nbase64_bytes = base64.b64encode(string_bytes) \nbase64_string = base64_bytes.decode(\"ascii\")\n\n", "script_arguments": [ "$workflow.definition_workflow_01OIGH6Y4K3LG0nP4pAXUfr6wQ8aOtxzWRf.input.variable_workflow_01OIGH6XX1X4L7A4eWHuaItn6tf9pKUbUVB$", "$workflow.definition_workflow_01OIGH6Y4K3LG0nP4pAXUfr6wQ8aOtxzWRf.input.variable_workflow_01OIGH6XX21J44XLHNjYycPCP9tE1MwYrz9$" ], "script_queries": [ { "script_query": "base64_string", "script_query_name": "base64_string", "script_query_type": "string" } ], "skip_execution": false }, "object_type": "definition_activity" }, { "unique_name": "definition_activity_01OIGJOOOP9FH4HjVZVOnI17otbDhIEDU54", "name": "Execute Python Script", "title": "Encode UMB API Credentials", "type": "python3.script", "base_type": "activity", "properties": { "action_timeout": 180, "continue_on_failure": false, "display_name": "Encode UMB API Credentials", "script": "import sys, base64\n\napi_client_id = sys.argv[1]\napi_client_secret = sys.argv[2]\n\nconcat_string = api_client_id + \":\" + api_client_secret\nstring_bytes = concat_string.encode(\"ascii\") \n \nbase64_bytes = base64.b64encode(string_bytes) \nbase64_string = base64_bytes.decode(\"ascii\")\n\n", "script_arguments": [ "$workflow.definition_workflow_01OIGH6Y4K3LG0nP4pAXUfr6wQ8aOtxzWRf.input.variable_workflow_01OIGIO6PMGKJ0sSX4RoT47vMuG05nMscfD$", "$workflow.definition_workflow_01OIGH6Y4K3LG0nP4pAXUfr6wQ8aOtxzWRf.input.variable_workflow_01OIGIVWBQ38319gDCP4q0Jj6c7Y3zUHWpJ$" ], "script_queries": [ { "script_query": "base64_string", "script_query_name": "base64_string", "script_query_type": "string" } ], "skip_execution": false }, "object_type": "definition_activity" }, { "unique_name": "definition_activity_01OIGH8BS584H0hjIYKD5zHt1Jbx5UTACV5", "name": "Add Row to Table", "title": "Add API keys to global table", "type": "core.addrowtotable", "base_type": "activity", "properties": { "action_timeout": 180, "continue_on_failure": false, "display_name": "Add API keys to global table", "input_table": "$global.variable_01OIGED6AOKJF1xDkDhe3D8nDvq7sNPFk7d.global.variable_01OIGED6AOKJF1xDkDhe3D8nDvq7sNPFk7d$", "row": [ { "key": "customer_name", "type": "string", "value": "$workflow.definition_workflow_01OIGH6Y4K3LG0nP4pAXUfr6wQ8aOtxzWRf.input.variable_workflow_01OIGH6XX23324joA2pkKMxBKs53iuVkDfj$" }, { "key": "encoded_amp_api_credentials", "type": "string", "value": "$activity.definition_activity_01OIGH7VMCQVP4UQg663MUHbRUCZyJrBgSZ.output.script_queries.base64_string$" }, { "key": "encoded_umb_api_credentials", "type": "string", "value": "$activity.definition_activity_01OIGJOOOP9FH4HjVZVOnI17otbDhIEDU54.output.script_queries.base64_string$" }, { "key": "umb_org_ID", "type": "string", "value": "$workflow.definition_workflow_01OIGH6Y4K3LG0nP4pAXUfr6wQ8aOtxzWRf.input.variable_workflow_01OIGJ1EHXFOJ7Uox6bUVdpyjurotbzWNra$" } ], "skip_execution": false }, "object_type": "definition_activity" } ], "categories": [ "category_01OIGHQE033W72ahnJ3oHLYTMRvqLeNaDrX" ] }, "categories": { "category_01OIGHQE033W72ahnJ3oHLYTMRvqLeNaDrX": { "unique_name": "category_01OIGHQE033W72ahnJ3oHLYTMRvqLeNaDrX", "name": "MSSP-NEW", "title": "MSSP-NEW", "type": "basic.category", "base_type": "category", "category_type": "custom", "object_type": "category" } }, "variables": { "variable_01OIGED6AOKJF1xDkDhe3D8nDvq7sNPFk7d": { "unique_name": "variable_01OIGED6AOKJF1xDkDhe3D8nDvq7sNPFk7d", "schema_id": "tabletype_01OIGDRBKEF960WVsTfgWwBqUo1lbLQH2U4", "properties": { "value": [ { "column_data": { "customer_name": "Company CHRIS", "encoded_amp_api_credentials": "OTFlZTQ4NTM3ZmY5N2Q1NjQ1M2E6ZmI3NTI4N2UtZjNhZS00NWM5LTgxMjktZGM5OTFhOWJlODEz", "encoded_umb_api_credentials": "MDQ0ZTMyZmIyNWMwNGEzZGI1ZjBlYjBkMDA2NDVjNWY6NzM1MTcxZDNlYjc5NDQ5MTkxNTQ4MjI1ODM0ODM2MjU", "umb_org_ID": "5325945" } }, { "column_data": { "customer_name": "customer-final-test", "encoded_amp_api_credentials": "ZGNiMTkzZGFkYzZhNjYyODk5OGI6Mzc0ZTMwYzEtNjgwMi00ZGE0LWJlOGYtMDc2NmIzMGE4YmYx", "encoded_umb_api_credentials": "MDQ0ZTMyZmIyNWMwNGEzZGI1ZjBlYjBkMDA2NDVjNWY6NzM1MTcxZDNlYjc5NDQ5MTkxNTQ4MjI1ODM0ODM2MjU=", "umb_org_ID": "5325945" } } ], "scope": "global", "name": "MSSP_api_creds", "type": "datatype.table", "is_required": false, "is_invisible": false }, "object_type": "variable" } }, "table_types": { "tabletype_01OIGDRBKEF960WVsTfgWwBqUo1lbLQH2U4": { "unique_name": "tabletype_01OIGDRBKEF960WVsTfgWwBqUo1lbLQH2U4", "data_type": "datatype.tabletype", "display_name": "MSSP_List_API_keys_new", "description": "AMP and Umbrella", "columns": [ { "name": "customer_name", "title": "Customer Name", "type": "string" }, { "name": "encoded_amp_api_credentials", "title": "Encoded AMP API Credentials", "type": "string" }, { "name": "encoded_umb_api_credentials", "title": "Encoded UMB API Credentials", "type": "string" }, { "name": "umb_org_ID", "title": "Umbrella Org ID", "type": "string" } ], "base_type": "datatype", "object_type": "tabletype" } } }