A tool to store/check file integrity information in filesystem extended attributes or JSON integrity database dump able to validate BagIt format.
See
- http://man7.org/linux/man-pages/man5/attr.5.html
- http://man7.org/linux/man-pages/man1/getfattr.1.html
- http://man7.org/linux/man-pages/man1/setfattr.1.html
- http://purl.org/net/bagit
The tools has build-in help. To see usage information run
fstree-integrity-watch.pl --help
To work with BagIt format we are using Library of Congress implementation of the validation tool. The tool is implemented in Python.
See
pip install bagit
Python v2.6+ is required.
The official Git repository of the tools
(https://github.com/LibraryOfCongress/bagit-python) is available as submodule
under the utils/bagit-python/
directory:
# after checkout
git submodule update --init --recursive
...
# to update working copy
git submodule update --recursive
The tools uses bunch of CPAN modules implementing useful functionality. To run the tool install the needed modules using your distribution software management tool or install up-to-date versions directly from CPAN:
cpan Class::Tiny DateTime Digest Encode Encode::Locale Exception::Class Exporter File::Basename File::ExtAttr File::Find File::Spec FindBin Getopt::Long IO::Handle IPC::Open3 JSON List::Compare List::MoreUtils List::Util Module::Load Scalar::Util Try::Tiny
Various digest algorithms are implemented in separate modules. The modules are loaded dynamically at runtime when needed so it is sufficient to install the implementation of algorithms you are going to use.
cpan Digest::Adler32 Digest::BLAKE Digest::BLAKE2 Digest::BMW Digest::CRC Digest::ECHO Digest::ED2K Digest::EdonR Digest::Fugue Digest::GOST Digest::Groestl Digest::Hamsi Digest::JH Digest::Keccak Digest::Luffa Digest::MD2 Digest::MD4 Digest::MD5 Digest::SHA Digest::SHA3 Digest::SHAvite3 Digest::SIMD Digest::Shabal Digest::Skein Digest::Whirlpool
See
The module loads Digest::*
modules dynamically using Module::Load
based on
algorithm selected by the caller. An exception is thrown if appropriate digest
module is not available in the system.
See
The module uses File::ExtAttr
module that depends on libattr
.
In case of cpan File::ExtAttr
installation error your system possibly needs
libattr-devel
packages to be installed.
See
The module uses FSTreeIntegrityWatch::Exception::*
exceptions to handles
errors. The system is base on Exception::Class
modules.
See
- https://metacpan.org/pod/Exception::Class
- http://www.drdobbs.com/web-development/exception-handling-in-perl-with-exceptio/184416129
FSTreeIntegrityWatch modules construct objects using Class::Tiny
minimalist
class constructor module.
At least version 1.001 of the Class::Tiny
module is required as older versions
lack the BUILDARGS method some of the FSTreeIntegrityWatch::*
modules use.
See
Command line arguments are processed using Getopt::Long
module. GNU getopt
and advanced features such as options bundling and auto completion can be used.
See
This feature is highly experimental!
You can use Perl Archive Toolkit (PAR) to create a single all-in-one binary executable of the tool.
It is necessary to have PAR::Packer
tool installed:
cpan PAR::Packer
Than you can pack the script with all the dependencies running
pack-to-executable.sh
producing standalone binary executable fstree-integrity-watch.packed-standalone
and Perl scripts fstree-integrity-watch.packed-*.pl
with various level of
dependencies packed inside to be run on slim Perl installations.
See