opensearch-project / opensearch-project/alerting

[FEATURE] Implement input validation for various monitor and trigger fields

Open
#671 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement v3.0.0
Dominant language
Kotlin
Stars
82
Forks
133
Avg merge
2d 11h
Merged PRs (30d)
9

Description

Is your feature request related to a problem?
The alerting dashboards plugin performs some validation on fields like monitorName, actionName, etc., but these validation methods only ensure that the input isn't left blank. In the case of monitorName, the frontend calls the backend to ensure there isn't a monitor with the name already, but the backend doesn't actually perform that same check when users create monitors using devtools or curl commands.

What solution would you like?
Input validation should be performed, in the front and backend plugins, for all fields in the monitor, trigger, and action classes to ensure the inputs conform to length and character restrictions.

What alternatives have you considered?
Ideally, the regex patterns used for validation by the backend would be available for viewing via the GetSettings or similar API so the frontend could get those patterns from the backend instead of duplicating and maintaining a separate set of them.

Do you have any additional context?
The security-analytics-dashboard plugin performs field input validation using regex patterns.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with public/utils/validate.js and compare its monitorName, actionName, and related checks with public/utils/validation.ts in the security-analytics-dashboard plugin. Trace the backend monitor, trigger, and action classes and determine the required length and character restrictions. Done means validation is applied in both plugins, with backend patterns considered for exposure through GetSettings or a similar API.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, kotlin
Domain
backend, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.