HI,
During this Christmas period I read, studied and took tests.
In one of my laboratories I created a new VM Ubuntu Server 22.04, I installed Wazuh Docker single node v.4.7.1
- Enabling the Wazuh archives: logall and logall_json in ossec_config in the Wazuh server/manager
- Visualizing the events on the dashboard:
manager:
I edited /var/lib/docker/volumes/single-node_filebeat_etc/_data/filebeat.yml
archives:
enabled: true
indexers:
Stack management > Index patterns > Create index pattern: wazuh-archives-*
Wazuh archives and alerts and archive indexes take up storage.
I read carefully:
ISM/ILM - Index life management:
https://documentation.wazuh.com/current/user-manual/wazuh-indexer/index-life-management.html#index-life-managementhttps://wazuh.com/blog/wazuh-index-management/SM - Snapshot Management:
https://wazuh.com/blog/index-backup-management/I want to solve 2 problems:1) The alerts and archives files present on the Wazuh server/manager could be used for forensic and compliance purposes.The .jsons were sent to the indexer by Filebeat anyway, so the index is OK.
I would need (I think) a cron to be able to move the files to S3 storage (setting immutability for compliance reasons), freeing up space on the server.Do you have cron examples for this purpose?
Reading around it seems to me that s3fs is better than rclone, what do you recommend?
2) on the indexer alerts and archives indexes must be eliminated via Index life management (it seems quite simple to me).
But, before deleting them, I would like to make a backup, with one year retention on S3 storage.I tried installing the s3 plugin directly into the indexer container, but I had a problem:
wazuh-indexer@wazuh:~/plugins$ /usr/share/wazuh-indexer/bin/opensearch-plugin install repository-s3
/usr/share/wazuh-indexer/bin/opensearch-env: line 108: cd: /etc/wazuh-indexer: No such file or directory
-> Installing repository-s3
-> Downloading repository-s3 from opensearch
[======================================================================== ] 100%??
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@
@ WARNING: plugin requires additional permissions @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@
* java.lang.RuntimePermission accessDeclaredMembers
* java.lang.RuntimePermission getClassLoader
* java.lang.reflect.ReflectPermission suppressAccessChecks
* java.net.NetPermission setDefaultAuthenticator
* java.net.SocketPermission * connect,resolve
* java.util.PropertyPermission opensearch.allow_insecure_settings read,write
See
http://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.htmlfor descriptions of what these permissions allow and the associated risks.
Continue with installation? [y/N]y
-> Failed installing repository-s3
-> Rolling back repository-s3
-> Rolled back repository-s3
Exception in thread "main" java.nio.file.FileSystemException: /usr/share/wazuh-indexer/plugins/.installing-4390580237951055143 -> /usr/share/wazuh-indexer/plugins/repository-s3: Directory not empty
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:416)
at java.base/sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:266)
at java.base/java.nio.file.Files.move(Files.java:1432)
at org.opensearch.plugins.InstallPluginCommand.movePlugin(InstallPluginCommand.java:920)
at org.opensearch.plugins.InstallPluginCommand.installPlugin(InstallPluginCommand.java:897)
at org.opensearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:276)
at org.opensearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:250)
at org.opensearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:104)
at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:138)
at org.opensearch.cli.MultiCommand.execute(MultiCommand.java:104)
at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:138)
at org.opensearch.cli.Command.main(Command.java:101)
at org.opensearch.plugins.PluginCli.main(PluginCli.java:60)
How can I solve it?