Detects and removes sensitive information from the client-side to secure a user's data.
Project description
Elapse Secrets Filters
Elapse Secrets Filters is a Python package designed to help you search and mask sensitive information in a body of text using pre-defined regular expressions. This package includes filters for common secrets like AWS keys, Github tokens, API keys, and much more.
The package provides two main functions:
-
filter_elapse_secrets(text: str) -> str
- Uses the predefined regex filters to search and mask (with asterisks) any matching sensitive information in the input text. -
find_error_in_regex(yaml_file: str) -> None
- Checks the YAML file containing regex rules for any incorrect patterns and logs the error if any are found.
Getting Started
-
Install elapse-secrets
pip install elapse-secrets
Usage
This is a basic usage example.
from elapse_secrets import filter_elapse_secrets
text_with_secrets = "My AWS Access Key is AKIAYOURACCESSKEYHERE"
filtered_text = filter_elapse_secrets(text_with_secrets)
print(filtered_text)
# Output: My AWS Access Key is ********
Documentation
filter_elapse_secrets(text: str) -> str
This function takes a string as input and returns the string with sensitive information replaced by asterisks.
Parameters
text (str)
: The text to filter.
Returns
str
: The filtered text.
find_error_in_regex(yaml_file: str) -> None
This function checks a YAML file for incorrect regular expression patterns. If an error is found, it is logged.
Parameters
yaml_file (str)
: The YAML file to check.
Returns
None
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
This project is licensed under the terms of the MIT license.
Contact
Please feel free to contact the maintainers of this project if you have any questions.
Acknowledgments
We would like to thank all the contributors who have been part of this project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for elapse_secrets-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f674498e74a8a5c3aeb691a7550c2cd0fb4e5b10697c0e074014ce3b3a19552 |
|
MD5 | 65860c1f1d33873c066c5a814b4309da |
|
BLAKE2b-256 | 3d3ca3f039bda636f8e94f84fa53cbb5388eee3157670880912293fe624f14de |