Commit Graph

52 Commits

Author SHA1 Message Date
b0ecf76131 [fix][build](audit-loader) Fix a build error for AuditLoaderPlugin. (#35119) 2024-05-21 16:34:48 +08:00
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
d93812d23f [fix](auditloader) support audit table millisecond and fix stmt truncated by '\r' (#29479)
Signed-off-by: nextdreamblue <zxw520blue1@163.com>
2024-01-03 20:47:56 +08:00
0931eb536c Revert "[Improvement](auditlog) add column catalog for audit log and audit log table (#26403)" (#28177)
This reverts commit daea751a986823bf5858704663d58f49fd5dfb39.
2023-12-08 18:46:59 +08:00
e4258dd868 [chore](fe plugin) Upgrade dependency to doris 2.0-SNAPSHOT #27522 2023-11-24 19:30:52 +08:00
daea751a98 [Improvement](auditlog) add column catalog for audit log and audit log table (#26403) 2023-11-08 10:25:15 +08:00
ad1f635070 [Feature](auditloader) Plugin auditloader use auth token to avoid using cleartext passwords in config (#26278)
Doris FE will check if stream load http request has auth token after checking password failed;
Plugin audit-log loader can use auth token if plugin config set use_auth_token to true

Co-authored-by: Mingyu Chen <morningman.cmy@gmail.com>
2023-11-07 19:14:57 +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
b7ca4fcc8d [fix](io): use try with resource make io stream close automatically to avoid resource leak (#24605) 2023-09-20 11:39:03 +08:00
a041f8eabe [fix](fe) Fx SimpleDateFormatter thread unsafe issue by replacing to DateTimeFormatter. (#19265)
DateTimeFormatter replace SimpleDateFormat in fe module because SimpleDateFormat is not thread-safe.
2023-05-11 22:50:24 +08: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
wxy
6829d361cb [Feature](audit) add errorCode and errorMessage in audit log (#14925)
* [feat] add errorCode and errorMessage in audit log.

* [Feature](audit) add errorCode and errorMessage in audit log

Co-authored-by: wangxiangyu@360shuke.com <wangxiangyu@360shuke.com>
2023-01-09 08:47:57 +08:00
6297ef10e9 [enhancement](plugin) import audit logs for slow queries into a separate table (#14100)
* import audit logs for slow queries into a separate table
2022-11-11 09:06:01 +08:00
wxy
c4b6d4d839 [enhancement](AuditLoaderPlugin): add audit queue capacity configurat… (#12887) 2022-09-27 08:50:30 +08:00
wxy
20de8ac29d [fix](auditloader plugin): fix bug for AuditLoaderPlugin that stmt appears truncated when stmt contains '\n'. (#12627)
Co-authored-by: wangxiangyu@360shuke.com <wangxiangyu@360shuke.com>
2022-09-16 10:28:10 +08:00
4fa53b4cdb [chore](workflow) Add shellcheck to check shell scripts (#11744) 2022-08-18 16:07:28 +08:00
165f0b5ac3 [fix](auditloader)add execute permission for fe_plugins/auditloader/build.sh (#11507)
Co-authored-by: cambyzju <zhuxiaoli01@baidu.com>
2022-08-04 17:42:31 +08:00
ac62c9507e [improvement](script)Audit build script (#11411) 2022-08-02 12:06:44 +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
c633402ce3 [feature] (sql-digest) support sql digest (#8919) 2022-05-08 17:25:41 +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
1e0e472784 [fix](audit-plugin) Fix audit load plugin may stopped when throw unexpected exceptions (#7607)
Fix audit load may stopped when throw unexpected exceptions
2022-01-06 23:21:13 +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
6e0664bdf8 [enhancement](audit) Enable fe audit plugin to audit more infos for query (#7300) 2021-12-06 10:33:15 +08:00
dcad6ff5e5 [License] Add License header for missing files (#7130)
1. Add License header for missing files
2. Modify the spark pom.xml to correct the location of `thrift`
2021-11-16 18:37:54 +08:00
e45b487504 [PLUGIN] optimize output msg when auditlog plugin error (#6653)
* Optimize output msg when auditlog plugin error
2021-09-16 10:29:47 +08:00
a6e197bcdc [License] add license to file header and fix Notice file (#5717) 2021-05-05 10:18:03 +08:00
6f46c52f1d Make the max stmt length to be loaded in audit table can be defined by user. (#5673) 2021-04-21 09:14:32 +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
67b0631257 [Enhancement] Fix bug for auditloader plugin that audit event cannot be processed in time (#5194)
* [Enhancement] Fix bug that audit event cannot be processed in time

Co-authored-by: caiconghui [蔡聪辉] <caiconghui@xiaomi.com>
2021-01-28 10:53:32 +08:00
67b842ce04 [License] Organize and modify the license of the code (#4371)
1. Disable the MySQL client and LZO library by default when building the Doris.

    MySQL client library is used for MySQL external table feature.
    This feature will be replaced by the new ODBC external table soon.

    LZO library is used to compress/decompress data of some old data format of Doris,
    which is no longer used anymore.

2. Add missing license to some files.

3. For all non-Apache-License code, all are explained in NOTICE file and the corresponding license is declared.

4. Remove the js source code from webroot, it will be downloaded as thirdparty
2020-08-24 21:51:55 +08:00
1b3af783e6 [Plugin] Add properties grammar in InstallPluginStmt (#4173)
This PR is to support grammar like the following: INSTALL PLUGIN FROM [source] [PROPERTIES("KEY"="VALUE", ...)]
user can set md5sum="xxxxxxx", so we don't need to provide a md5 uri.
2020-07-29 15:02:31 +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
dcd5e5df12 [AuditPlugin] Modify load label of audit plugin to avoid load confliction (#3681)
Change the load label of audit plugin as:

`audit_yyyyMMdd_HHmmss_feIdentity`.

The `feIdentity` is got from the FE which run this plugin, currently just use FE's IP_editlog_port.
2020-05-26 18:23:07 +08:00
8e21827505 [Bug][AuditPlugin] Fix bug that length of query stmt in audit should less than limit. (#3444)
Use `String.getBytes().length` instead of `String.length()` to get the real byte length of a string.
Fix: #3443 

Also fix the typo of `max_filter_ratio` in audit log plugin.
2020-05-01 21:17:10 +08:00
wyb
2de78e50e2 [Bug] Fix authorization missing when auditloader plugin redirect stream load (#3367)
HttpURLConnection can automatically redirect stream load to BE, but there is no authorization 
information in http request headers after redirect.

Maybe HttpURLConnection remove authorization info when do followRedirect.

The solution is set the followRedirect property to false on the connection object and do the 
redirect request manually.

#3364
2020-04-21 22:03:18 +08:00
c6ac60bab9 [SegmentV2] Optimize the upgrade logic of SegmentV2 (#3340)
This CL mainly made the following modifications:

1. Reorganized SegmentV2 upgrade document.
2. When the variable `use_v2_rollup` is set to true, the base rollup in v2 format is forcibly queried for verifying the data.
3. Fix a problem that there is no persistent storage format information in the schema change operation that performs v2 conversion.
4. Allow users to directly create v2 format tables.
2020-04-21 10:45:29 +08:00
ce1d5ab9ab [Bug] Fix some bugs of install/uninstall plugins (#3267)
1. Avoid losing plugin if plugin failed to load when replaying
    When in replay process, the plugin should always be added to the plugin manager,
    even if that plugin failed to be loaded.

2. `show plugin` statement should show all plugins, not only the successfully installed plugins.

3. plugin's name should be unique globally and case insensitive.

4. Avoid creating new instances of plugins when doing metadata checkpoint.

5. Add a __builtin_ prefix for builtin plugins.
2020-04-09 23:04:28 +08:00
c9c58342b2 [License] Add License to codes (#3272) 2020-04-07 16:35:13 +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