Skip to main content

Contrast Security IntelliJ plugin

The Contrast IDE (Integrated Development Environment) brings real-time security intelligence directly into IntelliJ. By integrating vulnerabilities from both projects (Scan) and applications (Assess) developers can filter by severity or status to prioritize and remediate vulnerabilities without leaving their workspace.

Key features

The plugin offers Assess and Scan, designed to provide a seamless experience for identifying and managing security vulnerabilities in commonly supported programming languages within the IntelliJ Community Edition.

  • Vulnerability report:

    • View vulnerabilities associated with applications for Assess and Projects in Scan

    • Provide filters such as severity, status, and discovery dates to refine the search on the vulnerability list

  • Current file:

    • Provide a Tree view on the list of vulnerabilities associated with the current file open in the IDE, with visual indicators based on criticality

    • Provide the ability to navigate to the Line of Code with contextual annotations

  • Detailed Vulnerability Information:

    • Assess provides in-depth details about each vulnerability, such as remediation steps, event logs, and options to mark or categorize the issue

    • The user interface provides a seamless navigation of the associated details related to each vulnerability in a dedicated tab view to enhance the user experience

  • Schedulers:

    • Automate the fetching of vulnerabilities for applications (for Assess) and projects (for Scan) based on a configurable schedule without manual intervention

These features enable developers to proactively identify, analyze, and address vulnerabilities, thereby improving overall code security and efficiency.

Before you begin

Make sure you have the supported recommendations and requirements.

System Requirements

Component

Recommendation

CPU

Quad-core

RAM

16 GB

Storage

SSD, 128 GB

Monitor

1080p

Software Requirements

Software

Requirements

Operating System

Ubuntu 22.04.5 LTS or Windows 11 or macOS Sequoia 14.x

JRE

21.0.8

JVM Heap Size

-Xms 2g -Xmx 4g

Supported IDE and Versions

IDE

Version

IntelliJ Community Edition

Version 2025.3.1.1 and 2025.2

Rider version 2025.3.1 and 2025.2.1

Install Java Development Kit (JDK)

Linux

  1. Install JDK 21.0.8 from the Oracle website.

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

  3. Open a terminal and go to the directory where you downloaded the jdk-21.0.8_linux-x64_bin.tar.gz file.

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

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

    sudo mv jdk-21.0.8 /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-21.0.8
    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 21.0.8 from the Oracle website.

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

  3. Go to the directory where you downloaded the jdk-21.0.8_windows-x64_bin.zip file and extract the contents.

  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, select Environment Variables

    • Under system variables, select New:

      Variable name: JAVA_HOME
      Variable value: Path to your JDK installation (e.g., C:\Program Files\Java\jdk21).
  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 21.0.8 from the Oracle website.

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

  3. Go to the directory where you downloaded the jdk-21.0.8_macos-x64_bin.tar.gz file.

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

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

    sudo mv jdk-21.0.8 /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-21.0.8/Contents/Home.

  7. Edit the shell configuration file. 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-21.0.8/Contents/Home
    export PATH=$JAVA_HOME/bin:$PATH
    
  9. Save the changes.

  10. Press Ctrl+O to save in nano.

  11. Press 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

Configure the Contrast IntelliJ plugin

  1. In IntelliJ IDEA, find the Contrast plugin and select the Settings icon (icon-settings.svg).

  2. Enter:

    • Contrast URL: The URL of your Contrast instance. For example, https://app.contrastsecurity.com.

    • Username: the username or e-mail address that you use for logging into Contrast.

    • API Key, Service Key, and Organization ID: Copy these values from your user profile in the Contrast web interface.

      To find these values:

      1. In the Contrast web interface, select your name in the upper right of the page.

      2. Select User settings.

      3. Copy the values for the API Key, Service Key, and Organization ID.

        Important

        Do not use the Agent keys (found under user menu > Organization settings > Agent keys). The access rights for the Agent keys are more limited than the API keys found under User Settings. The Agent keys will not work with the Contrast Intellij plugin.

  3. Select OK.