https://github.com/cprite/save-env
SaveEnv is an automated tool that scans public GitHub repositories for exposed OpenAI API keys in .env files. It verifies the keys and automatically opens issues to notify developers.
https://github.com/cprite/save-env
python selenium telebot webscraping
Last synced: 5 months ago
JSON representation
SaveEnv is an automated tool that scans public GitHub repositories for exposed OpenAI API keys in .env files. It verifies the keys and automatically opens issues to notify developers.
- Host: GitHub
- URL: https://github.com/cprite/save-env
- Owner: cprite
- License: mit
- Created: 2024-09-06T18:37:12.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-29T10:02:37.000Z (over 1 year ago)
- Last Synced: 2025-04-06T09:19:16.905Z (about 1 year ago)
- Topics: python, selenium, telebot, webscraping
- Language: Python
- Homepage:
- Size: 183 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]
Table of Contents
## About The Project
In the world of software development, API keys and other sensitive credentials are the keys to accessing critical services and applications. Unfortunately, these keys are sometimes accidentally exposed in public repositories, putting both developers and organizations at risk. If left unprotected, malicious actors can exploit these exposed credentials to access and misuse valuable data, leading to breaches, financial losses, and damaged reputations.
**SaveEnv** was created to address this growing problem by automating the process of detecting and notifying developers about exposed OpenAI API keys in ```.env``` files. By continuously monitoring public GitHub repositories, SaveEnv helps prevent sensitive data from falling into the wrong hands. The project's aim is to provide an easy-to-use tool that alerts developers to their mistakes before they can be exploited.
The script automatically scans GitHub every hour for ```.env``` files that may have OpenAI API keys. Here’s how the process works:
1. The script searches for public repositories with .env files that may contain sensitive data.
2. It identifies OpenAI API keys within these .env files.
3. For each extracted key, the script calls the OpenAI API to verify whether the key is still valid.
4. If the key is valid, the script automatically opens an issue on the affected repository, notifying the developer about the exposed key.
If you’re interested in monitoring the results of scanning hundreds of repositories daily, you can easily do so through my [custom-designed Telegram chat bot](https://t.me/save_env_bot) (currently off, will get it back soon). The results not only keep you informed about potential issues but can also serve as a motivating reminder to prioritize security in your own projects.
### 🛑 Disclaimer 🛑
This tool is designed to help developers protect their sensitive data. It is not intended for malicious use. By using this script, you agree to use it responsibly and within ethical boundaries. Always respect data privacy and security best practices.
### Built With
* [](https://www.python.org)
* [](https://www.selenium.dev/)
* [](https://jupyterlab.readthedocs.io/en/stable)
* [](https://pandas.pydata.org/)
* [](https://www.google.com/chrome/)
* [](https://code.visualstudio.com/)
* [](https://www.raspberrypi.com/products/raspberry-pi-4-model-b/)
**P.S.** You’re probably wondering why there’s a Raspberry Pi badge here… Well, this entire project is hosted on a home server I built using a Raspberry Pi 4 and a router! Raspberry Pi is one of the areas I’m currently actively exploring, and I love using it to bring creative ideas to life.
## Contributing
I'm open to collaboration and contributions from fellow developers! You can easily adapt the code to work with other APIs beyond OpenAI. Feel free to fork the project and modify it to suit your needs. Together, we can enhance this tool and help more developers safeguard their projects.
[contributors-shield]: https://img.shields.io/github/contributors/cprite/save-env.svg?style=for-the-badge
[contributors-url]: https://github.com/cprite/save-env/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/cprite/save-env.svg?style=for-the-badge
[forks-url]: https://github.com/cprite/save-env/network/members
[stars-shield]: https://img.shields.io/github/stars/cprite/save-env.svg?style=for-the-badge
[stars-url]: https://github.com/cprite/save-env/stargazers
[issues-shield]: https://img.shields.io/github/issues/cprite/save-env.svg?style=for-the-badge
[issues-url]: https://github.com/cprite/save-env/issues
[license-shield]: https://img.shields.io/github/license/cprite/save-env.svg?style=for-the-badge
[license-url]: https://github.com/cprite/save-env/blob/master/LICENSE
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/niknmirosh