commit
951442e3db
|
@ -107,6 +107,7 @@ extern bool tsMonitorComp;
|
|||
extern bool tsEnableAudit;
|
||||
extern char tsAuditFqdn[];
|
||||
extern uint16_t tsAuditPort;
|
||||
extern bool tsEnableAuditCreateTable;
|
||||
|
||||
// telem
|
||||
extern bool tsEnableTelem;
|
||||
|
|
|
@ -101,6 +101,9 @@
|
|||
# enable/disable audit log
|
||||
# audit 1
|
||||
|
||||
# enable/disable audit create table
|
||||
# auditCreateTable 1
|
||||
|
||||
# The following parameter is used to limit the maximum number of lines in log files.
|
||||
# max number of lines per log filters
|
||||
# numOfLogLines 10000000
|
||||
|
|
|
@ -98,9 +98,10 @@ int32_t tsMonitorMaxLogs = 100;
|
|||
bool tsMonitorComp = false;
|
||||
|
||||
// audit
|
||||
bool tsEnableAudit = false;
|
||||
bool tsEnableAudit = true;
|
||||
char tsAuditFqdn[TSDB_FQDN_LEN] = {0};
|
||||
uint16_t tsAuditPort = 6043;
|
||||
bool tsEnableAuditCreateTable = true;
|
||||
|
||||
// telem
|
||||
bool tsEnableTelem = true;
|
||||
|
@ -618,6 +619,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
|
|||
if (cfgAddBool(pCfg, "audit", tsEnableAudit, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
if (cfgAddString(pCfg, "auditFqdn", tsAuditFqdn, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
if (cfgAddInt32(pCfg, "auditPort", tsAuditPort, 1, 65056, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
if (cfgAddBool(pCfg, "auditCreateTable", tsEnableAuditCreateTable, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
|
||||
if (cfgAddBool(pCfg, "crashReporting", tsEnableCrashReport, CFG_SCOPE_BOTH) != 0) return -1;
|
||||
if (cfgAddBool(pCfg, "telemetryReporting", tsEnableTelem, CFG_SCOPE_BOTH) != 0) return -1;
|
||||
|
@ -1035,6 +1037,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
|
|||
tsEnableAudit = cfgGetItem(pCfg, "audit")->bval;
|
||||
tstrncpy(tsAuditFqdn, cfgGetItem(pCfg, "auditFqdn")->str, TSDB_FQDN_LEN);
|
||||
tsAuditPort = (uint16_t)cfgGetItem(pCfg, "auditPort")->i32;
|
||||
tsEnableAuditCreateTable = cfgGetItem(pCfg, "auditCreateTable")->bval;
|
||||
|
||||
tsEnableTelem = cfgGetItem(pCfg, "telemetryReporting")->bval;
|
||||
tsEnableCrashReport = cfgGetItem(pCfg, "crashReporting")->bval;
|
||||
|
|
|
@ -314,8 +314,7 @@ _CONNECT:
|
|||
sprintf(obj, "%s:%d", ip, pConn->port);
|
||||
|
||||
char detail[1000] = {0};
|
||||
sprintf(detail, "connType:%d, db:%s, pid:%d, startTime:%" PRId64 ", sVer:%s, app:%s",
|
||||
connReq.connType, connReq.db, connReq.pid, connReq.startTime, connReq.sVer, connReq.app);
|
||||
sprintf(detail, "app:%s", connReq.app);
|
||||
|
||||
auditRecord(pReq, pMnode->clusterId, "login", connReq.user, obj, detail, strlen(detail));
|
||||
|
||||
|
|
|
@ -947,13 +947,13 @@ static int32_t vnodeProcessCreateTbReq(SVnode *pVnode, int64_t ver, void *pReq,
|
|||
|
||||
taosArrayPush(rsp.pArray, &cRsp);
|
||||
|
||||
if(pCreateReq->sqlLen > 0){ //skip auto create table, not set sql when auto create table
|
||||
int32_t clusterId = pVnode->config.syncCfg.nodeInfo[0].clusterId;
|
||||
if(tsEnableAuditCreateTable){
|
||||
int64_t clusterId = pVnode->config.syncCfg.nodeInfo[0].clusterId;
|
||||
|
||||
SName name = {0};
|
||||
tNameFromString(&name, pVnode->config.dbname, T_NAME_ACCT | T_NAME_DB);
|
||||
|
||||
auditRecord(pReq, clusterId, "createTable", name.dbname, pCreateReq->name, pCreateReq->sql, pCreateReq->sqlLen);
|
||||
auditRecord(NULL, clusterId, "createTable", name.dbname, "", pCreateReq->name, strlen(pCreateReq->name));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -268,6 +268,8 @@ class TDTestCase:
|
|||
updatecfgDict["monitorMaxLogs"] = "10"
|
||||
updatecfgDict["monitorComp"] = "1"
|
||||
|
||||
updatecfgDict["audit"] = '0'
|
||||
|
||||
print ("===================: ", updatecfgDict)
|
||||
|
||||
def init(self, conn, logSql, replicaVar=1):
|
||||
|
|
Loading…
Reference in New Issue