Skip to content
Open
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>script-security</artifactId>
<version>1.14</version>
<version>1.16</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ public boolean act(RejectedAccessException ex) {
return true;
}
},
NO_DANGEROUS() {
public boolean act(RejectedAccessException ex) {
LOGGER.log(Level.INFO, "Unsecure signature found: " + ex.getSignature(), ex);
if(ex.isDangerous()) {
LOGGER.log(Level.INFO, "Dangerous signature rejected: " + ex.getSignature());
return false;
}
ScriptApproval.get().accessRejected(ex, ApprovalContext.create().withCurrentUser());
return true;
}
},
NO_SECURITY() {
public boolean act(RejectedAccessException ex) {
return true; // You have been warned
Expand All @@ -78,6 +89,8 @@ public boolean act(RejectedAccessException ex) {
public static Mode getConfigured(String config) {
if ("true".equals(config)) {
return ENABLED;
} else if ("no_dangerous".equals(config)) {
return NO_DANGEROUS;
} else if ("no_security".equals(config)) {
return NO_SECURITY;
} else {
Expand Down