-
Notifications
You must be signed in to change notification settings - Fork 212
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
Exception when parsing custom resources #223
Comments
yea, transforms are giving the underlying parser some troubles. right now it expects either AWS or Custom for the type, and raises that exception otherwise. i will work on having it relax that expectation. As far as removing an individual file from parsing, you could do a find with proper exclusions and then pipe the files into cfn_nag.... if you are using cfn_nag_scan, there's likely not a great way to exclude a file.... you might be able to hack something together with a regexp pattern to --template-pattern but it's going to look ugly (er if you can even get it to work with negative lookahead?) |
@erickascic negative lookahead works. This pattern
shows only files without the word fail. Note, technically this is vulnerable to |
@jangroth Did the negative lookahead regex help you with excluding files from parsing? |
I ended up piping into cfn_nag:
|
@twellspring The regex at its own works, however in combination with cfn_nag_scan it fails if there are any non cloudformation files in the directory. Working example that parses every cfn_nag_scan --input-path . --template-pattern='^((?!fail).)*(.yaml|.json)$' |
Leaving issue open for visibility |
While we still need a major re-think on how to handle transforms, cfn-nag 0.4.52 has a fix that should at least stop the exception for this example. if not please open a new issue with a more complete piece of test data. thx! |
We are using custom resources (SAM transformation) in our CFN:
This causes cfn_nag to throw an exception:
Also, I don't seem to find a way to exclude an individual file from parsing? Would appreciate If someone could point me in the right direction.
The text was updated successfully, but these errors were encountered: