- Kotlin 96.9%
- Java 3%
* Register the doc-level query and job lock indices as alerting system indices Alerting creates and owns .opensearch-alerting-queries* (the default doc-level query alias and its -000001 and rollover indices) and .opensearch-alerting-config-lock (the job lock index), but did not register them, unlike its alert, findings, comments and config indices. Add both to getSystemIndexDescriptors() from the existing constants. The query pattern does not cover query indices that a caller names in a monitor's data sources. Neither pattern overlaps another alerting pattern or one registered by the other plugins in the distribution. Add a unit test for the patterns and a secured IT for direct access, and move the ITs that wrote the lock index or created and closed the query index directly to the admin certificate client. Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Add a write control to the query and lock index IT The direct write tests expected a 403 but did not show that the same user can write elsewhere, so a missing role permission would also pass. Write the same document to an ordinary index first and expect 201. Also state precisely which direct operation on the query index the security plugin refuses in the create monitor clean up test. Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Create the clean up test's query index without the alias, as on main The create monitor clean up test in SecureMonitorRestApiIT failed on the secured CI run because monitor creation no longer failed. On main, the createIndex call created .opensearch-alerting-queries-000001 without the .opensearch-alerting-queries alias: its mapping string closed the request body before the aliases part, which the server ignored. With no write index behind the alias, updateQueryIndexMappings fails, so monitor creation fails and the test checks the clean up. The admin certificate body added in this PR also created the alias. A closed index behind the alias does not fail monitor creation: the mapping update succeeds on a closed index, and the test monitor has no queries to index. The test fails the same way with or without the new system index descriptors, so the descriptors do not change this behaviour. Create the same index, mappings and settings as main did, without the alias, still with the admin certificate. Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Remove the read role mapping at the end of the clean up test test create monitor failure clean up with a user without delete monitor access maps the user to the read-all role and only removed the alerting role mapping at the end. The next test recreates the same user, so when the test order put test create monitor with an user without index read role right after it, that user could read the source index and got 404 instead of 403. Reset the read-all mapping in the finally block, as the other tests in the class do. Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Read the search hit total as a Number in the query and lock index test The parser can return the total as a Long, and the cast to Int then throws. (... as Number).toInt() is the form the rest of the tests in this repo use. Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Close the parser that reads the search response in the new test The parser holds the response body stream, so read the body inside use(). Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Pin what the new tests prove The secured test compared the two indices against an ordinary index, so a refusal could also have come from the leading dot rather than from the registration. Compare against a dot prefixed index that is not registered instead, and read it as the user as well, so each assertion names the one difference it is about. Also name the index behind the alias, which is the case the pattern's trailing wildcard covers, and hold the lock descriptor to an exact name in the unit test. Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Say what the control index covers, not more The note claimed every assertion compares against the control index. The two that read through the admin certificate do not. Signed-off-by: Darshit Chanpura <dchanp@amazon.com> --------- Signed-off-by: Darshit Chanpura <dchanp@amazon.com> |
||
|---|---|---|
| .github | ||
| alerting | ||
| build-tools | ||
| core | ||
| docs | ||
| gradle/wrapper | ||
| release-notes | ||
| sample-remote-monitor-plugin | ||
| scripts | ||
| spi | ||
| worksheets | ||
| .codecov.yml | ||
| .editorConfig | ||
| .gitignore | ||
| .whitesource | ||
| build.gradle | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| DEVELOPER_GUIDE.md | ||
| gradlew | ||
| gradlew.bat | ||
| LICENSE.txt | ||
| MAINTAINERS.md | ||
| NOTICE.txt | ||
| README.md | ||
| RELEASING.md | ||
| SECURITY.md | ||
| settings.gradle | ||
| THIRD-PARTY | ||
- OpenSearch Alerting
- Highlights
- Documentation
- Contributing
- Code of Conduct
- Security
- License
- Copyright
OpenSearch Alerting
The OpenSearch Alerting enables you to monitor your data and send alert notifications automatically to your stakeholders. With an intuitive OpenSearch Dashboards interface and a powerful API, it is easy to set up, manage, and monitor your alerts. Craft highly specific alert conditions using Elasticsearch's full query language and scripting capabilities.
Highlights
Scheduled searches use cron expressions or intervals (e.g. every five minutes) and the Elasticsearch query DSL.
To define trigger conditions, use the Painless scripting language or simple thresholds (e.g. count > 100).
When trigger conditions are met, you can publish messages to the following destinations:
- Slack
- Custom webhook
- Amazon Chime
Messages can be static strings, or you can use the Mustache templates to include contextual information.
Documentation
Please see our documentation.
Contributing
See developer guide and how to contribute to this project.
Code of Conduct
This project has adopted the Amazon Open Source Code of Conduct. For more information see the Code of Conduct FAQ, or contact opensource-codeofconduct@amazon.com with any additional questions or comments.
Security
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our vulnerability reporting page. Please do not create a public GitHub issue.
License
This project is licensed under the Apache v2.0 License.
Copyright
Copyright OpenSearch Contributors. See NOTICE for details.