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

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

Ключ

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

Файл конфигурации cas.conf

СодержимоеОписание
{
 
    "Logging": {...},
см. Общая секция Logging
    "ThriftServers": {...},
см. Общая секция ThriftServers
    "NookDir": "/opt/iw/tm5", 
В секции указывается рабочий каталог модуля. По умолчанию – /opt/iw/tm5.
    "Statistic": {
Секция сбора статистики
         "Multiplier": 1000,
Множитель. Так как многие функции работают в течение очень короткого периода времени, то при помещении в статистику данные умножаются. Иначе часть цифр просто отсечётся
         "Enabled": false,
Включение или выключение сбора статистики
         "Groups": {
Группы статистики. Сбор статистики в каких группах включен, а в каких выключен
             "TechStats": true,
Статистика технологий
             "CasCacheStats": true,
Статистика кэша iw_cas
             "TechEnableStats": true,
Статистика включения технологий
             "CasWorkStats": true,
Статистика работы iw_cas
             "TechResultStats": true
Статистика результатов работы технологий
             }
 
        },
 
    "Bookworm": {...},
см. Общая секция Bookworm
    "DebugBreak": false, 
Посылать ли SIGTRAP (SIGBREAK на Windows) при обработке любого исключения. Служит для отладки
    "UnsafeSignalHandlers":false,
Поддержка работы с необрабатываемыми сигналами. По умолчанию выключена (false). При установке значения true позволяется устанавливать в коде обработчики "небезопасных" сигналов (например, SIGSEVG). Добавлять, включать/выключать данную настройку не рекомендуется без предварительной консультации с разработчиками.
    "Analysis": {
 
        "FormAnalysis": {
Детектор форм.
            "MaxHighlightedRows": 50, 
Максимальное количество полей формы, которое будет подсвечено. Значение по умолчанию – 50 .
            "StopWordsPath": "etc/config-perm/cas/form_stopwords.txt", 
Путь до словаря со стоп-словами
            "Enabled": "true", 
Включение (значение true) и выключение (значение false) технологий анализа
            "LongFieldThreshold": 0.20000000298023224, 
Доля длинных полей (больше одного слова) в перехваченной форме, используется в эвристической формуле для выбора алгоритма сравнения. Значение по умолчанию – 0.2.
            "MinMatchedRows": 1
Минимальное количество полей, при нахождении которых форма срабатывает. Влияет на все формы. Значение по умолчанию –  1.
        }, 
 
        "Vector": {
Технология анализа векторных изображений
            "Enabled": "true"
Включение (значение true) и выключение (значение false) технологий анализа
        }, 
 
        "Researcher": {
Детектор текстовых объектов.
            "LuaReplacesPath": "etc/config-perm/cas/lua_replaces.json", 
Путь до файла со списком символов, которые нужно заменить на заданные перед отправкой текста в верифицирующую функцию.
            "Enabled": "true", 
Включение (значение true) и выключение (значение false) технологий анализа
            "ResultLimits": {
Лимиты на количество результатов данной технологии в контексте события.
                "MaxEntriesPerInstance": 50, 

Максимальное количество найденных текстовых объектов, которые будут записаны в контекст. По-другому, сколько максимально раз уникальный объект может быть найден. Из пары параметров "MaxEntriesPerInstance и MaxInstancesPerTextObject" используется только этот в случае, если шаблон текстового объекта задан как СТРОКА. Значение по умолчанию – 50.

                "MaxInstancesPerTextObject": 50

Максимальное количество вхождений текстового объекта, которые будут записаны в контекст. По-другому, сколько разных значений объектов может быть найдено. Из пары параметров "MaxEntriesPerInstance и MaxInstancesPerTextObject" используется только этот в случае, если шаблон текстового объекта задан как РЕГУЛЯРНОЕ ВЫРАЖЕНИЕ. Значение по умолчанию – 50.

            }
 
        }, 
 
        "Autoling": {
Автоматический лингвистический анализ. Значение по умолчанию - false.
            "Enabled": "false", 
Включение (значение true) и выключение (значение false) технологий анализа
            "Classifier":
 
            {
 
                 "Type": "cosine",

Тип классификатора. Доступны значения:

  • svm - классификатор на основе Support Vector Machine;
  • cosine - классификатор на основе косинусной меры
                 "TermsNumLimit": 500

Максимальное число терминов, используемое классификатором. Доступно только для типа cosine

             };
 
             "Extractor":
 
             {
 
                 "MaxTermSize": 1,

Максимальное число слов в термине

                 "Dictionary":
 Словарь
                 [          
 
                     {
 
                         "Type": "morpho",

Тип словаря:

  • morpho - морфологический словарь;
  • simple - словарь без морфологии;
  • virtual - виртуальный словарь, возвращающий хэш от термина в качестве его ID
                         "Path": "etc/config-perm/cas/all_lang.dict"
 Путь к словарю
                     }
 
                 ],
 
                 "Stopwords":
 Стоп-слова
                 [
 
                     {
 
                          "Type": "morpho",

Тип словаря:

  • morpho - морфологический словарь;
  • simple - словарь без морфологии;
  • virtual - виртуальный словарь, возвращающий хэш от термина в качестве его ID
                          "Path": "etc/config-perm/cas/stopwords.dat"
 Путь до словаря со стоп-словами
                     }
 
                 ]
 
             }
 
        }, 
 
        "Classifier": {

Контентный анализ. Параметр содержит следующие настройки:

            "RelevanceThreshold": 0.10000000000000001, 
Порог срабатывания категорий. Значение по умолчанию – 0.10000000000000001
            "Enabled": "true", 
Включение (значение true) и выключение (значение false) технологий анализа
            "ResultLimits": {
Лимиты на количество результатов данной технологии в контексте события.
                "MaxEntriesPerTerm": 50
Максимальное количество вхождений найденных терминов для каждой категории, которые будут записаны в контекст. Значение по умолчанию – 50.
            }, 
 
            "Speller": {
Технология опечаток. По умолчанию технология выключена
                "Enabled": "true",
Включение (значение true) и выключение (значение false) технологии
                "SpellerDictsPath": "etc/config-perm/cas/"
Путь до директории с морфологическими словарями.
                },
 
            "Translit": { 

Технология транслитерации. По умолчанию технология выключена.

Предупреждение

Если для анализа трафика используется транслитерация, то термины могут детектироваться только без учёта регистра (т.е. если в термине есть буквы в верхнем регистре, то термин не будет детектирован).

 

                "TranslitConfigPath": "etc/config-perm/cas/translit_table.txt",
Путь до файла с таблицей замен для транслитерации.
                "Enabled": "true"
Включение (значение true) и выключение (значение false) технологии
} 
        }, 
 
        "Stamper": {
Детектор эталонных документов.
            "Enabled": "true", 
Включение (значение true) и выключение (значение false) технологий анализа
            "ResultLimits": {
Лимиты на количество результатов данной технологии в контексте события.
                "MaxEntriesPerFingerprint": 50
Максимальное количество вхождений найденных эталонных документов, которые будут записаны в контекст. Значение по умолчанию – 50.
            }
 
        }, 
 
        "Images": {

Детектор изображений. Параметр содержит следующие настройки:

            "MatcherConfig": "etc/config-perm/cas/image-matcher.yml", 
Путь к файлу с точными настройками анализа (image-matcher.yml)
            "KeypointMatcher": {
Технология поиска малых изображений на большом. Работает на кредитных картах
                "Enabled": "true"
 
            }, 
 
            "ImageMaxWidth": 50000, 
Максимальная ширина изображения. Если изображение имеет большую ширину, то оно не будет обрабатываться системой. Значение по умолчанию –  50 000.
            "Barcode": {
Технология распознавания штрих- и баркодов. Выдает текст
                "Enabled": "false"
Включение (значение true) и выключение (значение false) технологий анализа
            }, 
 
            "StampDetector": {
Детектор печатей
                "Enabled": "true"
Включение (значение true) и выключение (значение false) технологий анализа
            }, 
 
            "ResultLimits": {
Лимиты на количество результатов данной технологии в контексте события.
                "MaxFingerprint": 50
Максимальное количество найденных эталонных изображений, которые будут записаны в контекст. Значение по умолчанию – 50.
            }, 
 
            "ImageClassifier": {
Технология классификатора изображений, работающая с паспортами, чертежами, географическими картами
                "Enabled": "true"
 
            }, 
 
            "ImageMaxHeigth": 50000
Максимальная высота изображения. Если изображение имеет большую высоту, то оно не будет обрабатываться системой. Значение по умолчанию – 50000.
        }, 
 
        "Exclusions": {
Исключения
            "Enabled": "false"
Включение (значение true) и выключение (значение false) технологий анализа
        }, 
 
        "TableAnalysis": {
Детектор выгрузок из БД
            "MinWords": 10, 
Минимальное количество слов в файле выгрузки из БД, достаточное для детектирования выгрузки. В данное количество входят все названия полей и все содержащиеся в таблице данные. Требуется, чтобы слова были отделены друг от друга пробелом или иным отступом. Значение по умолчанию –  10.
            "Enabled": "true", 
Включение (значение true) и выключение (значение false) технологий анализа
            "MaxHighlightedWords": 50
Максимальное количество слов из выгрузки, которое будут подсвечены. Значение по умолчанию – 50.
        }
 
    }, 
 
    "Config": {
 
        "EnableSchemaCheck": true, 
Включение проверки xml на xsd (отключение значительно увеличивает скорость загрузки конфигурации). Значение по умолчанию – true
        "CacheMaxSize": 10000, 
Количество результатов анализа контентов, которое хранится в кэше. Количество элементов кэша. Значение по умолчанию – 10000
        "SchemaPath": "etc/cas_config.xsd", 
Путь до xsd файла, по которому проверяется валидность xml конфигурации. Значение по умолчанию – etc/cas_config.xsd
        "Path": "etc/config/cas"
Путь, к конфигурационному файлу cas. Значение по умолчанию – etc/config/cas
    }, 
 
}
 

Unit-файл iw_cas.service 

Код
Описание

[Unit]

Раздел для определения метаданных демона и настройки его взаимодействия с другими демонами
Description=InfoWatch Traffic Monitor Content Analysis Server

Название демона

After=network-online.service iwtm-consul.service  postgresql-9.6.service oracle.serviceДемоны, которые будут запущены до запуска текущего демона
  
[Service]Раздел настройки запуска демона

Type=simple

Тип запуска демона. simple - демон запускается и переходит в режим ожидания на консоли

PermissionsStartOnly=true

Запуск команд из ExecStartPre под пользователем root

ExecStartPre=/bin/bash /opt/iw/tm5/bin/check_coredumps.sh -d iw_cas

Полный путь и аргументы команды, которые должны быть выполнены до запуска основного процесса

ExecStart=/opt/iw/tm5/bin/iw_cas -p /opt/iw/tm5/etc

Полный путь и аргументы команды, которая должна быть выполнена для запуска демона. Запускается от пользователя, указанного в User

ExecStop=/bin/kill -s SIGQUIT $MAINPID

Команда для остановки демона. Если не указано, процесс будет немедленно уничтожен, когда демон будет остановлен. Запускается от пользователя, указанного в User

ExecReload=/bin/kill -s SIGHUP $MAINPID

