0

I am trying to write a control that should check a list containing IPs and the config value that I am pulling from should be_in the list. I have no idea where to create this list that the control should reference.

control "Approved Management IPs" do
  impact 1.0
  title "Telnet Disabled"
  desc "Config should have one of the following IPs on the management plane."

  options = {
    assignment_regex: /^\s*(<permitted-ips>)(\w+)<\/permitted-ips>/,
    multiple_values: true
    }

  describe parse_config_file('pandevice_vm_config.txt', options) do
   its('<permitted-ips>') { should be_in LIST }
  end
end
Mr.
  • 9,429
  • 13
  • 58
  • 82
Nick
  • 11
  • 2

1 Answers1

0

you can use this syntax :

  describe parse_config_file('pandevice_vm_config.txt', options) do
   its('<permitted-ips>') { should be_in ['localhost', '192.168.0.1'] }
  end
xanhacks
  • 122
  • 2
  • 5