🕵🏼Are you being audited? Business Central information is required. Microsoft Purview helps you. 🔎

🕵🏼¿Le están realizando una auditoría? Se requiere información de Business Central. Microsoft Purview le ayuda. 🔎

Entonces, ante esta afirmación, tuve algunas preguntas:

  1. ¿Qué operaciones se auditan?
  2. ¿Y la telemetría, son diferentes, se complementan?
  3. ¿Se pueden personalizar los eventos auditables?

Luego de revisar la documentación, algunas pruebas y leer los comentarios de expertos y conocedores, he ido clarificando mis dudas y se las comparto.

Tenemos un listado que irá creciendo relacionado a los tipos y operaciones que se auditan de manera automática:

¿Podemos crear nuestros propios eventos de auditoría? La respuesta rápida es no, lo revisaré un poco más en detalle más adelante, pero la función que se utiliza para auditar estas acciones se encuentra habilitado para un alcance de OnPrem.

Para revisar directamente esta funcionalidad, voy a proceder a crear el servicio de Microsoft Purview.

Para crear la cuenta se requieren datos genéricos muy similares entre los servicios de Azure, como el nombre, el grupo de recursos y ubicación geográfica.

Se realiza una validación inicial que debe ser superada.

Una vez validada procedemos a crearlo, y ya lo tenemos listo.

Una vez creado, accedemos al portal de gobernanza de Microsoft Purview (la nueva interfaz).

Para completar una política de retención de auditoría requerimos el nombre, una descripción, podríamos limitar a un usuario o usuarios. También requerimos elegir en la opción de Tipo de Registro el valor de «Dynamics365BusinessCentral», también podríamos limitar más la información a buscar si decidimos un tipo de actividad específica, las cuales hemos comentado anteriormente. Otro valor importante es la cantidad de días de retención de la información, el tiempo que hablamos es de días o hasta años. Para conservar los registros de auditoría durante 10 años, al usuario que genera el registro de auditoría también se le debe asignar una licencia complementaria de retención de registro de auditoría de 10 años, además de una licencia E5.

Cuando seleccionamos la opción de buscar, inicialmente la búsqueda se coloca en un estado de «encolado», luego va avanzando en su preparación y se encuentra en el estado de «en progreso», para finalmente pasar al estado de «completado».

El resultado de la búsqueda nos brinda un listado con información adicional y detallada del evento que ha auditado.

Es posible filtrar dentro de los resultados de la búsqueda, lo que nos permite acotar aún más los datos a analizar.

¿Puedo explotar esta información de otra manera?, la respuesta es si. Por lo que, tenemos varias posibilidades para revisar los datos.

En Business Central he podido identificar que estos eventos auditados se han trabajado desde la versión 24.5 y ha ido evolucionando.

En la versión 24.5 se empezaron a auditar actividades de administración de empresas y de integraciones, en la siguiente imagen se ve el código en el evento OnInsert de la tabla «Retention Policy Setup», se usan variables tipo DotNet para el registro y auditoría del evento.

    trigger OnInsert()
    var
        MyCustomerAuditLoggerALHelper: DotNet CustomerAuditLoggerALHelper;
        MyALSecurityOperationResult: DotNet ALSecurityOperationResult;
        MyALAuditCategory: DotNet ALAuditCategory;
        NewRetentionPolicyCreatedLbl: Label 'The new Retention Policy record with Table ID %1 is created by the UserSecurityId %2.', Locked = true;
    begin
        MyCustomerAuditLoggerALHelper.LogAuditMessage(StrSubstNo(NewRetentionPolicyCreatedLbl, Rec."Table ID", UserSecurityId()), MyALSecurityOperationResult::Success, MyALAuditCategory::ApplicationManagement, 3, 0);
    end;

Visualizamos en los siguientes listados, la extensión, el objeto y el evento donde se ha trabajado esta funcionalidad

El parámetro AuditMessageOperation nos indica el origen de las actividades, el tipo de operación del mensaje de auditoría.

Esta función es la que se usa actualmente en todos los eventos y operaciones que se auditan desde Business Central.

   trigger OnInsert()
    var
        NewRetentionPolicyCreatedLbl: Label 'The new Retention Policy record with Table ID %1 is created by the UserSecurityId %2.', Locked = true;
    begin
        Session.LogAuditMessage(StrSubstNo(NewRetentionPolicyCreatedLbl, Rec."Table ID", UserSecurityId()), SecurityOperationResult::Success, AuditCategory::ApplicationManagement, 3, 0);
    end;

Espero que esta información te ayude.


🕵🏼Are you being audited? Business Central information is required. Microsoft Purview helps you. 🔎

So, in light of this statement, I had a few questions:

  1. What operations are audited?
  2. And telemetry, are they different or complementary?
  3. Can auditable events be customized?

After reviewing the documentation, some tests and reading the comments of experts, I have clarified my doubts and I share them with you.

We have a list that will continue to grow related to the types and operations that are audited automatically:

Can we create our own audit events? The quick answer is no, I’ll go into this in a bit more detail later, but the method used to audit these actions is enabled for an OnPrem scope: Session.LogAuditMessage.

To directly review this functionality, I will proceed to create the Microsoft Purview service.

To create the account, generic data is required that is very similar between Azure services, such as name, resource group, and geographic location.

An initial validation is performed which must be passed.

Once validated, we proceed to create it, and it would be ready.

Once created, we access the Microsoft Purview governance portal (the new interface).

To complete an audit retention policy we require the name, a description, we could limit it to a user or users. We also need to choose the value of «Dynamics365BusinessCentral» in the Record Type option, we could also further limit the information to be searched if we decide on a specific type of activity, which we have discussed above. Another important value is the number of days to retain the information, the time we are talking about is days or even years. To retain audit records for 10 years, the user who generates the audit record must also be assigned a 10-year audit log retention add-on license, in addition to an E5 license.

When we select the search option, the search is initially placed in a «queued» state, then it progresses in its preparation and is in the «in progress» state, and finally it moves to the «completed» state.

The search result provides us with a list with additional and detailed information about the event that has been audited.

It is possible to filter within the search results, which allows us to further narrow down the data to be analyzed.

Can I consume this information in another way? The answer is yes. Therefore, we have several possibilities to review the data.

In Business Central I have been able to identify that these audited events have been worked on since version 24.5 and have been evolving.

In version 24.5, auditing of business administration and integration activities began. The following image shows the code in the OnInsert event of the «Retention Policy Setup» table, using DotNet type variables to record and audit the event.

    trigger OnInsert()
    var
        MyCustomerAuditLoggerALHelper: DotNet CustomerAuditLoggerALHelper;
        MyALSecurityOperationResult: DotNet ALSecurityOperationResult;
        MyALAuditCategory: DotNet ALAuditCategory;
        NewRetentionPolicyCreatedLbl: Label 'The new Retention Policy record with Table ID %1 is created by the UserSecurityId %2.', Locked = true;
    begin
        MyCustomerAuditLoggerALHelper.LogAuditMessage(StrSubstNo(NewRetentionPolicyCreatedLbl, Rec."Table ID", UserSecurityId()), MyALSecurityOperationResult::Success, MyALAuditCategory::ApplicationManagement, 3, 0);
    end;

We visualize in the following lists, the extension, the object and the event where this functionality has been added.

The AuditMessageOperation parameter tells us the origin of the activities, the type of operation of the audit message.

This function is currently used for all events and operations that are audited from Business Central.

   trigger OnInsert()
    var
        NewRetentionPolicyCreatedLbl: Label 'The new Retention Policy record with Table ID %1 is created by the UserSecurityId %2.', Locked = true;
    begin
        Session.LogAuditMessage(StrSubstNo(NewRetentionPolicyCreatedLbl, Rec."Table ID", UserSecurityId()), SecurityOperationResult::Success, AuditCategory::ApplicationManagement, 3, 0);
    end;

I hope this information helps you.


Más información / More information:

Deja un comentario