Last active
August 29, 2015 14:00
-
-
Save jasonmccallister/1415ab2ade35b070f75a to your computer and use it in GitHub Desktop.
CentOS - Install scripts for Digital Ocean and Puppet Enterprise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install the base packages | |
yum install nano git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# flush all rules | |
iptables -F | |
# block null packets | |
iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP | |
# block syn-flood attacks | |
iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP | |
# block XMAS packets | |
iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP | |
# allow localhost | |
iptables -A INPUT -i lo -j ACCEPT | |
# allow 80 and 443 for webserver | |
iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT | |
iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT | |
# allow SMTP on 465 | |
iptables -A INPUT -p tcp -m tcp --dport 465 -j ACCEPT | |
# allow SSH access | |
iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT | |
# allow outgoing connections block everything else | |
iptables -I INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
iptables -P OUTPUT ACCEPT | |
iptables -P INPUT DROP | |
# save rules | |
iptables -L -n | |
iptables-save > /etc/sysconfig/iptables | |
# restart iptables | |
service iptables restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# puppet enterprise install for agent nodes | |
# enable puppet labs repo for x64 | |
sudo rpm -ivh https://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-7.noarch.rpm | |
# update yum | |
yum update | |
# install puppet | |
yum install puppet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment