documentation_complete: true


title: 'Make sure that the dconf databases are up-to-date with regards to respective keyfiles'

description: |-
    By default, DConf uses a binary database as a data backend.
    The system-level database is compiled from keyfiles in the /etc/dconf/db/
    directory by the <pre>dconf update</pre> command. More specifically, content present
    in the following directories:
    <pre>/etc/dconf/db/{{{dconf_gdm_dir}}}</pre>
    <pre>/etc/dconf/db/local.d</pre>

rationale: |-
    Unlike text-based keyfiles, the binary database is impossible to check by OVAL.
    Therefore, in order to evaluate dconf configuration, both have to be true at the same time -
    configuration files have to be compliant, and the database needs to be more recent than those keyfiles,
    which gives confidence that it reflects them.

severity: high

identifiers:
    cce@rhel8: CCE-81003-6
    cce@rhel9: CCE-87295-2
    cce@rhel10: CCE-86609-5
    cce@sle12: CCE-83182-6
    cce@sle15: CCE-83288-1
    cce@sle16: CCE-96365-2

references:
    cis@sle12: '1.10'
    cis@sle15: '1.10'
    hipaa: 164.308(a)(1)(ii)(B),164.308(a)(5)(ii)(A)
    pcidss: Req-6.2
    srg: SRG-OS-000480-GPOS-00227
    stigid@sle12: SLES-12-010040
    stigid@sle15: SLES-15-010090

ocil_clause: 'The system-wide dconf databases are up-to-date with regards to respective keyfiles'

ocil: |-
    In order to be sure that the databases are up-to-date, run the
    <pre>dconf update</pre>
    command as the administrator.

platform: system_with_kernel

srg_requirement: |-
    {{{ full_name }}} effective dconf policy must match the policy keyfiles.

checktext: |-
    Check the last modification time of the local databases, comparing it to the last modification time of the related keyfiles. The following command will check every dconf database and compare its modification time to the related system keyfiles:

    Note: This requirement assumes the use of the {{{ full_name }}} default graphical user interface, Gnome Shell. If the system does not have any graphical user interface installed, this requirement is Not Applicable.

    $ function dconf_needs_update { for db in $(find /etc/dconf/db -maxdepth 1 -type f); do db_mtime=$(stat -c %Y "$db"); keyfile_mtime=$(stat -c %Y "$db".d/* | sort -n | tail -1); if [ -n "$db_mtime" ] && [ -n "$keyfile_mtime" ] && [ "$db_mtime" -lt "$keyfile_mtime" ]; then echo "$db needs update"; return 1; fi; done; }; dconf_needs_update

    If the command has any output, then a dconf database needs updated and this is a finding.

fixtext: |-
    Update the dconf databases by running the following command:

    $ sudo dconf update
