Skip to content

Commit

Permalink
Check if vulnearbility scanned is turned on
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsuter committed Feb 8, 2025
1 parent e824c59 commit 5bc1b70
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/io/ivyteam/devops/repo/check/RepoCheck.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public static List<RepoCheck> all(Database db) {
new RenovateRepoCheck(files),
new FileExistsRepoCheck(files, File.LICENSE),
new FileExistsRepoCheck(files, File.CODE_OF_CONDUCT_MD),
new FileExistsRepoCheck(files, File.SECURITY_MD));
new FileExistsRepoCheck(files, File.SECURITY_MD),
new VulnerabilityScanningEnabledRepoCheck());
}

public static List<Result> run(Repo repo) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package io.ivyteam.devops.repo.check;

import io.ivyteam.devops.repo.Repo;

class VulnerabilityScanningEnabledRepoCheck implements RepoCheck {

@Override
public Result check(Repo repo) {
if (repo.archived()) {
return Result.success("Archived repository do not need vulnerarbilty scanned turned on");
}
if (repo.isVulnAlertOn()) {
return Result.success("Repository has vulnerability scanned turned on");
}
return Result.success("Repository has vulnerability scanned turned off");
}
}

0 comments on commit 5bc1b70

Please sign in to comment.