Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Frederik Bauer <[email protected]>
  • Loading branch information
seqizz and TheFRedFox committed Jun 3, 2022
1 parent 4546aa7 commit cf902d1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/check_plugin_vulnerability.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This scripts checks the Jenkins Plugins for security issues
Copyright (c) 2021 InnoGames GmbH
Copyright (c) 2022 InnoGames GmbH
"""
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand All @@ -29,17 +29,19 @@
from sys import exit

SCRIPT = """
import jenkins.security.*
import jenkins.security.UpdateSiteWarningsConfiguration
import jenkins.security.ExtensionList
import groovy.json.JsonBuilder
ExtensionList<UpdateSiteWarningsConfiguration> configurations = ExtensionList.lookup(UpdateSiteWarningsConfiguration.class);
UpdateSiteWarningsConfiguration configuration = configurations.get(0);
problematic_plugins = []
current_warnings = configuration.getApplicableWarnings()
def problematic_plugins = []
def current_warnings = configuration.getApplicableWarnings()
current_warnings.each {
if (it.type.name() == 'PLUGIN') {
problematic_plugins.add(it.component)
}
}
print(new groovy.json.JsonBuilder(problematic_plugins.unique()))
print(new JsonBuilder(problematic_plugins.unique()))
""" # NOQA E501 Don't wrap because of groovy code

IGNORE_FILE = '/etc/nagios-plugins/check_plugin_vulnerability_ignore'
Expand Down

0 comments on commit cf902d1

Please sign in to comment.