MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / needs_security_audit

Function needs_security_audit

keepercommander/security_audit.py:111–128  ·  view source on GitHub ↗
(params, record)

Source from the content-addressed store, hash-verified

109 return ssd
110
111def needs_security_audit(params, record): # type: (KeeperParams, KeeperRecord) -> bool
112 if not params.enterprise_ec_key or not record:
113 return False
114
115 saved_score_data = params.security_score_data.get(record.record_uid, {})
116 saved_sec_data = params.breach_watch_security_data.get(record.record_uid, {})
117 score_data = saved_score_data.get('data', {})
118 score_revision = saved_score_data.get('revision')
119 sec_revision = saved_sec_data.get('revision')
120 current_password = _get_pass(record)
121 if current_password != score_data.get('password'):
122 return True
123
124 scores = dict(new=get_security_score(record) or 0, old=score_data.get('score', 0))
125 score_changed_on_passkey = any(x >= 100 for x in scores.values()) and any(x < 100 for x in scores.values())
126 creds_removed = bool(scores.get('old') and not scores.get('new'))
127 needs_alignment = current_password is not None and score_revision != sec_revision
128 return score_changed_on_passkey or creds_removed or needs_alignment
129
130def update_security_audit_data(params, records): # type: (KeeperParams, List[KeeperRecord]) -> int
131 if not params.enterprise_ec_key:

Callers 3

update_security_dataMethod · 0.85
attach_security_dataFunction · 0.85
executeMethod · 0.85

Calls 3

_get_passFunction · 0.85
get_security_scoreFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected