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:
  • Field Details

  • Constructor Details

    • WebhookEndpoint

      @DataBoundConstructor public WebhookEndpoint(String name, Secret webhookUrl)
    • WebhookEndpoint

      public WebhookEndpoint(String name, String webhookUrl)
  • Method Details

    • readResolve

      protected Object readResolve()
    • getId

      public String getId()
    • setId

      @DataBoundSetter public void setId(String id)
    • getName

      public String getName()
    • setName

      @DataBoundSetter public void setName(String name)
    • getChannel

      public String getChannel()
    • setChannel

      @DataBoundSetter public void setChannel(String channel)
    • getWebhookUrl

      public Secret getWebhookUrl()
    • getPlainWebhookUrl

      public String getPlainWebhookUrl()
    • setWebhookUrl

      @DataBoundSetter public void setWebhookUrl(Secret webhookUrl)
    • isEnabled

      public boolean isEnabled()
    • setEnabled

      @DataBoundSetter public void setEnabled(boolean enabled)
    • getScope

      public String getScope()
    • setScope

      @DataBoundSetter public void setScope(String scope)
    • getMinSeverity

      public String getMinSeverity()
    • setMinSeverity

      @DataBoundSetter public void setMinSeverity(String minSeverity)
    • getActionFilter

      public String getActionFilter()
    • setActionFilter

      @DataBoundSetter public void setActionFilter(String actionFilter)
    • 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

      public boolean matches(String eventType, String severity, String action)
      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

      public static boolean isCategoryTagMatched(String tag, String eventType, String actionUpper)
      Checks if a category tag (e.g. CATEGORY:AUTH, CATEGORY:SECURITY) matches the given event.
    • isCategorySatisfied

      public boolean isCategorySatisfied(String eventType, String action)
      Checks if the event category is enabled for this destination.
    • isSeveritySatisfied

      public boolean isSeveritySatisfied(String severity)
      Evaluates if the event severity meets or exceeds the minimum severity threshold.
    • getSeverityScore

      public static int getSeverityScore(String severity)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • testWebhookConnection

      public static FormValidation testWebhookConnection(String urlString)
      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.