From c75701a9f1f391bd60f212f85decee49d1fa73bb Mon Sep 17 00:00:00 2001 From: Daniel Dehennin Date: Tue, 23 Feb 2021 21:52:45 +0000 Subject: [PATCH] chore(rubocop): allow use of `YAML.load` for `_mapdata.rb` [skip ci] * Automated using https://github.com/myii/ssf-formula/pull/296 --- .rubocop.yml | 3 +++ test/integration/default/controls/_mapdata.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 1823d92..5f22c89 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -12,6 +12,9 @@ Metrics/BlockLength: - describe # Increase from default of `25` Max: 30 +Security/YAMLLoad: + Exclude: + - test/integration/**/_mapdata.rb # General settings across all cops in this formula AllCops: diff --git a/test/integration/default/controls/_mapdata.rb b/test/integration/default/controls/_mapdata.rb index 8490a6b..7d408e5 100644 --- a/test/integration/default/controls/_mapdata.rb +++ b/test/integration/default/controls/_mapdata.rb @@ -23,7 +23,7 @@ mapdata_file_path = "_mapdata/#{platform_finger}.yaml" # Load the mapdata from profile, into a YAML structure # https://docs.chef.io/inspec/profiles/#profile-files - mapdata_file_yaml = YAML.safe_load(inspec.profile.file(mapdata_file_path)) + mapdata_file_yaml = YAML.load(inspec.profile.file(mapdata_file_path)) # Dump the YAML back into a string for comparison mapdata_file_dump = YAML.dump(mapdata_file_yaml)