Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Regularly update the parent POM and project dependencies to ensure security and
Run `just update-dependencies` (executes `mvn versions:use-latest-versions`).

3. **Update All (Recommended)**:
Run `just update` to update the parent POM, dependencies, flake, and the Sysdig CLI version in one go.
Run `just update` to update the Jenkins version, parent POM, dependencies, flake, the newest/oldest Sysdig CLI versions and regenerate the scanner fixtures in one go (fixture regeneration requires `SECURE_API_TOKEN`, optionally `SECURE_API_URL`).

### Updating Base Jenkins Version
**Important:** Update the base Jenkins version **before** updating the parent POM or other dependencies.
Expand All @@ -99,7 +99,8 @@ Regularly update the parent POM and project dependencies to ensure security and
Run `just verify` to ensure the plugin builds and tests pass with the new version.

### Updating Sysdig CLI Version
To update the embedded Sysdig CLI version used by the scanner:
The scanner versions are tracked with `newest-version-marker` / `oldest-version-marker` comments (do not remove them):

1. Run `just update-sysdig-cli-version`.
This fetches the latest version from Sysdig and updates `RemoteSysdigImageScanner.java`.
1. Run `just update-cli-scanner` to set the default (newest) version, e.g. in `ScannerVersionResolver.java`.
2. Run `just update-oldest-cli-scanner` to set the oldest supported version (365-day window).
3. Run `just generate-scanner-fixtures` (requires `SECURE_API_TOKEN`) to regenerate the recorded scan-result fixtures for both.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ The table below describes the available configuration options.
The plugin pins a default `sysdig-cli-scanner` version and is tested end-to-end against both the
default and the oldest still-maintained version:

- Default pinned version: <!-- newest-version-marker -->1.30.2<!-- /newest-version-marker -->
- Oldest maintained version tested: <!-- oldest-version-marker -->1.23.0<!-- /oldest-version-marker -->
- Default pinned version: <!-- newest-version-marker -->1.32.0<!-- /newest-version-marker -->
- Oldest maintained version tested: <!-- oldest-version-marker -->1.24.0<!-- /oldest-version-marker -->

Both values are kept in sync by `just update-cli-scanner` and `just update-oldest-cli-scanner`.

Expand Down
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>6.2236.v12dd4c483242</version>
<version>6.2250.va_d01d559a_209</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -57,7 +57,7 @@
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-${jenkins.baseline}.x</artifactId>
<!-- You can find your version for the selected baseline in: https://repo.jenkins-ci.org/public/io/jenkins/tools/bom/ -->
<version>7169.vb_32a_cfd93fa_6</version>
<version>7349.vd0a_cb_6c87a_31</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
import org.kohsuke.stapler.QueryParameter;

public class IaCScanningBuilder extends Builder implements SimpleBuildStep {
private static final String FIXED_SCANNED_VERSION = "1.30.2"; // newest-version-marker
private static final String FIXED_SCANNED_VERSION = "1.32.0"; // newest-version-marker

private String engineCredentialsId;
private boolean listUnsupported = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* custom version configured by the user and falling back to a pinned version.
*/
public class ScannerVersionResolver {
private static final String FIXED_SCANNED_VERSION = "1.30.2"; // newest-version-marker
private static final String FIXED_SCANNED_VERSION = "1.32.0"; // newest-version-marker

private final ImageScanningConfig config;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public class TestMother {
* (via {@code just update-cli-scanner} / {@code just update-oldest-cli-scanner}), regenerate the
* matching fixtures with {@code just generate-scanner-fixtures}.
*/
public static final String NEWEST_FIXTURE_VERSION = "1.30.2"; // newest-version-marker
public static final String NEWEST_FIXTURE_VERSION = "1.32.0"; // newest-version-marker

public static final String OLDEST_FIXTURE_VERSION = "1.23.0"; // oldest-version-marker
public static final String OLDEST_FIXTURE_VERSION = "1.24.0"; // oldest-version-marker

private static final String NEWEST_FIXTURE = FIXTURE_DIR + "scanner_newest_scan_result.json.gz";
private static final String OLDEST_FIXTURE = FIXTURE_DIR + "scanner_oldest_scan_result.json.gz";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void applicationsAreReportedWithTheirApplicationType() {
.map(JsonElement::getAsJsonArray)
.filter(row -> row.get(3).getAsString().equals("grafana"))
.toList();
assertEquals(3, grafanaRows.size());
assertEquals(4, grafanaRows.size());
assertTrue(grafanaRows.stream()
.allMatch(row -> row.get(6).getAsString().equals("Observability And Monitoring Software")));
assertTrue(grafanaRows.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void testFreestyleWithCredentialsAndAssertLogOutput() throws Exception {

jenkins.assertLogContains("Attempting to download CLI", build);
jenkins.assertLogContains(
"Downloading https://download.sysdig.com/scanning/bin/sysdig-cli-scanner/1.30.2", // newest-version-marker
"Downloading https://download.sysdig.com/scanning/bin/sysdig-cli-scanner/1.32.0", // newest-version-marker
build);
jenkins.assertLogContains("Starting scan", build);
jenkins.assertLogContains("--iac --apiurl=https://secure.sysdig.com --loglevel=info", build);
Expand Down Expand Up @@ -144,15 +144,15 @@ void testFreestyleWithAllConfigs() throws Exception {
b.setIsRecursive(false);
b.setSeverityThreshold("m");
b.setSysdigEnv("https://us2.app.sysdig.com");
b.setVersion("1.23.0"); // oldest-version-marker
b.setVersion("1.24.0"); // oldest-version-marker
})
.build();

var build = jenkins.buildAndAssertStatus(Result.FAILURE, project);

jenkins.assertLogContains("Attempting to download CLI", build);
jenkins.assertLogContains(
"Downloading https://download.sysdig.com/scanning/bin/sysdig-cli-scanner/1.23.0", // oldest-version-marker
"Downloading https://download.sysdig.com/scanning/bin/sysdig-cli-scanner/1.24.0", // oldest-version-marker
build);
jenkins.assertLogContains("Starting scan", build);
jenkins.assertLogContains("--iac --apiurl=https://us2.app.sysdig.com --loglevel=info", build);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void testPipelineWithCredentialsAndAssertLogOutput() throws Exception {

jenkins.assertLogContains("Attempting to download CLI", build);
jenkins.assertLogContains(
"Downloading https://download.sysdig.com/scanning/bin/sysdig-cli-scanner/1.30.2", // newest-version-marker
"Downloading https://download.sysdig.com/scanning/bin/sysdig-cli-scanner/1.32.0", // newest-version-marker
build);
jenkins.assertLogContains("Starting scan", build);
jenkins.assertLogContains("--iac --apiurl=https://secure.sysdig.com --loglevel=info", build);
Expand All @@ -72,14 +72,14 @@ void testPipelineWithAllConfigs() throws Exception {
isRecursive: false,
severityThreshold: 'm',
sysdigEnv: 'https://us2.app.sysdig.com',
version: '1.23.0'""") // oldest-version-marker
version: '1.24.0'""") // oldest-version-marker
.buildWithRemoteExecution();

var build = jenkins.buildAndAssertStatus(Result.FAILURE, job);

jenkins.assertLogContains("Attempting to download CLI", build);
jenkins.assertLogContains(
"Downloading https://download.sysdig.com/scanning/bin/sysdig-cli-scanner/1.23.0", // oldest-version-marker
"Downloading https://download.sysdig.com/scanning/bin/sysdig-cli-scanner/1.24.0", // oldest-version-marker
build);
jenkins.assertLogContains("Starting scan", build);
jenkins.assertLogContains("--iac --apiurl=https://us2.app.sysdig.com --loglevel=info", build);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

class ScannerBinaryProviderTest {
/** Pinned default version. Kept in sync by {@code just update-cli-scanner}; do not drop the marker. */
private static final String PINNED_VERSION = "1.30.2"; // newest-version-marker
private static final String PINNED_VERSION = "1.32.0"; // newest-version-marker

/** Arbitrary version for the URL-shape tests below: they assert os/arch mapping, not the pin. */
private static final String ANY_VERSION = "1.27.2";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ void whenParsingNewestScannerOutputApplicationsAreParsedAsApplications() {

assertEquals(1, result.applications().size());
Application grafana = result.applications().iterator().next();
assertEquals("219adaa3-9c69-4f07-adc8-90fab4a74622", grafana.id());
assertEquals("94cfb0f5-a6e8-447c-adfd-127bfc613bd4", grafana.id());
assertEquals(Component.ComponentKind.Application, grafana.kind());
assertEquals("grafana", grafana.name());
assertEquals("9.5.21", grafana.version());
Expand All @@ -254,7 +254,7 @@ void whenParsingNewestScannerOutputApplicationsAreParsedAsApplications() {
assertTrue(layer.components().contains(grafana));

// Vulnerabilities are linked both ways.
assertEquals(3, grafana.vulnerabilities().size());
assertEquals(4, grafana.vulnerabilities().size());
// CVE-2025-1088 is only found in the application.
Vulnerability grafanaVuln =
result.findVulnerabilityByCVE("CVE-2025-1088").orElseThrow();
Expand All @@ -281,7 +281,7 @@ void whenParsingNewestScannerOutputGoModulesArePackagesWithPolicyFailures() {
.flatMap(r -> r.failures().stream())
.filter(f -> f.component() instanceof Package p && p.type() == PackageType.Golang)
.count();
assertEquals(206, failuresOnGoModules);
assertEquals(218, failuresOnGoModules);
}

@Test
Expand Down
Binary file not shown.
Binary file not shown.
Loading