Giter Club home page Giter Club logo

audit-spring-cloud-starter's Introduction

Audit-Spring-Cloud-Start

1.日志审计组件

a. 已实现功能

1. 记录所有的Controller下的WebApi操作信息,包含字段如下:
   a. uuid 审计日志的uuid
   b. actor 执行操作的用户,默认为anonymous,若集成到带有Spring Security模块的子系统中则会变成当前已登录的用户
   c. serverIp 服务端Ip
   d. clientIp 客户端请求Ip
   e. url 请求的url,以[GET],[POST]为前缀
   f. action 码猿指定某个web api执行的操作名称信息
   g. startTime 请求开始时间
   h. endTime 请求的结束时间
   i. status web api请求返回的状态码
   j. clazz 执行操作所在的类
   k. method 执行操作所在的方法
   l. args 执行操作方法的参数列表
   m. result 执行操作返回的结果
2. 自定义审计日志的模板
   在resources文件夹中新建audit.hbs文件,在其中书写审计日志的模板,模板语法兼容mustache语法,若无audit.hbs文件,则使用默认模板
   默认模板如下
   =========================={{ startTime }} Start ===================================
   Uuid: {{ uuid }}
   Actor: {{ actor }}
   ServerIp: {{ serverIp }}
   ClientIp: {{ clientIp }}
   Url: {{ url }}
   Action: {{ action }}
   Class: {{ clazz }}
   Method: {{ method }}
   Args: {{#each args }} {{ this }} {{/each}}
   Result: {{ result }}
   Status: {{ status }}
   =========================={{ endTime }} End =====================================
3. 支持注解的方式
   目前默认所有的Controller方法都执行审计操作
   以有注解:
   a. DeIdentify: 隐藏敏感字段的部分内容
      1) left:int 隐藏左边若干字符
      2) right:int 隐藏右边若干字符
      3) fromLeft:int 从左边若干字符起隐藏所有字符
      4) fromRight:int 从右边若干字符起隐藏所有字符
   b. IgnoreAudit: 将停止对该函数,该字段的审计功能
   c. Audit: 对类,函数,参数进行审计(未完成)
   注: 这些注解可以搭配使用
4. 搭配审计开关
   在application.properties中输入audit.enabled=true,审计功能才会开启,审计功能默认是关闭的

b.待实现功能

1. 将Audit注解对类生效
2. 剥离Spring Boot框架
3....

audit-spring-cloud-starter's People

Contributors

dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

audit-spring-cloud-starter's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.