SEAPATH and cybersecurity
SEAPATH follows the applicable cybersecurity guidelines defined by the ANSSI in the ANSSI-BP-028v2.0 document. Several mechanisms have been considered to guarantee the system security:
System hardening
Disk encryption
Secrets storage and protection
Process isolation
Privileges management policy
Connection encryption
User authentication process
Below are two detailed lists of all recommendations, their current state on SEAPATH Yocto and Debian and a small explanation of the work done or to be done.
Done: SEAPATH complies with this requirement. Tests are run with cukinia to ensure that future development don't break this compliance. (Some recommendations are done, but no tests exist for them. When it is so, it is explicitly written in the table below.)
Not Done: SEAPATH doesn't comply with this requirement. A small description of the work to do is given.
Not applicable: This requirement has no sense to be applied on SEAPATH.
User applicable: This requirement cannot be fulfilled by SEAPATH and must be ensured by the end user/SEAPATH integrator.
Partially done: This requirement is not done in SEAPATH. Either only specific parts of the requirement are done and tested, or the requirement is not properly tested for now.
Yocto Project
A compliance matrix listing all the tests done on SEAPATH and their relation to the recommendations is available at the end of each test report on the CI. You can find weekly test reports here: https://github.com/seapath/ci/tree/reports-PRmain/docs/reports/PR-main
| Subject | Level | Explanations | State |
---|---|---|---|---|
R1 | Choosing and configuring the hardware | MIE | The hardware chosen to run SEAPATH must comply with https://cyber.gouv.fr/publications/recommandations-de-configuration-materielle-de-postes-clients-et-serveurs-x86 | User applicable |
R2 | Configuring the BIOS/UEFI | MI | The BIOS must be configured according to the document https://cyber.gouv.fr/publications/recommandations-de-configuration-materielle-de-postes-clients-et-serveurs-x86 | User applicable |
R3 | Activating the UEFI secure boot | MI | SEAPATH is compatible with Secure Boot and support preload keys. | User applicable |
R4 | Replacing of preloaded keys | MIEH | Yocto provides secure boot functions. It is up to the end user to enable them and provide their keys. | User applicable |
R5 | Configuring a password on the bootloader | MI | Grub password can be configured at build time. | Done |
R6 | Protecting the kernel command line parameters and the initramfs | MIEH | We have made an implementation for the Dunfell version of Yocto. This implementation does not work on the Kirkstone version and should be updated. | Not Done |
R7 | Activating the IOMMU | MIE | TODO: add iommu=force in kernel parameter + add cukinia test | Not Done |
R8 | Configuring the memory options | MI | SEAPATH does not implement every kernel parameters by default because it would degrade performance a lot. However, a test exists to check for any known vulnerability on the hardware that is running SEAPATH. | Partially done |
R9 | Configuring the kernel options | MI | The kernel options are present | Done |
R10 | Disabling kernel modules loading | MIE | Module loading is disabled after boot | Done |
R11 | Configuration option of the Yama LSM | MI | The kernel parameter security=yama is present. | Done |
R12 | IPv4 configuration options | MI | IPV4 must comply to a certain list of sysctl configuration. | Partially done |
R13 | Disabling IPv6 | MI | IPV6 can be disabled with one machine option in meta-seapath. | User applicable |
R14 | File system configuration options | MI | The recommended options are present on SEAPATH. | Done |
R15 | Compile options for memory management | MIEH | We have access to the kernel config. TODO
| Not Done |
R16 | Compile options for kernel data structure | MIEH | We have access to the kernel config.
| Not Done |
R17 | Compile options for the memory allocator | MIEH | We have access to the kernel config.
| Not Done |
R18 | Compile options for the management of kernel modules | MIEH | We have access to the kernel config. | Not Done |
R19 | Compile options for abnormal situations | MIEH | We have access to the kernel config.
| Not Done |
R20 | Compile options for kernel security functions | MIEH | The recommended configs are present. | Done |
R21 | Compile options for the compiler plugins | MIEH | The recommended configs are present. | Done |
R22 | Compile options of the IP stack | MIEH | The CONFIG_SYN_COOKIES option is set, but no test exists for it. TODO | Partially done |
R23 | Compile options for various kernel behaviors | MIEH | The module disable kernel config is not present. We must verify that module loading is indeed mandatory. TODO | Partially done |
R24 | Compile options for 32-bit architectures | MIEH | This recommendation targets 32-bit x86 machines. Currently, SEAPATH is not supported on such hardware. | Not Applicable |
R25 | Compile options for x86_64 bit architectures | MIEH | We have access to the kernel config. | Not Done |
R26 | Compile options for ARM architectures | MIEH | This recommendation targets ARM based processor. Currently, SEAPATH is not supported on such hardware. | Not Applicable |
R27 | Compile options for ARM 64 bit architectures | MIEH | This recommendation targets ARM based processor. Currently, SEAPATH is not supported on such hardware. | Not Applicable |
R28 | Typical partitioning | MI | Not all partitions are correctly separated. On SEAPATH Yocto the rootfs is mounted as read only, so there is some separation and mount which make no sense.
TODO
Add test to check there is no executable on /var. Mount points tests must be added. | Partially done |
R29 | Access restrictions on /boot | MIE | /boot is not mounted by default, but can be with Ansible for certain tasks. | Partially done |
R30 | Removing the unused user accounts | M | There are no unused accounts on SEAPATH | Done |
R31 | User password strength | M | The passwords used on SEAPATH must follow https://www.ssi.gouv.fr/mots-de-passe/ For local user, rules are defined in login.defs and tested inside common_security_tests.d/hardening.conf. TODO Use yescrypt instead of SHA512 for password hash | User applicable |
R32 | Configuring a timeout on local user sessions | MI | The timeout for bash and ssh is set to 300s | Done |
R33 | Ensuring the imputability of administration actions | MI | Only sudo commands are logged. TODO Setup auditd as it is done on SEAPATH Debian | Not Done |
R34 | Disabling the service accounts | MI | No additional accounts can be opened by a service on SEAPATH. | Done |
R35 | Uniqueness and exclusivity of service accounts | MI | Some services are launched by the root user. We must create a user for these services. Services which need to run as root:
TODO Root services to changed are:
| Not Done |
R36 | Changing the default value of UMASK | MIE | UMASK is set to the desired value. | Done |
R37 | Using Mandatory Access Control features | MIE | No MAC feature is implemented on SEAPATH Yocto. | Not Done |
R38 | Creating a group dedicated to the use of sudo | MIE | The group "privileged" is used for sudo usage. | Done |
R39 | Sudo configuration guidelines | MI | All desired options are implemented and tested. | Done |
R40 | Using unprivileged users as target for sudo commands | MI | Old groups and users are still present in the sudoer files. | Not Done |
R41 | Limiting the number of commands requiring the use of the EXEC directive | MIE | Old groups and users are still present in the sudoer files. | Not Done |
R42 | Banishing the negations in sudo policie | MI | Old groups and users are still present in the sudoer files. | Not Done |
R43 | Defining the arguments in sudo specifications | MI | Old groups and users are still present in the sudoer files. | Not Done |
R44 | Editing files securely with sudo | MI | No text editor must be launched with sudo privileges. | User applicable |
R45 | Activating AppArmor security profiles | MIE | AppArmor is not installed on SEAPATH Yocto | Not Done |
R46 | Activating SELinux with the targeted policy | MIEH | SELinux is not installed on SEAPATH Yocto | Not Done |
R47 | Containing the unprivileged interactive users | MIEH | SELinux is not installed on SEAPATH Yocto | Not Done |
R48 | Setting up the SELinux variables | MIEH | SELinux is not installed on SEAPATH Yocto | Not Done |
R49 | Uninstalling SELinux Policy Debugging Tools | MIEH | SELinux is not installed on SEAPATH Yocto | Not Done |
R50 | Limiting the rights to access sensitive files and directories | MI | All sensitive files have the proper permissions. | Done |
R51 | Changing the secrets and access rights as soon as possible | MIE | SEAPATH is meant to be entirely functional once the installation and configuration are completed. | Done |
R52 | Securing access for named sockets and pipes | MI | Some tests exist for the open-vswitch user. | Partially done |
R53 | Avoiding files or directories without a known user or group | M | All files and directories have a known user and group except `/var/spool/mail`. | Not Done |
R54 | Setting the sticky bit on the writable directories | M | The sticky bit is set for all writable directories | Done |
R55 | Dedicating temporary directories to users | MI | The variable TMPDIR must be set and a test must be added for that. | Not Done |
R56 | Avoiding using executables with setuid and setgid rights | M | All executables that have setuid/setgid enabled are owned by root (Refer to R57) | Partially done |
R57 | Avoiding using executables with setuid root and setgid root rights | MIE | We have access to all package builds and configurations. Except for the sudo command, we should replace every binary that uses setuid/setgid either by a capability or by a sudo call. | Not Done |
R58 | Installing only strictly necessary packages | M | All installed packages are listed when building the Yocto distribution. SEAPATH basic images comes with only the necessary packages, the end user can add some if he needs them. | Done |
R59 | Using only official package repositories | M | SEAPATH uses official meta recipes and thus official repositories. | Done |
R60 | Using hardened package repositories | MIE | Yocto doesn’t have hardened package repositories, but we have compiled binaries with hardening options. The hardening compiled flags are tested just after finishing the build if the SEAPATH option SEAPATH_SECCOMPILE_MANIFEST_SKIP is set to 0 (or not set) in seapath.conf. | Not Applicable |
R61 | Updating regularly the system | M | SEAPATH provides an A/B update mechanism with atomic changes and automatic rollback in case of failure. Refer to the Ansible repository for more information. | User applicable |
R62 | Disabling the non-necessary services | M | All installed services are listed when building the Yocto distribution. SEAPATH basic images comes with only the necessary services, the end user can add some if he needs them. | Done |
R63 | Disabling non-essential features of services | MI | All installed services features are listed when building the Yocto distribution. SEAPATH basic images comes with only necessary services features, the end user can add some if he needs them. | Done |
R64 | Configuring the privileges of the services | MIE | Currently, only libvirtd and syslog-ng are configured. | Partially done |
R65 | Partitioning the services | MIE | Many services are already hardened, but not all. | Not Done |
R66 | Hardening the partitioning components | MIEH | This means hardening KVM/QEMU and SystemD. | Partially done |
R67 | Secure remote authentication with PAM | MI | Yocto provides multiple LDAP configurations and packages. It is up to the end user to implement its authentication solution on SEAPATH | User applicable |
R68 | Protecting the stored passwords | M | The password storage must follow https://www.ssi.gouv.fr/mots-de-passe/. TODO We use sha512, but we can change to use yescrypt (not required but recommended) | Done |
R69 | Securing access to remote user databases | MI | Same as R67 | User applicable |
R70 | Separating the system accounts and directory administrator | MI | SEAPATH do not have any directory user, it is the responsibility of the end user to implement this point. | User applicable |
R71 | Implementing a logging system | MIE | SEAPATH uses journald for local logs and syslog-ng for remote logs. | Partially done |
R72 | Implementing dedicated service activity journals | MIE | SEAPATH uses systemd that complies with this requirement. | Done |
R73 | Logging the system activity with auditd | MIE | The previous version of the BP-28 proposed to disabled auditd or configure it. The choice was made to disable it. | Not Done |
R74 | Hardening the local messaging service | MI | SEAPATH doesn’t have any messaging services | Not Applicable |
R75 | Configuring aliases for service accounts | MI | SEAPATH doesn’t have any messaging services | Not Applicable |
R76 | Sealing and checking files integrity | MIEH | We must install intrusion monitoring tools TODO setup dm-verity | Not Done |
R77 | Protecting the sealing database | MIEH | The sealing database is generally protected by intrusion monitoring tools. It is built in if we use dm-verity It can also be monitored by an external TPM | Not Done |
R78 | Partitioning the network services | MIE | It is the goal of SEAPATH to isolate services on virtual machines (or containers). | Not Done |
R79 | Hardening and monitoring the exposed services | MI | Network services are already hardened by systemD. However, this recommendation doesn’t specify a limit to the hardening. | Partially done |
R80 | Minimizing the attack surface of network services | M | Like in R52, some packages necessary for a complete test are not installed (sockstat/ss). | Not Done |
Debian
A compliance matrix listing all the tests done on SEAPATH and their relation to the recommendations is available at the end of each test report on the CI. You can find weekly test reports here: https://github.com/seapath/ci/tree/reports-PRdebian-main/docs/reports/PR-debian-main
| Subject | Level | Explanations | State |
---|---|---|---|---|
R1 | Choosing and configuring the hardware | MIE | The hardware chosen to run SEAPATH must comply with https://cyber.gouv.fr/publications/recommandations-de-configuration-materielle-de-postes-clients-et-serveurs-x86 | User applicable |
R2 | Configuring the BIOS/UEFI | MI | The BIOS must be configured according to the document https://cyber.gouv.fr/publications/recommandations-de-configuration-materielle-de-postes-clients-et-serveurs-x86 | User applicable |
R3 | Activating the UEFI secure boot | MI | SEAPATH is compatible with Secure Boot and support preload keys. | User applicable |
R4 | Replacing of preloaded keys | MIEH | We must replace the preload keys with ours. It implies : | Not Done |
R5 | Configuring a password on the bootloader | MI | Grub password can be configured in ansible inventory. | Done |
R6 | Protecting the kernel command line parameters and the initramfs | MIEH | Currently, neither the kernel nor the initramfs are protected by secure boot. | Not Done |
R7 | Activating the IOMMU | MIE | IOMMU is currenctly activated in pass-through mode. It must be activated in force mode. | Not Done |
R8 | Configuring the memory options | MI | SEAPATH does not activate every kernel parameters by default because it would degrade performance a lot. However a test exists to check for any known vulnerability on the hardware that is running SEAPATH. | Done |
R9 | Configuring the kernel options | MI | The kernel options are present | Done |
R10 | Disabling kernel modules loading | MIE | The goal is to deactivate module loading once all desired modules are loaded. | Not Done |
R11 | Configuration option of the Yama LSM | MI | The kernel parameter security=yama is present. | Done |
R12 | IPv4 configuration options | MI | IPV4 must comply to a certain list of sysctl configuration. | Partially done |
R13 | Disabling IPv6 | MI | IPV6 is not used on SEAPATH. It is disabled in the kernel parameters. | Done |
R14 | File system configuration options | MI | The recommended options are present on SEAPATH. | Done |
R15 | Compile options for memory management | MIEH | We have to recompile our own kernel. This implies: | Not Done |
R16 | Compile options for kernel data structure | MIEH | This recommendation implies recompiling the kernel. The work is the same as R15. | Not Done |
R17 | Compile options for the memory allocator | MIEH | This recommendation implies recompiling the kernel. The work is the same as R15. | Not Done |
R18 | Compile options for the management of kernel modules | MIEH | This recommendation implies recompiling the kernel. The work is the same as R15. | Not Done |
R19 | Compile options for abnormal situations | MIEH | This recommendation implies recompiling the kernel. The work is the same as R15. | Not Done |
R20 | Compile options for kernel security functions | MIEH | The Debian kernel used by SEAPATH is already compiled with these options. | Done |
R21 | Compile options for the compiler plugins | MIEH | This recommendation implies recompiling the kernel. The work is the same as R15. | Not Done |
R22 | Compile options of the IP stack | MIEH | This recommendation implies recompiling the kernel. The work is the same as R15. | Not Done |
R23 | Compile options for various kernel behaviors | MIEH | This recommendation implies recompiling the kernel. The work is the same as R15. | Not Done |
R24 | Compile options for 32 bit architectures | MIEH | This recommendation targets 32 bits x86 machines. Currently, SEAPATH is not supported on such hardware. | Not Applicable |
R25 | Compile options for x86_64 bit architectures | MIEH | This recommendation implies recompiling the kernel. The work is the same as R15. | Not Done |
R26 | Compile options for ARM architectures | MIEH | This recommendation targets ARM based processor. Currently, SEAPATH is not supported on such hardware. | Not Applicable |
R27 | Compile options for ARM 64 bit architectures | MIEH | This recommendation targets ARM based processor. Currently, SEAPATH is not supported on such hardware. | Not Applicable |
R28 | Typical partitioning | MI | Currently, only /boot and / are separated. | Not Done |
R29 | Access restrictions on /boot | MIE | /boot is restricted to root, but is always mounted. | Not Done |
R30 | Removing the unused user accounts | M | There are no unused accounts on SEAPATH | Done |
R31 | User password strength | M | The passwords used on SEAPATH must follow https://www.ssi.gouv.fr/mots-de-passe/ | User applicable |
R32 | Configuring a timeout on local user sessions | MI | The bash timeout is set to 300s. | Done |
R33 | Ensuring the imputability of administration actions | MI | Only sudo commands are logged. | Not Done |
R34 | Disabling the service accounts | MI | No additionnal accounts can be opened by a service on SEAPATH. | Done |
R35 | Uniqueness and exclusivity of service accounts | MI | Some services are lauched by the root user, we must create a user for these services. | Not Done |
R36 | Changing the default value of UMASK | MIE | UMASK is set to the desired value. | Done |
R37 | Using Mandatory Access Control features | MIE | SEAPATH uses Apparmor, the MAC solution of Debian. | Done |
R38 | Creating a group dedicated to the use of sudo | MIE | The group « privileged » is used for sudo usage. | Done |
R39 | Sudo configuration guidelines | MI | All desired options are implemented and tested. | Done |
R40 | Using unprivileged users as target for sudo commands | MI | No command targets root. | Done |
R41 | Limiting the number of commands requiring the use of the EXEC directive | MIE | Commands allowed to run with sudo should not used the EXEC directive.
There is currently no specific policy to handle the ansible user after the initial configuration, but the end user could think about removing or deactivating the user when it is not needed. | Done |
R42 | Banishing the negations in sudo policie | MI | No negation is present in the sudoer files | Done |
R43 | Defining the arguments in sudo specifications | MI | When possible, all commands allowed to run with sudo must define specific arguments.
The remarks are the same for R41. TODO | Done |
R44 | Editing files securely with sudo | MI | No text editor must be launched with sudo privileges. | User applicable |
R45 | Activating AppArmor security profiles | MIE | All AppArmor profiles are present, but no test exists for it. | Done |
R46 | Activating SELinux with the targeted policy | MIEH | Debian uses AppArmor instead of SELinux | Not Applicable |
R47 | Containing the unprivileged interactive users | MIEH | Debian uses AppArmor instead of SELinux | Not Applicable |
R48 | Setting up the SELinux variables | MIEH | Debian uses AppArmor instead of SELinux | Not Applicable |
R49 | Uninstalling SELinux Policy Debugging Tools | MIEH | Debian uses AppArmor instead of SELinux | Not Applicable |
R50 | Limiting the rights to access sensitive files and directories | MI | This principle is followed natively by Debian. | Done |
R51 | Changing the secrets and access rights as soon as possible | MIE | SEAPATH is meant to be entirely functional once the installation and configuration is completed. | Done |
R52 | Securing access for named sockets and pipes | MI | SEAPATH comply with this recommendation, but the test is difficult to write. | Done |
R53 | Avoiding files or directories without a known user or group | M | All files and directory have a known user and group | Done |
R54 | Setting the sticky bit on the writable directories | M | The sticky bit is set for all writable directories | Done |
R55 | Dedicating temporary directories to users | MI | All users and services have a dedicated temporary directory. | Done |
R56 | Avoiding using executables with setuid and setgid rights | M | No executables added by the SEAPATH project have the setuid or setgid rights. This recommendation is not applicable to Debian native executables. | Done |
R57 | Avoiding using executables with setuid root and setgid root rights | MIE | Some executables still have root setuid and setgid. | Not Done |
R58 | Installing only strictly necessary packages | M | A list of necessary packages is described in the testing process. A test verifies that no additionnal packages are installed. | Done |
R59 | Using only official package repositories | M | Only Debian repository are used by default. | Done |
R60 | Using hardened package repositories | MIE | Debian don't use hardened packages repositories | Not Applicable |
R61 | Updating regularly the system | M | SEAPATH provides an update system. On Debian, apt updates are used. | User applicable |
R62 | Disabling the non-necessary services | M | A list of necessary services is described in the testing process. A test verify that no additionnal services are started. | Done |
R63 | Disabling non-essential features of services | MI | We must take the list of services done in R62 and limit the functionnalities of all services to the minimum required. | Not Done |
R64 | Configuring the privileges of the services | MIE | A complete list of the services and their privileges must be established in order to restrict the services that can be and justify why others cannot. | Partially done |
R65 | Partitioning the services | MIE | Many services are already hardened, but not all. | Partially done |
R66 | Hardening the partitioning components | MIEH | This means hardening docker, KVM/QEMU and SystemD. | Not Done |
R67 | Secure remote authentication with PAM | MI | The Kerberos protocol can be installed on SEAPATH during the build of the Debian ISO. | User applicable |
R68 | Protecting the stored passwords | M | The password storage must follow https://www.ssi.gouv.fr/mots-de-passe/. | Done |
R69 | Securing access to remote user databases | MI | Similar to R67, this part must be configured by the end user after selecting the remote login software. | User applicable |
R70 | Separating the system accounts and directory administrator | MI | The selection of the users and their rights is highly dependent of the final use case of SEAPATH. | User applicable |
R71 | Implementing a logging system | MIE | SEAPATH uses journald for local logs and syslog-ng for remote logs. | Partially done |
R72 | Implementing dedicated service activity journals | MIE | SEAPATH uses systemd that complies with this requirement. | Done |
R73 | Logging the system activity with auditd | MIE | Auditd is installed and configured. | Done |
R74 | Hardening the local messaging service | MI | SEAPATH doesn’t have any messaging services | Not Applicable |
R75 | Configuring aliases for service accounts | MI | SEAPATH doesn’t have any messaging services | Not Applicable |
R76 | Sealing and checking files integrity | MIEH | We must install intrusion monitoring tools | Not Done |
R77 | Protecting the sealing database | MIEH | The sealing database is generally protected by intrusion monitoring tools. | Not Done |
R78 | Partitioning the network services | MIE | It is the goal of SEAPATH to isolate services on virtual machines (or containers). | Not Done |
R79 | Hardening and monitoring the exposed services | MI | Network services are already hardened by systemD. However, this recommendation doesn’t specify a limit to the hardening. | Partially done |
R80 | Minimizing the attack surface of network services | M | All network sockets listen on a dedicated interface. | Done |