Automatic safety reporting
Core service implementation
- Due to the instability of the security reporting server, the reporting service is automatically triggered by springboot scheduled tasks at 8, 9, 10, 11,
8,9,10,11,12,13
o'clock every day. - After the report is successful, the flag will be stored in redis to mark that it has been reported today. When the reporting service is triggered again, it will check whether the field exists. If it exists,
continue
. The flag field will be automatically cleared at 3 o'clock every day. - Since the
ttoken
field is embedded in the html page, extract ttoken
through regular expressions - Request the past submitted data form, filter the data of the past third day and fill in the request parameter form of the current security report
- During the execution of
reportService
reporting service, for users who fail to log in to the security reporting system, the system will automatically delete their accounts and prompt them to update the information via email. - The background has the logic to intercept existing users, but for users who register for the first time, repeated submission requests are sent. In order to prevent the insertion of duplicate fields,
Redis缓存锁
is used to mark the cache when the first request is made to register the service, and the cache is released after the service is terminated. - Front-end responsive layout
- Passwords are stored using AES symmetric encryption. Why not use asymmetric or irreversible encryption? Asymmetric encryption is really unnecessary in this scenario, the password and private key are leaked together; irreversible encryption is just as its name suggests, the password is used for request rather than for verification
Deployment Notes
- The security reporting server restricts access to IP addresses, and requests from outside the province cannot access the security reporting platform.
- Since there are not many vendors that provide cloud computing services in Central China (only Baidu Cloud provides Wuhan among the major manufacturers), the current idea is to build a microserver in the school, connect it to the school network, and then perform intranet penetration to connect the intranet equipment to The port is mapped to the port of the public network server, accesses the public network server, and forwards the request.
rear end
technology stack | illustrate |
---|
SpringBoot | Container + MVC framework |
MyBatis-Plus | ORM framework |
Hutool | Tools |
Redis | Cache database |
Druid | Database connection pool |
log4j2 | Log collection tool |
Maven | Project build tools |
Docker | Server-side deployment tools |
Ngnix | reverse proxy server |
front end
technology stack | illustrate |
---|
Vue2 | JavaScript framework |
ElementUI | UI component library |
Axios | promise network request library |