Skip to content

Commit

Permalink
Adding Logging Enabled Check to Azure Key Vault
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Nikles <justin.nikles@sap.com>
  • Loading branch information
jnikles1 committed Mar 11, 2022
1 parent 98d9364 commit 8e0e27b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libraries/azure_key_vault.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ def diagnostic_settings_logs
end
result
end

def has_logging_enabled?
return false if diagnostic_settings.nil? || diagnostic_settings.empty?
log = diagnostic_settings.each do |setting|
log = setting.properties&.logs&.detect { |l| l.category == 'AuditEvent' }
break log if log.present?
end
log&.enabled
end
end

# Provide the same functionality under the old resource name.
Expand Down

0 comments on commit 8e0e27b

Please sign in to comment.