Skip to main content

checkipaconsistency aka cipa

Formerly known as ipa_check_consistency and check_ipa_consistency

Tool to check consistency across FreeIPA servers

The tool can be used as a standalone consistency checker as well as a Nagios/Opsview plug-in (check Nagios section below for more info).

The script was originally written and then developed in BASH (until version v1.3.0) and eventually ported to Python in v2.0.0.

It has been tested with multiple FreeIPA 4.2+ deployments across a range of operating systems.

Requirements:

If you spot any problems or have any improvement ideas then feel free to open an issue and I will be glad to look into it for you.

Installation

A recommended way of installing the tool is pip install.

Once installed, a command line tool cipa should be available in your system’s PATH.

WARNING: Never attempt pip install as root!

If you do, pip will install new dependencies globally and override existing packages with potentially incompatible versions. This is particularly important when installing ``cipa`` on a machine running FreeIPA server.

You should either install the package as an unprivileged user with ``pip install –user`` or use a virtual environment.

pip install

Please note, in RHEL/CentOS systems you may need to install the following packages:

$ sudo yum install python-devel openldap-devel

The tool is available in PyPI and can be installed using pip:

$ pip install --user checkipaconsistency
$ cipa --help

Manual install

Run the following command to install required Python modules:

$ git clone https://github.com/peterpakos/checkipaconsistency.git
$ cd checkipaconsistency
$ pip install --user -r requirements.txt
$ ./cipa --help

Configuration

By default, the tool reads its configuration from ~/.config/checkipaconsistency file (the location can be overridden by setting environment variable XDG_CONFIG_HOME). If the config file (or directory) does not exist then it will be automatically created and populated with sample config upon the next run. Alternatively, you can specify all required options directly from the command line.

Help

$ cipa --help
usage: cipa [-H [HOSTS [HOSTS ...]]] [-d [DOMAIN]] [-D [BINDDN]] [-W [BINDPW]]
            [--help] [--version] [--debug] [--verbose] [--quiet]
            [-l [LOG_FILE]] [--no-header] [--no-border]
            [-n [{,all,users,susers,pusers,hosts,services,ugroups,hgroups,ngroups,hbac,sudo,zones,certs,conflicts,ghosts,bind,msdcs,replicas}]]
            [-w WARNING] [-c CRITICAL]

Tool to check consistency across FreeIPA servers

optional arguments:
  -H [HOSTS [HOSTS ...]], --hosts [HOSTS [HOSTS ...]]
                        list of IPA servers
  -d [DOMAIN], --domain [DOMAIN]
                        IPA domain
  -D [BINDDN], --binddn [BINDDN]
                        Bind DN (default: cn=Directory Manager)
  -W [BINDPW], --bindpw [BINDPW]
                        Bind password
  --help                show this help message and exit
  --version             show program's version number and exit
  --debug               debugging mode
  --verbose             verbose mode
  --quiet               do not log to console
  -l [LOG_FILE], --log-file [LOG_FILE]
                        log to file (./cipa.log by default)
  --no-header           disable table header
  --no-border           disable table border
  -n [{,all,users,susers,pusers,hosts,services,ugroups,hgroups,ngroups,hbac,sudo,zones,certs,conflicts,ghosts,bind,msdcs,replicas}]
                        Nagios plugin mode
  -w WARNING, --warning WARNING
                        number of failed checks before warning (default: 1)
  -c CRITICAL, --critical CRITICAL

Example

