Package io.jenkins.plugins.auditlogger
Class WebhookEndpoint
java.lang.Object
hudson.model.AbstractDescribableImpl<WebhookEndpoint>
io.jenkins.plugins.auditlogger.WebhookEndpoint
- All Implemented Interfaces:
Describable<WebhookEndpoint>,Serializable
public class WebhookEndpoint
extends AbstractDescribableImpl<WebhookEndpoint>
implements Serializable
Represents a single webhook destination (e.g., Slack channel, Microsoft Teams channel,
SIEM HTTP receiver) with fine-grained routing criteria including event scope,
minimum severity, and action label filters.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWebhookEndpoint(String name, Secret webhookUrl) WebhookEndpoint(String name, String webhookUrl) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetId()getName()getScope()static intgetSeverityScore(String severity) inthashCode()booleanisCategorySatisfied(String eventType, String action) Checks if the event category is enabled for this destination.static booleanisCategoryTagMatched(String tag, String eventType, String actionUpper) Checks if a category tag (e.g.booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanisSeveritySatisfied(String severity) Evaluates if the event severity meets or exceeds the minimum severity threshold.booleanDetermines whether this endpoint matches an event based on its enabled state, configured scope, severity threshold, category filters, and optional action filter.protected ObjectvoidsetActionFilter(String actionFilter) voidsetChannel(String channel) voidsetEnabled(boolean enabled) voidvoidsetMinSeverity(String minSeverity) voidvoidsetNotifyAnomalies(boolean notifyAnomalies) voidsetNotifyAuth(boolean notifyAuth) voidsetNotifyCredentials(boolean notifyCredentials) voidsetNotifyJobs(boolean notifyJobs) voidsetNotifyNodes(boolean notifyNodes) voidsetNotifySecurity(boolean notifySecurity) voidvoidsetWebhookUrl(Secret webhookUrl) static FormValidationtestWebhookConnection(String urlString) Sends a harmless test payload to verify webhook connectivity and response.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.model.Describable
getDescriptor
-
Field Details
-
SCOPE_ALL
- See Also:
-
SCOPE_ANOMALIES
- See Also:
-
SCOPE_CRITICAL_LOGS
- See Also:
-
-
Constructor Details
-
WebhookEndpoint
-
WebhookEndpoint
-
-
Method Details
-
readResolve
-
getId
-
setId
-
getName
-
setName
-
getChannel
-
setChannel
-
getWebhookUrl
-
getPlainWebhookUrl
-
setWebhookUrl
-
isEnabled
public boolean isEnabled() -
setEnabled
@DataBoundSetter public void setEnabled(boolean enabled) -
getScope
-
setScope
-
getMinSeverity
-
setMinSeverity
-
getActionFilter
-
setActionFilter
-
isNotifyAuth
public boolean isNotifyAuth() -
setNotifyAuth
@DataBoundSetter public void setNotifyAuth(boolean notifyAuth) -
isNotifySecurity
public boolean isNotifySecurity() -
setNotifySecurity
@DataBoundSetter public void setNotifySecurity(boolean notifySecurity) -
isNotifyCredentials
public boolean isNotifyCredentials() -
setNotifyCredentials
@DataBoundSetter public void setNotifyCredentials(boolean notifyCredentials) -
isNotifyJobs
public boolean isNotifyJobs() -
setNotifyJobs
@DataBoundSetter public void setNotifyJobs(boolean notifyJobs) -
isNotifyNodes
public boolean isNotifyNodes() -
setNotifyNodes
@DataBoundSetter public void setNotifyNodes(boolean notifyNodes) -
isNotifyAnomalies
public boolean isNotifyAnomalies() -
setNotifyAnomalies
@DataBoundSetter public void setNotifyAnomalies(boolean notifyAnomalies) -
matches
Determines whether this endpoint matches an event based on its enabled state, configured scope, severity threshold, category filters, and optional action filter.- Parameters:
eventType- the event scope type: "ANOMALY" or "AUDIT_LOG" / "CRITICAL_LOG"severity- the event severity ("CRITICAL", "HIGH", "MEDIUM", "LOW", "INFO")action- the specific action name (e.g. "SCRIPT_CONSOLE_ACCESS", "FAILED_LOGIN")- Returns:
- true if the event should be dispatched to this webhook endpoint
-
isCategoryTagMatched
Checks if a category tag (e.g. CATEGORY:AUTH, CATEGORY:SECURITY) matches the given event. -
isCategorySatisfied
Checks if the event category is enabled for this destination. -
isSeveritySatisfied
Evaluates if the event severity meets or exceeds the minimum severity threshold. -
getSeverityScore
-
equals
-
hashCode
public int hashCode() -
testWebhookConnection
Sends a harmless test payload to verify webhook connectivity and response. Can be invoked by both endpoint test buttons and global single webhook test button.
-