Skip to content

Commit

Permalink
Merge pull request #10 from noobpk/dev
Browse files Browse the repository at this point in the history
Bump to version 1.3
  • Loading branch information
noobpk authored Aug 30, 2023
2 parents e37c715 + 76e01d8 commit b2866d8
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 107 deletions.
122 changes: 30 additions & 92 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,129 +9,62 @@ Gemini - The Runtime Application Self Protection (RASP) Solution Combined With D
![Static Badge](https://img.shields.io/badge/Recurrent%20Neural%20Network-%23ff6666)
![Static Badge](https://img.shields.io/badge/Sentence%20Transformers-%236e31ff)

## Introduction

## Architecture
Gemini-Self-Protector pioneers the fusion of Runtime Application Self Protection (RASP) and transformative Deep Learning. In today's evolving digital landscape, intelligent and adaptive application security is paramount. Enter Gemini-Self-Protector, ushering in a new era of proactive defense that revolutionizes application safeguarding amid ever-changing threats.

By seamlessly integrating RASP into your application's runtime fabric, Gemini-Self-Protector achieves unparalleled protection. It dynamically monitors and secures various aspects of functionality—database interactions, file operations, and network communications. This symbiosis with Deep Learning empowers Gemini-Self-Protector to adapt and evolve defenses in real-time, staying ahead of emerging threats.

## Gemini Architecture

The architecture of gemini-self-protector is composed of seven layers however it is optimized so as not to affect the performance on the application.

![image](https://user-images.githubusercontent.com/31820707/232506270-b0776d83-34b8-47fb-aa2a-eab3a4cc3be7.png)

## Support
## Language Support

| Language | Platform/ Framework |
| -------- | ------------------- |
| Python | Flask |

## Deep Learning
## Deep Learning Technology

Gemini uses a deep learning model that combines Convolutional Neural Network (CNN) and a family of Recurrent neural network (RNN) techniques to detect and identify vulnerabilities.

For more details: [Web-Vuln-Detection-Predict](https://github.com/noobpk/Web-Vuln-Detection-Predict)

## Gemini Protect Against

| Attacks | Supported |
| ----------------------- | ------------------ |
| Malformed Content Types | |
| HTTP Method Tampering | :white_check_mark: |
| Large Requests | :white_check_mark: |
| Path Traversal | :white_check_mark: |
| Unvalidated Redirects | :white_check_mark: |

| Injections | Supported |
| -------------------------- | ------------------ |
| Command Injection | :white_check_mark: |
| Cross-Site Scripting | :white_check_mark: |
| Cross-Site Request Forgery | |
| CSS & HTML Injection | |
| JSON & XML Injection | |
| SQL Injection | :white_check_mark: |

| Weaknesses | Supported |
| ---------------------------- | ------------------ |
| Insecure Cookies & Transport | |
| Weak Browser Caching | :white_check_mark: |
| Vulnerable Dependencies | :white_check_mark: |
| Weak Cryptography | |
| HTTP Response Headers | :white_check_mark: |
| API Rate Limit | :white_check_mark: |

## Gemini Security Response Headers

| HTTP Response Headers | Default configuration |
| ------------------------------ | --------------------- |
| X-Frame-Options | SAMEORIGIN |
| X-XSS-Protection | 1; mode=block |
| X-Content-Type-Options | nosniff |
| Referrer-Policy | no-referrer-when-downgrade |
| Content-Type | N/A |
| Strict-Transport-Security | max-age=31536000; includeSubDomains; preload |
| Expect-CT | enforce; max-age=31536000 |
| Content-Security-Policy | N/A |
| X-Permitted-Cross-Domain-Policies | none |
| Feature-Policy | fullscreen 'self' |
| Cache-Control | no-cache, no-store, must-revalidate |
| Pragma | no-cache |
| Expires | 0 |
| X-UA-Compatible | IE=Edge,chrome=1 |
| Access-Control-Allow-Origin | * |
| Access-Control-Allow-Methods | * |
| Access-Control-Allow-Headers | * |
| Access-Control-Allow-Credentials | true |
| Cross-Origin-Opener-Policy | N/A |
| Cross-Origin-Embedder-Policy | N/A |
| Cross-Origin-Resource-Policy | N/A |
| Permissions-Policy | N/A |
| FLoC | N/A |
| Server | gemini |
| X-Powered-By | N/A |
| X-AspNet-Version | N/A |
| X-AspNetMvc-Version | N/A |
| X-DNS-Prefetch-Control | N/A |
## More About Gemini-Self-Protector

📜 All about Gemini-Self-Protector is in [here](https://github.com/noobpk/gemini-self-protector/wiki)

## Installation

```
$ pip install gemini_self_protector
pip install gemini_self_protector
```

## Quick Start
⚙️ See detailed installation instructions [here](https://github.com/noobpk/gemini-self-protector/wiki/Quick-Start)

## Protect Mode & Sensitive

Gemini supports 3 modes and recommends sensitivity levels for the application to operate at its best state.

| Mode | Sensitive |
| ------- | --------- |
| off | N/A |
| monitor | 70 |
| block | 50 |
| Mode | Sensitive |
| --------- | --------- |
| off | N/A |
| monitor | 70 |
| protector | 50 |

## Public Predict Server
## Public Predict Serve

| Address | Version | License Key |
| Address | Version | Authentication Key |
| ------- | --------- | --------- |
| https://web-vuln-detect.my-app.in | 07-2023 | 988907ce-9803-11ed-a8fc-0242ac120002 |

## License Key

The license key is used for authentication with the API.

## Deploy Predict Server with Docker

To deploy predict server using docker, follow these steps -

1. Clone this repository on your local machine or any other system where you have installed Docker. Replace `your-auth-key` with whatever you want. Suggest to use `uuid` or `sha256` for this key.

```
$ wget -O docker-compose.yml https://raw.githubusercontent.com/noobpk/gemini-self-protector/dev/predict-server/docker-compose.yml
```
2. Open terminal in that directory

3. Run following command to run container
## Deployment Module Predict

```
$ docker-compose up
```
[gemini-predict-serve](https://github.com/noobpk/gemini-predict-serve)

## GUI Features

Expand All @@ -145,8 +78,9 @@ $ docker-compose up

👉 Dependency Vulnerability Check

## Theme
https://appseed.us/product/datta-able/flask/
## Demo

[Gemini-Self-Protector | Demo | Install - Configurate - Usage](https://youtu.be/sUJsJE29KcE)

## Screenshot

Expand Down Expand Up @@ -176,3 +110,7 @@ Interested in contributing? Check out the contributing guidelines. Please note t
## License

`gemini_self_protector` was created by lethanhphuc. It is licensed under the terms of the MIT license.

## Theme

https://appseed.us/product/datta-able/flask/
11 changes: 0 additions & 11 deletions gemini-predict-server/docker-compose.yml

This file was deleted.

2 changes: 1 addition & 1 deletion gemini-python/gemini_self_protector/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "gemini_self_protector"
version = "0.1.2-c"
version = "0.1.3"
description = "Runtime Application Self-Protection"
authors = ["lethanhphuc"]
license = "MIT"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,20 @@ def web_vuln_detect_predict(payload) -> None:
predict_server_key_auth = _Config.get_tb_config().predict_server_key_auth
headers = {"Content-Type": "application/json",
"Authorization": predict_server_key_auth}
client_ip = _Utils.flask_client_ip()
predict = requests.post(
f'{predict_server}/predict', json={"data": payload}, headers=headers)
f'{predict_server}/predict', json={"ip": client_ip, "data": payload}, headers=headers)
if (predict):
response = predict.json()
accuracy = response.get('accuracy', 0)
return accuracy
else:
logger.warning(
"[!] Cannot connect to predict server. Gemini-self protector cannot predit this request.")
"[!] Cannot connect to predict server. Gemini-self protector cannot predict this request.")
return 0
except requests.exceptions.RequestException as e:
logger.warning(
"[!] Cannot connect to predict server. Gemini-self protector cannot predit this request.")
"[!] Cannot connect to predict server. Gemini-self protector cannot predict this request.")
return 0
except Exception as e:
logger.error(
Expand Down

0 comments on commit b2866d8

Please sign in to comment.