Checkmarx Plugin for IntelliJ Guide
Checkmarx Plugin for IntelliJ Guide
Changing the 'Preset' to 'XSS and SQLi only' during Checkmarx scan setup focuses the scan on detecting Cross-Site Scripting (XSS) and SQL Injection (SQLi) vulnerabilities specifically. This is significant as it allows developers to concentrate on these high-risk vulnerability types, potentially reducing noise from less critical findings and optimizing the scan process for known critical flaws .
Integration of Checkmarx with IntelliJ allows developers to directly view scan results and security vulnerabilities in the same environment where they code. Developers can navigate to the specific code locations of vulnerabilities, change result states, assign issues, and apply comments without leaving the IDE. This streamlines the workflow and encourages immediate fixes, enhanced by features like the Graph View, which visually represents the data flow vulnerabilities .
To conduct a scan using the Checkmarx plugin in IntelliJ, right-click the project name in the Project Explorer, select the Checkmarx logo beside the Cx Viewer option, and choose 'Scan.' Log in using the provided credentials, and either select an existing project or create a new one. Change the Preset to 'XSS and SQLi only,' set the team, and initiate a full scan. This launches the scan, which can be tracked in the IntelliJ status bar and on the Checkmarx Portal .
Pattern masks in the Checkmarx plugin are used to exclude specific files or code components from scans, based on predefined patterns. For example, in the AltoroJ project, Swagger code is excluded using pattern masks. This helps tailor the scan to focus on relevant code blocks, removing noise from auto-generated or non-essential parts, which streamlines the scan process and results .
Incremental scans allow developers to confirm that specific code changes effectively resolved previously identified vulnerabilities without needing a full re-scan. This not only saves time by focusing on altered code blocks but also rapidly validates fixes, ensuring continuous security improvements. It further reinforces the effectiveness of iterative security testing in the development lifecycle .
A full scan with the Checkmarx plugin analyzes the entire codebase for vulnerabilities, while an incremental scan targets only changed code since the last scan. Full scans provide a comprehensive security assessment, albeit with longer duration, whereas incremental scans offer quicker, targeted assessments to verify the impact of recent changes, optimizing time and resource usage .
After installing the Checkmarx IDE plugin in IntelliJ, you configure it by accessing the CxViewer Preferences in the Settings window of IntelliJ. You specify the Checkmarx server URL, test the connection, and set exclusions for scans under the Advanced menu. This allows you to exclude specific code, like the swagger code, by adding file pattern masks. Once settings are configured, they're applied, closing the Settings window .
Engaging with Checkmarx scan results directly within IntelliJ enhances a developer's workflow by integrating security insights into the development environment. This immediacy allows developers to rapidly address vulnerabilities, supported by seamless navigation to code issues, in-app issue management, and graphical data flow views. Such integration facilitates prompt and effective security measures, embedding security considerations into routine coding practices .
Private scans in the Checkmarx Plugin are used by developers to verify their code without impacting project reporting or risk metrics. They are visible only to the server administrator and the user who initiated them. In contrast, public scans are part of project reporting and are visible to a broader audience. Private scans facilitate personal code checks, whereas public scans contribute to the collective assessment of the project's risk .
Comparing public and private scan results in Checkmarx is beneficial as it provides insights into the effectiveness of the incremental changes made during development. Such comparisons can reveal resolved issues and highlight efficiency improvements, such as faster scan times for incremental scans. This comparison helps evaluate the impact of fixes and the ongoing security state of the application, aiding in continuous security improvement .