Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am trying to run an Inspec profile locally and running into the AWS resource pack deprecation error. #6951

Open
srishtirox opened this issue Jan 23, 2024 · 2 comments

Comments

@srishtirox
Copy link

inspec exec .\rdstest.rb -t aws://
[2024-01-23T06:24:29+00:00] ERROR: DEPRECATION: AWS resources in core InSpec are deprecated and have been removed in InSpec 5. They are now part of a resource pack. Please update your profiles to depend on git@github.com:inspec/inspec-aws.git . Resource 'aws_rds_instance' (used at ./rdstest.rb:4)

My Inspec profile does already depend on the inspec-aws resource pack:

name: test_aws
title: AWS InSpec Profile
maintainer: The Authors
copyright: The Authors
copyright_email: you@example.com
license: Apache-2.0
summary: An InSpec Compliance Profile For AWS
version: 0.1.0
inspec_version: '~> 5'
inputs:

  • name: aws_vpc_id
    required: false

    Below is deliberately left as a default empty string to allow the profile to run when this is not provided.

    # Please see the README for more details.
    value: ''
    description: 'Optional Custom AWS VPC Id'
    depends:
    • name: inspec-aws
      git: git@github.com:inspec/inspec-aws.git
      supports:
    • platform: aws

PS C:\Users\Administrator\test_aws\controls> inspec exec .\rdstest.rb -t aws:// --log-level=debug
[2024-01-23T06:38:49+00:00] DEBUG: Option backend_cache is enabled
[2024-01-23T06:38:49+00:00] DEBUG: Resolve .\rdstest.rb into cache C:/home/.inspec/cache
[2024-01-23T06:38:49+00:00] DEBUG: Dependency does not exist in the cache .\rdstest.rb
[2024-01-23T06:38:49+00:00] DEBUG: Starting run with targets: ["Inspec::Profile<tests from ..rdstest.rb>"]
[2024-01-23T06:38:49+00:00] DEBUG: Loading ./rdstest.rb into #Inspec::ProfileContext:0x00000278e568a000
[2024-01-23T06:38:49+00:00] ERROR: DEPRECATION: AWS resources in core InSpec are deprecated and have been removed in InSpec 5. They are now part of a resource pack. Please update your profiles to depend on git@github.com:inspec/inspec-aws.git . Resource 'aws_rds_instance' (used at ./rdstest.rb:4)

@clintoncwolfe
Copy link
Contributor

I'd make the following suggestions:

  • clear your inspec.lock . InSpec caches its dependency resolution.
  • could you post the contents of rdstest.rb ? That determines what is actually happening.

@srishtirox
Copy link
Author

srishtirox commented Jan 23, 2024

Downloaded the inspec-aws locally :

`PS C:\Users\Administrator\test_aws> ls

d---- 1/23/2024 6:23 AM controls
d---- 1/23/2024 5:51 PM inspec-aws
-a--- 1/23/2024 6:22 AM 96 inputs.yml
-a--- 1/23/2024 6:04 PM 608 inspec.yml
-a--- 1/23/2024 6:22 AM 9453 README.md`

Also updated the path in inspec.yml :

`name: test_aws
title: AWS InSpec Profile
maintainer: The Authors
copyright: The Authors
copyright_email: you@example.com
license: Apache-2.0
summary: An InSpec Compliance Profile For AWS
version: 0.1.0
inspec_version: '~> 5'
inputs:

  • name: aws_vpc_id
    required: false
    value: ''
    description: 'Optional Custom AWS VPC Id'
    depends:

    • name: inspec-aws
      path: C:\Users\Administrator\test_aws
      supports:
    • platform: aws`

    test control file :

    control 'aws-rds-01' do impact 1.0 title 'Check RDS instance existence' describe aws_rds_instance(db_instance_identifier: 'my_instance_id') do its ('db_instance_class') { should eq 'db.r6i.xlarge' } end end

Version :

PS C:\Users\Administrator\test_aws> inspec --version 5.22.36

Same error :

[2024-01-23T18:06:22+00:00] ERROR: DEPRECATION: AWS resources in core InSpec are deprecated and have been removed in InSpec 5. They are now part of a resource pack. Please update your profiles to depend on git@github.com:inspec/inspec-aws.git . Resource 'aws_rds_instance' (used at ./controls/rdstest.rb:4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants