train
train copied to clipboard
Azure Government Endpoints are not working
Description
Error during execution is 'The subscription '12345678-1234-1234-1234-123456789012' could not be found.
Train and Platform Version
os RHEL7.5 inspec 2.2.20 ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
Replication Case
execute test
inspec exec ./test/integration/default -t azure:// -l=debug --diagnose
inspec profile check
tag "Default Value": "Generic Resource Test at Azure Gov \n\n\n"
describe azure_generic_resource(group_name: ENV.fetch('AZURE_RG'), name: 'vm') do
its('location') { should eq 'usgovvirginia' }
end
Possible Solutions
according to tcpdump, inspec performs lookups for azure instead of azuregov, verified ip addresses to which connection is made is the same address provided by dns resolution, assumption is made inspec is connecting to azure endpoints instead of azuregov
Stacktrace
https://gist.github.com/yarick/983adc75570948cd30cc4d40c028ee57
inspec exec ./test/integration/default -t azure:// -l=debug --diagnose InSpec version: 2.2.20 Train version: 1.4.15 Command line configuration: {"target"=>"azure://", "log_level"=>"debug", "diagnose"=>true} JSON configuration file: {} Merged configuration: {"reporter"=>{"cli"=>{"stdout"=>true}}, "show_progress"=>false, "color"=>true, "create_lockfile"=>true, "backend_cache"=>true, "type"=>:exec, "target"=>"azure://", "log_level"=>"debug", "diagnose"=>true}
[2018-06-26T11:18:33-04:00] DEBUG: Option backend_cache is enabled
[2018-06-26T11:18:33-04:00] DEBUG: Resolve ./test/integration/default into cache /root/.inspec/cache
[2018-06-26T11:18:33-04:00] DEBUG: Dependency does not exist in the cache ./test/integration/default
[2018-06-26T11:18:33-04:00] DEBUG: Starting run with targets: ["Inspec::Profile
Profile: AZURE Inspec Demo based on CIS_Microsoft_Azure_Foundations_Benchmark (azure-inspec-demo) Version: 0.2 Target: azure://12345678-1234-1234-1234-123456789012
× M-2.12: 2.12 Ensure that 'JIT Network Access' is set to 'On' (Scored) (2 failed) × azure_generic_resource The subscription '12345678-1234-1234-1234-123456789012' could not be found. × azure_resource_group The subscription '12345678-1234-1234-1234-123456789012' could not be found.
Profile Summary: 0 successful controls, 1 control failure, 0 controls skipped Test Summary: 0 successful, 2 failures, 0 skipped
Hi ... I have a patch available which works for AzureGermanCloud, which suffers from the same "problem" as the US-Government Cloud. Would there stlll be interest to have that integrated?
yes, I think we should paramartize this and if possible enable it to look at the region you are using and default to that and then have a fail through to have it statically set to perhaps at the far end.
so it would go in my mind:
- user ENV_VAR
- Azure setting file
- find by 'region' matrix
- static fall through