-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathInit.py
32 lines (23 loc) · 837 Bytes
/
Init.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/python
__author__ = 'nirv'
from Chef.ConfigurationManagement import ChefClient
from NessusScanner.VulnerabilityAssessment import Scanner
from CloudServices.Common.Exceptions import RemediationException,GenericException
from CloudServices.IaaS.Instances import EC2Instance
from CloudServices.Common.Logger import Logger
ec2 = EC2Instance()
try:
chef_client = ChefClient()
chef_client.verify_management()
nessus = Scanner()
nessus.run_scan()
ec2.move_current_instance_to_production_group()
ec2.strict_current_instance_role_permissions()
except RemediationException as re:
## ec2.strict_current_instance_role_permissions() ## Depends on the business, it can be added.
exit()
except GenericException as ge:
exit()
except Exception as ex:
Logger.log("error", ex.message)
exit()