Skip to content

Commit

Permalink
Add python and pip installation templates
Browse files Browse the repository at this point in the history
  • Loading branch information
GGP1 committed May 9, 2024
1 parent f40365e commit 8c17b97
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 170 deletions.
43 changes: 43 additions & 0 deletions source/_templates/cloud/pip_installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.. Copyright (C) 2024 Wazuh, Inc.
The required modules can be installed with pip, the Python package manager. Most UNIX distributions have this tool available in their software repositories:

.. tabs::

.. group-tab:: Yum

.. code-block:: console
# yum update && yum install python3-pip
.. group-tab:: APT

.. code-block:: console
# apt-get update && apt-get install python3-pip
It is recommended to use a pip version greater than or equal to 19.3 to ease the installation of the required dependencies.

.. tabs::

.. group-tab:: Python 3.8–3.10

.. code-block:: console
# pip3 install --upgrade pip
.. group-tab:: Python 3.11

.. code-block:: console
# pip3 install --upgrade pip --break-system-packages
.. note::

This command modifies the default externally managed Python environment. See the `PEP 668 <https://peps.python.org/pep-0668/>`__ description for more information.

To prevent the modification, you can run ``pip3 install --upgrade pip`` within a virtual environment. You must update the module's script shebang with your virtual environment interpreter, for example, ``#!/path/to/your/virtual/environment/bin/python3``.


.. End of include file
18 changes: 18 additions & 0 deletions source/_templates/cloud/python_installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.. Copyright (C) 2024 Wazuh, Inc.
.. tabs::

.. group-tab:: Yum

.. code-block:: console
# yum update && yum install python3
.. group-tab:: APT

.. code-block:: console
# apt-get update && apt-get install python3
.. End of include file
Original file line number Diff line number Diff line change
Expand Up @@ -9,71 +9,20 @@ Installing dependencies
=======================

.. note::
The integration with AWS S3 can be configured in the Wazuh manager (which also behaves as an agent) or directly in a Wazuh agent. This choice merely depends on how you decide to access your AWS infrastructure in your environment.
The integration with AWS can be configured in the Wazuh manager (which also behaves as an agent) or directly in a Wazuh agent. This choice merely depends on how you decide to access your AWS infrastructure in your environment.

.. warning::
The Wazuh manager includes all dependencies installed, these steps are only necessary when configuring the integration in a Wazuh agent.
The Wazuh manager includes all dependencies installed, these steps are only necessary when configuring the integration in a Wazuh agent.


Python
------

The AWS module requires `Python 3 <https://www.python.org/>`__. Specifically, it's compatible with
`Python |PYTHON_CLOUD_CONTAINERS_MIN|–|PYTHON_CLOUD_CONTAINERS_MAX| <https://www.python.org/downloads/>`_. While later Python versions should work as well, we can't assure they are compatible.
The AWS module requires `Python 3 <https://www.python.org/>`__. Specifically, it's compatible with `Python |PYTHON_CLOUD_CONTAINERS_MIN|–|PYTHON_CLOUD_CONTAINERS_MAX| <https://www.python.org/downloads/>`_. While later Python versions should work as well, we can't assure they are compatible.

.. tabs::

.. group-tab:: Yum

.. code-block:: console
# yum update && yum install python3
.. group-tab:: APT

.. code-block:: console
# apt-get update && apt-get install python3
The required modules can be installed with Pip, the Python package manager. Most UNIX distributions have this tool available in their software repositories:

.. tabs::

.. group-tab:: Yum

.. code-block:: console
# yum update && yum install python3-pip
.. group-tab:: APT

.. code-block:: console
# apt-get update && apt-get install python3-pip
It is recommended to use a pip version greater than or equal to 19.3 to ease the installation of the required dependencies.

.. tabs::

.. group-tab:: Python 3.8–3.10

.. code-block:: console
# pip3 install --upgrade pip
.. group-tab:: Python 3.11

.. code-block:: console
# pip3 install --upgrade pip --break-system-packages
.. note::

This command modifies the default externally managed Python environment. See the `PEP 668 <https://peps.python.org/pep-0668/>`__ description for more information.

To prevent the modification, you can run ``pip3 install --upgrade pip`` within a virtual environment. You must update the ``aws-s3`` script shebang with your virtual environment interpreter, for example, ``#!/path/to/your/virtual/environment/bin/python3``.
.. include:: /_templates/cloud/python_installation.rst

.. include:: /_templates/cloud/pip_installation.rst

.. _boto-3:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,72 +7,20 @@ Installing dependencies
=======================

.. note::

The Azure monitoring module can be configured in the Wazuh manager (which also behaves as an agent) or directly in a Wazuh agent.
The integration with Azure can be configured in the Wazuh manager (which also behaves as an agent) or directly in a Wazuh agent. This choice merely depends on how you decide to access your AWS infrastructure in your environment.

.. warning::
The Wazuh manager includes all dependencies installed, these steps are only necessary when configuring the integration in a Wazuh agent.
The Wazuh manager includes all dependencies installed, these steps are only necessary when configuring the integration in a Wazuh agent.


Python
------

