==================
Audit event export
==================

Package Security Manager can be configured to automatically generate and export a list of events from the system to external storage, such as an Amazon Web Services (AWS) Simple Storage Service (S3) bucket, or to a valid network storage location. 

.. _event_types:

Anaconda records the following events for export, organized by type:

.. dropdown:: Event types
    :color: primary
    :animate: fade-in

    .. dropdown:: artifact
        :color: primary
        :animate: fade-in

            * ``artifact_copied``
            * ``artifact_downloaded``
            * ``artifact_generated``
            * ``artifact_metadata_updated``
            * ``artifact_registered``
            * ``artifact_removed``
            * ``artifact_skipped``
            * ``artifact_view_refreshed``

    .. dropdown:: authentication
        :color: primary
        :animate: fade-in

            * ``auto_role_added``
            * ``auto_role_deleted``
            * ``auto_role_updated``

    .. dropdown:: build
        :color: primary
        :animate: fade-in

            * ``build_channel_cve_notification``

    .. dropdown:: channel
        :color: primary
        :animate: fade-in

            * ``channel_created``
            * ``channel_cve_count_update``
            * ``channel_deleted``
            * ``channel_group_added``
            * ``channel_group_deleted``
            * ``channel_refresh_complete``
            * ``channel_reindex``
            * ``channel_unfrozen``
            * ``channel_updated``

    .. dropdown:: cve
        :color: primary
        :animate: fade-in

            * ``cve_deleted``
            * ``cve_update_finished``
            * ``cve_updated``

    .. dropdown:: group
        :color: primary
        :animate: fade-in

            * ``group_user_added``
            * ``group_user_deleted``

    .. dropdown:: mirror
        :color: primary
        :animate: fade-in 

            * ``mirror_deleted``
            * ``mirror_registered``
            * ``mirror_updated``

    .. dropdown:: mirroring
        :color: primary
        :animate: fade-in

            * ``mirroring_completed``
            * ``mirroring_failed``
            * ``mirroring_started``
            * ``mirroring_stopped``

    .. dropdown:: report
        :color: primary
        :animate: fade-in

            * ``report_generated``

    .. dropdown:: sbom
        :color: primary
        :animate: fade-in

            * ``sbom_deleted``
            * ``sbom_updated``

    .. dropdown:: user
        :color: primary
        :animate: fade-in

            * ``user_token_created``
            * ``user_token_metadata_updated``
            * ``user_token_revoked``
            * ``user_token_updated``

To establish a background job to generate and export a chronological recording of events that have occurred within the system:

#. Open a terminal and connect to your instance of Package Security Manager.
#. Open your installer directory, where the ``docker-compose.yml`` file is located, by running the command:

    .. code-block:: none

        # Replace <INSTALLER> with the name of your installer directory
        cd <INSTALLER>. 

#. Open your ``docker-compose.yml`` file using your preferred file editor.
#. Find the ``repo_worker:`` section of the file.
#. Add the following variables to the ``repo_worker:`` ``environment:`` section: 

    .. csv-table:: 
        :file: ../csv/audit_event_export_values.csv
        :widths: 50, 50
        :header-rows: 1

#. Restart the ``repo_worker`` container by running the following command:

    .. code-block:: none

        docker compose up --detach

.. note:: 

    If you are using the ``REPO_CONFIGURE_AUDIT_EVENT_TYPES=`` variable, the report will include the ``artifact_downloaded`` events even if you do not include it.