mirror of
https://github.com/inspec/inspec
synced 2024-11-23 21:23:29 +00:00
add cache credentials/meta_info to windows user resource
This commit is contained in:
parent
0272b1e7ff
commit
9d7f9e6f39
1 changed files with 25 additions and 0 deletions
|
@ -573,6 +573,31 @@ module Inspec::Resources
|
|||
res[0] unless res.empty?
|
||||
end
|
||||
|
||||
def meta_info(username)
|
||||
res = identity(username)
|
||||
return if res.nil?
|
||||
{
|
||||
home: res[:home],
|
||||
shell: res[:shell],
|
||||
domain: res[:domain],
|
||||
userflags: res[:userflags],
|
||||
}
|
||||
end
|
||||
|
||||
def credentials(username)
|
||||
res = identity(username)
|
||||
return if res.nil?
|
||||
{
|
||||
mindays: res[:mindays],
|
||||
maxdays: res[:maxdays],
|
||||
warndays: res[:warndays],
|
||||
badpasswordattempts: res[:badpasswordattempts],
|
||||
maxbadpasswords: res[:maxbadpasswords],
|
||||
minpasswordlength: res[:minpasswordlength],
|
||||
passwordage: res[:passwordage],
|
||||
}
|
||||
end
|
||||
|
||||
def list_users
|
||||
collect_user_details.map { |user| user[:username] }
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue