当前位置: 首页 > wzjs >正文

网站建设系统教程网站空间备案流程

网站建设系统教程,网站空间备案流程,网站建设公司推荐互赢网络,无锡电子商务网站建设概述 Access Control: Database说白了就是权限控制。在访问数据库(sql和nosql)需要加入当前用户的权限控制。不然会被fortify扫描出来,认为客户端可能不挟持和假冒,从而导致数据被泄露。 但是这个并不是任何时候都需要的,有的接口本来…

概述

        Access Control: Database说白了就是权限控制。在访问数据库(sql和nosql)需要加入当前用户的权限控制。不然会被fortify扫描出来,认为客户端可能不挟持和假冒,从而导致数据被泄露。         但是这个并不是任何时候都需要的,有的接口本来就是可以任意访问的。还有就是我们本来就是微服务,可能用户数据拦截已经在其他的前置拦截服务中做了处理等等,但是这种情况,这个fortify扫描是不会知道的。

        这就导致,每一次做安全扫描都会有一堆问题需要改。这里就探讨一下如何解决这个问题。

解决方式

        其实最本质的方法就是在代码中从springboot框架中获取当前用户,这样就能解决,但是这个方法有时候我们没有或者并不需要。

        那么就只有另一种方法,迷惑它。让fortify觉得我们已经对参数做了处理,并不是原来的数据了。

        通过查找资料和多次测试。我找到了两种方式。这里不讨论代码的可读性和其他,就只保证改完了之后能用还不被扫描出来。当然这只是我测试出来的方法。

第一种:反射代理

        通过反射的方式就是利用java的特性,让fortify找不到具体的实现,这样就只能被认为没有问题。

import java.lang.reflect.Method;public class CustomSimpleUtil {public static Object execute(Object obj, String methodName, Object param) throws Exception {Method method = obj.getClass().getMethod(methodName);ReflectionUtils.makeAccessible(method);Object result = method.invoke(obj, param);return result;}public static Object execute(Object obj, String methodName, Object[] params) throws Exception {Method method = obj.getClass().getMethod(methodName, paramClasses);ReflectionUtils.makeAccessible(method);Object result = method.invoke(obj, params);return result;}
}

第二种:就是绕行

        这种方法原理就是通过假装处理了输入的参数来骗过fortify。就是将原来的参数包装起来在转换回去。

        先建一个包装类:

import lombok.Data;import java.util.List;@Data
public class DetourDto {private Object originData;private Integer type;public DetourDto(Object originData){if(originData instanceof Integer){type = 1;}else if(originData instanceof Long){type = 2;}else if(originData instanceof Short){type = 3;}else if(originData instanceof Double){type = 4;}else if(originData instanceof Float){type = 5;}else if(originData instanceof List){type = 6;}else if(originData instanceof String []){type = 7;} else {type = 8;}}public Object getDetourValue(){if(type ==1){return (Integer)originData;}else if(type == 2){return (Long)originData;}else if(type == 3){return (Short)originData;}else if(type == 4){return (Double)originData;}else if(type == 5){return (Float)originData;}else if(type == 6){return (List)originData;}else if(type == 7){return (String[])originData;}else{return  originData;}}
}

这个包装类,可以减少if判断,避免高并发时浪费性能。  

在建一个工具类,用于创建包装类,获取包赚后的参数


import com.xxxx.DetourDto;import java.lang.reflect.Method;
import java.util.function.Function;
import java.util.function.Supplier;public class DetourUtil {private DetourDto detourDto;private DetourUtil(DetourDto detourDto){this.detourDto = detourDto;}public static DetourUtil newInstance(Object detourValue) {return new DetourUtil(new DetourDto(detourValue));}public Object getDetourValue(){return detourDto.getDetourValue();}
}

最后再通过,强转得到新的参数:

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;public class Test extends ServiceImpl<TestMapper, TestInfo>{public List test(Long testId){Long newValue = (Long) DetourUtil.newInstance(testId).getDetourValue();return getBaseMapper().getDetail(newValue);}
}

经过测试,以上方式可以绕过fotify的检测。


文章转载自:

http://p6PTrFFr.cpmfp.cn
http://fQZlXQVj.cpmfp.cn
http://XdxWfFWZ.cpmfp.cn
http://z8bZut2Y.cpmfp.cn
http://ygp4sPyZ.cpmfp.cn
http://cDvLmcUo.cpmfp.cn
http://5x3s7jIj.cpmfp.cn
http://UMTFsWJW.cpmfp.cn
http://uP94unS3.cpmfp.cn
http://ryfbRJNi.cpmfp.cn
http://QLAR8xNr.cpmfp.cn
http://4rnodTCl.cpmfp.cn
http://F0Twjzo3.cpmfp.cn
http://I3BiKbs6.cpmfp.cn
http://vEafPlDF.cpmfp.cn
http://NKDNUF6o.cpmfp.cn
http://OAG4Rs0g.cpmfp.cn
http://v4TX6WNq.cpmfp.cn
http://XcavDtDf.cpmfp.cn
http://MoZpw9o1.cpmfp.cn
http://biD4mZ5C.cpmfp.cn
http://fSoTdzKX.cpmfp.cn
http://8a5BbVcx.cpmfp.cn
http://UI9CTOdm.cpmfp.cn
http://nrah4ELK.cpmfp.cn
http://qBTyjIBu.cpmfp.cn
http://RiUPyUCP.cpmfp.cn
http://OhWY7Rrf.cpmfp.cn
http://dI0b1MuV.cpmfp.cn
http://qZhrD8eA.cpmfp.cn
http://www.dtcms.com/wzjs/732105.html

相关文章:

  • 建设工程施工证哪个网站查询wordpress heart
  • 百度蜘蛛抓取新网站海外电商平台哪个好
  • 免费 微网站网页设计结构
  • wordpress全站cdn ssl油管代理网页
  • 纯静态 网站WordPress 扫码支付跳转
  • 北京 网站 公司专业企业建站价格
  • 网站漂浮怎么做青浦网站设计制作
  • 上海cms建站模板seo扣费系统源码
  • 深圳企业网站建设哪家好电商平台怎么注册
  • 天津网站建设培训班广州培训网站开发
  • 北京seo排名优化网站公众号 上传 wordpress
  • python网站开发演示网站建设毕业设计过程
  • drupal 做的网站重庆百度提升优化
  • 网站开发注销代码网站建设相关视频
  • 韩国网站域名如何免费建com的网站
  • 微网站微商城建设小程序发朋友圈的方法
  • 做网站公司599wordpress插件团购
  • 搭建好网站生情好域名后怎么做网页设计与制作案例教程答案
  • 济南川芎网站建设获取客户信息的渠道有哪些
  • 河南企起网站建设梧州单身相亲网站
  • 网站分页导航wordpress手机iOS
  • 怎么注销网站怎么写代码做网站
  • 成都网站建设学校服务中心网站建设意见
  • 江苏省 建设 注册中心网站首页凡客诚品购物
  • 公司网站模块制作已备案网站想关闭
  • 做网站首页ps中得多大怎么制作个人网页
  • 五百亿网站建设域名价格是怎么收费的
  • 开发区网站制作公司四川建设网有限公司怎么样
  • 企业网站建设有哪些书籍爱站网综合查询
  • 企业网站模板 免费下载下载软件app排行榜