# 1. 关闭 Swagger
URL: /%E6%96%87%E6%A1%A3/04.%E5%BC%80%E5%8F%91%E6%96%87%E6%A1%A3/02.%20%E5%90%8E%E7%AB%AF%E5%BC%80%E5%8F%91/01.%20%E5%90%8E%E7%AB%AF%E8%A7%84%E8%8C%83/01.%20%E5%90%8E%E7%AB%AF%E6%BC%8F%E6%B4%9E%E6%95%B4%E7%90%86


# 1. 关闭 Swagger

```text
    1.注释：MySwaggerResourceProvider
	2.删除gatewaypom 
	<artifactId>knife4j-spring-boot-starter</artifactId>
	 <artifactId>knife4j-spring-ui</artifactId>
	3.删除注解@EnableKnife4j
	4.注释SwaggerResourceController/MySwaggerResourceProvider

```

# 2. 针对/sys/ng-alain/getDictItemsByTableSQL 注入

```java
@Override  
public List<Map<String, String>> getDictByTable(String table, String key, String value) { 
	//增加SqlInjectionUtil检查
    SqlInjectionUtil.specialFilterContentForDictSql(table);  
    SqlInjectionUtil.specialFilterContentForDictSql(key);  
    SqlInjectionUtil.specialFilterContentForDictSql(value);  
    return this.mapper.getDictByTableNgAlain(table,key,value);  
}

```

# 3. 针对 actuator 漏洞

删除以下 POM

```xml
<dependency>  
    <groupId>org.springframework.boot</groupId>  
    <artifactId>spring-boot-starter-actuator</artifactId>  
</dependency>
```

# 4. swagger 关闭页面访问

```YAML
	server:
	  error:
	    include-exception: true
	    include-stacktrace: ALWAYS
	    include-message: ALWAYS
	    ### 是否启用默认的错误页面，默认为true 需要重启网关
	    whitelabel:
	      enabled: false
```

## 5. 针对积木报表漏洞

~~~ text
积木报表在2.0和3.6.0之前存在安全漏洞需要将涉及到的jmreport剔除
~~~
