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

Fix a number of issues in AWS network ACLs #1843

Merged
merged 7 commits into from
May 7, 2015

Conversation

ctiwald
Copy link
Contributor

@ctiwald ctiwald commented May 7, 2015

Turns out network ACLs weren't working quite right. They had four distinct hashing problems all of which were masked by #1808.

Not anymore. This PR should fix all of them. I recommend reviewing it by commit, rather than by the total file changed diff, as they're logically separated.

ctiwald added 7 commits May 6, 2015 23:03
resourceAwsNetworkAclRead swallowed these errors resulting in rules
that never properly updated. Implement an entry-to-maplist function
that'll allow us to write something that Set knows how to read.
AWS includes default rules with all network ACL resources which cannot
be modified by the user. Don't attempt to store them locally or change
them remotely if they are already stored -- it'll consistently result
in hashing problems.
…1 protocol

AWS doesn't store ports for -1 protocol rules, thus the read from the
API will always come up with a different hash. Force the user to make a
deliberate port choice when enabling -1 protocol rules. All from_port
and to_port's on these rules must be 0.
AWS will accept any overly-specific IP/mask combination, such as
10.1.2.2/24, but will store it by its implied network: 10.1.2.0/24.
This results in hashing errors, because the remote API will return
hashing results out of sync with the local configuration file.

Enforce a stricter API rule than AWS. Force users to use valid masks,
and run a quick calculation on their input to discover their intent.
Users can input a limited number of protocol names (e.g. "tcp") as
inputs to network ACL rules, but the API only supports valid protocol
number:

http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml

Preserve the convenience of protocol names and simultaneously support
numbers by only writing numbers to the state file. Also use numbers
when hashing the rules, to keep everything consistent.
@ctiwald ctiwald force-pushed the ct/fix-network-acls branch from 8eafb3e to 0688431 Compare May 7, 2015 04:03
catsby added a commit that referenced this pull request May 7, 2015
Fix a number of issues in AWS network ACLs
@catsby catsby merged commit 4874179 into hashicorp:master May 7, 2015
@catsby
Copy link
Contributor

catsby commented May 7, 2015

Thanks @ctiwald ! Great work here

@ctiwald
Copy link
Contributor Author

ctiwald commented May 7, 2015

Happy to help the cause.

@ghost
Copy link

ghost commented May 2, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators May 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants