This article shows how to leverage the Lumu Defender API and Cynet API to mitigate security risks.
1. Make sure you are located in the account you want to integrate with Lumu. Head to the left navigation bar, then click on your MSP organization name. Finally, locate the account you want to configure and click on it.
Follow these steps inside your Cynet console to create it.1. In your account window, head left to the navigation bar, expand the Settings section and click on the Users & Roles menu.
2. In the User & Roles window, click on the Roles tab, then click on the Add Role button.
3. On the panel that opens, enter the following information:a. Under Role Name(1), provide a distinctive name for the role.b. In the Permissions list, unfold the API(2) dropdown, and select the API - full access(3) permissionc. Once you’re done, click on the Add(4) button to save your new role.
1. In your account window, head left to the navigation bar, expand the Settings section and click on the Users & Roles menu
2. In the User & Roles window, click on the API Users tab, then click on the New button.
3. In the panel that opens, fill in the data following these guidelines:a. Under Display Name(1), provide a distinctive name for the API user.b. Under User Role(2), enter the name of the user role created in the Create an integration role section.c. When finished, click on the Add(3) button to save your integration user.
4. The API Access-Key & Secret-Key window will appear. Take note of the Access-Key and the Secret-Key field data and keep them on hand, these will be required later to configure the integration.
This will be the only time these will be shown.
The Threat Hunting feature must be enabled to make the integration work. To enable this feature, follow these steps inside your Cynet console:
You must perform this task for every Windows group.1. Head to the left navigation bar, expand the Settings section and click on the Groups menu.
2. In the Groups window, look for the required endpoint group and click on the Pencil icon to edit it. In this example, the icon is displayed on “Manually Installed Endpoints”.
3. In the Settings tab, click on the Advanced settings link under the Endpoint Detection & Response (EDR) section.
4. Enable the Threat Hunting toggle
5. Save your changes by clicking on the Ok buttonAfter enabling Threat Hunting for the selected groups, you must define the Alert Severity for the threat hunting-related alerts.1. In the Settings section, click on the Threat Hunting menu.
2. In the Threat Hunting window, look for the Alert Severity field. Select the most suitable value for your security operations. Click on the Save Changes button when done.
The Cynet base URL is required for setting up the integration in later steps, the URL follows the next structure:
The CYNET-URL-INSTANCE is needed to configure the integration
To collect the Lumu Defender API key, please refer to the Defender API document.
To collect your Lumu company UUID, log in to your Lumu portal. Once you are in the main window, copy the string below your company name.
The companies file is in charge of defining how the integration connects to Lumu and extracts the information of the incidents and related indicators of compromise.
-
lumu:
uuid: "COMPANY_UUID"
defender_key: "DEFENDER_API_KEY"
hash_type: "sha256"
ioc_types: # list of ioc types, option one, many or all
- hash
adversary: # list of adversary types, option one, many or all
- C2C
- Malware
- Mining
- Spam
- Phishing
- Anonymizer
days: 3 # MIN 1, MAX 3
Within this file, COMPANY_UUID and DEFENDER_API_KEY fields are mandatory. Please use the values captured in the previous steps. The ioc_types values must match with the IOC types required by the integration, in this case, hash.
The integration file contains the information required for the integration to connect and interact with your Cynet deployment:
- lumu:
uuid: "COMPANY_UUID"
adversaryTypes: [ "C2C", "Malware", "Mining", "Spam", "Phishing", "Anonymizer"] # ["C2C", "Malware", "Mining", "Spam", "Phishing", "Anonymizer"]
days: 3 # INTEGER=(get incidents from X days of the ioc manager local db)
app:
name: "UNIQUE-NAME"
clean: false # true | false
ioc:
- hash
hash_type: sha256 # sha256 | sha1 | md5
api:
url: "https://CYNET-URL-INSTANCE.api.cynet.com/"
client_id: "CYNET-CLIENT-ID" # Ask it to Cynet support or MSP admin
username: "CYNET-API-USER-ACCESS-KEY"
password: "CYNET-API-USER-SECRET-KEY"
Keep in mind that:
COMPANY_UUID is the ID found in the Collect your Lumu company UUID step.
DEFENDER_API_KEY is the key found in the Collect the Lumu Defender API key.
CYNET-CLIENT-ID is the client ID collected from Cynet in the Obtain your Cynet client ID step.
CYNET-API-USER-ACCESS-KEY is the access key found in Step 4 of the Create an API user section, under Access-Key.
CYNET-API-USER-SECRET-KEY is the access key found in Step 4 of the Create an API user section, under Secret-Key.
To use the script, you must locate yourself on the path selected for deployment (<app_lumu_root>). Use the following command to show all options available for the package:
| Options | Description |
| -h, --help | show this help message and exit |
| --config CONFIG | default: integrations.yml, CONFIG FILE PATH of the companies, follow the nex YML template. |
| --ioc-manager-db-path IOC_MANAGER_DB_PATH | default path: ./ioc.db, PATH where the integration goes to read the Lumu Incidents |
| --logging {screen,file} | Logging option (default screen). |
| --verbose, -v | Verbosity level. |
| --hours HOURS | keep db log record from [x hours], for auto maintenance local db purpose |
To query all the hashes related to Lumu incidents triggered in the last 30 days, run the following command.
python3 run.py
By default, the integration script will query incidents related to all adversary types.
python3 run.py --config integrations.yml --ioc-manager-db-path /<ioc-manager-path>/ioc.db
To clean the existing records in Cynet, just set up the clean flag in the integrations.yml file to true.
Then, run the integration script as follows:
python3 run.py [--config CONFIG] [--ioc-manager-db-path IOC_MANAGER_DB_PATH]
According to your needs, you can combine the examples shown, also, adding the –logging {file, screen} and –verbose argument can be used for better understanding of what can be rolling wrong.
2. Run the container by using the following command.
With this mode, your integration will run every 5 minutes.
To collect integration logs:
-v flag. The script execution log will show more detailed information.If you receive the following error.
There could be another instance running. To check this, open the pid.pid file in the integration folder. This file stores the process ID if it’s running.
You can define remediation playbooks for your Lumu alerts and create actions to remediate them automatically. Next, you will find examples for a remediation playbook and an auto remediation rule.
1. Expand the left navigation menu. Click on the Remediation menu under the Settings section
2. In the Remediation window, move to the Playbooks tab. Click on the Create button
3. In the CREATE PLAYBOOK window, fill in the required information. Follow these guidelines:a. Give a Name(1) to the playbookb. Set the Playbook Execution Time(2) to Parallelc. Under the Playbook Actions section, select and move the Quarantine (For Playbook)(3) and the Kill Process (For Playbook)(4) available custom remediations to the Custom remediations playbook sectiond. Click on the Save(5) button
1. Expand the left navigation menu and then click on the Actions menu
2. In the Actions window, move to the Auto remediation tab. Click on the Create Rule button
3. Fill in the required information. Follow these guidelinesa. Under Name(1) enter a descriptive name.b. Under the Matching > Alert Name(2) field, type Threat Hunting Detected By File SHA256c. Select the device groups(3) you want to apply the remediation rule to.d. Select the Alerts Severity(4) based on the configuration made in the Threat Hunting modulee. In the Action section, select PlayBook Actions(5). Select the playbook created in the previous stepf. Click on the Save button when done.