Conversation
There was a problem hiding this comment.
Pull request overview
This PR attempts to fix Elasticsearch configuration issues by adding SSL certificate configuration for the BI client and transport layer SSL settings for the Elasticsearch Docker container.
Changes:
- Added certificate path configuration for Elasticsearch BI client when connecting to local Elasticsearch instance
- Wrapped the ping check in a try-except block to handle connection errors gracefully
- Enabled transport layer SSL in the Elasticsearch Docker configuration with appropriate certificates
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| intel_owl/settings/elasticsearch.py | Added certificate configuration logic and error handling for Elasticsearch BI client initialization |
| docker/elasticsearch.override.yml | Enabled transport layer SSL with certificate configuration for inter-node communication |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@mlodic please review |
intel_owl/settings/elasticsearch.py
Outdated
| except Exception as info_error: | ||
| info = f"info unavailable: {info_error}" | ||
| logger.warning( | ||
| "ELASTICSEARCH DSL client configuration did not connect correctly: %s", |
intel_owl/settings/elasticsearch.py
Outdated
| ) | ||
| else: | ||
| print("Elasticsearch not correctly configured") | ||
| logger.warning("Elasticsearch BI not correctly configured") |
There was a problem hiding this comment.
prints were meant to be there to get the output on the console
intel_owl/settings/elasticsearch.py
Outdated
| ) | ||
| except Exception as e: | ||
| logger.warning( | ||
| "ELASTICSEARCH BI client configuration did not connect correctly: %s", |
intel_owl/settings/elasticsearch.py
Outdated
| except Exception as info_error: | ||
| info = f"info unavailable: {info_error}" | ||
| logger.warning( | ||
| "ELASTICSEARCH BI client configuration did not connect correctly: %s", |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* fixed elasticsearch * code refactor * improved error handling
Applied Ruff formatting to elasticsearch.py which was modified in upstream commit 90a6003 (fixed elasticsearch intelowlproject#3228).
Closes #2834
Description
Added certificate path configuration for Elasticsearch BI client when connecting to local Elasticsearch instance
Wrapped the ping check in a try-except block to handle connection errors gracefully
Enabled transport layer SSL in the Elasticsearch Docker configuration with appropriate certificates
Type of change
Please delete options that are not relevant.
Checklist
developdumpplugincommand and added it in the project as a data migration. ("How to share a plugin with the community")test_files.zipand you added the default tests for that mimetype in test_classes.py.FREE_TO_USE_ANALYZERSplaybook by following this guide.urlthat contains this information. This is required for Health Checks (HEAD HTTP requests).get_mocker_response()method of the unittest class. This serves us to provide a valid sample for testing.DataModelfor the new analyzer following the documentation# This file is a part of IntelOwl https://github.com/intelowlproject/IntelOwl # See the file 'LICENSE' for copying permission.Black,Flake,Isort) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.testsfolder). All the tests (new and old ones) gave 0 errors.DeepSource,Django Doctorsor other third-party linters have triggered any alerts during the CI checks, I have solved those alerts.Important Rules