Repository navigation
01_Getting Started
Nir Valtman edited this page Feb 4, 2015
·
4 revisions
This version of Cloudefigo supports only Amazon Web Services (AWS) environment. Thus, an account in AWS with administrative privileges is required for this stage. Following providing the privileges described below, no administrative privileges will be needed any more.
To get a local copy of the current code, clone it using git:
$ git clone https://github.com/valtmanir/Cloudefigo.git Cloudefigo
$ cd Cloudefigo
- Make sure you are using 2 different security group: remediation and production. All servers are launched into Remediation SG and move only after they pass vulnerability scan sucessfuly.
- Create a new instance of the latest Ubuntu and assign an Elastic IP to it. Then, install Nessus on this instance.
- Get Chef server and assign an Elastic IP to it as well. Cloudefigo tested with managed-chef but other versions of Chef can be implmeneted as well.
- Create a new user and group for Cloudefigo management operations. Then, add the following policy to the group:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1413548658000",
"Effect": "Allow",
"Action": [
"ec2:ModifyInstanceAttribute",
"ec2:RunInstances",
"ec2:CreateTags",
"ec2:DescribeInstances"
],
"Resource": [
"*"
]
},
{
"Sid": "Stmt1413627168000",
"Effect": "Allow",
"Action": [
"iam:CreateRole",
"iam:GetRole",
"iam:ListRoles",
"iam:PutRolePolicy",
"iam:CreateInstanceProfile",
"iam:GetInstanceProfile",
"iam:AddRoleToInstanceProfile",
"iam:PassRole"
],
"Resource": [
"*"
]
},
{
"Sid": "Stmt1417412719000",
"Effect": "Allow",
"Action": [
"cloudtrail:DescribeTrails"
],
"Resource": [
"*"
]
},
{
"Sid": "Stmt1417412836000",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:ListBucket",
"s3:PutObject",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::cloud-log-trial",
"arn:aws:s3:::cloud-log-trial/*"
]
}
]
}
Note that resource names may be different between environments.
4. Generate API keys for this user and store them for the coming steps. You can download them in excel format to ease the process, but do not forget to remove them when the getting started stages done.
- Install Python 2.7.
- In order to install Pychef, the following dependencies should be installed. The first is Python-pip. Note that if running pip from Windows, the execution path should be the
PYTHONPATH\Lib\site-packagesand the pip command should be called aspython pip. - When pip installed, it is easy to install Wheel by running the following command line:
pip install wheel
- Then install PyChef using Wheel by running (this example runs on linux):
wget https://pypi.python.org/packages/2.7/P/PyChef/PyChef-0.2.3-py27-none-any.whl
wheel install PyChef-0.2.3-py27-none-any.whl
- Install Django web application framework by following the instructions in the following link. Note that if using pip, in some cases the MD5 checksum is incorrect, an therefore, need to add the parameter
--trusted-host pypi.python.org. - Amazon Web Services CLI needed to manage the credentials of the management user only. Install the AWS CLI and set the credentials using the following command:
$ aws configure
AWS Access Key ID [None]: (your access key id)
AWS Secret Access Key [None]: (your secret access key)
Default region name [None]:
Default output format [None]:
- Install AWS SDK (Boto) using Wheel by running (this example runs on linux):
wget https://pypi.python.org/packages/3.4/b/boto/boto-2.36.0-py2.py3-none-any.whl#md5=3777433a2f800450a63d44c4b91d5caf
wheel install boto-2.36.0-py2.py3-none-any.whl
When all set up, the configuration must be edited before any magic can happen.