Skip to content

Commit c179ad2

Browse files
Merge pull request #4 from lightspin-tech/dev
refactor
2 parents ddaf8f6 + f9efbc4 commit c179ad2

File tree

10 files changed

+582
-420
lines changed

10 files changed

+582
-420
lines changed

README.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![red-detector](https://github.com/lightspin-tech/red-detector/blob/main/red-detector.png)
1+
![red-detector](red-detector.png)
22

33
# Red-Detector
44

@@ -18,15 +18,20 @@ Actions details:
1818
| "AuthorizeSecurityGroupIngress" | Enables attaching security group to the EC2 instance. Contains IP premmisions to ssh port and a random port generated for the scan UI access. |
1919
| "DescribeInstances" | Enables access to the clients EC2 instances details. |
2020
| "CreateKeyPair" | Enables the creation of a key pair that is being used as the key of the EC2 instance. |
21+
| "CreateTags" | Enabled the creation of Tags on the Volume and Snapshot. |
2122
| "DescribeRegions" | Enables access to the clients active regions to enable the user select the relevant one for the scan. |
2223
| "RunInstances" | Enables the creation of an EC2 instance under the users client. |
2324
| "ReportInstanceStatus" | Enables getting the current status of the created EC2 instance to make sure it is running. |
2425
| "DescribeSnapshots" | Enables getting the current status of the taken snapshot to make sure it is available. |
26+
| "DescribeImages" | Enables querying AMI's to get the latest Ubuntu AMI. |
27+
| "DescribeVolumeStatus" | Enables getting the current status of the volume being created. |
28+
| "DescribeVolumes" | Enables getting details about a volume. |
2529
| "CreateVolume" | Enables the creation of a volume, in order to attach it the taken snapshot and attach it to the EC2 instance used for the vulnerabilities scan. |
2630
| "DescribeAvailabilityZones" | Enables access to the clients active availability zones to select one for the created volume that is being attach to the EC2 instance. |
27-
| "DescribeVpcs" | Enables getting the clinets default vpc. Used for the EC2s security group generation. |
31+
| "DescribeVpcs" | Enables getting the clients default vpc. Used for the EC2s security group generation. |
2832
| "CreateSecurityGroup" | Enables the creation of a security group that is being attached to the EC2 instance. |
2933
| "CreateSnapshot" | Enables taking a snapshot. Used to take a snapshot of the chosen EC2 instance. |
34+
| "DeleteSnapshot" | Enables deleting the stale snapshot was created during the process |
3035

3136

3237
2. Running EC2 instance - Make sure you know the region and instance id of the EC2 instance you would like to scan.
@@ -40,20 +45,29 @@ Supported versions:
4045

4146

4247
## Installation
43-
Bash
4448
```bash
4549
sudo git clone https://github.com/lightspin-tech/red-detector.git
4650
pip3 install -r requirements.txt
4751
```
4852

4953

5054

51-
## Usage
52-
Bash
55+
## Usage
56+
### Interactive
5357
```bash
54-
cd red-detector
5558
python3 main.py
5659
```
60+
### Command arguments
61+
```bash
62+
usage: main.py [-h] [--region REGION] [--instance-id INSTANCE_ID] [--keypair KEYPAIR] [--log-level LOG_LEVEL]
63+
64+
optional arguments:
65+
-h, --help show this help message and exit
66+
--region REGION region name
67+
--instance-id INSTANCE_ID EC2 instance id
68+
--keypair KEYPAIR existing key pair name
69+
--log-level LOG_LEVEL log level
70+
```
5771

5872
## Flow
5973
1. Run main.py.
@@ -64,5 +78,12 @@ python3 main.py
6478
3. Track the process progress... It takes about 30 minutes.
6579
4. Get a link to your report!
6680

81+
## Troubleshooting
82+
### verbouse logging
83+
```python3 main.py --log-level DEBUG```
84+
### scanners databases update process
85+
1. connect to the EC2 instance created ```ssh ubuntu@PUBLICIP -i KEYPAIR.pem```
86+
2. watch the progress ```tail /var/log/user-data.log```
87+
6788
## License
6889
This repository is available under the [Apache License 2.0](https://github.com/lightspin-tech/red-detector/blob/main/LICENSE).

create_ec2_instance.py

Lines changed: 0 additions & 222 deletions
This file was deleted.

0 commit comments

Comments
 (0)