Команда для перезагрузки конфигурации демона, если она доступна. Запускается от пользователя, указанного в User

Restart=on-failure

Команда для рестарта демона, если он остановится или упадет. Значение on-failure означает, что демон будет перезапускаться, если он остановился с ненулевым кодом возврата или был завершен по сигналу (kill <pid_демона>)

RestartSec=5

Время ожидания перед попыткой перезапуска демона

RestartPreventExitStatus=SIGKILL

Команда, по которой можно принудительно завершить работу демона

TimeoutStopSec=0

Время, в течение которого система будет ждать остановки демона, прежде чем пометить его недоступный или завершенный принудительно

User=iwtm

Имя пользователя, от которого осуществляется запуск демона

Group=iwtm

Имя группы пользователя

LimitNOFILE=32768

Максимальное количество открытых файлов

LimitFSIZE=infinity

Максимальный размер файла (КБ). infinity - без ограничений

LimitNPROC=65536

Максимальное количество процессов

LimitCORE=infinity

Ограничение на размер coredump-файла ядра (КБ)

LimitMEMLOCK=infinity

Максимальное заблокированное в памяти адресное пространство (КБ)

 

 
  

[Install]

Определение поведения демона, если он включен или отключен

WantedBy=multi-user.target

Запускать этот демон, когда система грузится в multi-user режиме
Sv translation
languageen

The cas.conf configuration file:

ContentDescription
{
 
    "Logging": {...},
see General section Logging
    "ThriftServers": {...},
see General section ThriftServers
    "NookDir": "/opt/iw/tm5", 
In this section, the module working directory is specified. By default –  /opt/iw/tm5
"Statistic": {
In this section, statistics are collected
         "Multiplier": 1000,
A multiplier. As many functions work during a short period, their data is multiplied in statistics. Otherwise, some numbers will be omitted
         "Enabled": false,
Whether to enable/disable collecting statistics сбора статистики
         "Groups": {
Statistics groups. Collecting statistics: in what groups it is enabled and in what groups it is disabled
             "TechStats": true,
Statistics of technologies
             "CasCacheStats": true,
Statistics of iw_cas cache
             "TechEnableStats": true,
Statistics of enabling technologies
             "CasWorkStats": true,
Statistics of iw_cas operation
             "TechResultStats": true
Statistics of technology operation results
             }
 
        },
 
    "Bookworm": {...},
see General section Bookworm
    "DebugBreak": false, 
If SIGTRAP should be sent (SIGBREAK to Windows) while any exception handling. Used for debugging purposes.
 "UnsafeSignalHandlers":false,
Unhandled signals support. Disabled by default (false). Once true is set, it is allowed to use unsafe handlers in code (e.g. SIGSEVG). Adding, enabling/disabling this parameter is not recommended without consultation with developers.
    "Analysis": {
 
            "FormAnalysis": {
Detector of forms
            "MaxHighlightedRows": 50, 
Maximum number of rows of the form to be highlighted. Default value –  50
            "StopWordsPath": "etc/config-perm/cas/form_stopwords.txt", 
Path to stop words dictionary
            "Enabled": "true", 
Enabling (true) and disabling (false) of analysis technologies.
            "LongFieldThreshold": 0.20000000298023224, 
Long fields threshold (more than one word) in the intercepted form, used in the heuristic formula for comparison algorithm selection. Default value –  0.2
            "MinMatchedRows": 1
The minimum number of matched rows to activate the form. It has an influence on all forms. Default value –   1
        }, 
 
        "Vector": {
Vector image analysis technology.
            "Enabled": "true"
Enabling (true) and disabling (false) of analysis technologies.
        }, 
 
        "Researcher": {
Text object detector
            "LuaReplacesPath": "etc/config-perm/cas/lua_replaces.json", 
Path to the file with symbol list to be replaced for the specified ones before sending the text to the verification function.
            "Enabled": "true", 
Enabling (true) and disabling (false) of analysis technologies.
            "ResultLimits": {
Event-context technology results limits.
               "MaxEntriesPerInstance": 50, 

The maximum number of text objects found to be written to the context. This means, how many times maximum the unique object can be found. From parameters "MaxEntriesPerInstance" and "MaxInstancesPerTextObject" it is used only in case the text object template is specified as astring. Default value – 50 .

                "MaxInstancesPerTextObject": 50

The maximum number of text object occurrences to be written to the context. This means, how many different object values can be found. From parameters "MaxEntriesPerInstance" and "MaxInstancesPerTextObject" it is used only this one, in case the text object template is set as a regular expression. Default value – 50.

            }
 
        }, 
 
        "Autoling": {
Automatic linguistics analysis. Default value - false
            "Enabled": "False", 
Enabling (true) and disabling (false) of analysis technologies.
            "Classifier":
 
            {
 
                 "Type": "cosine",

Classification type. Available values:

  • svm - Support Vector Machine classifier;
  • cosine - cosine measure classifier.
                 "TermsNumLimit": 500

The maximum number of terms used by the classifier. Available only for cosine.

             };
 
            "Extractor":
 
             {
 
                 "MaxTermSize": 1,

Maximum number of words in a term.

                 "Dictionary":
 Dictionary
                 [          
 
                     {
 
                         "Type": "morpho",

Dictionary type:

  • morpho - morphological;
  • simple - without morphology;
  • virtual - virtual, returning a hash of the term as ID.
                         "Path": "etc/config-perm/cas/all_lang.dict"
Path to the dictionary.
                     }
 
                 ],
 
                 "Stopwords":
Stop words.
                 [
 
                     {
 
                          "Type": "morpho",

Dictionary type:

  • morpho - morphological;
  • simple - without morphology;
  • virtual - virtual, returning a hash of the term as ID.
                          "Path": "etc/config-perm/cas/stopwords.dat"
Path to stop words dictionary.
                     }
 
                 ]
 
             }
 
        }, 
 
        "Classifier": {

Content analysis.

            "RelevanceThreshold": 0.10000000000000001, 
Relevance threshold. Default value – 0.10000000000000001
            "Enabled": "True", 
Enabling (true) and disabling (false) of analysis technologies.
            "ResultLimits": {
Limits for the number of event-context technology results.
                "MaxEntriesPerTerm": 50
The maximum number of terms entries for each category, which should be written to the context. Default value – 5 0
            }, 
 
            "Speller": {
Speller. Technology is disabled by default
  "Enabled": "true",
Enabling (true) and disabling (false) of analysis technologies.
"SpellerDictsPath": "etc/config-perm/cas/"The path to the directory containing morphological dictionaries
     },
 
            "Translit": { 

Transliteration. The technology is disabled by default.

Предупреждение

If transliteration is used for traffic analysis, then case-sensitive term detection does not work (terms with uppercase letters are not detected).

"TranslitConfigPath": "etc/config-perm/cas/translit_table.txt",
The path to the exchange tables for transliteration
  "Enabled": "true" 
Enabling (true) and disabling (false) of analysis technologies.
}
 
}, 
        "Stamper": {
Reference document detector.
            "Enabled": "True", 
Enabling (true) and disabling (false) of analysis technologies.
            "ResultLimits": {
Event-context technology results limits.
                 "MaxEntriesPerFingerprint": 50
Maximum number of reference documents entries to be written to the context. Default value – 50.
            }
 
        }, 
 
       "Images": {

Image detector.

            "MatcherConfig": "etc/config-perm/cas/image-matcher.yml", 
Path to analysis configuration file (image-matcher.yml).
            "KeypointMatcher": {
Small image detector technology. Used for credit cards.
                "Enabled": "True"
 
            }, 
 
            "ImageMaxWidth": 50000, 
Maximum image width. If the image is wider, it will not be processed by the System. Default value –  50 000
            "Barcode": {
Barcode recognition technology. Returns text.
   "Enabled": "false"
Enabling (on) and disabling (off) of analysis technologies.
            }, 
 
            "StampDetector": {
Stamp detector.
                "Enabled": "True"
Enabling (true) and disabling (false) of analysis technologies.
            }, 
 
            "ResultLimits": {
Event-context technology results limits.
                "MaxFingerprint": 50
The maximum number of found fingerprints to be written to the context. Default value – 50.
            }, 
 
            "ImageClassifier": {
Image classifier technology to work with passports, drawings, maps.
                "Enabled": "True"
 
            }, 
 
            "ImageMaxHeigth": 50000
Maximum image height. If the image is higher, it will not be processed by the System. Default value –  50000
        }, 
 
        "Exclusions": {
Exclusions
            "Enabled": "False"
Enabling (true) and disabling (false) of analysis technologies.
        }, 
 
        "TableAnalysis": {
DB unloading detector.
            "MinWords": 10, 
The minimum number of words in a DB unloadings file, sufficient to detect unloading. All field names and data from the table are included in this value. It is required having an interword space. Default value –  10
            "Enabled": "True", 
Enabling (true) and disabling (false) of analysis technologies.
            "MaxHighlightedWords": 50
Maximum number of words from unloading to be highlighted. Default value – 50
        }
 
    }, 
 
    "Config": {
 
        "EnableSchemaCheck": true, 
Enabling the check of xml on xsd  (disabling substantially increases the configuration loading speed).   true by default.
        "CacheMaxSize": 10000, 
Number of analysis results saved in the cache. The number of cache elements. Default value – 10000
        "SchemaPath": "etc/cas_config.xsd", 
Path to xsd file, used for xml configuration validation. Default value – etc/cas_config.xsd
         "Path": "etc/config/cas"
Path to the cas file. Default value – etc/config/cas
    }, 
 
} 

