GithubHelp home page GithubHelp logo

banpump-team / data-diode Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 943 KB

Software for sending stuff through a data diode with fountain code error correction

License: GNU General Public License v3.0

Makefile 1.70% C 98.30%
air-gap file-upload fountain-codes syslog unidirectional fec

data-diode's Introduction

data-diode software

If this file is not rendered correctly, read example.txt

Static arp should be set for each side of the data diode.

Place the following line in a crontab script for the root user if you want to upload files from a SRCDIR directory when unchanged for 1 minute:

sendfiles=`find /path/to/SRCDIR -type f  -iname "*.*" -mmin +1 -exec lsattr {} + | grep  -v -- '----i-d---------------' | sed 's/----------------------//g'|sed 's/\.\//\"/g'|sed -z 's/\n/\"\n/g'`; if [ -n "$sendfiles" ]; then echo -n "$sendfiles" | xargs -n1 | xargs -I% chattr +i %; fi; echo -n "$sendfiles" | xargs -n1 | xargs -I% datadiode-send REMOTE_IP PORT % 4 6; if [ -n "$sendfiles" ]; then echo -n "$sendfiles" | xargs -n1 | xargs -d '\n' -I% chattr +d %; fi 

A receiver must be listening on the correct IP and PORT on the other side:

datadiode-recv PORT /path/to/DSTDIR 

For automatic recovery of incoming files use inotify-tools:

inotifywait -F -m /path/to/DSTDIR -e create --include '.*\.finished$' | while read -r directory action file; do datadiode-recovery /path/to/DSTDIR "${file%.finished}" 4; done; 

Another example is for MySQL/MariaDB incremental backup. The tools are mysqlbackup/mariabackup/xtrabackup:

On the sender side: tar -cvzf - xtrabackup/* | split -b 1024M - "DD-part" lastone=`ls DD-part* | tail -n1`
mv "$lastone" "$lastone".EOF

On the receiver side: lastone=ls DD-part*.EOF
mv "$lastone" "${lastone%.EOF}" cat DD-part* > xtrabackup.tgz

If you'd like to use vsftpd instead of sshfs or other tools for uploading files into /path/to/SRCDIR vsftpd is the right choice.

For Syslog via data diode you need to enable UDP server in /etc/rsyslog.conf or inside the included config file /etc/rsyslog.d/remote.conf:

module(load="imudp") input(type="imudp" port="514" Address="127.0.0.1")

on the destination server. This is the syslog input for the concentrator where datadiode-syslog-deamplifier will send data to.

Client syslog daemons should send data into the datadiode-syslog-amplifier:

. @datadiode-amplifier-host-ip:1514

Similar settings for BSD syslog and syslog-ng if they are the choice over rsyslog.

data-diode's People

Contributors

cherubimro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.