$ cipa -d ipa.example.com -W ********
+--------------------+----------+----------+----------+-----------+----------+----------+-------+
| FreeIPA servers:   | ipa01    | ipa02    | ipa03    | ipa04     | ipa05    | ipa06    | STATE |
+--------------------+----------+----------+----------+-----------+----------+----------+-------+
| Active Users       | 1199     | 1199     | 1199     | 1199      | 1199     | 1199     | OK    |
| Stage Users        | 0        | 0        | 0        | 0         | 0        | 0        | OK    |
| Preserved Users    | 0        | 0        | 0        | 0         | 0        | 0        | OK    |
| Hosts              | 357      | 357      | 357      | 357       | 357      | 357      | OK    |
| Services           | 49       | 49       | 49       | 49        | 49       | 49       | OK    |
| User Groups        | 55       | 55       | 55       | 55        | 55       | 55       | OK    |
| Host Groups        | 29       | 29       | 29       | 29        | 29       | 29       | OK    |
| Netgroups          | 11       | 11       | 11       | 11        | 11       | 11       | OK    |
| HBAC Rules         | 3        | 3        | 3        | 3         | 3        | 3        | OK    |
| SUDO Rules         | 2        | 2        | 2        | 2         | 2        | 2        | OK    |
| DNS Zones          | 114      | 114      | 114      | 114       | 114      | 114      | OK    |
| Certificates       | 0        | 0        | 0        | 0         | 0        | 0        | OK    |
| LDAP Conflicts     | 0        | 0        | 0        | 0         | 0        | 0        | OK    |
| Ghost Replicas     | 0        | 0        | 0        | 0         | 0        | 0        | OK    |
| Anonymous BIND     | ON       | ON       | ON       | ON        | ON       | ON       | OK    |
| Microsoft ADTrust  | False    | False    | False    | False     | False    | False    | OK    |
| Replication Status | ipa03 0  | ipa03 0  | ipa04 0  | ipa03 0   | ipa03 0  | ipa04 0  | OK    |
|                    | ipa04 0  | ipa04 0  | ipa05 0  | ipa01 0   | ipa01 0  |          |       |
|                    | ipa05 0  | ipa05 0  | ipa01 0  | ipa02 0   | ipa02 0  |          |       |
|                    | ipa02 0  | ipa01 0  | ipa02 0  | ipa06 0   |          |          |       |
+--------------------+----------+----------+----------+-----------+----------+----------+-------+

Debug mode

If you experience any problems with the tool, try running it in debug mode:

$ cipa --debug
2017-12-22 20:05:04,494 [main] DEBUG Namespace(binddn=None, bindpw=None, critical=2, debug=True, disable_border=False, disable_header=False, domain=None, hosts=None, log_file=None, nagios_check=None, quiet=False, warning=1)
2017-12-22 20:05:04,494 [main] DEBUG Initialising...
2017-12-22 20:05:04,494 [main] DEBUG Config file not found at /Users/peter/.config/checkipaconsistency
2017-12-22 20:05:04,494 [main] INFO Initial config saved to /Users/peter/.config/checkipaconsistency - PLEASE EDIT IT!
2017-12-22 20:05:04,495 [main] CRITICAL IPA domain not set

For more verbosity use --debug --verbose arguments.

Nagios plug-in mode

The tool can be easily transformed into a Nagios/Opsview check:

$ pip install checkipaconsistency
$ su - nagios
$ vim ~/.config/checkipaconsistency
$ ln -s `which cipa` /usr/local/nagios/libexec/check_ipa_consistency

Perform all checks using default warning/critical thresholds:

$ /usr/local/nagios/libexec/check_ipa_consistency -n all
OK - 15/15 checks passed

Perform specific check with custom alerting thresholds:

$ /usr/local/nagios/libexec/check_ipa_consistency -n users -w 2 -c3
OK - Active Users

LDAP Conflicts

Normally conflicting changes between replicas are resolved automatically (the most recent change takes precedence). However, there are cases where manual intervention is required. If you see LDAP conflicts in the output of this script, you need to find the conflicting entries and decide which of them should be preserved/deleted.

More information on solving common replication conflicts can be found here.

Metadata

Release files for checkipaconsistency 2.7.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for checkipaconsistency 2.7.10
File Size Uploaded Provenance Actions
checkipaconsistency-2.7.10.tar.gz 13.3 kB Without provenance Details for checkipaconsistency-2.7.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for checkipaconsistency 2.7.10
File Interpreter ABI Platform Actions
checkipaconsistency-2.7.10-py2.py3-none-any.whl Python 3, Python 2 none any Details for checkipaconsistency-2.7.10-py2.py3-none-any.whl

Total release size: 37.7 kB

Release files / checkipaconsistency-2.7.10.tar.gz

Download URL checkipaconsistency-2.7.10.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2399fe8ab19183e4cd078e4eb984ed3bb357363602904075f5de94b1b3f960b0
BLAKE2b-256 checksum
How to use checksums
ad0d8b147938b9f8a93e3a2fe41a80e15ec7e88d3847c8b7708200a9551e51d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3

Release files / checkipaconsistency-2.7.10-py2.py3-none-any.whl

Download URL checkipaconsistency-2.7.10-py2.py3-none-any.whl
Size 24.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
3f00427129515a0598e9303612a520707150c782a4982fcbb24837bd86f23045
BLAKE2b-256 checksum
How to use checksums
47ff042e322592f3d72ac0c346dbf2a758c1d2649d0b27ec8d093bb4bfe822b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3

Security for checkipaconsistency 2.7.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page