# Running inspec aws tests through authenticated http proxy

**URL:** <https://discourse.chef.io/t/running-inspec-aws-tests-through-authenticated-http-proxy/14715>\
**Category:** Chef InSpec\
**Created:** [March 13, 2019, 3:53pm UTC](https://discourse.chef.io/t/running-inspec-aws-tests-through-authenticated-http-proxy/14715 "2019-03-13T15:53:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulforsyth](https://avatars.discourse-cdn.com/v4/letter/p/9fc348/32.png) [@paulforsyth](https://discourse.chef.io/u/paulforsyth)\
**Post date:** [March 13, 2019, 3:53pm UTC](https://discourse.chef.io/t/running-inspec-aws-tests-through-authenticated-http-proxy/14715/1 "2019-03-13T15:53:12Z")

</div>

Hi there, we're just exploring using inspec to do some testing and have hit a bit of a snag.  
Our environment is pretty well locked down so any http/s traffic needs to go via a proxy. Generally we define the HTTP\_PROXY environment variable and most tooling seems to work with this ok but inspec seems to be returning a "error!: 407 Proxy authentication required" response when performing a simple test (e.g. verify existence of s3 bucket). The credentials for the proxy are in the HTTP\_PROXY var as user:pass@proxy:port, and indeed removing that variable gives me a "failed to open TCP Connection to [s3.eu-west-1.amazonaws.com:443](http://s3.eu-west-1.amazonaws.com:443)" suggesting that there is no egress without the proxy setting.

Has anyone else used inspec with an authenticated proxy?

---

<div class="post-metadata">

**Author:** ![paulforsyth](https://avatars.discourse-cdn.com/v4/letter/p/9fc348/32.png) [@paulforsyth](https://discourse.chef.io/u/paulforsyth)\
**Post date:** [March 14, 2019, 10:48am UTC](https://discourse.chef.io/t/running-inspec-aws-tests-through-authenticated-http-proxy/14715/2 "2019-03-14T10:48:14Z")

</div>

So the problem appears to be with the aws-sdk for ruby, seemingly it somehow strips the credentials out of the environment variable which causes the 407 response from the proxy.

A the moment it seems we can get round this by including the code

`Aws.config[:http_proxy] = ENV['http_proxy']`

in each test file.

Is there a way that I can only specify this once for a test of tests e.g. fixture\_setup style?
