配置ddos增加记录日志跟区域管控

This commit is contained in:
zhanghongqing
2018-11-26 17:06:25 +08:00
parent 4e6b1fd088
commit 67d8b893e3
8 changed files with 49 additions and 10 deletions

Binary file not shown.

View File

@@ -37,6 +37,7 @@
<result column="antiddos_protocol" property="antiddosProtocol" jdbcType="VARCHAR" /> <result column="antiddos_protocol" property="antiddosProtocol" jdbcType="VARCHAR" />
<result column="bps_threadshold" property="bpsThreadshold" jdbcType="BIGINT" /> <result column="bps_threadshold" property="bpsThreadshold" jdbcType="BIGINT" />
<result column="pps_threadshold" property="ppsThreadshold" jdbcType="BIGINT" /> <result column="pps_threadshold" property="ppsThreadshold" jdbcType="BIGINT" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap> </resultMap>
<sql id="columns"> <sql id="columns">
@@ -44,7 +45,7 @@
,r.protocol,r.protocol_id,r.direction,r.cfg_type,r.action,r.dest_port,r.dest_ip_address ,r.protocol,r.protocol_id,r.direction,r.cfg_type,r.action,r.dest_port,r.dest_ip_address
,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id ,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id
,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id, ,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id,
r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable,r.do_log
,r.area_effective_ids,r.function_id,r.cfg_region_code,r.antiddos_protocol,r.bps_threadshold,r.pps_threadshold ,r.area_effective_ids,r.function_id,r.cfg_region_code,r.antiddos_protocol,r.bps_threadshold,r.pps_threadshold
</sql> </sql>
@@ -219,7 +220,8 @@
cfg_region_code, cfg_region_code,
antiddos_protocol, antiddos_protocol,
bps_threadshold, bps_threadshold,
pps_threadshold pps_threadshold,
do_log
)values ( )values (
#{cfgDesc,jdbcType=VARCHAR}, #{cfgDesc,jdbcType=VARCHAR},
#{action,jdbcType=INTEGER}, #{action,jdbcType=INTEGER},
@@ -254,7 +256,8 @@
#{cfgRegionCode,jdbcType=INTEGER}, #{cfgRegionCode,jdbcType=INTEGER},
#{antiddosProtocol,jdbcType=VARCHAR}, #{antiddosProtocol,jdbcType=VARCHAR},
#{bpsThreadshold,jdbcType=BIGINT}, #{bpsThreadshold,jdbcType=BIGINT},
#{ppsThreadshold,jdbcType=BIGINT} #{ppsThreadshold,jdbcType=BIGINT},
#{doLog,jdbcType=INTEGER}
) )
</insert> </insert>
@@ -348,6 +351,9 @@
</if> </if>
<if test="cfgRegionCode != null " > <if test="cfgRegionCode != null " >
cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER}, cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER},
</if>
<if test="doLog != null " >
do_log = #{doLog,jdbcType=INTEGER},
</if> </if>
antiddos_protocol = #{antiddosProtocol,jdbcType=VARCHAR}, antiddos_protocol = #{antiddosProtocol,jdbcType=VARCHAR},
bps_threadshold = #{bpsThreadshold,jdbcType=BIGINT}, bps_threadshold = #{bpsThreadshold,jdbcType=BIGINT},

View File

@@ -65,7 +65,7 @@ mail_keyword_control=Mail Keyword Block
mail_attachment_name_control=Mail Attachment Name Block mail_attachment_name_control=Mail Attachment Name Block
mail_attachment_content_control=Mail Attachment Content Block mail_attachment_content_control=Mail Attachment Content Block
file_transfer_control=File Transfer file_transfer_control=File Transfer
ftp_address_control=FTP Url Block ftp_address_control=FTP URL Block
ftp_name_control=FTP Filename Block ftp_name_control=FTP Filename Block
ftp_content_control=FTP File Content Block ftp_content_control=FTP File Content Block
http_app_feature=Application HTTP Feature http_app_feature=Application HTTP Feature
@@ -1018,7 +1018,7 @@ domain_intercepter_ratelimit=Domain Intercept Rate Limit
app_built_in_features_config=APP Built-in Features app_built_in_features_config=APP Built-in Features
PXY_INTERCEPT_PKT_BIN=Packet Payload PXY_INTERCEPT_PKT_BIN=Packet Payload
certificate=Certificate certificate=Certificate
do_log=Log Option do_log=Unstructured Log Option
file_strategy=File Strategy file_strategy=File Strategy
file_desc=File Desc file_desc=File Desc
content_type=Content Type content_type=Content Type

View File

@@ -1017,7 +1017,7 @@ domain_intercepter_ratelimit=\u57DF\u540D\u62E6\u622A\u9650\u901F
app_built_in_features_config=APP\u5185\u7F6E\u7279\u5F81\u7EF4\u62A4 app_built_in_features_config=APP\u5185\u7F6E\u7279\u5F81\u7EF4\u62A4
PXY_INTERCEPT_PKT_BIN=\u5305\u8F7D\u8377 PXY_INTERCEPT_PKT_BIN=\u5305\u8F7D\u8377
certificate=\u8BC1\u4E66 certificate=\u8BC1\u4E66
do_log=\u662F\u5426\u8BB0\u5F55\u65E5\u5FD7 do_log=\u8BB0\u5F55\u975E\u7ED3\u6784\u5316\u65E5\u5FD7
file_strategy=\u6587\u4EF6\u7B56\u7565 file_strategy=\u6587\u4EF6\u7B56\u7565
file_desc=\u6587\u4EF6\u63CF\u8FF0\t file_desc=\u6587\u4EF6\u63CF\u8FF0\t
content_type=\u5185\u5BB9\u7C7B\u578B content_type=\u5185\u5BB9\u7C7B\u578B

View File

@@ -0,0 +1 @@
alter table ddos_ip_cfg add do_log int(11) COMMENT 'do_log:1记录所有日志2只记录结构化日志。默认是2'

View File

@@ -23,12 +23,12 @@ var setSelectIndex = function(){
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="whether_area_block"/></label> <label class="control-label col-md-3"><font color="red">*</font><spring:message code="whether_area_block"/></label>
<div class="col-md-6"> <div class="col-md-6">
<label class="radio-inline"> <label class="radio-inline">
<input type="radio" name="isAreaEffective" value="0" class="required areaControl" <input type="radio" name="isAreaEffective" value="0" class="required"
<c:if test="${empty _cfg.isAreaEffective or _cfg.isAreaEffective==0}">checked</c:if> <c:if test="${empty _cfg.isAreaEffective or _cfg.isAreaEffective==0}">checked</c:if>
><spring:message code="all"/> ><spring:message code="all"/>
</label> </label>
<label class="radio-inline"> <label class="radio-inline">
<input type="radio" name="isAreaEffective" value="1" class="required areaControl" <input type="radio" name="isAreaEffective" value="1" class="required"
<c:if test="${_cfg.isAreaEffective==1}">checked</c:if> <c:if test="${_cfg.isAreaEffective==1}">checked</c:if>
><spring:message code="selective"/> ><spring:message code="selective"/>
</label> </label>

View File

@@ -62,7 +62,6 @@ $(function(){
<input type="hidden" name="functionId" value="${_cfg.functionId}"> <input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}"> <input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="protocolId" name="protocolId" value="${_cfg.protocolId}"> <input type="hidden" id="protocolId" name="protocolId" value="${_cfg.protocolId}">
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
<!-- 配置域类型 --> <!-- 配置域类型 -->
<c:forEach items="${regionList}" var="region"> <c:forEach items="${regionList}" var="region">
<c:if test="${_cfg.functionId eq region.functionId}"> <c:if test="${_cfg.functionId eq region.functionId}">
@@ -118,7 +117,29 @@ $(function(){
</div> </div>
</div> </div>
</div> </div>
<div>
<div class="row doLog">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
</div>
</div>
</div>
<h3 class="form-section"> <h3 class="form-section">
<spring:message code="action_region" /> <spring:message code="action_region" />
<small></small> <small></small>
@@ -164,6 +185,9 @@ $(function(){
</div> </div>
<!-- desc and action --> <!-- desc and action -->
<%@include file="/WEB-INF/include/form/dDosIpInfo.jsp" %> <%@include file="/WEB-INF/include/form/dDosIpInfo.jsp" %>
<br>
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>
<br>
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %> <%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
</div> </div>
<div class="form-actions"> <div class="form-actions">

View File

@@ -323,6 +323,7 @@
<th class="sort-column r.cfg_desc"><spring:message code="config_describe"/></th> <th class="sort-column r.cfg_desc"><spring:message code="config_describe"/></th>
<th class="sort-column r.action"><spring:message code="block_type"/></th> <th class="sort-column r.action"><spring:message code="block_type"/></th>
<th><spring:message code="is_audit"/></th> <th><spring:message code="is_audit"/></th>
<th><spring:message code="do_log"/></th>
<th><spring:message code="log_total"/></th> <th><spring:message code="log_total"/></th>
<th><spring:message code="whether_area_block"/></th> <th><spring:message code="whether_area_block"/></th>
@@ -375,6 +376,13 @@
<c:when test="${cfg.isAudit eq '3'}"><span indexTable="${cfg.indexTable}" data-placement="right" data-original-title="<spring:message code='letter_cancel_info'/>: " class="label le-ca-fo label-warning tooltips" data-icon="&#xe01e;"> <spring:message code="cancel_approved"/></span></c:when> <c:when test="${cfg.isAudit eq '3'}"><span indexTable="${cfg.indexTable}" data-placement="right" data-original-title="<spring:message code='letter_cancel_info'/>: " class="label le-ca-fo label-warning tooltips" data-icon="&#xe01e;"> <spring:message code="cancel_approved"/></span></c:when>
</c:choose> </c:choose>
</td> </td>
<td>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:if test="${dict.itemCode eq cfg.doLog }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</td>
<td audit="${cfg.isAudit}" functionId="${cfg.functionId}" compileId="${cfg.compileId}" action="${cfg.action}" serviceId="${cfg.serviceId}"><div class="loading-total"></div></td> <td audit="${cfg.isAudit}" functionId="${cfg.functionId}" compileId="${cfg.compileId}" action="${cfg.action}" serviceId="${cfg.serviceId}"><div class="loading-total"></div></td>
<td> <td>