-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dashboard test loading for auditbeat #5938
Add dashboard test loading for auditbeat #5938
Conversation
@elastic/apm-server Could be useful for apm-server too. |
auditbeat/tests/system/test_base.py
Outdated
es = Elasticsearch([self.get_elasticsearch_url()]) | ||
self.render_config_template( | ||
modules=[{ | ||
"name": "auditd", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think these test get executed because the config for the one above is out-of-date. You can enable them.
Let's use the file_integrity
module instead of auditd
because it can run on more platforms.
modules=[{
"name": "file_integrity",
"extras": {
"paths": ["file.example"],
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to your suggested config. I assume the first paragraph was related to the second part with the new config to enable it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@exekias In general I wonder if we should require a module to run the setup
command?
] | ||
|
||
{% if geoip_paths is not none %} | ||
geoip: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this for? AFAIK we don't have any builtin geoip enrichment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was copy paste from filebeat. Removed now as we don't use it anymore.
auditbeat/tests/system/test_base.py
Outdated
@@ -60,8 +60,10 @@ def test_dashboards(self): | |||
es = Elasticsearch([self.get_elasticsearch_url()]) | |||
self.render_config_template( | |||
modules=[{ | |||
"name": "auditd", | |||
}], | |||
"name": "file_integrity", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you fix the config for the one above too, please.
In auditbeat/Makefile I think SYSTEM_TESTS
needs to be set to true for these to execute.
@andrewkroh I only realised now that the system tests we had were not running at all for auditbeat. So I enabled system tests + integration tests. I'm pushing a change now to see if everything works as expected but will squash and rebase again in case it goes green. I also enabled the file_integrity module for all platforms, not only linux. |
Opened #5945 This needs rebase as soon as the other PR is merged. |
In combination with adding the dashboard loading a libbeat.yml.j2 was created so all beats can share the common config options and we do not have to add each option for each beat. So far this is applied to metricbeat, auditbeat and filebeat. Other beats will follow in a follow up PR.
Change testing.
9c80193
to
060f9a1
Compare
] | ||
|
||
{% if setup_template_name %} | ||
setup.template.name: setup_template_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be a reference to the setup_template_name
variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say yes. It got copied from here: https://github.com/elastic/beats/pull/5938/files#diff-bfed2fbdbe1d791a97c6ca3a63e6a8deL152
Will fix it for both variables.
The failing test is a flaky test in k8s and should not be related. @exekias ^ |
In combination with adding the dashboard loading a libbeat.yml.j2 was created so all beats can share the common config options and we do not have to add each option for each beat.
So far this is applied to metricbeat, auditbeat and filebeat. Other beats will follow in a follow up PR.