mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-07-05 11:06:34 +00:00
Merge pull request #14996 from jumpserver/pr@dev@fix_long_time_no_login_risk
fix: long_time_no_login account, not listed as risk account
This commit is contained in:
commit
60eaec68c6
@ -10,7 +10,7 @@
|
|||||||
- name: Gather posix account last login
|
- name: Gather posix account last login
|
||||||
ansible.builtin.shell: |
|
ansible.builtin.shell: |
|
||||||
for user in {{ users.stdout_lines | join(" ") }}; do
|
for user in {{ users.stdout_lines | join(" ") }}; do
|
||||||
last -i --time-format iso -n 1 ${user} | awk '{ print $1,$3,$4, $NF }' | head -1 | grep -v ^$
|
last -i --time-format iso -n 1 ${user} | awk '{ print $1,$3,$4, $NF }' | head -1 | awk 'NF'
|
||||||
done
|
done
|
||||||
register: last_login
|
register: last_login
|
||||||
|
|
||||||
|
@ -116,9 +116,10 @@ class AnalyseAccountRisk:
|
|||||||
if not date:
|
if not date:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
pre_date = ori_account and getattr(ori_account, field)
|
# 服务器收集的时间和数据库时间一致,不进行比较,无法检测风险 不太对,先注释
|
||||||
if pre_date == date:
|
# pre_date = ori_account and getattr(ori_account, field)
|
||||||
continue
|
# if pre_date == date:
|
||||||
|
# continue
|
||||||
|
|
||||||
if date and date < timezone.now() - delta:
|
if date and date < timezone.now() - delta:
|
||||||
risks.append(
|
risks.append(
|
||||||
|
Loading…
Reference in New Issue
Block a user