Commit Graph

23 Commits

Author SHA1 Message Date
7c493b08c5 [refactor](dialect) make http sql converter plugin and audit loader as builtin plugin (#29692)
Followup #28890

Make HttpSqlConverterPlugin and AuditLoader as Doris' builtin plugin.
To make it simple for user to support sql dialect and using audit loader.

HttpSqlConverterPlugin

By default, there is nothing changed.

There is a new global variable sql_converter_service, default is empty, if set, the HttpSqlConverterPlugin will be enabled

set global sql_converter_service = "http://127.0.0.1:5001/api/v1/convert"

AuditLoader

By default, there is nothing changed.

There is a new global variable enable_audit_plugin, default is false, if set to true, the audit loader plugin will be enable.

Doris will create audit_log in __internal_schema when startup

If enable_audit_plugin is true, the audit load will be inserted into audit_log table.

3 other global variables related to this plugin:

audit_plugin_max_batch_interval_sec: The max interval for audit loader to insert a batch of audit log.
audit_plugin_max_batch_bytes: The max batch size for audit loader to insert a batch of audit log.
audit_plugin_max_sql_length: The max length of statement in audit log
2024-01-16 18:31:59 +08:00
2ca90b2bf1 [Refactor](dialect) Add sql dialect converter plugins (#28890)
The current logic for SQL dialect conversion is all in the `fe-core` module, which may lead to the following issues:
- Changes to the dialect conversion logic may occur frequently, requiring users to upgrade the Doris version frequently within the fe-core module, leading to a longer change cycle.
- The cost of customized development is high, requiring users to replace the fe-core JAR package.

Turning it into a plugin can address the above issues properly.
2024-01-12 11:44:20 +08:00
e4258dd868 [chore](fe plugin) Upgrade dependency to doris 2.0-SNAPSHOT #27522 2023-11-24 19:30:52 +08:00
76abbfc555 [fix](mvn source) fix audit compile java-cup and cup-maven-plugin not found (#25564) 2023-10-18 01:07:31 -05:00
918a244068 [chore](pom) update apache pom to 29 (#18843) 2023-04-20 16:57:05 +08:00
89c21af87d [chore](fe) update fe snapshot to 1.2 and fix auditloader compile error (#15787)
This PR #14925 change some field of AuditEvent, so we need to upgrade the fe-core's SNAPSHOT to 1.2
because auditloader depends on fe-core

Already push the 1.2-SNAPSHOT to
https://repository.apache.org/content/repositories/snapshots/org/apache/doris/fe-core/1.2-SNAPSHOT/
2023-01-11 08:46:48 +08:00
388db05ef9 [bugfix](log4j) Upgrade log4j to 2.18.0 (#11368) 2022-07-31 22:21:33 +08:00
d9066440f6 [fix](fe_plugins) update fe plugins' dependency to fe 1.0-SNAPSHOT (#11141) 2022-07-25 09:13:15 +08:00
67f341f44e [TLP](step-1) Remove incubator prefix (#10230)
Remove some `incubator-` prefix in source code.
The document is not modified, will be done in next PR.
2022-06-19 19:34:52 +08:00
4bdeef3b64 [chore][fix][doc](fe-plugin)(mysqldump) fix build auditlog plugin error (#7804)
1. fix problems when build fe_plugins
2. format
3. add docs about dump data using mysql dump
2022-01-26 09:11:23 +08:00
ad35067a2a [chore][docs] add deploy spark/flink connectors to maven release repo docs (#7616) 2022-01-06 23:23:33 +08:00
738d2d2e07 [refactor] update parent pom version and optimize build scripts (#7548) 2022-01-05 10:45:11 +08:00
85c30fc720 [deps] Upgrade Log4j to 2.7.1 to solve the CVE-2021-44832 security vulnerability (#7536)
Upgrade Log4j to 2.7.1 to solve the CVE-2021-44832 security vulnerability

Co-authored-by: Zhengguo Yang <yangzhgg@gmail.com>
2021-12-30 10:21:37 +08:00
2872dbfeb8 [refactor] Standardize the writing of pom files, prepare for deployment to maven (#7477) 2021-12-30 10:16:37 +08:00
7a1bb5b335 log4j upgrade to 2.17.0 (#7440)
Solved the third security vulnerability CVE-2021-45105 that was discovered
2021-12-21 09:28:02 +08:00
e64da03866 [deps](log4j) Upgrade log4j 2 to 2.16.0 (#7394)
Upgrade log4j 2 to 2.16.0, the official strongly recommends upgrading to this version
2021-12-14 15:57:16 +08:00
568f6611df [deps](log4j) upgrade log4j (#7364)
to 2.15.0
2021-12-10 23:19:11 +08:00
a6e197bcdc [License] add license to file header and fix Notice file (#5717) 2021-05-05 10:18:03 +08:00
d8202ca9cc [Enhancement] move common codes from fe-core to fe-common and remove log4j1 (#5317) (#5318)
The io related codes may be used by new modules, so It's better to move them to fe-common.

The modification to fe-core is frequent, but there are many generated java files by thrift
will slow down the compilation, so It's better to move thrift generation process to fe-common.

Currently both log4j1 and log4j2 are used, which leads to logs are written to wrong files.
Our modification will remove log4j1 from dependency, use slf4j + slf4j -> log4j2 instead.
2021-02-04 13:41:03 +08:00
ad17afef91 [CodeRefactor] #4098 Make FE multi module (#4099)
This PR change the FE code structure to maven multi module structure. 
See ISSUE: #4098 for more info, such as How to resolve conflicts.
2020-07-21 12:42:42 +08:00
fcb651329c [Plugin] Making FE audit module pluggable (#3219)
Currently we have implemented the plugin framework in FE. 
This CL make the original audit log logic pluggable.
The following classes are mainly implemented:

1. AuditPlugin
    The interface of audit plugin

2. AuditEvent
    An AuditEvent contains all information about an audit event, such as a query, or a connection.

3. AuditEventProcessor
    Audit event processor receive all audit events and deliver them to all installed audit plugins.

This CL implements two audit module plugins:

1. The builtin plugin `AuditLogBuilder`, which act same as the previous logic, to save the 
    audit log to the `fe.audit.log`

2. An optional plugin `AuditLoader`, which will periodically inserts the audit log into a Doris table
    specified by the user. In this way, users can conveniently use SQL to query and analyze this
    audit log table.

Some documents are added:

1. HELP docs of install/uninstall/show plugin.
2. Rename the `README.md` in `fe_plugins/` dir to `plugin-development-manual.md` and move
    it to the `docs/` dir
3. `audit-plugin.md` to introduce the usage of `AuditLoader` plugin.

ISSUE: #3226
2020-04-03 09:53:50 +08:00
eda23b57f2 [Plugin] Create the FE plugin dir if missing (#3202)
The FE plugin dir should be created when initializing.
Also modify the pom.xml in fe_plugins dir to make it able to use custom maven setting.
2020-03-26 11:21:10 +08:00
f585f30b1e [Plugin] Add FE plugin framework (#2463)
issue #2344 

* Add install/unintall Plugin statement
* Add show plugin statement
* Support install plugin through two ways:
    * Built-in Plugin: use PluginMgr's register method.
    * Dynamic Plugin: install by SQL statement, and the process:
        1. check Plugin has already install?
        2. download Plugin file from remote source or copy from local source
        3. extract Plugin's .zip 
        4. read Plugin's plugin.properties, and check Plugin's Value
        5. dynamic load .jar and init Plugin's main Class
        6. invoke Plugin's init method
        7. register Plugin into PluginMgr.
        8. update meta

* Support FE Plugin dynamic uninstall process
    1. check Plugin has install?
    2. invoke Plugin's close method
    3. delete Plugin from PluginMgr
    4. update meta

* Add audit plugin interface 
* Add plugin enable flags in Config
* Add plugin install path in Config, default plugin will install in ${DORIS_FE_PATH}/plugins
* Add FE plugins project
* Add audit plugin demo

The usage:

```
// install plugin and show plugins;

mysql>
mysql> install plugin from "/home/users/seaven/auditplugin.zip";                                              
Query OK, 0 rows affected (0.05 sec)
mysql>
mysql> show plugins;
+-------------------+-------+---------------+---------+-------------+------------------------+--------+---------------------------------------+
| Name              | Type  | Description   | Version | JavaVersion | ClassName              | SoName | Sources                               |
+-------------------+-------+---------------+---------+-------------+------------------------+--------+---------------------------------------+
| audit_plugin_demo | AUDIT | just for test | 0.11.0  | 1.8.31      | plugin.AuditPluginDemo | NULL   | /home/users/hekai/auditplugindemo.zip |
+-------------------+-------+---------------+---------+-------------+------------------------+--------+---------------------------------------+
1 row in set (0.00 sec)

mysql> show plugins;
+-------------------+-------+---------------+---------+-------------+------------------------+--------+---------------------------------------+
| Name              | Type  | Description   | Version | JavaVersion | ClassName              | SoName | Sources                               |
+-------------------+-------+---------------+---------+-------------+------------------------+--------+---------------------------------------+
| audit_plugin_demo | AUDIT | just for test | 0.11.0  | 1.8.31      | plugin.AuditPluginDemo | NULL   | /home/users/hekai/auditplugindemo.zip |
+-------------------+-------+---------------+---------+-------------+------------------------+--------+---------------------------------------+
1 row in set (0.00 sec)

mysql> uninstall plugin audit_plugin_demo; 
Query OK, 0 rows affected (0.04 sec)
mysql> show plugins;
Empty set (0.00 sec)
```

TODO:

*Config.plugin_dir should be created if missing
2020-03-25 22:57:05 +08:00