Skip to content

Commit

Permalink
Adjust input name and values for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
DMedina6 committed Jan 14, 2025
1 parent 42f94ea commit b8c925b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions controls/SV-230484.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

# Get inputs
authoritative_timeservers = input('authoritative_timeservers')
authoritative_timeservers_exact = input('authoritative_timeservers_exact')
match_all_authoritative_timeservers_enabled = input('match_all_authoritative_timeservers_enabled')

# Get the system server values
# Converts to array if only one value present
Expand Down Expand Up @@ -104,16 +104,16 @@
# Check for valid maxpoll value <17
describe 'chrony.conf' do
# authoritative_timeservers_exact specifies whether to verify all inputted timeservers or just one
if authoritative_timeservers_exact
if match_all_authoritative_timeservers_enabled
it 'should include all specified valid timeservers' do
expect(authoritative_timeservers.all? { |input|
server_values.include?(input) && max_poll_values[server_values.index(input)] < 17
server_values.include?(input) && max_poll_values[server_values.index(input)] <= 16
}).to be true
end
else
it 'should include at least one valid timeserver' do
expect(authoritative_timeservers.any? { |input|
server_values.include?(input) && max_poll_values[server_values.index(input)] < 17
server_values.include?(input) && max_poll_values[server_values.index(input)] <= 16
}).to be true
end
end
Expand Down
2 changes: 1 addition & 1 deletion inspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ inputs:
value: ["0.us.pool.ntp.mil"]

# SV-230484
- name: authoritative_timeservers_exact
- name: match_all_authoritative_timeservers_enabled
description: Specify that all timeservers in authoritative_timeservers must be present and valid
type: Boolean
value: false
Expand Down

0 comments on commit b8c925b

Please sign in to comment.