The iw_cas.service unit file:

CodeDescription

[Unit]

A section where the daemon metadata is determined and interaction settings with other daemons are specified
Description=InfoWatch Traffic Monitor Content Analysis Server Daemon name
After=network-online.service iwtm-consul.service  postgresql-9.6.service oracle.serviceDaemons that will be started before the current one
  
[Service]A section where the daemon start settings are specified

Type=simple

Daemon start type. simple - the daemon is started and goes into standby on the console

PermissionsStartOnly=true

Running commands from ExecStartPre under root

ExecStartPre=/bin/bash /opt/iw/tm5/bin/check_coredumps.sh -d iw_cas

The full path and arguments of the command that should be executed before the main process is started

ExecStart=/opt/iw/tm5/bin/iw_cas -p /opt/iw/tm5/etc

The full path and command arguments that should be executed before starting the daemon. The command is run under user specified in the User field

ExecStop=/bin/kill -s SIGQUIT $MAINPID

A command to stop the daemon. If the command is not specified, the process will be killed once the daemon is stopped. The command is run under user specified in the User field

ExecReload=/bin/kill -s SIGHUP $MAINPID

A command that reloads the daemon configuration if it is available. The command is run under user specified in the User field

Restart=on-failure

A command that restarts the daemon when it stops or crashes. The on-failure value indicates that the daemon will be restarted if it has stopped with a non-zero return code or was ended by signal (kill <daemon_pid>)

RestartSec=5

A timeout before attempting to restart the daemon

RestartPreventExitStatus=SIGKILL

A command that forcibly ends the daemon operation

TimeoutStopSec=0

The time during which the system waits for the signal to stop before marking the process as unavailable or terminated

User=iwtm

The name of the user under whose account the daemon is started

Group=iwtm

Name of the user group

LimitNOFILE=32768

The maximum number of open files

LimitFSIZE=infinity

The maximum size of a file (KB). The infinity value means that the size is unlimited

LimitNPROC=65536

The maximum number of processes

LimitCORE=infinity

Restriction Limit for the core file dump size (KB)

LimitMEMLOCK=infinity

The maximum size of memory locked address space (KB)

 

 
  

[Install]

Defines the behavior of a daemon when it is enabled/disabled

WantedBy=multi-user.target

Start the daemon when the system is loaded in multi-user mode