Skip to content
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

Fixes needed for control V-73259 #9

Closed
rx294 opened this issue Oct 15, 2019 · 1 comment · Fixed by #5
Closed

Fixes needed for control V-73259 #9

rx294 opened this issue Oct 15, 2019 · 1 comment · Fixed by #5
Assignees

Comments

@rx294
Copy link
Collaborator

rx294 commented Oct 15, 2019

  • Current code wrongly assumes that control is NA for non Domain Controllers, however check text specifies it applicable to both

  • Current code relies on parsing based on character positions which can be very brittle.

Please below powershell code that can return data in a JSON format which can be tested in describe blocks

for Domain Controllers:

json(command: " Search-ADAccount -AccountInactive -UsersOnly -TimeSpan 35.00:00:00 | ConvertTo-Json").params

For memeber servers:

user_query = <<-FOO
$users = @() 
  ([ADSI]('WinNT://{0}' -f $env:COMPUTERNAME)).Children | Where {
  $_.SchemaClassName -eq 'user' } | ForEach {
   $user = ([ADSI]$_.Path)
   $lastLogin = $user.Properties.LastLogin.Value


   $enabled = ($user.Properties.UserFlags.Value -band 0x2) -ne 0x2
   if ($lastLogin -eq $null) {
   $lastLogin = 'Never'
   }
   else {
   $today = Get-Date
   $diff = New-TimeSpan -Start "$lastLogin" -End $today
   $lastLogin = $diff.Days
   }

  $users += (@{ user = $user.Name.Value; lastLogin = $lastLogin; enabled = $enabled})
  }

$users | ConvertTo-Json
FOO

json(command: user_query).params
@rx294 rx294 changed the title Fixes need for control V-73259 Fixes needed for control V-73259 Oct 16, 2019
kkola added a commit that referenced this issue Oct 18, 2019
@kkola
Copy link
Collaborator

kkola commented Oct 18, 2019

8b5935d fixes this issue

aaronlippold added a commit that referenced this issue Feb 10, 2020
* first simple pass for the profile

* update 73615 to use Windows 2016 PS commands

* change attributes to inputs

* move attributes to inside the control code

* updates related to legal notice text and caption

* update 73221 to correct domain roles and AD check

* update 73259 to check for DC role

* update 73261 to account for DC role

* update 73387 with inputs for MaxConnIdleTime

* update LegalNoticeCaption input for 73649

* update 73607 check for DoD interoperabilty certs

* update 78127 language

* control updates to 73785 and 73803

* update 73783

* update 73775 to NOT a domain controller check

* check for AD only system in 73771

* check for 73775 for AD only flag

* read AD only flag for 73775

* check for AD in 73759

* update 73749 to use 'be_in'

* update 73733 to use 'be_in'

* update 73731 to use 'be_in'

* minor edits to 73379

* check for SMBv1 in 78123 and 78125

* add check for no accounts or groups to 73783

* Update Review.md

* Update Review.md

* Update Review.md

* address incorrect if statement issue #6

* fix incorrect NIST tag issue #7

* fix temporary account check. issue #8

* fixes issue #9

* Update Review.md

* Update Review.md

* Update Review.md

* fix for issue #11

* Update Review.md

* fix issue #12

* fix issue #13

* fix issue #13

* fix issue #17

* fix issue #18

* fix for issue #19

* fix issue #16: NIST tag duplication (#20)

* v-73607: minor edit; v-73223: account all systems

* update V-73231

* update V-73247

* update V-73391

* minor edit to v-73391

* update V-73391 to be more readable

* update V-73249

* update v-73249 and v-73251

* update V-73249 and V-73251

* remove commented lines from V-73251

* update V-73253

* remove comments

* update V-73255

* remove comments

* update V-73369

* update V-73381

* update V-73375

* fixes issue #22

* update V-73255 for readability

* control fixes so inspec v4.18 can run execute (#21)

* control fixes so inspec v4.18 can run execute

* update inspec.yml

* fixes for issue #14

* fixes for issue #15

* fix for issue #14

Co-authored-by: Rony Xavier <rx294@nyu.edu>
Co-authored-by: Aaron Lippold <lippold@gmail.com>
aaronlippold added a commit that referenced this issue Feb 10, 2020
* first simple pass for the profile

* update 73615 to use Windows 2016 PS commands

* change attributes to inputs

* move attributes to inside the control code

* updates related to legal notice text and caption

* update 73221 to correct domain roles and AD check

* update 73259 to check for DC role

* update 73261 to account for DC role

* update 73387 with inputs for MaxConnIdleTime

* update LegalNoticeCaption input for 73649

* update 73607 check for DoD interoperabilty certs

* update 78127 language

* control updates to 73785 and 73803

* update 73783

* update 73775 to NOT a domain controller check

* check for AD only system in 73771

* check for 73775 for AD only flag

* read AD only flag for 73775

* check for AD in 73759

* update 73749 to use 'be_in'

* update 73733 to use 'be_in'

* update 73731 to use 'be_in'

* minor edits to 73379

* check for SMBv1 in 78123 and 78125

* add check for no accounts or groups to 73783

* Update Review.md

* Update Review.md

* Update Review.md

* address incorrect if statement issue #6

* fix incorrect NIST tag issue #7

* fix temporary account check. issue #8

* fixes issue #9

* Update Review.md

* Update Review.md

* Update Review.md

* fix for issue #11

* Update Review.md

* fix issue #12

* fix issue #13

* fix issue #13

* fix issue #17

* fix issue #18

* fix for issue #19

* fix issue #16: NIST tag duplication (#20)

* v-73607: minor edit; v-73223: account all systems

* update V-73231

* update V-73247

* update V-73391

* minor edit to v-73391

* update V-73391 to be more readable

* update V-73249

* update v-73249 and v-73251

* update V-73249 and V-73251

* remove commented lines from V-73251

* update V-73253

* remove comments

* update V-73255

* remove comments

* update V-73369

* update V-73381

* update V-73375

* fixes issue #22

* update V-73255 for readability

* control fixes so inspec v4.18 can run execute (#21)

* control fixes so inspec v4.18 can run execute

* update inspec.yml

* fixes for issue #14

* fixes for issue #15

* fix for issue #14

* update check, fix tags to use new  desc format (#23)

Co-authored-by: Krishna Kola <kkola@digitalinfuzion.com>
Co-authored-by: Rony Xavier <rx294@nyu.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants