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

cannot test custom_rules #230

Closed
azam-akram opened this issue Jun 19, 2019 · 8 comments · Fixed by #231
Closed

cannot test custom_rules #230

azam-akram opened this issue Jun 19, 2019 · 8 comments · Fixed by #231
Assignees

Comments

@azam-akram
Copy link

azam-akram commented Jun 19, 2019

Hi
I am new to this, please accept my apology for stupid question.
I have defined my own custom rule and wrote some test cases (which executes fine). But when I test my custom rule with real cfn_nag like,
cfn_nag -r ./lib/customized_rules/ ./spec/test_templates/s3_bucket/my_template.json
Then I get following error
Error: file or url for option 'rule_directory' cannot be opened: Is a directory @ rb_sysopen - ./lib/customized_rules/. Try --help for help.
Any help would really be appriciated.
Thanks

@ghost
Copy link

ghost commented Jun 19, 2019

@azam-akram are you absolutely sure that ./lib/customized_rules is a directory that exists and that you have permission to? This error means it can't access the directory to scan for rules.

@azam-akram
Copy link
Author

Thanks for reply. I am sure the ./lib/customised directory exists with following permissions,
drwxr-xr-x

@jesseadams
Copy link

@azam-akram Please provide the following info:

  1. Version of cfn-nag you are running
  2. That operating system you are running cfn-nag on

I'll try to reproduce it. Thanks!

@jesseadams jesseadams self-assigned this Jun 19, 2019
@azam-akram
Copy link
Author

I am using
cfn_version 0.4.15
Windows OS
Git Bash terminal

@azam-akram
Copy link
Author

When I copy my rule into
C:\Ruby26-x64\lib\ruby\gems\2.6.0\gems\cfn-nag-0.4.15\lib\cfn-nag\custom_rules
then it works, but I want to keep my rules into a seprate directory.

@azam-akram
Copy link
Author

Should I reinstall cfn_nag (a new version consisting of your commit)?

@azam-akram
Copy link
Author

IT work now with cfn_nag version 0.4.16
Thanks for the fix

@jesseadams
Copy link

Thanks for confirming. Please open another issue if there is anything else we can help you with in the future.

@stelligent stelligent locked as resolved and limited conversation to collaborators Jun 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants