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

Adding subscription level check for diagnostic settings #322

Merged
merged 3 commits into from
Oct 8, 2020
Merged

Adding subscription level check for diagnostic settings #322

merged 3 commits into from
Oct 8, 2020

Conversation

voojoe
Copy link
Contributor

@voojoe voojoe commented Oct 7, 2020

Description

Adding in a number of new attributes for the azure_subscription resource in order to allow checks for configuration of the diagnostic settings.

Issues Resolved

#321

Check List

@voojoe voojoe requested a review from a team as a code owner October 7, 2020 14:34
@voojoe voojoe changed the title Adding subscription diagnostic settings Adding subscription level check for diagnostic settings Oct 7, 2020
return nil if diagnostic_settings.first.nil?
result = []
diagnostic_settings.each do |setting|
result += setting.properties.logs.reject(&:enabled).map(&:category)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's perhaps worthwhile to use the ruby safe navigator in each of these methods, in case there is a scenario where one of the values does not exist.

result += setting.properties&.logs&.reject(&:enabled)&.map(&:category)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @rmoles thanks for the suggestion, I've pushed that now

Copy link
Contributor

@rmoles rmoles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @voojoe

@rmoles rmoles merged commit d13f4f7 into inspec:master Oct 8, 2020
@voojoe voojoe deleted the adding_subscription_diagnostic_settings branch October 8, 2020 16:15
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 this pull request may close these issues.

3 participants