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

StackNameMatchesRegexRule crashed with AttributeError #260

Closed
rubendob opened this issue Nov 25, 2023 · 2 comments · Fixed by #261
Closed

StackNameMatchesRegexRule crashed with AttributeError #260

rubendob opened this issue Nov 25, 2023 · 2 comments · Fixed by #261
Labels
bug Something isn't working

Comments

@rubendob
Copy link

rubendob commented Nov 25, 2023

Hi guys

cfripper, version 1.15.1

I was just testing the filter rule option and taking the example from the readme I'm getting an exception

# cfripper cfripper/tests/test_templates/config/security_group_firehose_ips.json --rules-filters-folder cfripper/cfripper/config/rule_configs

StackNameMatchesRegexRule crashed with AttributeError for project - None, service - None, stack - None
Traceback (most recent call last):
  File "/Users/rubenortiz/Projects/Ruben/Deploybot/venv/lib/python3.9/site-packages/cfripper/rule_processor.py", line 24, in process_cf_template
    result += rule.invoke(cfmodel, extras)
  File "/Users/rubenortiz/Projects/Ruben/Deploybot/venv/lib/python3.9/site-packages/cfripper/rules/stack_name_matches_regex.py", line 31, in invoke
    stack_name = self._config.stack_name or extras.get("stack_name", "")
AttributeError: 'NoneType' object has no attribute 'get'
Valid: False
Issues found:
	- EC2SecurityGroupMissingEgressRule: Missing egress rule in RedshiftSecurityGroup means all traffic is allowed outbound. Make this explicit if it is desired configuration

Expected behavior: Valid True

Also I think I'm missing something in the command line, how can I pass the filter I want to test to the command?

Thanks

@jsoucheiron
Copy link
Member

Oh, I'm afraid you found an issue introduced by a new rule in 1.15. We'll get it fixed soon, but until then 1.14 should do the trick, there aren't many changes.

@w0rmr1d3r
Copy link
Member

Release v1.15.2, containing the fix for this issue.

@w0rmr1d3r w0rmr1d3r added the bug Something isn't working label Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants