feat: 修改 nginx waf

This commit is contained in:
zhengkunwang223 2022-12-20 16:47:43 +08:00 committed by zhengkunwang223
parent 582bb0b4f3
commit 67aaa3b2bd
7 changed files with 31 additions and 20 deletions

View File

@ -1,4 +1,4 @@
#user nginx;
user root;
worker_processes auto;
error_log /var/log/nginx/error.log notice;

View File

@ -905,4 +905,15 @@ export default {
manualCreate: '手动创建',
acmeAccount: 'Acme 账号',
},
firewall: {
ccDeny: 'CC 防护',
ipWhiteList: 'IP 白名单',
ipBlockList: 'IP 黑名单',
fileExtBlockList: '文件扩展名黑名单',
urlWhiteList: 'URL 白名单',
urlBlockList: 'URL 黑名单',
argsCheck: 'GET 参数校验',
postCheck: 'POST 参数校验',
cookieBlockList: 'Cookie 黑名单',
},
};

View File

@ -67,7 +67,7 @@ let form = reactive({
let req = ref<Website.WafReq>({
websiteId: 0,
key: '$CCDeny',
rule: 'ccrate',
rule: 'ccRate',
});
let enableUpdate = ref<Website.WafUpdate>({
websiteId: 0,

View File

@ -1,18 +1,15 @@
<template>
<el-tabs tab-position="left" type="border-card" v-model="index">
<el-tab-pane :label="'CC 防护'" name="cc">
<el-tab-pane :label="$t('firewall.ccDeny')" name="cc">
<CCDeny :id="id" v-if="index == 'cc'"></CCDeny>
</el-tab-pane>
<el-tab-pane :label="'IP 白名单'" name="ipWhiteList">
<IpList :id="id" :rule="'ipWhitelist'" :param-key="'$ipWhiteAllow'" v-if="index == 'ipWhiteList'"></IpList>
<el-tab-pane :label="$t('firewall.ipWhiteList')" name="ipWhiteList">
<IpList :id="id" :rule="'ipWhiteList'" :param-key="'$ipWhiteAllow'" v-if="index == 'ipWhiteList'"></IpList>
</el-tab-pane>
<el-tab-pane :label="'IP 黑名单'" name="ipBlockList">
<el-tab-pane :label="$t('firewall.ipBlockList')" name="ipBlockList">
<IpList :id="id" :rule="'ipBlockList'" :param-key="'$ipBlockDeny'" v-if="index == 'ipBlockList'"></IpList>
</el-tab-pane>
<el-tab-pane :label="'文件扩展名黑名单'" name="fileExtBlockList">
<FileBlockList :id="id" v-if="index == 'fileExtBlockList'"></FileBlockList>
</el-tab-pane>
<el-tab-pane :label="'URL白名单'" name="urlWhiteList">
<el-tab-pane :label="$t('firewall.urlWhiteList')" name="urlWhiteList">
<ValueList
:id="id"
:rule="'urlWhiteList'"
@ -20,7 +17,7 @@
v-if="index == 'urlWhiteList'"
></ValueList>
</el-tab-pane>
<el-tab-pane :label="'URL黑名单'" name="urlBlockList">
<el-tab-pane :label="$t('firewall.urlBlockList')" name="urlBlockList">
<ValueList
:id="id"
:rule="'urlBlockList'"
@ -28,13 +25,7 @@
v-if="index == 'urlBlockList'"
></ValueList>
</el-tab-pane>
<el-tab-pane :label="'GET参数(args)校验'" name="args">
<ValueList :id="id" :rule="'argsCheckList'" :param-key="'$argsDeny'" v-if="index == 'args'"></ValueList>
</el-tab-pane>
<el-tab-pane :label="'POST参数校验'" name="post">
<ValueList :id="id" :rule="'postCheckList'" :param-key="'$postDeny'" v-if="index == 'post'"></ValueList>
</el-tab-pane>
<el-tab-pane :label="'Cookie黑名单'" name="cookie">
<el-tab-pane :label="$t('firewall.cookieBlockList')" name="cookie">
<ValueList
:id="id"
:rule="'cookieBlockList'"
@ -42,6 +33,15 @@
v-if="index == 'cookie'"
></ValueList>
</el-tab-pane>
<el-tab-pane :label="$t('firewall.argsCheck')" name="args">
<ValueList :id="id" :rule="'argsCheckList'" :param-key="'$argsDeny'" v-if="index == 'args'"></ValueList>
</el-tab-pane>
<el-tab-pane :label="$t('firewall.postCheck')" name="post">
<ValueList :id="id" :rule="'postCheckList'" :param-key="'$postDeny'" v-if="index == 'post'"></ValueList>
</el-tab-pane>
<el-tab-pane :label="$t('firewall.fileExtBlockList')" name="fileExtBlockList">
<FileBlockList :id="id" v-if="index == 'fileExtBlockList'"></FileBlockList>
</el-tab-pane>
</el-tabs>
</template>
<script lang="ts" setup>

View File

@ -53,7 +53,7 @@ const props = defineProps({
},
rule: {
type: String,
default: 'ipWhitelist',
default: 'ipWhiteList',
},
paramKey: {
type: String,
@ -75,7 +75,7 @@ let data = ref([]);
let req = ref<Website.WafReq>({
websiteId: 0,
key: '$ipWhiteAllow',
rule: 'ipWhitelist',
rule: 'ipWhiteList',
});
let fileUpdate = reactive({
path: '',