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

Add opened_only matcher for security groups. #121

Merged
merged 2 commits into from
Feb 19, 2016
Merged

Conversation

ceaess
Copy link
Contributor

@ceaess ceaess commented Feb 17, 2016

Not sure how well this fits in with the overall development plan. My company needs this for our use of awspec, and it seems silly not to contribute back to core. I'd be happy to make any changes y'all see fit, or move it into a plugin-type infrastructure if you have that. Please let me know!

This matcher allows the user to make exclusivity statements about certain rules.
Prior, a user could only make statements about the existence of opened rules for
security groups, now they can state that not only is there an opened rule but that
that is the only open rule for a given port, protocol.

The specs and stubs were reworked only to ensure testability of this new matcher without creating any new stubs. Again, happy to go in a different direction if you're up for larger scale changes to the organization of the specs/stubs.

This matcher allows the user to make exclusivity statements about certain rules.
Prior, a user could only make statements about the existence of opened rules for
security groups, now they can state that not only is there an opened rule but
that that is the _only_ open rule for a given port, protocol, cidr.
@k1LoW
Copy link
Owner

k1LoW commented Feb 18, 2016

Thank you for your contribution!

plugin-type infrastructure.

The specs and stubs were reworked only to ensure testability of this new matcher without creating any new stubs.

You are right.... It is worthy of consideration.

opened_only

Its nice idea. and I want opened_only 2 cidrs opened_only 4 cidrs like

its(:outbound) { should be_opened_only(50_000).protocol('tcp').for(%w(100.456.789.012/32 200.567.890.123/32)) }

@ceaess
Copy link
Contributor Author

ceaess commented Feb 18, 2016

@k1LoW That last commit should allow arbitrary numbers of cidrs. :)

@k1LoW
Copy link
Owner

k1LoW commented Feb 19, 2016

Great commit!!
LGTM! Thank you!!

k1LoW added a commit that referenced this pull request Feb 19, 2016
Add opened_only matcher for security groups.
@k1LoW k1LoW merged commit 63520a1 into k1LoW:master Feb 19, 2016
@k1LoW
Copy link
Owner

k1LoW commented Feb 19, 2016

Released as v0.33.0.

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

Successfully merging this pull request may close these issues.

2 participants