Skip to content

Commit

Permalink
Split container into hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
mmerklinger committed Oct 10, 2024
1 parent 74f3577 commit 366aa45
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 70 deletions.
21 changes: 21 additions & 0 deletions nethsm/container/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Container
=========

Software container images of NetHSM are available for testing and production. They are distributed as OCI images and can be run locally with a compatible executor such as Docker and Podman.

Compared to the NetHSM hardware the following functions are not implemented at software container's REST API:

* Network configuration
* Factory reset
* Reboot
* Software update

Refer to the following chapters to learn more about the respective differences.

.. toctree::
:hidden:
:maxdepth: 1
:glob:

production-image.rst
test-image.rst
69 changes: 1 addition & 68 deletions nethsm/container.rst → nethsm/container/production-image.rst
Original file line number Diff line number Diff line change
@@ -1,68 +1,3 @@
Container
=========

Software container images of NetHSM are available for testing and production. They are distributed as OCI images and can be run locally with a compatible executor such as Docker and Podman.

Compared to the NetHSM hardware the following functions are not implemented at software container's REST API:

* Network configuration
* Factory reset
* Reboot
* Software update

Refer to the following chapters to learn more about the respective differences.

Test Image
----------

The image can be obtained from `Docker Hub <https://hub.docker.com/r/nitrokey/nethsm>`_.

.. warning::

Do not use the test image under any circumstances for production data and use cases.

Tagging Policy
^^^^^^^^^^^^^^

The images in the repository are tagged with the Git commit hash from the main branch of the `repository <https://github.com/nitrokey/nethsm>`__.
The latest image is tagged with ``testing``.

.. _test-image-configuration:

Configuration
^^^^^^^^^^^^^

The image can be configured with the following environment variables.

+----------------------+--------------------------------------+
| Environment variable | Description |
+======================+======================================+
| ``DEBUG_LOG`` | Enables extended logging for NetHSM. |
+----------------------+--------------------------------------+

Usage
^^^^^

The container can be executed as follows.

.. tabs::
.. tab:: Docker
.. code-block:: bash
$ docker run --rm -ti -p 8443:8443 docker.io/nitrokey/nethsm:testing
.. tab:: Podman
.. code-block:: bash
$ podman run --rm -ti -p 8443:8443 docker.io/nitrokey/nethsm:testing
This will run NetHSM as a Unix process inside the container and expose the REST API via the HTTPS protocol on port `8443`.

.. important::
The container uses a self-signed TLS certificate.
Make sure to use the correct connection settings to establish a connection.
Please refer to chapter `NetHSM introduction <index.html>`__ to learn more.

Production Image
----------------

Expand All @@ -76,7 +11,7 @@ The image can be obtained from `Nitrokey NetHSM registry <https://registry.git.n
A compromised platform could easily compromise a NetHSM software container it executes.
In addition the TRNG is not existent so that the entropy used and provided by the NetHSM depends on the platform's entropy.

Tagging Policy
Tagging Policy
^^^^^^^^^^^^^^

The images in the repository are tagged with the Git commit hash and the version of the release.
Expand All @@ -94,8 +29,6 @@ This mode is only available on Linux and requires access to the ``/dev/tun`` and

The mode can be set with the environment variable ``MODE`` (see next chapter `Configuration <container.html#production-image-configuration>`__).

.. _production-image-configuration:

Configuration
^^^^^^^^^^^^^

Expand Down
48 changes: 48 additions & 0 deletions nethsm/container/test-image.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Test Image
----------

The image can be obtained from `Docker Hub <https://hub.docker.com/r/nitrokey/nethsm>`_.

.. warning::

Do not use the test image under any circumstances for production data and use cases.

Tagging Policy
^^^^^^^^^^^^^^

The images in the repository are tagged with the Git commit hash from the main branch of the `repository <https://github.com/nitrokey/nethsm>`__.
The latest image is tagged with ``testing``.

Configuration
^^^^^^^^^^^^^

The image can be configured with the following environment variables.

+----------------------+--------------------------------------+
| Environment variable | Description |
+======================+======================================+
| ``DEBUG_LOG`` | Enables extended logging for NetHSM. |
+----------------------+--------------------------------------+

Usage
^^^^^

The container can be executed as follows.

.. tabs::
.. tab:: Docker
.. code-block:: bash
$ docker run --rm -ti -p 8443:8443 docker.io/nitrokey/nethsm:testing
.. tab:: Podman
.. code-block:: bash
$ podman run --rm -ti -p 8443:8443 docker.io/nitrokey/nethsm:testing
This will run NetHSM as a Unix process inside the container and expose the REST API via the HTTPS protocol on port `8443`.

.. important::
The container uses a self-signed TLS certificate.
Make sure to use the correct connection settings to establish a connection.
Please refer to chapter `NetHSM introduction <index.html>`__ to learn more.
2 changes: 1 addition & 1 deletion nethsm/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ In case you want to restore a backup of a NetHSM, please refer to the chapter `R
opendnssec.rst
ejbca.rst
knotdns.rst
container.rst
container/index.rst
2 changes: 1 addition & 1 deletion nethsm/integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ It will be reset every eight hours (CET 6:00, 14:00, 22:00). User "admin", passw
Container Image
^^^^^^^^^^^^^^^

NetHSM `container images <nethsm/container.html>`__ are available for testing and production.
NetHSM `container images <nethsm/container/index.html>`__ are available for testing and production.

Integration Into Custom Application
-----------------------------------
Expand Down

0 comments on commit 366aa45

Please sign in to comment.