vmware / dod-compliance-and-automation

Security hardening content for VMware solutions to US Department of Defense standards
Other
153 stars 61 forks source link

[vSphere][8.0][VCSA-80-000290] undefined method `push' for "Administrator":String #262

Closed pstearns closed 1 month ago

pstearns commented 1 month ago

Describe the bug

Push is undefined

  bashShellAdminUsers = input('bashShellAdminUsers')
  # Get appliance management user and add to list of authorized users. Unique to each vCenter.
  applmgmtuser = powercli_command('Get-SsoGroup -Domain vsphere.local -Name applmgmtSvcUsers | Get-SsoPersonUser | Select-Object -ExpandProperty Name').stdout.strip
  bashShellAdminUsers.push(applmgmtuser)

Reproduction steps

Running the VCSA-80-000290 control results in:

Profile:   VMware vSphere 8.0 vCenter STIG (VMware vSphere 8.0 vCenter STIG)
Version:   2.0.1
Target:    vmware://administrator@vsphere.local@server
Target ID: 701bbd03-8c59-5742-ac23-de0a2f938199

  ×  VCSA-80-000290: The vCenter Server must limit membership to the "SystemConfiguration.BashShellAdministrators" Single Sign-On (SSO) group.
     ×  Control Source Code Error /opt/stigtools/vsphere8/dod-compliance-and-automation-master/vsphere/8.0/v2r1-stig/vsphere/inspec/vmware-vsphere-8.0-stig-baseline/vcenter/controls/VCSA-80-000290.rb:1
     undefined method `push' for "Administrator":String

Profile Summary: 0 successful controls, 1 control failure, 0 controls skipped
Test Summary: 0 successful, 1 failure, 0 skipped

Expected behavior

The unique appliance management user gets added to the bashShellAdminUsers array using push.

Additional context

No response

pstearns commented 1 month ago

Closing issue as issue on my end. Rereading message I found that I was passing the bashShellAdminUsers array as a string.