Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.
Комментарий: Published by Scroll Versions from space TMAG and version 7.14
Sv translation
languageru

Версия API: 1.8 и выше

Метод: GET

Ресурс: /event/verdict

Описание:

Метод возвращает вердикт события по ID документа:

  • Разрешено (Allowed);
  • Помещено на карантин (Quarantined);
  • Заблокировано (Forbidden).

Кроме того, вывод метода содержит поля:

  • OBJECT_ID, integer – уникальный идентификатор объекта;
  • TBS_ID, number – идентификатор табличного пространства для секционирования.

Параметры:

  • documentId – идентификатор перехваченного документа;
  • date – дата перехвата в формате ГГГГ-ММ-ДД по UTC+0:00.

Пример:

Блок кода
languagetext
titleЗапрос
collapsetrue
curl -X 'GET' \
  'https://server.company.ru/xapi/event/verdict?documentId=b042cae7-cd7f-4ff3-9af7-5ed41ec0dc23&date=2024-01-15' \
  -H 'X-API-Version: 1.8'
Блок кода
languagetext
titleОтвет
collapsetrue
{
  "data": [
    {
      "VERDICT": "Allowed",
      "DOCUMENT_ID": "string",
      "OBJECT_ID": 0,
      "TBS_ID": 0
    }
  ]
}

Для быстрого получения вердиктов по событиям рекомендуется делать запрос сразу по нескольким documentID:

Блок кода
languagetext
titleЗапрос
collapsetrue
https://server.infowatch.ru/xapi/event/verdict?documentId=ID1,ID2,ID2ID3ID3,ID4,ID5,ID6,IDnnn&date=DATE2'

Отслеживание вердикта по документу

Если требуется нужно проверить набор файлов из внешней системы и, и при условии срабатывания политик и на основании решения пользователя по событию, предпринять какие-либо действия, то необходимо:

  1. Отправить файлы для проверки в ТМ.
  2. Получить и сохранить информацию о событии ТМ.
  3. Отслеживать статус события.

Отправка файлов для проверки в ТМ

В системе сохраняется информация о ходе проверки файлов. Она имеет следующую структуру:

  • file_path – путь или полное имя файла, отправляемого на анализ;
  • document_id – GUID события, сгенерированный при отправке файла на анализ;
  • object_id – идентификатор события, созданного ТМ в результате анализа;
  • tbs_id – идентификатор табличного пространства;
  • verdict – вердикт, проставленный в результате анализа;
  • user_decision – решение пользователя после помещения события на карантин.

  Отправка файла осуществляется путем выполнения запроса PushAPI:

Блок кода
languagetext
titleПример запроса для отправки файла на анализ в TM
collapsetrue
pushapi-util --host 127.0.0.1 --token 8iwivt0cmirlcceuu12l --id IW --class fileexch --service im_vk --evtattr event_name:"vkontakte Event" --sender "vkontakte:sender1111:'{\"display_name\":\"Врбт Тестер\",\"url\":\"https://www.facebook.com/100006160150433\",\"login\":\"new_login\"}'" --receiver vkontakte:vkontakteressivier1 --receiver "vkontakte:11111123:'{\"url\":\"https://vk.com/vrbttester\",\"login\":\"some_login\"}'" --data file:file.txt,filename:file.txt
Блок кода
languagetext
titleПример ответа с получением document_id события
collapsetrue
Object database GUID: df5f046e-0555-46e1-be48-8da33f41b9bb

Данную операцию необходимо нужно повторить для каждого файла и сохранить все полученные GUID. Они будут использоваться далее для отслеживания состояния анализа и изменения решения пользователя.

Получение событий из ТМ

Это действие необходимо нужно для того, чтобы получить информацию о сработавших политиках и вынесенном вердикте по событию в ТМ по результатам анализа содержимого файлов. Помимо этого, на данном этапе требуется получить идентификаторы событий OBJECT_ID и идентификаторы табличных пространств TBS_ID на основе их GUID (document_id).

Для этого необходимо выполнить запрос Public API вида. Он может иметь следующий вид:

Блок кода
languagetext
titleПример запроса
collapsetrue
https://server.infowatch.ru/xapi/event?filter[document_id]={GUID_1},{GUID_2},...,{GUID_N}&filter[date][from]={START_TIME}&filter[date][to]={END_TIME}

Где {GUID_i} – GUID (document_id) файла, полученный при отправке на анализ.

Результатом данного запроса будет массив, элементами которого являются события ТМ. Сопоставляя document_id, сохраненные в результате отправки файлов на анализ, с document_id события, полученного на этом шаге, сохраняем OBJECT_ID и TBS_ID, а также параметры, необходимые для принятия дальнейшего решения по проверяемым файлам (например, вердикт). Вердикты по document_id будут получены для документов, которые есть в БД на момент запроса. Если по запрошенному document_id документа нет в БД, то вердикт на такой документ получен не будет.

На обработку событий в ТМ может потребоваться некоторое время, поэтому возможно, что в результат выполнения API-запроса попадет информация не обо всех событиях, document_id которых был передан. Следовательно, для тех document_id, события по которым не были получены, необходимо нужно повторное выполнение запроса к public API до тех пор, пока они все не будут обработаны.

Отслеживание статуса события

Для отслеживания изменения пользовательского решения рекомендуется периодически выполнять запросы на получение аудита по событиям, где было изменено решение пользователя. Запрос может иметь следующий вид:

Блок кода
languagetext
titleПример запроса
collapsetrue
https://server.infowatch.ru/xapi/audit?filter[change_date][>]={START_TIME}&filter[entity_type][]=Object

Где {START_TIME} - – unix timestamp момента , после последнего запроса на получение аудита (для первой итерации – момента после отправки первого файла на анализ).
После выполнения запроса все события аудита перебираются по очереди, в них поле ENTITY_ID сопоставляется с сохраненными ранее OBJECT_ID. Решение можно принимать на основе полей аудита OPERATION и PROPERTY_CHANGES.

Sv translation
languageen

API Version: 1.8 and later

Method: GET

Resource: /event/verdict

Description:

The method returns an event verdict based on the document ID:

  • Allowed;
  • Quarantined;
  • Forbidden.

Besides, the method's output includes the following fields:

  • OBJECT_ID, integer, is the  – unique object ID;
  • TBS_ID, number, is the – tablespace ID for partitioning.

Parameters:

  • documentId is the – ID of an the intercepted document;
  • date is the – interception date in the YYYY-MM-DD format .(UTC+0:00)

Example:

Блок кода
languagetext
titleQuery
collapsetrue
curl -X 'GET' \
  'https://server.company.comru/xapi/event/verdict?documentId=b042cae7-cd7f-4ff3-9af7-5ed41ec0dc23&date=2024-01-15' \
  -H 'X-API-Version: 1.8'
Блок кода
languagetext
titleResponse
collapsetrue
{
  "data": [
    {
      "VERDICT": "Allowed",
      "DOCUMENT_ID": "string",
      "OBJECT_ID": 0,
      "TBS_ID": 0
    }
  ]
}

To get event verdicts fast, we recommend making a query for several documentID at once:

Блок кода
languagetext
titleQuery
collapsetrue
https://server.infowatch.ru/xapi/event/verdict?documentId=ID1,ID2,ID3,ID4,ID5,ID6,IDnnn&date=DATE2'

Tracking the verdict through the document

If you need to check a set of files of from an externalsystem, and on condition that a policy is triggered when a user verdict is changed, you need to take actions, then and take some actions when thepolicies are triggeredandthe user has made a decisionon the event,then you need to:

  1. Send the files to TM for checking.
  2. Get and store the information about the TM event in TM.
  3. Track the event status.

Sending files to TM for checking

The system stores the information about the process of file checking. The information It has the following structure:

  • file_path – path or the full name of the file to be sent to analysis;
  • document_id – event GUID of event, generated during sending when the file is sent to analysis;
  • object_id – identifier of events, the event that was created in TM after as a result of the analysis;
  • tbs_id – table space identifier;
  • verdict – verdict made after as a result of the analysis;
  • user_decision –user decision after placing the event to quarantine.

  The file is sent via a PushAPI query:

Блок кода
languagetext
titleExample of query for sending a file to TM for analysis
collapsetrue
pushapi-util --host 127.0.0.1 --token 8iwivt0cmirlcceuu12l --id IW --class fileexch --service im_vk --evtattr event_name:"vkontakte Event" --sender "vkontakte:sender1111:'{\"display_name\":\"ВрбтVrbt Тестерtester\",\"url\":\"https://www.facebook.com/100006160150433\",\"login\":\"new_login\"}'" --receiver vkontakte:vkontakteressivier1vkontaktereceiver1 --receiver "vkontakte:11111123:'{\"url\":\"https://vk.com/vrbttester\",\"login\":\"some_login\"}'" --data file:file.txt,filename:file.txt
Блок кода
languagetext
titleExample of response with document_id of the event
collapsetrue
Object database GUID: df5f046e-0555-46e1-be48-8da33f41b9bb

The operation is to be repeated You need to repeat the operation for each file and all GUID are to be storedsave all the received GUIDs. They are to be used to track the analysis status and to change the user verdictdecision. 

Getting events from TM

The This action is required to get the information about triggered policies and the verdict made for the TM event after the analysis of the file content. Furthermore, the step requires receiving the event identifiers OBJECT_ID and TBS_ID based on the basis of their GUID (document_id).

For this, you need to make a Public API query as follows:

Блок кода
languagetext
titleExample of query
collapsetrue
https://server.infowatch.ru/xapi/event?filter[document_id]={GUID_1},{GUID_2},...,{GUID_N}&filter[date][from]={START_TIME}&filter[date][to]={END_TIME}

For this, you need to complete Public API query as follows:

Wherewhere {GUID_i} – GUID is the GUID (document_id) of the file , gotten after received when sending the file to analysis.

The result of the query is an array which elements are the consisting of TM events. By matching the document_id, stored as a result of file sending files to analysis , with document_idof the event , received at this step, OBJECT_ID and TBS_ID are stored, as well as the parameters , required for making further decision regarding the files being checked (for example, a verdict). Verdicts by document_id will be receivedfordocumentsthatarein the databaseat the time of the query. Ifthere is no documentin the database for the queried document_id,then the verdictforsuch a document will notbereceived.

A certain amount of time is needed to process events in TM. So, it is possible , that the result of the API query does not contain the information about all the events for which document_id have been was transferred. Hence, you need to complete the public API query again for the document_id, for which the events are were not received, until all of them are processed.   

Tracking event status

To track the changes in user verdict, it is recommended to complete decision, we recommend periodically making audit queries for audit of events for which where the verdict decision was changed. The query can be may look like this:

Блок кода
languagetext
titleExample of query
collapsetrue
https://server.infowatch.ru/xapi/audit?filter[change_date][>]={START_TIME}&filter[entity_type][]=Object

Where where {START_TIME} – unix is the Unix timestamp of the moment after the last audit query for audit (for the first iteration – the moment after sending the first file to analysis).
After completing the query, all the audit events are processed one by one, the ENTITY_ID field in them is to be matched with the previously stored OBJECT_ID field. The verdict decision can be made based on the basis of the OPERATION and PROPERTY_CHANGES fields.