---
title: >-
  Make sure that the dconf databases are up-to-date with regards to respective
  keyfiles
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > OOTB Rules > Make sure that the dconf databases are
  up-to-date with regards to respective keyfiles
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Make sure that the dconf databases are up-to-date with regards to respective keyfiles
 
## Description{% #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

```
dconf update
```

command. More specifically, content present in the following directories:

```
/etc/dconf/db/gdm.d
```

```
/etc/dconf/db/local.d
```

## Rationale{% #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.

## Remediation{% #remediation %}

### Shell script{% #shell-script %}

The following script can be run on the host to remediate the issue.

```bash
#!/bin/bash

# Remediation is applicable only in certain platforms
if rpm --quiet -q gdm && { rpm --quiet -q kernel-core; }; then

dconf update

else
    >&2 echo 'Remediation is not applicable, nothing was done'
fi
```

### Ansible playbook{% #ansible-playbook %}

The following playbook can be run with Ansible to remediate the issue.

```go
- name: Gather the package facts
  package_facts:
    manager: auto
  tags:
  - CCE-81003-6
  - NIST-800-171-03.04.02
  - PCI-DSS-Req-6.2
  - PCI-DSSv4-8.2
  - PCI-DSSv4-8.2.8
  - dconf_db_up_to_date
  - high_severity
  - low_complexity
  - medium_disruption
  - no_reboot_needed
  - unknown_strategy

- name: Make sure that the dconf databases are up-to-date with regards to respective
    keyfiles - Get database modification time for gdm
  ansible.builtin.stat:
    path: /etc/dconf/db/gdm
  register: gdm_db
  when:
  - '"gdm" in ansible_facts.packages'
  - '"kernel-core" in ansible_facts.packages'
  tags:
  - CCE-81003-6
  - NIST-800-171-03.04.02
  - PCI-DSS-Req-6.2
  - PCI-DSSv4-8.2
  - PCI-DSSv4-8.2.8
  - dconf_db_up_to_date
  - high_severity
  - low_complexity
  - medium_disruption
  - no_reboot_needed
  - unknown_strategy

- name: Make sure that the dconf databases are up-to-date with regards to respective
    keyfiles - Get keyfiles for gdm
  ansible.builtin.find:
    paths: /etc/dconf/db/gdm.d/
    recurse: true
  register: gdm_keyfiles
  when:
  - '"gdm" in ansible_facts.packages'
  - '"kernel-core" in ansible_facts.packages'
  tags:
  - CCE-81003-6
  - NIST-800-171-03.04.02
  - PCI-DSS-Req-6.2
  - PCI-DSSv4-8.2
  - PCI-DSSv4-8.2.8
  - dconf_db_up_to_date
  - high_severity
  - low_complexity
  - medium_disruption
  - no_reboot_needed
  - unknown_strategy

- name: Make sure that the dconf databases are up-to-date with regards to respective
    keyfiles - Run dconf update for gdm
  ansible.builtin.command:
    cmd: dconf update
  changed_when: true
  when:
  - '"gdm" in ansible_facts.packages'
  - '"kernel-core" in ansible_facts.packages'
  - not gdm_db.stat.exists or gdm_keyfiles.files | length > 0 and gdm_keyfiles.files
    | map(attribute='mtime') | max > gdm_db.stat.mtime
  tags:
  - CCE-81003-6
  - NIST-800-171-03.04.02
  - PCI-DSS-Req-6.2
  - PCI-DSSv4-8.2
  - PCI-DSSv4-8.2.8
  - dconf_db_up_to_date
  - high_severity
  - low_complexity
  - medium_disruption
  - no_reboot_needed
  - unknown_strategy

- name: Make sure that the dconf databases are up-to-date with regards to respective
    keyfiles - Get database modification time for local
  ansible.builtin.stat:
    path: /etc/dconf/db/local
  register: local_db
  when:
  - '"gdm" in ansible_facts.packages'
  - '"kernel-core" in ansible_facts.packages'
  tags:
  - CCE-81003-6
  - NIST-800-171-03.04.02
  - PCI-DSS-Req-6.2
  - PCI-DSSv4-8.2
  - PCI-DSSv4-8.2.8
  - dconf_db_up_to_date
  - high_severity
  - low_complexity
  - medium_disruption
  - no_reboot_needed
  - unknown_strategy

- name: Make sure that the dconf databases are up-to-date with regards to respective
    keyfiles - Get keyfiles for local
  ansible.builtin.find:
    paths: /etc/dconf/db/local.d/
    recurse: true
  register: local_keyfiles
  when:
  - '"gdm" in ansible_facts.packages'
  - '"kernel-core" in ansible_facts.packages'
  tags:
  - CCE-81003-6
  - NIST-800-171-03.04.02
  - PCI-DSS-Req-6.2
  - PCI-DSSv4-8.2
  - PCI-DSSv4-8.2.8
  - dconf_db_up_to_date
  - high_severity
  - low_complexity
  - medium_disruption
  - no_reboot_needed
  - unknown_strategy

- name: Make sure that the dconf databases are up-to-date with regards to respective
    keyfiles - Run dconf update for local
  ansible.builtin.command:
    cmd: dconf update
  changed_when: true
  when:
  - '"gdm" in ansible_facts.packages'
  - '"kernel-core" in ansible_facts.packages'
  - not local_db.stat.exists or local_keyfiles.files | length > 0 and local_keyfiles.files
    | map(attribute='mtime') | max > local_db.stat.mtime
  tags:
  - CCE-81003-6
  - NIST-800-171-03.04.02
  - PCI-DSS-Req-6.2
  - PCI-DSSv4-8.2
  - PCI-DSSv4-8.2.8
  - dconf_db_up_to_date
  - high_severity
  - low_complexity
  - medium_disruption
  - no_reboot_needed
  - unknown_strategy
```