The Azure module requires `Python 3 <https://www.python.org/>`__. Specifically, it's compatible with
`Python |PYTHON_CLOUD_CONTAINERS_MIN|–|PYTHON_CLOUD_CONTAINERS_MAX| <https://www.python.org/downloads/>`_. While later Python versions should work as well, we can't assure they are compatible.

.. tabs::

.. group-tab:: Yum

.. code-block:: console
# yum update && yum install python3
.. group-tab:: APT

.. code-block:: console
# apt-get update && apt-get install python3
The required modules can be installed with Pip, the Python package manager. Most of UNIX distributions have this tool available in their software repositories:

.. tabs::

.. group-tab:: Yum

.. code-block:: console
# yum update && yum install python3-pip
The Azure module requires `Python 3 <https://www.python.org/>`__. Specifically, it's compatible with `Python |PYTHON_CLOUD_CONTAINERS_MIN|–|PYTHON_CLOUD_CONTAINERS_MAX| <https://www.python.org/downloads/>`_. While later Python versions should work as well, we can't assure they are compatible.

.. group-tab:: APT
.. include:: /_templates/cloud/python_installation.rst

.. code-block:: console
# apt-get update && apt-get install python3-pip
It is recommended to use a pip version greater than or equal to 19.3 to ease the installation of the required dependencies.

.. tabs::

.. group-tab:: Python 3.8–3.10

.. code-block:: console
# pip3 install --upgrade pip
.. group-tab:: Python 3.11

.. code-block:: console
# pip3 install --upgrade pip --break-system-packages
.. note::

This command modifies the default externally managed Python environment. See the `PEP 668 <https://peps.python.org/pep-0668/>`__ description for more information.

To prevent the modification, you can run ``pip3 install --upgrade pip`` within a virtual environment. You must update the ``azure-logs`` script shebang with your virtual environment interpreter, for example, ``#!/path/to/your/virtual/environment/bin/python3``.
.. include:: /_templates/cloud/pip_installation.rst

Azure Storage client library for Python
---------------------------------------
Expand Down
62 changes: 5 additions & 57 deletions source/cloud-security/gcp/prerequisites/dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
Installing dependencies
=======================

The Wazuh module for Google Cloud Pub/Sub and the Wazuh module for Google Cloud Storage buckets can be configured on both the Wazuh server and the monitored endpoint. This choice depends on where you want to reach the Google Cloud services. Perform the steps below to install Python and Pip on the endpoint you are performing the integration.
.. note::
The integration with Google Cloud Services can be configured in the Wazuh manager (which also behaves as an agent) or directly in a Wazuh agent. This choice merely depends on how you decide to access your AWS infrastructure in your environment.

.. warning::

Expand All @@ -14,64 +15,11 @@ The Wazuh module for Google Cloud Pub/Sub and the Wazuh module for Google Cloud
Python
------

The Wazuh module for Google Cloud Pub/Sub and the Wazuh module for Google Cloud Storage buckets require `Python 3 <https://www.python.org/>`__. It's compatible with
`Python |PYTHON_CLOUD_CONTAINERS_MIN|–|PYTHON_CLOUD_CONTAINERS_MAX| <https://www.python.org/downloads/>`_. While later Python versions should work as well, we can't assure they are compatible.
The GCP module requires `Python 3 <https://www.python.org/>`__. It's compatible with `Python |PYTHON_CLOUD_CONTAINERS_MIN|–|PYTHON_CLOUD_CONTAINERS_MAX| <https://www.python.org/downloads/>`_. While later Python versions should work as well, we can't assure they are compatible.

Run the following command to install Python 3 if you do not already have it installed:
.. include:: /_templates/cloud/python_installation.rst

.. tabs::

.. group-tab:: Yum

.. code-block:: console
$ sudo yum update && yum install python3
.. group-tab:: APT

.. code-block:: console
$ sudo apt-get update && apt-get install python3
Run the command below to install Pip, the Python package manager. Most UNIX distributions have this tool available in their software repositories by default.

Perform the next steps if you do not already have it installed.

.. tabs::

.. group-tab:: Yum

.. code-block:: console
$ sudo yum update && yum install python3-pip
.. group-tab:: APT

.. code-block:: console
$ sudo apt-get update && apt-get install python3-pip
If you already have Python3 and Pip installed, perform the following steps to upgrade your Pip version. We recommend using a pip version greater than or equal to 19.3 to ease the installation of the required dependencies.

.. tabs::

.. group-tab:: Python 3.8–3.10

.. code-block:: console
$ sudo pip3 install --upgrade pip
.. group-tab:: Python 3.11

.. code-block:: console
$ sudo pip3 install --upgrade pip --break-system-packages
.. note::

This command modifies the default externally managed Python environment. See the `PEP 668 <https://peps.python.org/pep-0668/>`__ description for more information.

To prevent the modification, you can run ``pip3 install --upgrade pip`` within a virtual environment. You must update the gcloud ``var/ossec/wodles/gcloud/gcloud`` module shebang with your virtual environment interpreter. For example: ``#!</path/to/your/virtual/environment>/bin/python3``.
.. include:: /_templates/cloud/pip_installation.rst

Google Cloud pip dependencies
-----------------------------
Expand Down

0 comments on commit 8c17b97

Please sign in to comment.