Skip to content

De-duplicates and merges client assets in a more comprehensive contextual way based on asset name, hostname, and IP address.

License

Notifications You must be signed in to change notification settings

PlexTrac-Labs/asset-deduplication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asset-deduplication

This Python script is designed to facilitate asset deduplication using the Plextrac API. It identifies duplicate assets within a specific Plextrac client and updates associated findings to reference a primary asset for each group of duplicate assets. Below is an overview of the script functionality and usage instructions.

Requirements

Installing

After installing Python, pip, and pipenv, run the following commands to setup the Python virtual environment.

git clone this_repo
cd path/to/cloned/repo
pipenv install

Setup

After setting up the Python environment the script will run in, you will need to setup a few things to configure the script before running.

Credentials

In the config.yaml file you should add the full URL to your instance of Plextrac.

The config also can store your username and password. Plextrac authentication lasts for 15 mins before requiring you to re-authenticate. The script is set up to do this automatically through the authentication handler. If these 3 values are set in the config, and MFA is not enabled for the user, the script will take those values and authenticate automatically, both initially and every 15 mins. If any value is not saved in the config, you will be prompted when the script is run and during re-authentication.

Usage

After setting everything up you can run the script with the following command. You should run the command from the folder where you cloned the repo.

pipenv run python main.py

You can also add values to the config.yaml file to simplify providing the script with custom parameters needed to run.

Required Information

The following values can either be added to the config.yaml file or entered when prompted for when the script is run.

Script Execution Flow

  • Retrieve a list of clients from the Plextrac instance.
  • Prompt the user to select a client for asset deduplication.
  • Load assets for the selected client.
  • Identify duplicate assets and group them together.
  • Determine asset pair replacements needed to update associated findings.
  • Update affected assets on finding records.
  • Delete duplicate client assets no longer tied to any findings.
  • Log the completion status and any failed operations.

About

De-duplicates and merges client assets in a more comprehensive contextual way based on asset name, hostname, and IP address.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages