This project is designed to provide network security services using Docker containers deployed on AWS EC2 instances. The project utilizes AWS ECR for container image storage and AWS S3 for data storage.
.
├── .github/
│ └── workflows/
│ └── main.yml
├── app.py
├── data_schema/
│ └── schema.yaml
├── dataset/
│ └── phishingData.csv
├── Dockerfile
├── final_model/
│ ├── model.pkl
│ └── preprocessing.pkl
├── main.py
├── notebooks/
│ └──__init__.py
├── prediction_output/
│ ├── __init__.py
│ └── output.csv
├── push_data.py
├── README.md
├── requirements.txt
├── setup.py
├── src/
│ ├── cloud/
│ ├── components/
│ ├── constant/
│ ├── entity/
│ ├── exception/
│ ├── logging/
│ ├── pipeline/
│ └── utils/
├── static/
│ └── __init__.py
├── templates/
│ ├── __init__.py
│ └── table.html
├── test_mongodb.py
├── valid_data/
│ └── test.csv
└── venv/
- Docker
- AWS CLI
- Python 3.8+
- pip
-
Clone the repository:
git clone https://github.com/yourusername/your-repo.git cd your-repo
-
Install dependencies:
pip install -r requirements.txt
-
Set up AWS credentials:
Configure your AWS CLI with the necessary credentials:
aws configure
-
Build and push Docker image to ECR:
docker build -t your-ecr-repo-name . docker tag your-ecr-repo-name:latest your-ecr-uri/your-ecr-repo-name:latest docker push your-ecr-uri/your-ecr-repo-name:latest
-
Deploy on EC2:
Use the following command to run the Docker container on an EC2 instance:
docker run -d -p 8080:8080 --ipc="host" --name=networksecurity -e 'AWS_ACCESS_KEY_ID=your-access-key-id' -e 'AWS_SECRET_ACCESS_KEY=your-secret-access-key' -e 'AWS_REGION=your-region' your-ecr-uri/your-ecr-repo-name:latest
-
Continuous Integration and Deployment:
The project uses GitHub Actions for CI/CD. The workflow is defined in main.yml. It includes steps for linting, running unit tests, building and pushing Docker images to ECR, and deploying the container on EC2.
-
Access the application:
Once the container is running, you can access the application at
http://<ec2-instance-public-ip>:8080
. -
Data Storage:
The project uses AWS S3 for storing data. Ensure that your S3 bucket is properly configured and accessible.