inspec-aws icon indicating copy to clipboard operation
inspec-aws copied to clipboard

Feature request: AWS Api Gateway support

Open safv12 opened this issue 7 years ago • 5 comments

🎛 Description

🙋 feature request

Hi every one, any plans for support AWS Api gateway in resources? Regards!

safv12 avatar May 25 '18 15:05 safv12

We're always interested in finding out what people would like to see next. Can you give us some idea as to what sort of tests you'd like to do? If you could write a few examples of controls you'd like to be able to write, that would be perfect.

clintoncwolfe avatar May 29 '18 17:05 clintoncwolfe

I'm very new using inspec. I hope this examples helps to this feature request.

# Test API Gateway settings
describe aws_api_gateway('my_api_gateway_name') do
    it { should_exist }  # The api gateway should exist
    its('resources') { should include('resource1', 'resource2') } # Should contains this two resources
    its('stages') { should include('dev', 'prod') } # Should contains this two stages
    its('api_key_source') { should be 'HEADER' } # Validate the API key source
    its('content_encoding') { should be_active } # content encoding is active
end

The API Gateway contains resources and the resources has methods, I'm not sure how we can test the configuration for each resource's method. For example

  • Method Request configuration
  • Integration request configuration
  • Integration response
  • Method response

safv12 avatar May 30 '18 14:05 safv12

It's very helpful, thanks!

We might break things apart into multiple InSpec resources - have a aws_api_gateway_resource InSpec resource, for example.

clintoncwolfe avatar May 30 '18 16:05 clintoncwolfe

That sounds great! Thanks @clintoncwolfe.

safv12 avatar May 30 '18 17:05 safv12

It is part of the feature roadmap.

soumyo13 avatar Sep 13 '21 08:09 soumyo13