A user-friendly tool for effortless capturing of AWS ECS/EC2 network interfaces, simplifying your networking tasks.
- ✅ ECS Clusters Capturing
- ✅ EC2 Instances Capturing
-
Clone the repository:
git clone https://github.com/hyavari/ECXCapture
-
Navigate to the
ECXCapture
directory:cd {path}/ECXCapture
-
Install the requirements:
pip install -r requirements.txt
-
Update the config file (
config/config.js
) based on your AWS settings. The config.js file is structured into three main sections:Define regions for different environments such as "lab" and "prod." Each region includes an array of AWS regions.
Example:
"regions": { "lab": ["ca-central-1"], "prod": ["us-east-2", "us-west-2"] },
Define S3 buckets for each environment. Each bucket includes a name and the AWS region where it is located.
Example:
"buckets": { "lab": { "name": "capture-pcaps-lab", "region": "us-east-1" }, "prod": { "name": "capture-pcaps-prod", "region": "us-east-2" } },
Define capture services categorized by type (e.g., "SIP Servers," "Media Servers"). These are used to prompt user to what they want to capture. Each catagory can have sub catagories which includes an identifier, such as "PCSCF" or "RTPENGINE," along with its
type
(e.g., "ecs" or "ec2") andid
.id
is actually the key name of your ECS cluster or EC2 instance which tool looks for to start capture.Example:
"captureServices": { "SIP Servers": { "PCSCF": { "id": "kamailio-test", "type": "ecs" } }, "Media Servers": { "RTPENGINE": { "id": "rtpengine-test", "type": "ec2" } } }
-
Run the script:
python ecx_capture.py
-
Follow the on-screen instructions to perform data capture.
aws
cli installed on tasks or we can use a simple script
to upload pcaps to S3. I used a node.js script on my ECS task, because I had node.js installed for my applications. You can find it under pcapScript folder. It would be easy to use it when you are building your image.
COPY ./pcapScript /pcapScript
WORKDIR /pcapScript
RUN . ~/.nvm/nvm.sh && npm install
Contributions are welcome! Please reach out to me.
For any questions or suggestions, please contact the me at Hossein Yavari.