Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms


iptables (26) Versions 0.14.1

Installs the iptables daemon and provides a LWRP for managing rules

cookbook 'iptables', '= 0.14.1'
cookbook 'iptables', '= 0.14.1', :supermarket
knife cookbook site install iptables
knife cookbook site download iptables


Sets up iptables to use a script to maintain firewall rules. However this cookbook may be deprecated or heavily modified in favor of the general firewall cookbook, see Roadmap.


  • [COOK-652] - create a firewall cookbook
  • [COOK-688] - create iptables providers for all resources



  • Ubuntu/Debian
  • RHEL/CentOS



The default recipe will install iptables and provides a ruby script (installed in /usr/sbin/rebuild-iptables) to manage rebuilding firewall rules from files dropped off in /etc/iptables.d.


See Roadmap for plans to replace the definition with LWRPs.


The definition drops off a template in /etc/iptables.d after the name parameter. The rule will get added to the local system firewall through notifying the rebuild-iptables script. See Examples below.


Ensure that the system is set up to use the definition and rebuild script with recipe[iptables]. Then create templates with the firewall rules in the cookbook where the definition will be used. See Examples.

Since certain chains can be used with multiple tables (e.g., PREROUTING), you might have to include the name of the table explicitly (i.e., *nat, *mangle, etc.), so that the /usr/sbin/rebuild-iptables script can infer how to assemble final ruleset file that is going to be loaded. Please note, that unless specified otherwise, rules will be added under the filter table by default.


To enable port 80, e.g. in an httpd cookbook, create the following template:

# Port 80 for http
-A FWR -p tcp -m tcp --dport 80 -j ACCEPT

This would go in the cookbook, httpd/templates/default/http.erb. Then to use it in recipe[httpd]:

iptables_rule "http"

To redirect port 80 to local port 8080, e.g., in the aforementioned httpd cookbook, created the following template:

# Redirect anything on eth0 coming to port 80 to local port 8080
-A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080

Please note, that we explicitly add name of the table (being *nat in this example above) where the rules should be added.

This would most likely go in the cookbook, httpd/templates/default/http_8080.erb. Then to use it in recipe[httpd]:

iptables_rule "http_8080"


default["iptables"]["install_rules"] = true  # install the default rules

License and Author

Author:: Adam Jacob Author:: Joshua Timberman

Copyright:: 2008-2011, Opscode, Inc

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

abiquo Applicable Versions
aem Applicable Versions
amiga-ppp Applicable Versions
apache2 Applicable Versions
arcgis-enterprise Applicable Versions
cassandra Applicable Versions
chef-manageiq Applicable Versions
cloudless-box Applicable Versions
common_linux Applicable Versions
concourse Applicable Versions
confd-iptables Applicable Versions
cookbook-openshift3 Applicable Versions
cookbook-openshift3 0.0.1
cookbook-openshift3 0.0.2
cookbook-openshift3 1.0.2
cookbook-openshift3 1.0.3
cookbook-openshift3 1.0.4
cookbook-openshift3 1.0.5
cookbook-openshift3 1.0.6
cookbook-openshift3 1.0.7
cookbook-openshift3 1.0.8
cookbook-openshift3 1.0.9
cookbook-openshift3 1.10.0
cookbook-openshift3 1.10.1
cookbook-openshift3 1.10.2
cookbook-openshift3 1.10.3
cookbook-openshift3 1.10.4
cookbook-openshift3 1.10.5
cookbook-openshift3 1.10.6
cookbook-openshift3 1.10.7
cookbook-openshift3 1.10.8
cookbook-openshift3 1.10.9
cookbook-openshift3 1.10.10
cookbook-openshift3 1.10.11
cookbook-openshift3 1.10.12
cookbook-openshift3 1.10.13
cookbook-openshift3 1.10.14
cookbook-openshift3 1.10.15
cookbook-openshift3 1.10.16
cookbook-openshift3 1.10.17
cookbook-openshift3 1.10.18
cookbook-openshift3 1.10.19
cookbook-openshift3 1.10.20
cookbook-openshift3 1.10.21
cookbook-openshift3 1.10.22
cookbook-openshift3 1.10.23
cookbook-openshift3 1.10.24
cookbook-openshift3 1.10.25
cookbook-openshift3 1.10.26
cookbook-openshift3 1.10.27
cookbook-openshift3 1.10.28
cookbook-openshift3 1.10.29
cookbook-openshift3 1.10.30
cookbook-openshift3 1.10.31
cookbook-openshift3 1.10.32
cookbook-openshift3 1.10.33
cookbook-openshift3 1.10.34
cookbook-openshift3 1.10.35
cookbook-openshift3 1.10.36
cookbook-openshift3 1.10.37
cookbook-openshift3 1.10.38
cookbook-openshift3 1.10.39
cookbook-openshift3 1.10.40
cookbook-openshift3 1.10.41
cookbook-openshift3 1.10.42
cookbook-openshift3 1.10.43
cookbook-openshift3 1.10.44
cookbook-openshift3 1.10.45
cookbook-openshift3 1.10.46
cookbook-openshift3 1.10.47
cookbook-openshift3 1.10.48
cookbook-openshift3 1.10.49
cookbook-openshift3 1.10.50
cookbook-openshift3 1.10.51
cookbook-openshift3 1.10.52
cookbook-openshift3 1.10.53
cookbook-openshift3 1.10.54
cookbook-openshift3 1.10.55
cookbook-openshift3 1.10.56
cookbook-openshift3 1.10.57
cookbook-openshift3 1.10.58
cookbook-openshift3 1.10.59
cookbook-openshift3 1.10.60
docker Applicable Versions
drupal-cookbook Applicable Versions
extended_drbd Applicable Versions
ganglia Applicable Versions
hypertable Applicable Versions
jenkins Applicable Versions
kimchi Applicable Versions
openssh Applicable Versions
piwik Applicable Versions
plexconnect Applicable Versions
redmine2 Applicable Versions
riak Applicable Versions
sanitize Applicable Versions
sensu Applicable Versions
spacewalk-server Applicable Versions
sshguard Applicable Versions
teamforge Applicable Versions
treslek Applicable Versions

v0.14.1 (2015-01-01)

  • Fixing File.exists is deprecated for File.exist

v0.14.0 (2014-08-31)

  • [#14] Adds basic testing suite including Berksfile
  • [#14] Adds basic integration/post-converge tests
  • [#14] Adds default prefix and postfix rules to disalow traffic

v0.13.2 (2014-04-09)

  • [COOK-4496] Added Amazon Linux support

v0.13.0 (2014-03-19)

  • [COOK-3927] Substitute Perl version of rebuild-iptables with Ruby version

v0.12.2 (2014-03-18)

  • [COOK-4411] - Add newling to iptables.snat


  • [COOK-2213] - iptables disabled recipe


  • [COOK-1883] - add perl package so rebuild script works


  • [COOK-641] - be able to save output on rhel-family
  • [COOK-655] - use a template from other cookbooks


  • Current public release.

Foodcritic Metric

0.14.1 failed this metric

FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/1438b4e80c06a03c678d240e/iptables/recipes/default.rb:45
FC015: Consider converting definition to a LWRP: /tmp/cook/1438b4e80c06a03c678d240e/iptables/definitions/iptables_rule.rb:1
FC019: Access node attributes in a consistent manner: /tmp/cook/1438b4e80c06a03c678d240e/iptables/recipes/default.rb:45
FC031: Cookbook without metadata file: /tmp/cook/1438b4e80c06a03c678d240e/iptables/metadata.rb:1
FC043: Prefer new notification syntax: /tmp/cook/1438b4e80c06a03c678d240e/iptables/definitions/iptables_rule.rb:20
FC043: Prefer new notification syntax: /tmp/cook/1438b4e80c06a03c678d240e/iptables/definitions/iptables_rule.rb:23
FC045: Consider setting cookbook name in metadata: /tmp/cook/1438b4e80c06a03c678d240e/iptables/metadata.rb:1