Skip to main content

Contrast Security IntelliJ plugin

Use the Contrast IDE (Integrated Development Environment) plugin to integrate security vulnerabilities associated with projects (Scan) and applications (Assess). The Contrast plugin provides thorough information about vulnerabilities visible in projects and applications on a near real-time basis. The plugin offers filters based on severity, status, and discovery date to customize the vulnerability data to view.

The key features include a vulnerability report to view vulnerabilities associated with applications, provide a tree view on the list of the vulnerabilities related to the current file open in the IDE with visual indicators based on criticality, provide in-depth details about each vulnerability, automate the collection of vulnerabilities for applications and projects based on a schedule.

Before you begin

  • Make sure you have the supported system requirements:

    • CPU: Quad-core

    • RAM: 16 GB

    • Storage: SSD, 128 GB

    • Monitor: 1080p

  • Make sure you have the supported software requirements:

    • Operating systems: Ubuntu 22.04.5 LTS or Windows 11

    • JRE: 17.0.12

    • JVM Heap Size: -Xms 2g -Xmx 4g

  • Use IntelliJ Community Edition 2024.3 and 2024.2

Install Java Development Kit (JDK)

Linux

  1. Install JDK 17.0.13 from the Oracle website.

  2. Download the appropriate tar.gz file for your system (for example, jdk-17.0.13_linux-x64_bin.tar.gz).

  3. Open a terminal and go to the directory where you downloaded the tar.gz file.

  4. Extract the contents using the command (example):

    tar -xvzf jdk-17.0.12_linux-x64_bin.tar.gz
  5. Move the extracted JDK to the /usr/lib/jvm/ directory:

    sudo mv jdk-17.0.12 /usr/lib/jvm/
  6. Set the JAVA_HOME environment variable and update the PATH.

  7. Edit  .bashrc or .profile file (depending on the shell):

    nano ~/.bashrc
  8. Add the following lines at the end of the file:

    export JAVA_HOME=/usr/lib/jvm/jdk-17.0.12
    export PATH=$JAVA_HOME/bin:$PATH
  9. Apply changes by reloading .bashrc.

    source ~/.bashrc
  10. Run the following command to verify that Java is correctly installed:

    java -version
  11. Continue by configuring the heap size.

Windows

  1. Install JDK 17.0.13 from the Oracle website.

  2. Download the appropriate tar.gz file for your system (for example, jdk-17.0.13_windows-x64_bin.tar.gz)

  3. Go to the directory where you downloaded the tar.gz file.

  4. Set the environment variables:

    • Add JAVA_HOME

    • Select Win + S

    • Type Environment Variables

    • Select Edit the system environment variables

    • In the system properties window, click Environment Variables

    • Under system variables, select New:

      Variable name: JAVA_HOME
      Variable value: Path to your JDK installation (e.g., C:\Program Files\Java\jdk17).
  5. Locate the Path variable under System Variables.

  6. Select New and add:

    %JAVA_HOME%\bin
  7. Select OK.

  8. Verify the configuration and open a new command prompt:

    java -version
  9. Continue by configuring the heap size.

macOS

  1. Install JDK 17.0.13 from the Oracle website.

  2. Download the appropriate tar.gz file for your system (for example, jdk-17.0.13_macos-x64_bin.tar.gz).

  3. Go to the directory where you downloaded the tar.gz file.

  4. Extract the contents using the command (example):

    tar -xvzf jdk-17.0.13_macos-x64_bin.tar.gz
  5. Move the extracted folder to the JDK directory:

    sudo mv jdk-17.0.13 /Library/Java/JavaVirtualMachines/
  6. Set the JAVA_HOME environment variable. Determine the JDK Path - the extracted JDK is now located at: /Library/Java/JavaVirtualMachines/jdk-17.0.13/Contents/Home.

  7. Open the shell configuration file:

    nano ~/.zshrc
  8. Add the following lines to set the JAVA_HOME and update the PATH:

    export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-17.0.13/Contents/Home
    export PATH=$JAVA_HOME/bin:$PATH
    
  9. Save the changes.

  10. Select Ctrl+O to save in nano.

  11. Select Ctrl+X to exit.

  12. Apply the changes:

    source ~/.zshrc
  13. Verify the configuration and open a new command prompt:

    java -version
  14. Continue by configuring the heap size.

Configure the Heap Size

  1. Open IntelliJ IDEA.

  2. Go to Help > Edit Custom VM Options.

  3. Add or update the following lines:

    -Xms1024m    # Initial heap size (1 GB)
    -Xmx4096m    # Maximum heap size (4 GB)
  4. Save the file and restart IntelliJ IDEA.

Install the Contrast IntelliJ plugin

Select one of these options.

Install the Contrast IntelliJ plugin via JetBrains Marketplace

  1. Open IntelliJ IDE and go to File > Settings > Plugins.

  2. Under marketplace search for Contrast then select the install button.

  3. After installation select Apply and then OK.

Install the Contrast IntelliJ plugin via manual installation

  1. Download the plugin's .zip file and download it to your machine.

  2. Launch IntelliJ IDEA on your system.

  3. Go to Plugin Settings:

    • Go to File > Settings

    • In the Settings/Preferences dialog, select Plugins

  4. Install the plugin from the disk:

    • Click the gear icon in the top-right corner of the plugins window

    • Select Install Plugin from Disk from the drop-down menu

  5. In the window, go to the location of the .zip file and select it.

    IntelliJ IDEA will verify and install the plugin. If prompted, confirm the installation.

  6. Restart IntelliJ IDEA:

    • After the installation, a prompt may appear asking you to restart IntelliJ IDEA

    • Click Restart IDE to complete the installation process

  7. Verify Installation:

    • Once IntelliJ IDEA restarts, go back to Plugins under Settings/Preferences

    • Ensure the plugin is listed under Installed Plugins and is enabled