2023-07-16 15:25:03 -07:00
< div align = "center" >
< img src = "melamine.png" alt = "melamine logo" >
2023-07-16 10:23:03 -07:00
# melamine
2023-07-16 15:25:03 -07:00
**melamine** is a better file shredder
2023-07-16 16:10:32 -07:00
it runs on linux (Ubuntu tested) for now< br / >
2023-07-16 15:25:03 -07:00
[Installation ](#installation ) •
[Example ](#example ) •
[Contributing ](#contributing ) •
[License ](#license )
< / div >
2023-07-16 10:23:03 -07:00
2023-07-16 15:25:03 -07:00
## Installation
2023-07-16 17:39:32 -07:00
Install using the below command lines to ensure dependencies are met for Ubuntu. `sudo` is currently required.
2023-07-16 10:23:03 -07:00
```bash
sudo apt install --yes --no-install-recommends build-essential python3-dev libzfslinux-dev & & \
sudo pip3 install Cython & & \
2023-07-16 15:25:03 -07:00
git clone https://github.com/truenas/py-libzfs & & pushd py-libzfs & & \
./configure --prefix=/usr & & sudo make install & & popd & & \
git clone https://sillyhats.mips.uk/pdf/melamine & & pushd melamine & & \
2023-07-16 17:39:32 -07:00
sudo python3 -m pip install .
```
Verify the installation with `sudo melamine --help` or `sudo melamine -h` to see:
```bash
usage: melamine [-h] [--recursive] [--yes] [--dryrun] [--exhaustive]
[--ignoredir IGNOREDIR] [--logfile LOGFILE] [--quiet]
[--verbose]
paths [paths ...]
Comprehensive DoD 5220.22-M-compliant file shredder for Linux.
positional arguments:
paths Specify any number of existing files or directories to
be processed.
options:
-h, --help show this help message and exit
--recursive, -r Process directories recursively. Default is false.
--yes, -y Skip confirmation prompts. Default is false.
--dryrun, -d Provide mock output without deleting anything. Default
is false.
--exhaustive, -e Exhaustively check local mounts for duplicate files by
hash. Default is false.
--ignoredir IGNOREDIR, -i IGNOREDIR
Specify directories to be ignored during the process.
This option can be used multiple times.
--logfile LOGFILE, -o LOGFILE
Specify a file to log all output (NOT IMPLEMENTED).
--quiet, -q Silence all output (NOT IMPLEMENTED).
--verbose, -v Provide extra output for debugging (NOT IMPLEMENTED).
2023-07-16 10:23:03 -07:00
```
2023-07-16 15:25:03 -07:00
## Example
2023-07-16 16:10:32 -07:00
melamine is not yet ready for production use. If you'd like to try it, generate dummy files below. Preferably, do this on a separate mount point than any essential files or in a virtual machine.
Currently, only inode discovery and the beginnings of ext2/3 and zfs support exist.
```bash
rm -rf /tmp/melamine & & mkdir -p /tmp/melamine;
rm -rf /tmp/melamine_hardlinks & & mkdir -p /tmp/melamine_hardlinks;
for i in $(seq 1 4); do dd if=/dev/urandom of=/tmp/melamine/test_$i bs=1 count=$(( RANDOM % 256 * 256 )); done;
ln /tmp/melamine/test_1 /tmp/melamine_hardlinks/hardlink_1;
ln /tmp/melamine/test_2 /tmp/melamine_hardlinks/hardlink_2;
2023-07-16 17:39:32 -07:00
melamine --recursive /tmp/melamine
2023-07-16 16:10:32 -07:00
```
You can then confirm that the two hardlink inodes match using `ls -li` .
```bash
ls -li /tmp/melamine/test_*;
ls -li /tmp/melamine_hardlinks/hardlink_*;
```
2023-07-16 15:25:03 -07:00
## Contributing
If you would like to contribute to this project, feel free to submit a pull request or open an issue on GitHub.
This tool was written as part of my coursework for CSC 842 - Security Tool Development at Dakota State University. Consequently, I may choose not to maintain this tool beyond the length of the course, but have selected a license that enables open contributions in any case.
## License
This project is licensed under the MIT License. See the `LICENSE` file for details.