Files
EdgeCommon/pkg/rpc/protos/service_firewall.proto

80 lines
1.8 KiB
Protocol Buffer
Raw Normal View History

2021-07-12 16:57:06 +08:00
syntax = "proto3";
option go_package = "./pb";
package pb;
2021-07-18 16:26:45 +08:00
import "models/rpc_messages.proto";
2021-07-12 16:57:06 +08:00
import "models/model_http_firewall_rule_group.proto";
// 防火墙全局服务
service FirewallService {
// 组合看板数据
rpc composeFirewallGlobalBoard (ComposeFirewallGlobalBoardRequest) returns (ComposeFirewallGlobalBoardResponse);
2021-07-18 16:26:45 +08:00
// 发送告警(notify)消息
rpc notifyHTTPFirewallEvent (NotifyHTTPFirewallEventRequest) returns (RPCSuccess);
2021-07-12 16:57:06 +08:00
}
// 组合看板数据
message ComposeFirewallGlobalBoardRequest {
}
message ComposeFirewallGlobalBoardResponse {
int64 countDailyLogs = 1;
int64 countDailyBlocks = 2;
int64 countDailyCaptcha = 3;
int64 countWeeklyBlocks = 4;
repeated HTTPFirewallRuleGroupStat httpFirewallRuleGroups = 30;
repeated DailyStat dailyStats = 31;
repeated HourlyStat hourlyStats = 32;
repeated NodeStat topNodeStats = 33;
repeated DomainStat topDomainStats = 34;
2021-07-12 16:57:06 +08:00
message HTTPFirewallRuleGroupStat {
HTTPFirewallRuleGroup httpFirewallRuleGroup = 1;
int64 count = 2;
}
message HourlyStat {
string hour = 1;
int64 countLogs = 2;
int64 countCaptcha = 3;
int64 countBlocks = 4;
}
message DailyStat {
string day = 1;
int64 countLogs = 2;
int64 countCaptcha = 3;
int64 countBlocks = 4;
}
message NodeStat {
int64 nodeId = 1;
string nodeName = 2;
int64 countRequests = 3;
int64 bytes = 4;
int64 countAttackRequests = 6;
int64 attackBytes = 7;
}
message DomainStat {
int64 serverId = 1;
string domain = 2;
int64 countRequests = 3;
int64 bytes = 4;
int64 countAttackRequests = 6;
int64 attackBytes = 7;
}
2021-07-18 16:26:45 +08:00
}
// 发送告警(notify)消息
message NotifyHTTPFirewallEventRequest {
int64 serverId = 1;
int64 httpFirewallPolicyId = 2;
int64 httpFirewallRuleGroupId = 3;
int64 httpFirewallRuleSetId = 4;
int64 createdAt = 5;
2021-07-12 16:57:06 +08:00
}