Skip to content

Commit cbf53fa

Browse files
authored
Merge pull request #9104 from wazuh/enhancement/development-update
Enhancement/development update
2 parents 1c4107a + 8e6ae8b commit cbf53fa

File tree

11 files changed

+554
-1639
lines changed

11 files changed

+554
-1639
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file.
1010
### Changed
1111

1212
- **Post-release**: Updated the *Navigating the Wazuh dashboard* section. ([#9105](https://github.com/wazuh/wazuh-documentation/pull/9105))
13+
- **Post-release**: Updated the *Development* section. ([#9104](https://github.com/wazuh/wazuh-documentation/pull/9104))
1314

1415
## [v4.14.0]
1516

source/_static/js/redirects.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ newUrls['4.14'] = [
7777
'/release-notes/release-4-14-0.html',
7878
]
7979

80+
/* Pages no longer available in x.y (this is not required if there is a redirection for this url) */
81+
82+
removedUrls['4.14'] = [
83+
'/development/selinux-wazuh-context.html'
84+
];
85+
8086
/* *** RELEASE 4.13 ****/
8187

8288
/* Pages added in 4.13 */

source/development/client-keys.rst

Lines changed: 73 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -8,94 +8,98 @@
88
Client keys file
99
================
1010

11-
The ``client.keys`` file stores the data used to authenticate secure agents.
12-
13-
Location
14-
--------
15-
16-
UNIX systems
17-
Folder ``etc`` inside the installation directory.
18-
19-
Windows agents
20-
Installation directory.
11+
The ``client.keys`` file stores the data used to authenticate and identify Wazuh agents. A record of the ``client.keys`` file is stored on the Wazuh server and the Wazuh agent endpoints. The location depends on the operating system. The table below lists the default paths for each OS:
12+
13+
+---------------------+--------------------------------------------------------+
14+
| Operating systems | Location of the ``client.keys`` file |
15+
+=====================+========================================================+
16+
| Windows | ``C:\Program Files (x86)\ossec-agent\client.keys`` |
17+
+---------------------+--------------------------------------------------------+
18+
| Linux/Unix | ``/var/ossec/etc/client.keys`` |
19+
+---------------------+--------------------------------------------------------+
20+
| macOS | ``/Library/Ossec/etc/client.keys`` |
21+
+---------------------+--------------------------------------------------------+
2122

2223
File format
2324
-----------
2425

25-
This file contains one line per each agent entry. In the case of agents, only one line is allowed, and this line must match exactly one entry in the ``client.keys`` file at manager, otherwise the agent will be rejected.
26+
The Wazuh manager ``client.keys`` file contains one entry per agent. The Wazuh agent ``client.keys`` file has one line, which must match an entry on the Wazuh manager. If the lines don't match, the Wazuh manager rejects the Wazuh agent.
27+
28+
The ``client.keys`` file is formatted as described in the table below:
2629

2730
::
2831

2932
<ID> <Name> <Address> <Password>
3033

31-
**ID**
32-
33-
Agent identification number.
34-
35-
+--------------------+---------------+
36-
| Allowed characters | Digits only |
37-
+--------------------+---------------+
38-
| Allowed size | 3 to 8 digits |
39-
+--------------------+---------------+
40-
| Padding | 0-padded |
41-
+--------------------+---------------+
42-
| Unique value | Yes |
43-
+--------------------+---------------+
44-
| Reserved values | ID "000" |
45-
+--------------------+---------------+
46-
47-
**Name**
48-
49-
Name of the agent.
34+
Where:
35+
36+
- **ID** - represents the Wazuh agent identification number with the following considerations:
37+
38+
+--------------------+---------------+
39+
| Allowed characters | Digits only |
40+
+--------------------+---------------+
41+
| Allowed size | 3 to 8 digits |
42+
+--------------------+---------------+
43+
| Padding | 0-padded |
44+
+--------------------+---------------+
45+
| Unique value | Yes |
46+
+--------------------+---------------+
47+
| Reserved values | ID "000" |
48+
+--------------------+---------------+
49+
50+
- **Name** - represents the name of the agent with the following considerations:
51+
52+
+--------------------+--------------------------------------------------+
53+
| Allowed characters | Alphanumeric characters, ``-``, ``_`` and ``.`` |
54+
+--------------------+--------------------------------------------------+
55+
| Allowed size | Up to 128 bytes |
56+
+--------------------+--------------------------------------------------+
57+
| Unique value | Yes |
58+
+--------------------+--------------------------------------------------+
59+
60+
- **Address** - represents the allowed source IP address range in CIDR format. If the IP address is explicitly provided, the Wazuh manager will only enroll the agent if the provided IP address matches the source IP address.
61+
62+
+--------------------+----------------------------+
63+
| Format | CIDR. Netmask is optional. |
64+
+--------------------+----------------------------+
65+
| Unique value | Yes |
66+
+--------------------+----------------------------+
67+
| Reserved values | None |
68+
+--------------------+----------------------------+
69+
| Aliases | ``any`` = ``0.0.0.0/0`` |
70+
+--------------------+----------------------------+
71+
72+
- **Password** - represents a base64 encoded string that is used for external message encryption.
73+
74+
+--------------------+----------------------+
75+
| Allowed characters | Printable characters |
76+
+--------------------+----------------------+
77+
| Allowed size | Up to 128 bytes |
78+
+--------------------+----------------------+
79+
| Unique value | No |
80+
+--------------------+----------------------+
5081

51-
+--------------------+--------------------------------------------------+
52-
| Allowed characters | Alphanumeric characters, ``-``, ``_`` and ``.`` |
53-
+--------------------+--------------------------------------------------+
54-
| Allowed size | Up to 128 bytes |
55-
+--------------------+--------------------------------------------------+
56-
| Unique value | Yes |
57-
+--------------------+--------------------------------------------------+
58-
59-
**Address**
60-
61-
Allowed source address range in CIDR format. If specified, the manager will only accept the agent if its source IP address matches this address.
62-
63-
+--------------------+----------------------------+
64-
| Format | CIDR. Netmask is optional. |
65-
+--------------------+----------------------------+
66-
| Unique value | Yes |
67-
+--------------------+----------------------------+
68-
| Reserved values | None |
69-
+--------------------+----------------------------+
70-
| Aliases | ``any`` = ``0.0.0.0/0`` |
71-
+--------------------+----------------------------+
72-
73-
**Password**
74-
75-
String that will take part in the external message encryption.
82+
Void entries
83+
------------
7684

77-
+--------------------+----------------------+
78-
| Allowed characters | Printable characters |
79-
+--------------------+----------------------+
80-
| Allowed size | Up to 128 bytes |
81-
+--------------------+----------------------+
82-
| Unique value | No |
83-
+--------------------+----------------------+
85+
Key entries can be invalidated, causing the associated Wazuh agent to be considered as unenrolled. This can occur in the following cases:
8486

85-
Void entries
86-
~~~~~~~~~~~~
87+
- The entire line is deleted.
88+
- The line begins with ``#`` or whitespace.
89+
- The agent name starts with ``#`` or ``!``.
8790

88-
Key entries can be invalidated so the related agent is considered removed: the line is discarded.
91+
.. note::
8992

90-
- Line starting with ``#`` or whitespace.
91-
- Agent name starting with ``#`` or ``!``.
93+
The Wazuh manager needs to be stopped before invalidating a key to ensure proper un-enrolling.
9294

9395
Examples
94-
~~~~~~~~
96+
--------
97+
98+
Below is an example of the content of the ``client.keys`` file. The last agent ``004`` meets one of the conditions for a void entry because the agent name ``!data3`` starts with ``!``.
9599

96100
::
97101

98102
001 server1 any bb8a28997c6c3964eacb3d32308072f6661f567a41105b2b0b09f1a82331b937
99103
002 dbserver 10.0.1.2 363a99a6e9c9a8b6bb766d676453538e0cb20162f84b36472d99cfbef4928440
100104
003 data2 10.1.2.0/24 3d263f5cc513072fe6b63ab221d1facf132918235c97f19efd9446257d16ea4a
101-
004 !data3 any ed52060a133343dbc74474c19aaad8fb7dddd9a4b5965ebbe9edb2a73fd11a17
105+
004 !data3 any ed52060a133343dbc74474c19aaad8fb7dddd9a4b5965ebbe9edb2a7

source/development/coredump.rst

Lines changed: 43 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,82 +6,88 @@
66
Configuring core dump generation
77
================================
88

9-
A *core dump* or *crash dump* is a snapshot of a process's memory taken when a serious or unhandled error occurs. The operating system on a monitored endpoint can automatically generate core dumps. These dumps are valuable for diagnosing hanging processes. Alongside environment information, such as the operating system version, they can offer insights into the cause of a crash.
9+
A core dump or crash dump is a snapshot of the memory of a process taken when a program terminates abnormally, such as due to a crash or unhandled error. The operating system on a monitored endpoint can automatically generate core dumps. These dumps are valuable for diagnosing frozen processes. Alongside environment information, such as the operating system version, they offer insights into the cause of a crash.
1010

1111
Red Hat based OSs
1212
-----------------
1313

14-
#. Edit the Systemd ``/etc/systemd/system.conf`` file. Add the following lines.
14+
Follow the steps below to enable core dump on RedHat based systems:
15+
16+
#. Edit the ``/etc/systemd/system.conf`` file and add the following lines.
1517

1618
.. code-block:: console
1719
1820
DumpCore=yes
1921
DefaultLimitCORE=infinity
2022
21-
#. Edit the Systemd ``/etc/sysctl.d/core.conf`` file. Add the following lines.
23+
#. Edit the ``/etc/sysctl.d/core.conf`` file and add the following lines:
2224

2325
.. code-block:: console
2426
2527
kernel.core_pattern = /var/lib/coredumps/core-%e-pid%p-time%t
2628
kernel.core_uses_pid = 1
2729
fs.suid_dumpable = 2
2830
29-
#. Create directory ``/var/lib/coredumps`` and grant it permissions ``773``.
31+
#. Create the ``/var/lib/coredumps`` directory and grant it permissions ``773``:
32+
33+
.. code-block:: console
34+
35+
# mkdir /var/lib/coredumps
36+
# chmod 700 /var/lib/coredumps
3037
31-
#. Reboot the system
38+
#. Reboot the system.
3239

33-
#. After system reboot set the core ``ulimit`` to ``unlimited`` in your terminal.
40+
#. After system reboot, set the core ``ulimit`` to ``unlimited`` in your terminal:
3441

3542
.. code-block:: console
3643
3744
# ulimit -c unlimited
3845
# sysctl -p
3946
40-
#. Restart wazuh agent:
47+
#. Restart the Wazuh agent:
4148

4249
.. code-block:: console
4350
44-
# ./var/ossec/bin/wazuh-control restart
51+
# /var/ossec/bin/wazuh-control restart
4552
4653
4754
Debian based OSs
4855
----------------
4956

5057
In Linux version 2.41 and later, a template defines the location and name of the generated `core dump files <https://man7.org/linux/man-pages/man5/core.5.html>`__. Earlier versions generate the core dump files next to the location of the file that caused the error.
5158

52-
Using `systemd`
53-
^^^^^^^^^^^^^^^
59+
Using systemd
60+
^^^^^^^^^^^^^
5461

55-
Systemd allows centralized management and configuration of core dumps across your system. To set up core dump generation with systemd, use the built-in features as follows.
62+
Systemd allows centralized management and configuration of core dumps across your system. To set up core dump generation with systemd, use the built-in features as follows:
5663

57-
#. Check that the Systemd core dump unit socket is active.
64+
#. Install the Systemd core dump package:
5865

5966
.. code-block:: console
6067
61-
# systemctl status systemd-coredump*
68+
# apt install systemd-coredump
6269
63-
.. code-block:: none
64-
:class: output
65-
:emphasize-lines: 3
70+
#. Check that the Systemd core dump unit socket is active:
6671

67-
● systemd-coredump.socket - Process Core Dump Socket
68-
Loaded: loaded (/lib/systemd/system/systemd-coredump.socket; static)
69-
Active: active (listening) ...
72+
.. code-block:: console
7073
71-
#. Edit the Systemd ``/etc/systemd/coredump.conf`` file.
74+
# systemctl status systemd-coredump.socket
7275
73-
.. code-block:: console
76+
.. code-block:: none
77+
:class: output
7478
75-
# systemctl edit systemd-coredump
79+
systemd-coredump.socket - Process Core Dump Socket
80+
Loaded: loaded (/lib/systemd/system/systemd-coredump.socket; static)
81+
Active: active (listening)...
7682
77-
#. Add the following lines in the editor that opens to enable core dump collection and set external core dump storage. To disable core dump generation you must set ``Storage=none``.
83+
#. Edit the ``/etc/systemd/coredump.conf`` file, and add the following lines to enable core dump collection and set external core dump storage. To disable core dump generation you must set ``Storage=none``.
7884

7985
.. code-block:: console
8086
8187
[Coredump]
8288
Storage=external
8389
84-
#. **Recommended** – Set a size limit for core dump files. For example, 2 GB.
90+
#. **Recommended** – Add this configuration to the ``/etc/systemd/coredump.conf`` file to set a size limit for core dump files. For example, 2 GB.
8591

8692
.. code-block:: console
8793
@@ -91,13 +97,13 @@ Systemd allows centralized management and configuration of core dumps across you
9197

9298
.. code-block:: console
9399
94-
# systemctl restart systemd-coredump
100+
# systemctl restart systemd-coredump.socket
95101
96-
#. Check the status of the systemd-coredump service to ensure it is running without errors.
102+
#. Check the status of the systemd-coredump service to ensure it is running without errors:
97103

98104
.. code-block:: console
99105
100-
# systemctl status systemd-coredump
106+
# systemctl status systemd-coredump.socket
101107
102108
#. To check the generated core dump files, take a look at the default ``/var/lib/systemd/coredump/`` directory. To find out the filename pattern for these files, run the following command.
103109

@@ -108,7 +114,7 @@ Systemd allows centralized management and configuration of core dumps across you
108114
.. code-block:: none
109115
:class: output
110116
111-
|/lib/systemd/systemd-coredump %P %u %g %s %t
117+
|/lib/systemd/systemd-coredump %P %u %g %s %t 9223372036854775808 %h %d
112118
113119
Manual configuration
114120
^^^^^^^^^^^^^^^^^^^^
@@ -121,7 +127,7 @@ Setting up core dump generation without using systemd involves configuring the o
121127
122128
# ulimit -c unlimited
123129
124-
#. Set the core dump file location and pattern. For example, to set the the ``/var/core/`` directory and the filename pattern ``core.%e.%p``, where ``%e`` represents the executable name and ``%p`` represents the process ID, run the following command.
130+
#. Set the core dump file location and pattern. For example, to set the ``/var/core/`` directory and the filename pattern ``core.%e.%p``, where ``%e`` represents the executable name and ``%p`` represents the process ID, run the following command.
125131

126132
.. code-block:: console
127133
@@ -133,20 +139,20 @@ Setting up core dump generation without using systemd involves configuring the o
133139

134140
Consider restarting relevant processes to ensure that the changes take effect.
135141

136-
#. **Recommended** – To preserve these changes across reboots, add the ``ulimit`` and ``echo`` commands above to a startup or system initialization script such as ``/etc/rc.local``.
142+
#. We recommend preserving these changes across reboots. Add the ``ulimit`` and ``echo`` commands above to a startup or system initialization script such as ``/etc/rc.local``.
137143

138144
macOS endpoints
139145
---------------
140146

141-
On macOS, most applications have core dump generation disabled by default. However, you can enable it using the ``ulimit`` command. To enable core dump generation on macOS follow these steps.
147+
On macOS, most applications have core dump generation disabled by default. However, you can enable it using the ``ulimit`` command. To enable core dump generation on macOS follow these steps:
142148

143149
#. Set the core dump size limit to ``unlimited`` to enable core dump generation with complete debugging information. To disable it, set it to zero by running ``ulimit -c 0``. To check the current core dump size limit, run ``ulimit -c``.
144150

145151
.. code-block:: console
146152
147153
# ulimit -c unlimited
148154
149-
#. Set the core dump generation path and filename pattern. For example, to set the ``/cores/`` directory and the filename pattern ``core.%P``, where ``%P`` is the process ID, run the following command.
155+
#. Set the core dump generation path and filename pattern. For example, to set the ``/cores/`` directory and the filename pattern ``core.%P``. Where ``%P`` is the process ID, run the following command.
150156

151157
.. code-block:: console
152158
@@ -162,7 +168,7 @@ To collect user-mode crash dumps on Windows, you can use the Windows Error Repor
162168
Accessing the Windows Registry
163169
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
164170

165-
#. Press **Windows + R** keys on your keyboard to open the **Run** dialog box.
171+
#. Press **Windows** + **R** keys on your keyboard to open the Run dialog box.
166172

167173
#. Type ``regedit`` in the search box and click **OK** to open the Registry editor.
168174

@@ -177,15 +183,15 @@ Configuring Windows Error Reporting
177183
178184
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps
179185
180-
#. Right-click on the ``LocalDumps`` key and choose **New** > **Key**. Name the new key ``wazuh-agent.exe``.
186+
#. Right-click on the ``LocalDumps`` key and choose **New > Key**. Name the new key ``wazuh-agent.exe``.
181187

182-
#. Right-click inside the ``wazuh-agent.exe`` key and choose **New** > **Expandable String Value**. Name the new value ``DumpFolder``.
188+
#. Right-click inside the ``wazuh-agent.exe`` key and choose **New > Expandable String Value**. Name the new value ``DumpFolder``.
183189

184190
#. Right-click the ``DumpFolder`` value and select **Modify**. Change it to ``%LOCALAPPDATA%\WazuhCrashDumps``.
185191

186-
#. Right-click inside the ``wazuh-agent.exe`` key again and choose **New** > **DWORD (32-bit) Value**. Name the new value ``DumpType``.
192+
#. Right-click inside the ``wazuh-agent.exe`` key again and choose **New > DWORD (32-bit) Value**. Name the new value as ``DumpType``.
187193

188-
#. Right-click the ``DumpType`` value and select **Modify**. Change it to ``2``.
194+
#. Right-click the ``DumpType`` value and select **Modify**. Change it to ``2``.
189195

190196
#. Close the regedit tool and restart the Wazuh agent using PowerShell with administrator privileges.
191197

0 commit comments

Comments
 (0)