This file contains hidden or 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
#!/bin/bash | |
# Get the private IP address | |
export CURR_HOST_NAME=`hostname` | |
# AWS mode | |
#CURR_PRIVATE_IP=`curl http://169.254.169.254/latest/meta-data/local-ipv4` | |
# Ubuntu (fusion) | |
CURR_PRIVATE_IP=`ip addr show eth0 | grep inet | grep eth0 | awk '{print $2}' | awk -F/ '{print $1}'` | |
ENTRY_EXISTS=`grep $CURR_PRIVATE_IP /etc/hosts` |
This file contains hidden or 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
rulebase = pandevice.policies.Rulebase() | |
policies.SecurityRule.refreshall(rulebase) | |
def add_rule(rulebase, sec_rule, position): | |
if rulebase: | |
if not position: | |
rulebase.add(sec_rule) | |
else: | |
rulebase.insert(position, sec_rule) |
This file contains hidden or 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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "Install Kali linux in the existing VPC / subnet", | |
"Parameters": { | |
"ServerKeyName": { | |
"Description": "SSH Key", | |
"Type": "AWS::EC2::KeyPair::KeyName" | |
}, | |
"PublicSubnet": { |