-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
审计功能增强 #1342
审计功能增强 #1342
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1342 +/- ##
==========================================
- Coverage 75.54% 75.40% -0.14%
==========================================
Files 81 81
Lines 12548 12624 +76
==========================================
+ Hits 9479 9519 +40
- Misses 3069 3105 +36
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看是否需要在extra中记录设备等信息,同时关于不存在的账号登录操作是否也有必要记录到数据库中,这块因为无法锁定可能存在风险 |
不存在的账号登录操作不记录会导致个信息缺失。是否是因为DDOS的考虑呢?限制登录接口的访问频率似乎更好 |
考虑应该都是内网环境使用,加入地理信息没有太多用 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
记录和agent应该差不多了
sql/audit_log.py
Outdated
@@ -2,6 +2,8 @@ | |||
import logging | |||
import datetime | |||
import simplejson as json | |||
import geolite2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这两个包应该没用到
sql/audit_log.py
Outdated
now = timezone.now() | ||
AuditEntry.objects.create(action=u'登入', extra_info=ip, user_id=user.id, user_name=user.username, user_display=user.display, action_time=now) | ||
AuditEntry.objects.create(action=u'登入', extra_info='|'.join([ip,ua]), user_id=user.id, user_name=user.username, user_display=user.display, action_time=now) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加入ua应该要扩充长度了,要不还是恢复前面的记录ip吧😂,我考虑过多了
} | ||
|
||
// 通过前端元素查看确定要绑定事件的对象,有其他更好的实现方式? | ||
function downloadAppendOpt(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
发现查询没有记录查询的语句,可以参考这个issue处理下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,我研究研究。
将审计功能全部抽到一个菜单栏
关联之前的 pr #1251