Submission server/infrastructure for the SRS challenge at FIC https://fic.srs.epita.fr/
Go to file
2014-11-21 10:24:13 +01:00
db Fix DB schema by adding missing hash algorithms 2014-11-10 18:14:51 +01:00
docs Add themes DTD 2014-11-19 18:30:07 +01:00
htdocs Can revoke/generate server certiticate in admin interface 2014-11-20 18:06:07 +01:00
misc Can revoke/generate server certiticate in admin interface 2014-11-20 18:06:07 +01:00
onyx Optimize exercice numbering 2014-11-20 21:56:37 +01:00
submission Create submission dir 2013-11-05 02:51:43 +01:00
.dockerignore Add .dockerignore 2014-11-19 18:01:04 +01:00
.gitignore Ignore emacs temp files 2014-11-20 12:21:57 +01:00
backup.sh Use bash for Debian compat 2014-11-20 21:03:35 +01:00
check.pl Fix bad query when checking for already solved exercice 2014-11-20 21:02:29 +01:00
clear_cache.sh Use bash for Debian compat 2014-11-20 21:03:35 +01:00
comm-socket.pl Can use comm-socket with argument 2014-01-20 10:58:59 +01:00
config.sh Document some script + centralize script configuration 2014-11-19 18:29:46 +01:00
Dockerfile Make raw copy or hardlink instead of symlink, mainly for container test usage 2014-11-21 10:24:13 +01:00
gen_hash_link_files.sh Make raw copy or hardlink instead of symlink, mainly for container test usage 2014-11-21 10:24:13 +01:00
gen_site.pl Avoid removing root tree directory 2014-11-20 22:55:31 +01:00
gen_site.sh Use bash for Debian compat 2014-11-20 21:03:35 +01:00
launch_local.sh Catch some SIG to kill sons 2014-11-21 10:20:59 +01:00
launch.sh Catch some SIG to kill sons 2014-11-21 10:20:59 +01:00
nginx_gen_team.sh Document some script + centralize script configuration 2014-11-19 18:29:46 +01:00
nginx-server-common.conf Stronger SSL config 2014-11-10 17:21:29 +01:00
nginx-server.conf Change fic2014 to fic 2014-11-05 17:53:41 +01:00
nginx.conf Stronger SSL config 2014-11-10 17:21:29 +01:00
php-fpm.conf Add a Dockerfile for development purpose 2014-08-27 12:26:49 +02:00
README.md Use bash for Debian compat 2014-11-20 21:03:35 +01:00
stop.sh Document some script + centralize script configuration 2014-11-19 18:29:46 +01:00
submission.php Can send solutions on the backend (using the same file as frontend) 2014-11-05 17:44:57 +01:00
synchro.sh Use bash for Debian compat 2014-11-20 21:03:35 +01:00
TODO Updating TODO 2014-11-20 23:08:40 +01:00

FIC forensic challenge validation server

This is a CTF server for distributing and validating exercices. It is design to be robust, so it uses some uncommon technologies like client certificate for authentication, cryptographic functions and DMZ network architecture.

Development And Testing

The easiest way to have a working server is to build a Docker container.

Docker

First, build the container with the following command:

docker build -t fic .

Then, run it with:

docker run -t -i -P fic

It will ask you for a passphrase, you must provide one with at least 4 characters. This key is used to generate the server certificate.

When you see:

root@xxxxxxxxxxxx:/var/www/fic-server/misc#

congratulations, the container is running!

Use docker ps to view to which local ports was assigned the contained webserver.

Production Environnement

Setup

You should compile/install hardened kernel (with latest stable GrSec patch) on each machine.

Prefer GNU/Linux distributions where most packages are compiled with -fPIC and -fstack-protector, like Ubuntu or Gentoo Hardened.

As machines aren't always in safe place (transportation, night before CTF, ...), disks should be encrypted.

Always set strong password when it is possible eg. SSL certificats, ...

Frontend

Keep in mind that this is the machine exposed to participant.

Requirements
  • nginx with those modules: aio (for fast delivery of huge content), fastcgi, rewrite, ssl;
  • php-fpm with mcrypt module (for submission encryption);
Firewall rules

Expose to participants only 80 and 443 ports.

Expose on synchronization interface the 22 port, used for synchronization and administration purpose from backend.

DROP has to be the default rule for INPUT, FORWARD and OUTPUT chains; use CONNTRACK states.

Backend

Requirements
  • realpath;
  • mysql;
  • nginx with fastcgi module;
  • php-fpm with mysql module;
  • openssl and pwgen for client certificat generation;
  • mcrypt;
  • HTTP::Request::Common perl module (provided by libwww-perl);
  • Digest::Whirlpool perl module (provided by lib-digest-whirlpool-perl);
  • Mcrypt from CPAN (cpan -i Mcrypt, on Debian, it requires libltdl-dev and build-essential) to decrypt submissions (see https://metacpan.org/pod/Mcrypt);
Firewall rules

This machine shouldn't have any network connection, except outgoing one to the frontend for synchronization.

Others setups

Indicate in /etc/hosts.conf IP(s) of the frontend.

History

FIC2014

Two machines were used : one for backend (Deimos) and one for frontend (Phobos). They ran a GNU/Linux Gentoo Hardened with custom 3.2 kernel without module loading, unused and unecessary components and with all GrSecurity features activated.

Each machine was two network interfaces: one was used to permit to the backend machine to connect to the frontend (over IPv6). The second interface on the backend was used for administration purpose (with a laptop not connected to Internet). The second interface on the frontend was used to provide network connectivity to participants.

The D Day

TODO