Zilliz Milvus - Guardium Logstash filter plug-in
Meet Milvus
- Tested versions: 2.4.4 or later
- Environment: Milvus Standalone (Docker Linux), Milvus Distributed (Milvus Operator)
- Supported inputs: Filebeat (push)
- Supported Guardium versions: Guardium Data Protection 12.2 and later
This is a Logstash filter plug-in for the universal connector that is featured in IBM Security Guardium. It parses events and messages from the Zilliz Milvus access log into a Guardium Record.
The plug-in is free and open-source (Apache 2.0). It can be used as a starting point to develop additional filter plug-ins for Guardium universal connector.
Limitations
- Milvus access logs do not include the server IP address.
- Milvus access logs do not specify the source program but do provide the SDK version.
Configuring access logs for Milvus
Before you begin
Install Milvus. For more information, see Milvus.
Procedure
-
Configure access logs for Milvus.
In the
milvus.yamlfile, find theproxy | accessLogsection and configure the following parameters:- Set
accessLog | enabletotrue. - In the
localPathparameter, enter the directory where the access log file is located. - In the
filenameparameter, enter the name of your access log file.
proxy:accessLog:enable: truelocalPath: /tmp/milvus_accessfilename: access.logFor more information, see Configure Access logs.
- Set
-
The Milvus filter requires IBM Log Event Extended Format (LEEF) for the access log entry. For more information, see LEEF overview.
-
Update the
formatterssection in your Milvus configuration file to use LEEF.formatters:base:format:"LEEF:1.0|Zilliz|Milvus|1.0|$method_name-$method_status|devTime=$time_now\tdevTimeFormat=yyyy/MM/dd HH:mm:ss.SSS xxx\tuserName=$user_name\tuserAddress=$user_addr\tdatabaseName=$database_name\tcollectionName=$collection_name\tpartitionName=$partition_name\tqueryExpression=$method_expr\terrorCode=$error_code\terrorMessage=$error_msg\ttraceId=$trace_Id\tresponseSize=$response_size\ttimeCost=$time_cost\ttimeStart=$time_start\ttimeEnd=$time_end\tsdkVersion=$sdk_version\tmethodName=$method_name\tmethodStatus=$method_status"
Installing and configuring Filebeat
Guardium uses the Filebeat input plugin to ingest access logs from Milvus. For more information, see Filebeat.
Procedure
-
Install Filebeat on your system. For more information, see Install Filebeat.
-
Configure Filebeat to use Logstash for additional data processing by updating the
filebeat.ymlconfiguration file located in the Filebeat installation directory. For more information about locating the installation directory, see Directory layout. -
In the
filebeat.ymlfile, navigate to thefilebeat.inputssection and add the following parameters. Make sure to add themilvustag to identify the Milvus events from other data.filebeat.inputs:- type: filestream- id: <ID>enabled: truepaths:- <directory path to access log file>fields:service: milvusfields_under_root: truetags: ["milvus"] -
Configure the output section in the
filebeat.ymlfile by completing the following steps.a. Disable Elasticsearch output by commenting it out.
b. Enable Logstash output by uncommenting the Logstash section. For more information, see Configure the Logstash output.
For example:
output.logstash:hosts: ["<host>:<port>"]Note: The
hostsspecifies the Logstash server and theportspecifies where Logstash is configured to listen for incoming Beats connections. You can set any port number except5044,5141, and5000as these ports are currently reserved in Guardium v11.3 and v11.4. -
Navigate to the
processorssection and add the following attribute to get the server's time zone. For more information, see Add the local time zone.In the following example, the processor is enabled with the default settings.
processors:- add_locale: ~ -
Start FileBeat. For more information, see Start filebeat.
Configuring Milvus filters in Guardium
The Guardium universal connector is the Guardium entry point for native access logs. The Guardium universal connector identifies and parses the received events, and converts them to a standard Guardium format. The output of the Guardium universal connector is forwarded to the Guardium sniffer on the collector for policy and auditing enforcements.
Before you begin
- Configure the policies you need. For more information, see Policies.
- You must have permissions for the S-Tap Management role. By default, the admin user is assigned the S-Tap Management role.
- Download the logstash-filter-milvus-guardium plug-in.
Procedure
- On the collector, go to Setup > Tools and Views > Configure Universal Connector.
- Enable the universal connector if it is disabled.
- Click Upload File and select the offline logstash-filter-milvus-guardium plug-in. After it is uploaded, click OK.
- Click Upload File and select the
key.jsonfile. After it is uploaded, click OK. - Click the Plus sign to open the Connector Configuration dialog box.
- In the Connector name field, enter a name.
- Update the input section to add the details from the
milvusOverFilebeat.conffile'sinputsection, omitting the keywordinput{at the beginning and its corresponding}at the end. - Update the filter section to add the details from the
milvusOverFilebeat.conffile'sfiltersection, omitting the keywordfilter{at the beginning and its corresponding}at the end. - Make sure that the
typefields in theinputandfilterconfiguration sections align. This field must be unique for each connector added to the system. - Click Save. Guardium validates the new connector and displays it in the Configure Universal Connector page.
- After the offline plug-in is installed and the configuration is uploaded and saved in the Guardium machine, restart the universal connector by using the Disable/Enable button.