Commit Graph

1841 Commits

Author SHA1 Message Date
David Kupka
bc6543efae Fix: Use unattended parameter instead of options.unattended
Attribute 'unattended' is not always present in 'options' so function
parameter 'unattended' should be used.

https://fedorahosted.org/freeipa/ticket/5563

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-11 16:34:31 +01:00
David Kupka
da1b119663 installer: Change reverse zones question to better reflect reality.
https://fedorahosted.org/freeipa/ticket/5563

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-11 16:34:31 +01:00
David Kupka
f05bea5a12 ipa-replica-prepare: Add '--auto-reverse' and '--allow-zone-overlap' options
Opiton should be added to ipa-replica-prepare when it was added to
ipa-{server,replica,dns}-install but was forgotten.

https://fedorahosted.org/freeipa/ticket/5563

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-01-11 16:34:31 +01:00
Martin Basti
1d56665fd2 Upgrade: Fix upgrade of NIS Server configuration
Former upgrade file always created the NIS Server container, that caused
the ipa-nis-manage did not set all required NIS maps. Default creation
of container has been removed.

Updating of NIS Server configuration and
NIS maps is done only if the NIS Server container exists.

https://fedorahosted.org/freeipa/ticket/5507

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2016-01-11 09:45:54 +01:00
Martin Babinsky
bef0f4c5c3 prevent crash of CA-less server upgrade due to absent certmonger
ipa-server-upgrade tests whether certmonger service is running before
attempting to upgrade IPA master. This causes the upgrader to always fail when
there is no CA installer and certmonger is not needed, effectively preventing
CA-less IPA master to upgrade succefuly.

This test is now skipped if CA is not enabled.

https://fedorahosted.org/freeipa/ticket/5519

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-01-11 09:08:26 +01:00
Martin Basti
129d97c10b Allow to used mixed case for sysrestore
This commit allows to use mixed case of keys for sysrestore, before this
commit all keys were saved in lowercase what prevents to accesing them.

Original usage of mixed case for sysretore key in opendssecinstance had
to be changed to lowercase to prevent issues on already installed
systems.

https://fedorahosted.org/freeipa/ticket/5574

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-01-08 18:21:26 +01:00
Petr Spacek
3d1a8d3134 Fix DNS zone overlap check to allow ipa-replica-install to work
https://fedorahosted.org/freeipa/ticket/5564

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-01-08 10:14:51 +01:00
Petr Spacek
aab190cc5d Fix --auto-reverse option in --unattended mode.
Now the option correctly adds missing reverse zones even in unattended
mode.

Still, this is not sufficient in all cases because 'automatic empty zones'
created by BIND (as specified in RFC 6303) can shadow the reverse zones
hosted on other servers. This needs to be solved in a separate patch.

https://fedorahosted.org/freeipa/ticket/5559

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-01-08 10:13:23 +01:00
Martin Basti
8f09499ee0 update_uniqueness plugin: fix referenced before assigment error
This error may potentially happen when plugin migration is skipped due
an error. In that case variable 'update' was undefined.

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-01-07 16:36:22 +01:00
Martin Basti
00fd28e026 Enable pylint unnecessary-pass check
Enables check and removes extra pass statement from code.

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
81ff72b9af Enable pylint missing-final-newline check
Enables check and fixes:
ipaserver/install/otpdinstance.py:25: [C0304(missing-final-newline), ]
Final newline missing)

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
fb3eab7ec7 Enable pylint lost exception check
Commit enables check and also fixes:
ipaserver/dcerpc.py:718: [W0150(lost-exception),
DomainValidator.__search_in_dc] return statement in finally block may
swallow exception)

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
e1192ebd97 Remove wildcard imports
Wildcard imports should not be used.

Check for wildcard imports has been enabled in pylint.
Pylint note: options 'wildcard-import' causes too much false positive
results, so instead it I used 'unused-wildcard-import' option which has almost
the same effect.

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Martin Basti
e4075b1fe2 Remove unused imports
This patch removes unused imports, alse pylint has been configured to
check unused imports.

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
David Kupka
8ad39a974f ipa-dns-install: Do not check for zone overlap when DNS installed.
When DNS is already installed somewhere in topology we should not check for
zone overlap because it would always say that we are overlapping our own domain.
ipa-replica-install already does that but ipa-dns-install did not.

https://fedorahosted.org/freeipa/ticket/5564

Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2015-12-22 16:04:14 +01:00
Martin Basti
e622da3e1a Remove unused code in server installer related to KRA
The first instance of KRA system should be allowed to install only by ipa-kra-install. This commit removes TODO and unneeded parts in code.

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-12-22 14:05:55 +01:00
David Kupka
f0703d3c2a installer: Fix logic of reading option values from cache.
Only options explicitly set must be stored before installer exits first step
of external CA setup. When installer continues all stored option values must
be restored.

https://fedorahosted.org/freeipa/ticket/5556

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-21 18:37:32 +01:00
David Kupka
30fbc7e948 installer: Propagate option values from components instead of copying them.
https://fedorahosted.org/freeipa/ticket/5556

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-21 18:37:32 +01:00
Martin Babinsky
66de9a6c9b harden domain level 1 topology connectivity checks
this patch makes the check_last_link_managed() function more resistant to both
orphaned topology suffixes and also to cases when there are IPA masters do not
seem to manage any suffix. The function will now only complain loudly about
these cases and not cause crashes.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-12-21 12:12:04 +01:00
Petr Spacek
58331208a5 dns: Handle SERVFAIL in check if domain already exists.
In cases where domain is already delegated to IPA prior installation
we might get timeout or SERVFAIL. The answer depends on the recursive
server we are using for the check.

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-12-16 15:25:53 +01:00
David Kupka
1534061d9b dns: Add --auto-reverse option.
Introducing '--auto-reverse' option. When specified reverse records for
all server's IP addresses are checked and when record nor reverse zone
does not exist reverse zone is created.

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-12-14 18:53:53 +01:00
David Kupka
8d19da49c4 dns: Check if domain already exists.
Raise an error when the domain already exists. This can be overriden using
--force or --allow-zone-overlap options.

https://fedorahosted.org/freeipa/ticket/3681

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-12-14 18:53:53 +01:00
Jan Cholasta
110e3dfc54 replica promotion: let ipa-client-install validate enrollment options
ipa-client-install output is redirected to standard output, so let it print
its own error message for missing options.

https://fedorahosted.org/freeipa/ticket/5542

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-14 15:38:32 +01:00
Martin Basti
4272ba40ea Explicitly call chmod on newly created directories
Without calling os.chmod(), umask is effective and may cause that
directory is created with permission that causes failure.

This can be related to https://fedorahosted.org/freeipa/ticket/5520

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-14 14:57:26 +01:00
Martin Basti
5e2cd38ab9 DNS: fix file permissions
With non default umask named-pkcs11 cannot access the softhsm token storage

https://fedorahosted.org/freeipa/ticket/5520

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-14 14:57:26 +01:00
Jan Cholasta
c856401478 server install: redirect ipa-client-install output to standard output
https://fedorahosted.org/freeipa/ticket/5527

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-14 14:46:45 +01:00
Fraser Tweedale
38861428e7 dogtaginstance: remove unused function 'check_inst'
Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-14 14:32:36 +01:00
Jan Cholasta
d68613194b replica promotion: notify user about ignoring client enrollment options
When IPA client is already installed, notify the user that the enrollment
options are ignored in ipa-replica-install.

https://fedorahosted.org/freeipa/ticket/5530

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-14 14:23:37 +01:00
Martin Basti
bf9a34f4cf Install RA cert during replica promotion
This cert is needed with KRA to be able store and retrieve secrets.

https://fedorahosted.org/freeipa/ticket/5512

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-12-14 11:48:40 +01:00
Petr Viktorin
099cf98307 Refactor ipautil.run
The ipautil.run function now returns an object with returncode and
output are accessible as attributes.

The stdout and stderr of all commands are logged (unless skip_output is given).

The stdout/stderr contents must be explicitly requested with a keyword
argument, otherwise they are None.
This is because in Python 3, the output needs to be decoded, and that can
fail if it's not decodable (human-readable) text.

The raw (bytes) output is always available from the result object,
as is "leniently" decoded output suitable for logging.

All calls are changed to reflect this.

A use of Popen in cainstance is changed to ipautil.run.

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-14 10:54:23 +01:00
Martin Babinsky
4cc206b0f8 prevent crashes of server uninstall check caused by failed LDAP connections
https://fedorahosted.org/freeipa/ticket/5409

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-12-11 19:22:31 +01:00
Gabe
5c9b9089b7 Migrate wget references and usage to curl
https://fedorahosted.org/freeipa/ticket/5458

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-12-11 18:46:10 +01:00
Jan Cholasta
14a44ea47b replica promotion: use host credentials for connection check
https://fedorahosted.org/freeipa/ticket/5497

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-11 18:44:13 +01:00
Jan Cholasta
8d7f67e08c replica install: add remote connection check over API
Add server_conncheck command which calls ipa-replica-conncheck --replica
over oddjob.

https://fedorahosted.org/freeipa/ticket/5497

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-11 18:44:13 +01:00
Gabe
12e7f71600 ipa-replica-install prints incorrect error message when replica is already installed
https://fedorahosted.org/freeipa/ticket/5022
https://fedorahosted.org/freeipa/ticket/5320

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-11 18:24:42 +01:00
Tomas Babej
90f7fa074a replicainstall: Make sure the enrollment state is preserved
During the promote_check phase, the subsequent checks after the machine
is enrolled may cause the installation to abort, hence leaving it
enrolled even though it might not have been prior to the execution of
the ipa-replica-install command.

Make sure that ipa-client-install --uninstall is called on the machine
that has not been enrolled before in case of failure during the
promote_check phase.

https://fedorahosted.org/freeipa/ticket/5529

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-12-11 18:07:20 +01:00
Tomas Babej
c3c8651ac1 replicainstall: Add check for domain if server is specified
Avoids failing in the later stages during the ipa-client-install
command.

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2015-12-11 17:21:14 +01:00
Jan Cholasta
ccb2f52313 server uninstall: ignore --ignore-topology-disconnect in domain level 0
Topology disconnect is always ignored in domain level 0, so the option can
be safely ignored.

https://fedorahosted.org/freeipa/ticket/5409

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-12-11 07:18:44 +01:00
Jan Cholasta
b4a78db4e7 replica promotion: check domain level before ipaservers membership
Check domain level before checking ipaservers membership to prevent
"not found" error when attempting replica promotion in domain level 0.

https://fedorahosted.org/freeipa/ticket/5401

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-12-11 07:11:46 +01:00
Jan Cholasta
8f36a5bd68 replica install: add ipaservers if it does not exist
This prevents crash when adding the host entry to ipaservers when
installing replica of a 4.2 or older server.

https://fedorahosted.org/freeipa/ticket/3416

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-12-11 07:11:46 +01:00
David Kupka
b7953cda4f replica: Fix ipa-replica-install with replica file (domain level 0).
Attribute _ca_enabled is set in promote_check() and is not available in
install(). When installing replica in domain level 0 we can determine existence
of CA service based on existence of cacert.p12 file in provided replica-file.

https://fedorahosted.org/freeipa/ticket/5531

Reviewed-By: Oleg Fayans <ofayans@redhat.com>
2015-12-10 07:49:53 +01:00
Jan Cholasta
faf6085564 replica promotion: allow OTP bulk client enrollment
https://fedorahosted.org/freeipa/ticket/5498

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-12-09 10:16:32 +01:00
Martin Basti
cac756b87d Force creation of services during replica install
Missing A record should not prevent replica to be installed.

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-12-07 19:12:24 +01:00
Tomas Babej
dcb6626e87 replicainstall: Admin password should not conflict with replica file
The --admin-password (-w) has its use both in domain level 0 and 1.

https://fedorahosted.org/freeipa/ticket/5517

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-12-07 14:34:11 +01:00
Jan Cholasta
42544484dc replica promotion: automatically add the local host to ipaservers
If the user is authorized to modify members of the ipaservers host group,
add the local host to ipaservers automatically.

https://fedorahosted.org/freeipa/ticket/5401

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Simo Sorce <ssorce@redhat.com>
2015-12-07 08:14:13 +01:00
Jan Cholasta
c2af409517 replica promotion: use host credentials when setting up replication
Use the local host credentials rather than the user credentials when
setting up replication. The host must be a member of the ipaservers host
group. The user credentials are still required for connection check.

https://fedorahosted.org/freeipa/ticket/5401

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Simo Sorce <ssorce@redhat.com>
2015-12-07 08:14:13 +01:00
Jan Cholasta
7b9a97383c aci: replace per-server ACIs with ipaserver-based ACIs
https://fedorahosted.org/freeipa/ticket/3416

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Simo Sorce <ssorce@redhat.com>
2015-12-07 08:13:23 +01:00
Jan Cholasta
a8d7ce5cf1 aci: add IPA servers host group 'ipaservers'
https://fedorahosted.org/freeipa/ticket/3416

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Simo Sorce <ssorce@redhat.com>
2015-12-07 08:13:23 +01:00
Martin Babinsky
a497288b3e replica install: improvements in the handling of CA-related IPA config entries
When a CA-less replica is installed, its IPA config file should be updated so
that ca_host points to nearest CA master and all certificate requests are
forwarded to it. A subsequent installation of CA subsystem on the replica
should clear this entry from the config so that all certificate requests are
handled by freshly installed local CA.

https://fedorahosted.org/freeipa/ticket/5506

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-12-04 19:37:37 +01:00
David Kupka
2f51f0dce2 ipa-replica-install support caless install with promotion.
https://fedorahosted.org/freeipa/ticket/5441

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-03 09:32:39 +01:00
Martin Basti
bbbe411f35 Modify error message to install first instance of KRA
First instance of KRA should be installed by ipa-kra-install.

https://fedorahosted.org/freeipa/ticket/5460

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-12-02 17:21:32 +01:00
Martin Basti
efeb7d54ba ipa-kra-install: allow to install first KRA on replica
https://fedorahosted.org/freeipa/ticket/5460

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-12-02 17:20:19 +01:00
Martin Babinsky
b8c619a713 implement domain level 1 specific topology checks into IPA server uninstaller
When uninstalling domain level 1 master its removal from topology is checked
on remote masters. The uninstaller also checks whether the uninstallation
disconnects the topology and if yes aborts the procedure. The
'--ignore-disconnected-topology' options skips this check.

https://fedorahosted.org/freeipa/ticket/5377
https://fedorahosted.org/freeipa/ticket/5409

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-12-02 14:10:19 +01:00
Martin Babinsky
8d4b14e0ce extract domain level 1 topology-checking code from ipa-replica-manage
This facilitates reusability of this code in other components, e.g. IPA server
uninstallers.

https://fedorahosted.org/freeipa/ticket/5409

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-12-02 14:10:19 +01:00
Tomas Babej
034e76062f replicainstall: Add possiblity to install client in one command
https://fedorahosted.org/freeipa/ticket/5310

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-01 16:33:13 +01:00
Petr Spacek
8f5f0d6edd Remove global variable dns_forwarders from ipaserver.install.dns
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-01 10:19:25 +01:00
Petr Spacek
45d9d4e8ae ipa-dns-install offer IP addresses from resolv.conf as default forwarders
In non-interactive more option --auto-forwarders can be used to do the
same. --forward option can be used to supply additional IP addresses.

https://fedorahosted.org/freeipa/ticket/5438

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-01 10:19:25 +01:00
Martin Babinsky
f6240f21fc perform IPA client uninstallation as a last step of server uninstall
With the ability to promote replicas from an enrolled client the
uninstallation procedure has to be changed slightly. If the client-side
components are not removed last during replica uninstallation, we can end up
with leftover ipa default.conf preventing future client re-enrollment.

https://fedorahosted.org/freeipa/ticket/5410

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-01 09:39:19 +01:00
Martin Basti
2a1a3c498a Upgrade: increase time limit for upgrades
Default ldap search limit is now 30 sec by default during upgrade.

Limits must be changed for the whole ldap2 connection, because this
connection is used inside update plugins and commands called from
upgrade.

Together with increasing the time limit, also size limit should be
unlimited during upgrade. With sizelimit=None we may get the
TimeExceeded exception from getting default value of the sizelimit from LDAP.

https://fedorahosted.org/freeipa/ticket/5267

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-01 08:51:44 +01:00
Petr Vobornik
7b976c664d use starttls in CSReplicationManager connection again
commit 2606f5aecd

has:
-            realm, hostname, dirman_passwd, port, starttls=True)
+            realm, hostname, dirman_passwd, port)

In CSReplicationManager

which causes, e.g.:

ipa-csreplica-manage -p Secret123 list ipa.example.com
cannot connect to 'ldaps://ipa.example.com:389': TLS error -5938:Encountered end of file

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-11-30 12:26:51 +01:00
Tomas Babej
79f32a6dc4 custodia: Make sure container is created with first custodia replica
If a first 4.3+ replica is installed in the domain, the custodia
container does not exist. Make sure it is created to avoid failures
during key generation.

https://fedorahosted.org/freeipa/ticket/5474

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-11-30 11:54:44 +01:00
Martin Basti
ab8cba61c0 ipa-kra-install: error when replica file is passed with domain level > 0
installing kra on promoted replica (domain level > 0) does not require
replica file.

https://fedorahosted.org/freeipa/ticket/5455

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-27 16:14:06 +01:00
Martin Basti
dcaf57271c KRA install: show installation message only if install really started
Message that installation started/failed was shown even when
install_check fail (installation itself did not start).
This commit show messages only if installation started.

Enhacement for https://fedorahosted.org/freeipa/ticket/5455

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-27 16:14:06 +01:00
Martin Babinsky
7978c21473 replica promotion: modify default.conf even if DS configuration fails
When we promote an IPA client to replica, we need to write master-like
default.conf once we start configuring directory server instance. This way
even if DS configuration fails for some reason the server uninstall code can
work properly and clean up partially configured replica.

https://fedorahosted.org/freeipa/ticket/5417

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2015-11-27 10:32:04 +01:00
Martin Babinsky
b543c9a137 fix a typo in replica DS creation code
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-11-26 11:05:22 +01:00
Martin Basti
5d9a5997a1 KRA: do not stop certmonger during standalone uninstall
https://fedorahosted.org/freeipa/ticket/5477

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-11-26 11:00:54 +01:00
Martin Basti
801672cc66 Remove invalid error messages from topology upgrade
Return False does not mean that update failed, it mean that nothing has
been updated, respectively ldap is up to date.

https://fedorahosted.org/freeipa/ticket/5482

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-11-25 13:58:05 +01:00
Jan Cholasta
aeffe2da42 install: drop support for Dogtag 9
Dogtag 9 CA and CA DS install and uninstall code was removed. Existing
Dogtag 9 CA and CA DS instances are disabled on upgrade.

Creating a replica of a Dogtag 9 IPA master is still supported.

https://fedorahosted.org/freeipa/ticket/5197

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-11-25 09:12:25 +01:00
Martin Basti
5427e7a8c7 Install: Force service add during replica promotion
Replica does not need to have A/AAAA records during install, so we
cannot enforce it and service must be added with --force option.

https://fedorahosted.org/freeipa/ticket/5420

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-11-24 18:37:15 +01:00
Martin Babinsky
ed830af693 do not disconnect when using existing connection to check default CA ACLs
https://fedorahosted.org/freeipa/ticket/5459

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-24 17:37:57 +01:00
Martin Babinsky
341406d165 disconnect ldap2 backend after adding default CA ACL profiles
ensure_default_caacl() was leaking open api.Backend.ldap2 connection which
could crash server/replica installation at later stages. This patch ensures
that after checking default CA ACL profiles the backend is disconnected.

https://fedorahosted.org/freeipa/ticket/5459

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-11-24 15:37:06 +01:00
Fraser Tweedale
620036d26e Add profiles and default CA ACL on migration
Profiles and the default CA ACL were not being added during replica
install from pre-4.2 servers.  Update ipa-replica-install to add
these if they are missing.

Also update the caacl plugin to prevent deletion of the default CA
ACL and instruct the administrator to disable it instead.

To ensure that the cainstance installation can add profiles, supply
the RA certificate as part of the instance configuration.
Certmonger renewal setup is avoided at this point because the NSSDB
gets reinitialised later in installation procedure.

Also move the addition of the default CA ACL from dsinstance
installation to cainstance installation.

Fixes: https://fedorahosted.org/freeipa/ticket/5459
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-24 10:12:24 +01:00
David Kupka
2ef1eb0ae7 ipa-otptoken-import: Fix connection to ldap.
https://fedorahosted.org/freeipa/ticket/5475

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-23 15:50:16 +01:00
David Kupka
5f2cfb5aa2 ipa-cacert-renew: Fix connection to ldap.
https://fedorahosted.org/freeipa/ticket/5468

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-23 15:50:16 +01:00
Gabe
84e479edaa Check if IPA is configured before attempting a winsync migration
https://fedorahosted.org/freeipa/ticket/5470

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-11-23 13:47:36 +01:00
Fraser Tweedale
5136cd6e4b Avoid race condition caused by profile delete and recreate
When importing IPA-managed certificate profiles into Dogtag,
profiles with the same name (usually caIPAserviceCert) are removed,
then immediately recreated with the new profile data.  This causes a
race condition - Dogtag's LDAPProfileSystem profileChangeMonitor
thread could observe and process the deletion after the profile was
recreated, disappearing it again.

Update the profile instead of deleting and recreating it to avoid
this race condition.

Fixes: https://fedorahosted.org/freeipa/ticket/5269
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-23 11:05:49 +01:00
Martin Basti
7f0d018c66 fix caching in get_ipa_config
Different opbject types were compared thus always result of comparation
was False and caching does not work.

https://fedorahosted.org/freeipa/ticket/5463

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-19 16:43:52 +01:00
Martin Babinsky
4d59a711af suppress errors arising from adding existing LDAP entries during KRA install
https://fedorahosted.org/freeipa/ticket/5346

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-19 15:04:12 +01:00
Jan Cholasta
f3076c6ab3 cert renewal: make renewal of ipaCert atomic
This prevents errors when renewing other certificates during the renewal of
ipaCert.

https://fedorahosted.org/freeipa/ticket/5436

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-11-19 13:06:12 +01:00
Jan Cholasta
164fb7b1d1 install: export KRA agent PEM file in ipa-kra-install
https://fedorahosted.org/freeipa/ticket/5462

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-11-19 11:17:49 +01:00
Martin Basti
19044e87ac Drop configure.jar
Configure.jar used to be used with firefox version < 10 which is not
supported anymore, thus this can be removed.

https://fedorahosted.org/freeipa/ticket/5144

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2015-11-13 14:02:45 +01:00
Martin Babinsky
d66492c15e remove an unneccesary check from IPA server uninstaller
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-11-12 09:48:48 +01:00
Martin Babinsky
117bf5af8c remove Kerberos authenticators when installing/uninstalling service instance
each service possessing Kerberos keytab/ccache will now perform their removal
before service principal creation and during service uninstall

https://fedorahosted.org/freeipa/ticket/5243

Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Simo Sorce <ssorce@redhat.com>
2015-11-11 15:39:42 +01:00
Petr Spacek
0043065598 Remove unused constant NEW_MASTER_MARK from ipaserver.install.dns
Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-11-11 14:58:14 +01:00
Petr Spacek
bca9371d8e Remove dead code in ipaserver/install/installutils: read_ip_address()
Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-11-10 16:54:33 +01:00
Tomas Babej
767b8de012 adtrustinstance: Do not use bare except clauses
https://fedorahosted.org/freeipa/ticket/5134

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-11-10 16:52:56 +01:00
Tomas Babej
fa3ed16760 adtrustinstance: Restart samba service at the end of adtrust-install
Errors related to establishing trust can occur if samba service is not
restarted after ipa-adtrust-install has been run. Restart the service at
the end of the installer to avoid such issues.

https://fedorahosted.org/freeipa/ticket/5134

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-11-10 16:52:56 +01:00
Tomas Babej
afd253b349 adtrustinstance: Wait for sidgen task completion
As part of hardening of adtrust installer, we should wait until
the sidgen task is completed before continuing, as it can take
considerable amount of time for a larger deployment.

https://fedorahosted.org/freeipa/ticket/5134

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-11-10 16:52:56 +01:00
Martin Basti
a8c3d6fbb7 Upgrade: enable custodia service during upgrade
There was missing step in upgrade that enables the service in LDAP

https://fedorahosted.org/freeipa/ticket/5429

Reviewed-By: Gabe Alford <redhatrises@gmail.com>
2015-11-10 10:41:23 +01:00
Martin Babinsky
4d94367006 ipa-replica-prepare: domain level check improvements
ipa-replica-prepare command is disabled in non-zero domain-level. Instead of
raising and exception with the whole message instructing the user to promote
replicas from enrolled clients in level 1+ topologies, the exception itself
contains only a brief informative message and the rest is logged at error
level.

https://fedorahosted.org/freeipa/ticket/5175

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2015-11-05 17:50:17 +01:00
Timo Aaltonen
43654c973c ipaplatform: Add NTPD_OPTS_VAR and NTPD_OPTS_QUOTE to constants
https://fedorahosted.org/freeipa/ticket/5343

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-11-04 13:12:12 +01:00
Timo Aaltonen
d269e25bfb httpinstance: Use full path via HTTPD_IPA_REWRITE_CONF for Include.
https://fedorahosted.org/freeipa/ticket/5343

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-11-04 13:12:12 +01:00
Timo Aaltonen
489c24837c ipaplatform: Add NAMED_USER to constants
https://fedorahosted.org/freeipa/ticket/5343

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-11-04 13:12:12 +01:00
Timo Aaltonen
874b6d9f28 ipaplatform: Add HTTPD_USER to constants, and use it.
https://fedorahosted.org/freeipa/ticket/5343

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-11-04 13:12:12 +01:00
Martin Basti
0d66026d22 DNSSEC: remove sysrestore state after uninstall
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-11-03 16:25:01 +01:00
Martin Basti
58c92227c5 Fix typo in ods-exporter uninstall to restore state
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-11-03 16:25:01 +01:00
Petr Spacek
6f855dcc5c DNSSEC: improve log messages in uninstaller
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-30 13:45:36 +01:00
Petr Spacek
d7f0d633d9 DNSSEC: on uninstall, do not restore OpenDNSSEC kasp.db if backup failed
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-30 13:45:36 +01:00
Martin Basti
4ec8df2739 KRA: fix check that CA is installed
https://fedorahosted.org/freeipa/ticket/5345

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-10-29 14:26:26 +01:00
Simo Sorce
53294aa7a7 Check early if a CA is already installed locally
There is no reason to proceed if a CA is already installed, and the
check does not involve a lot of setup, so do it early on.

Ticket: https://fedorahosted.org/freeipa/ticket/5397

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-27 17:42:30 +01:00
Martin Basti
beb6a3236d Domain levels: use constants rather than hardcoded values
Added constants for domain levels
DOMAIN_LEVEL_0 = 0
DOMAIN_LEVEL_1 = 1

This allows to search for domain level easier in code.

Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-10-27 10:29:41 +01:00
Martin Basti
1195278f6b Remove executable bit from ipa_kra_install.py
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2015-10-26 18:08:27 +01:00
Martin Babinsky
c43dce3a61 always ask the resolver for the reverse zone when manipulating PTR records
Instead of searching for all zones to identify the correct reverse zone, we
will first ask the resolver to return the name of zone that should contain the
desired record and then see if IPA manages this zone.

This patch also removes a duplicate function in bindinstance.py that is not
used anywhere.

https://fedorahosted.org/freeipa/ticket/5200

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-10-22 18:36:17 +02:00
Petr Viktorin
6417931a9f Fix left-over Python 3 syntax errors
Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-10-22 18:34:46 +02:00
Petr Viktorin
8a2b65a357 Fix more bytes/unicode issues
Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-10-22 18:34:46 +02:00
Petr Viktorin
eab334dde8 Handle binascii.Error from base64.b64decode()
In Python 3, the base64.b64decode function raises binascii.Error (a ValueError
subclass) when it finds incorrect padding. In Python 2 it raises TypeError.

Callers should usually handle ValueError; unless they are specifically
concerned with handling base64 padding issues).

In some cases, callers should handle ValueError:
- ipalib.pkcs10 (get_friendlyname, load_certificate_request): callers should
  handle ValueError
- ipalib.x509 (load_certificate*, get_*): callers should handle ValueError

In other cases ValueError is handled:
- ipalib.parameters
- ipapython.ssh
- ipalib.rpc (json_decode_binary - callers already expect ValueError)
- ipaserver.install.ldapupdate

Elsewhere no error handling is done, because values come from trusted
sources, or are pre-validated:
- vault plugin
- ipaserver.install.cainstance
- ipaserver.install.certs
- ipaserver.install.ipa_otptoken_import

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-10-22 18:34:46 +02:00
Martin Basti
92a4b18fc2 DNSSEC: warn user if DNSSEC key master is not installed
Warning user that DNSSEC key master is not installed when commands
dnszone-add, dnszone-mod, dnszone-show when option dnssec=true

https://fedorahosted.org/freeipa/ticket/5290

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-10-22 18:29:44 +02:00
Martin Basti
179d86b5f6 DNSSEC: Remove service containers from LDAP after uninstalling
The service containers are no needed there after uninstall anymore.
Removing these service also allows to detect if DNSSEC master is
installed on any replica for any user.

https://fedorahosted.org/freeipa/ticket/5290

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-10-22 18:29:44 +02:00
Martin Basti
2b01f71bef DNSSEC: store status of services only before first install
DNS installer allows to reinstall DNS and DNSSEC, so the status of
services should be stored only for first time.

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-10-22 18:26:59 +02:00
Simo Sorce
bc39cc9f81 Allow to install the KRA on a promoted server
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-10-22 17:53:14 +02:00
Gabe
a0b8415236 Warn if no installation found when running ipa-server-install --uninstall
https://fedorahosted.org/freeipa/ticket/5341

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-22 14:00:49 +02:00
Simo Sorce
958996b9cc Allow ipa-ca-install to use the new promotion code
This makes it possible to install a CA after-the-fact on a server
that has been promoted (and has no replica file available).

https://fedorahosted.org/freeipa/ticket/2888

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-10-22 13:40:04 +02:00
Martin Babinsky
d81260ef60 disable ipa-replica-prepare in non-zero IPA domain level
the original replica installation path (ipa-replica-prepare +
ipa-replica-install) remains valid only when IPA domain level is zero. When
this is not the case, ipa-replica-prepare will print out an error message which
instructs the user to use the new replica promotion machinery to setup
replicas.

https://fedorahosted.org/freeipa/ticket/5175

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-20 18:23:22 +02:00
Martin Babinsky
98bf90e4ce fix dsinstance.py:get_domain_level function
This patch cleans up an unused parameter and fixes the return value when
'ipaDomainLevel' is found: instead of a dict we should return an integer.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-20 17:34:33 +02:00
Martin Basti
f4c8c93e70 Rename option --dirsrv-config-mods to --dirsrv-config-file
Option is renamed to be consistent with other options.

Affected tickets:
    https://fedorahosted.org/freeipa/ticket/4949
    https://fedorahosted.org/freeipa/ticket/4048
    https://fedorahosted.org/freeipa/ticket/1930

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-10-19 14:18:23 +02:00
Martin Basti
ae23432ef5 Add option to specify LDIF file that contains DS configuration changes
This allows to user modify configuration changes of the directory server
instance during installation of DS

https://fedorahosted.org/freeipa/ticket/4949

Also fixes:
https://fedorahosted.org/freeipa/ticket/4048
https://fedorahosted.org/freeipa/ticket/1930

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-10-15 18:37:52 +02:00
Martin Basti
65c89cc711 Add method to read changes from LDIF
modifications_from_ldif will read LDIF file and changes in LDIF will
be cached until parse() is called. After calling parse() method changes
will be applied into destination LDIF.

Only changetype modify is supported, the default operation is add.

https://fedorahosted.org/freeipa/ticket/4949

Also fixes:
https://fedorahosted.org/freeipa/ticket/4048
https://fedorahosted.org/freeipa/ticket/1930

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-10-15 18:37:52 +02:00
Martin Basti
63638ac9a3 Make offline LDIF modify more robust
* move code to installutils
* add replace_value method
* use lists instead of single values for add_value, remove_value methods

https://fedorahosted.org/freeipa/ticket/4949

Also fixes:
https://fedorahosted.org/freeipa/ticket/4048
https://fedorahosted.org/freeipa/ticket/1930

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-10-15 18:37:52 +02:00
Simo Sorce
9e007edbd9 Remove unused kra option
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-10-15 14:26:15 +02:00
Simo Sorce
6a0087aea1 Add low level helper to get domain level
This can be used only locally on an existing master (uses ldapi).
Useful to check the domain_level in scripts before the api is
initialized and/or credentials are available.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-10-15 14:24:33 +02:00
Simo Sorce
42e859daa7 Make checks for existing credentials reusable
move the in installutils so they can be reused by multiple scripts

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-10-15 14:24:33 +02:00
Simo Sorce
2606f5aecd Allow to setup the CA when promoting a replica
This patch makes --setup-ca work to set upa clone CA while creating
a new replica. The standalone ipa-ca-install script is not converted
yet though.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-10-15 14:24:33 +02:00
Ludwig Krispenz
fcb9854dcb handle multiple managed suffixes
trigger topology updaet if suffix entry is added
    trigger topology update if managedSuffix is modified in host entry

Reviewed-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-10-15 14:24:33 +02:00
Petr Vobornik
834b5fd513 enable topology plugin on upgrade
Reviewed-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-10-15 14:24:33 +02:00
Petr Vobornik
fff31ca220 topology: manage ca replication agreements
Configure IPA so that topology plugin will manage also CA replication
agreements.

upgrades if CA is congigured:
- ipaca suffix is added to cn=topology,cn=ipa,cn=etc,$SUFFIX
- ipaReplTopoManagedSuffix: o=ipaca is added to master entry
- binddngroup is added to o=ipaca replica entry

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-10-15 14:24:33 +02:00
Simo Sorce
86240938b5 Add function to extract CA certs for install
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-10-15 14:24:33 +02:00
Simo Sorce
5761f73e25 Allow ipa-replica-conncheck to use default creds
If the user has already run kinit try to use those credentials.
The user can always override by explicitly passing the -p flag.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-10-15 14:24:33 +02:00
Simo Sorce
f7d1e4f9a2 Change DNS installer code to use passed in api
Fixes a number of places where api was not passed around internally.
Also allows to install dns in replica promotion which requires an
alternative api to be created with the right configuration.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-10-15 14:24:33 +02:00
Simo Sorce
d03619fff3 Implement replica promotion functionality
This patch implements a new flag --promote for the ipa-replica-install command
that allows an administrative user to 'promote' an already joined client to
become a full ipa server.

The only credentials used are that of an administrator. This code relies on
ipa-custodia being available on the peer master as well as a number of other
patches to allow a computer account to request certificates for its services.

Therefore this feature is marked to work only with domain level 1 and above
servers.

Ticket: https://fedorahosted.org/freeipa/ticket/2888

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-10-15 14:24:33 +02:00
Simo Sorce
463dda3067 Add ipa-custodia service
Add a customized Custodia daemon and enable it after installation.
Generates server keys and loads them in LDAP autonomously on install
or update.
Provides client code classes too.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-10-15 14:24:33 +02:00
Petr Spacek
644bb4fd9d ipa-adtrust-install: Print complete SRV records
https://fedorahosted.org/freeipa/ticket/5358

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-10-14 12:42:25 +02:00
Gabe
d0bdc37679 Remove bind configuration detected question
https://fedorahosted.org/freeipa/ticket/5351

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-13 18:54:09 +02:00
Petr Viktorin
f67155486b Alias long to int under Python 3
In py3, the two types are unified under the name "int".

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-10-13 14:16:32 +02:00
Jan Cholasta
61bdbd6e47 upgrade: make sure ldap2 is connected in export_kra_agent_pem
https://fedorahosted.org/freeipa/ticket/5360

Reviewed-By: Ales 'alich' Marecek <amarecek@redhat.com>
2015-10-12 15:51:14 +02:00
Jan Cholasta
4b381b1503 vault: select a server with KRA for vault operations
This uses the same mechanism which is used for the CA.

https://fedorahosted.org/freeipa/ticket/5302

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-08 13:42:58 +02:00
Jan Cholasta
b035a2a114 install: always export KRA agent PEM file
Export the file even when KRA is not installed locally so that vault commands
work on all IPA replicas.

https://fedorahosted.org/freeipa/ticket/5302

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-08 13:42:58 +02:00
Jan Cholasta
110e85cc74 install: fix KRA agent PEM file permissions
This fixes CVE-2015-5284.

https://fedorahosted.org/freeipa/ticket/5347

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-08 13:41:08 +02:00
Petr Viktorin
026b1b5307 Use six.moves.http_client instead of httplib
The module was renamed in Python 3.

Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-07 10:27:20 +02:00
Petr Viktorin
187efdfe42 Use six.moves.configparser instead of ConfigParser
The module name was lowercased in Python 3.

Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-07 10:27:20 +02:00
Petr Viktorin
ad2bc94725 Use six.moves.xmlrpc.client instead of xmlrpclib
The module is renamed to xmlrpc.client in Python 3.

Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-07 10:27:20 +02:00
Petr Viktorin
70b37a956c Use six.moves.urllib instead of urllib/urllib2/urlparse
In Python 3, these modules are reorganized.

Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-07 10:27:20 +02:00
Timo Aaltonen
7c32ecaa0e httpinstance: Replace a hardcoded path to password.conf with HTTPD_PASSWORD_CONF
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-05 19:28:43 +02:00
Timo Aaltonen
7059117ec3 paths: Add GENERATE_RNDC_KEY.
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-05 17:45:51 +02:00
Martin Babinsky
e3cb6305cc ipa-server-install: mark master_password Knob as deprecated
fixes a regression introduced during fixing
https://fedorahosted.org/freeipa/ticket/5184

https://fedorahosted.org/freeipa/ticket/5335

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-10-01 16:09:03 +02:00
Jan Cholasta
6067824be4 install: fix ipa-server-install fail on missing --forwarder
https://fedorahosted.org/freeipa/ticket/4517

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-01 14:59:41 +02:00
Jan Cholasta
c388dbd4de install: fix invocation of KRAInstance.create_instance()
Reviewed-By: Simo Sorce <ssorce@redhat.com>
2015-10-01 07:42:33 +02:00
Robert Kuska
01da4a8de3 Replace StandardError with Exception
StandardError was removed in Python3 and instead
Exception should be used.

Signed-off-by: Robert Kuska <rkuska@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-09-30 10:51:36 +02:00
Martin Basti
74da4f5870 Replica inst. fix: do not require -r, -a, -p options in unattended mode
Previous patches for this ticket introduced error, that replica install
requires to specify -r, -p and -a option in unattended mode.
This options are not needed on replica side.

https://fedorahosted.org/freeipa/ticket/4517

Reviewed-By: Milan Kubík <mkubik@redhat.com>
2015-09-29 15:12:43 +02:00
Tomas Babej
75cba4e8bf winsync-migrate: Properly handle collisions in the names of external groups
Since the names of the external groups containing the migrated users
must be stripped of characters which are not valid for use in group names,
two different groups might be mapped to one during this process.

Properly handle collisions in the names by adding an incremental
numeric suffix.

https://fedorahosted.org/freeipa/ticket/5319

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-09-23 17:05:47 +02:00
Tomas Babej
a758f16abe winsync-migrate: Convert entity names to posix friendly strings
During the migration from winsync replicated users to their
trusted identities, memberships are being preserved. However,
trusted users are external and as such cannot be added as
direct members to the IPA entities. External groups which
encapsulate the migrated users are added as members to those
entities instead.

The name of the external group is generated from the type
of the entity and its name. However, the entity's name can
contain characters which are invalid for use in the group
name.

Adds a helper function to convert a given string to a string
which would be valid for such use and leverages it in the
winsync-migrate tool.

https://fedorahosted.org/freeipa/ticket/5319

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-09-23 17:05:47 +02:00
Jan Cholasta
4c39561261 install: fix kdcproxy user home directory
https://fedorahosted.org/freeipa/ticket/5314

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-09-23 16:29:49 +02:00
Jan Cholasta
0de8603183 install: create kdcproxy user during server install
This change makes kdcproxy user creation consistent with DS and CA user
creation. Before, the user was created in the spec file, in %pre scriptlet
of freeipa-server.

https://fedorahosted.org/freeipa/ticket/5314

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-09-22 16:34:51 +02:00
Michael Simacek
bdccebbcdb Rewrap errors in get_principal to CCacheError
Causes nicer error message when kerberos credentials are not available.

https://fedorahosted.org/freeipa/ticket/5272

Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-09-22 13:29:55 +02:00
Tomas Babej
cfeea91828 ipa-backup: Add mechanism to store empty directory structure
Certain subcomponents of IPA, such as Dogtag, cannot function if
non-critical directories (such as log directories) have not been
stored in the backup.

This patch implements storage of selected empty directories,
while preserving attributes and SELinux context.

https://fedorahosted.org/freeipa/ticket/5297

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-09-22 13:17:25 +02:00
Jan Cholasta
bed64a888a install: Add common base class for server and replica install
https://fedorahosted.org/freeipa/ticket/4517

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-09-22 12:09:22 +02:00
Simo Sorce
d8b1f42f17 Simplify the install_replica_ca function
Instantiate CAInstall only once instead of 3 times in a row always with the
same values.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-09-22 10:44:45 +02:00
Simo Sorce
953b1079cf Remove unused arguments
In the dogtag/ca/kra instances self.domain is never used.
Remove it.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-09-22 10:44:45 +02:00
Gabe
65e958fda4 Standardize minvalue for ipasearchrecordlimit and ipasesarchsizelimit for unlimited minvalue
https://fedorahosted.org/freeipa/ticket/4023

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-09-22 08:00:16 +02:00
Martin Basti
e7713d45a4 Server Upgrade: addifnew should not create entry
addifnew should add value only if entry exists, instead of creating
entry.

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-09-21 12:04:12 +02:00
Martin Basti
a4b1bb25c9 Limit max age of replication changelog
Limit max age of replication changelog to seven days, instead of grow to
unlimited size.

https://fedorahosted.org/freeipa/ticket/5086

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-09-21 12:04:12 +02:00
Jan Cholasta
5137478fb8 install: support KRA update
https://fedorahosted.org/freeipa/ticket/5250

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2015-09-17 14:55:54 +02:00
Jan Cholasta
33aba6f35e Use byte literals where appropriate
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2015-09-17 11:08:43 +02:00
Jan Cholasta
23507e6124 Alias "unicode" to "str" under Python 3
The six way of doing this is to replace all occurences of "unicode"
with "six.text_type". However, "unicode" is non-ambiguous and
(arguably) easier to read. Also, using it makes the patches smaller,
which should help with backporting.

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2015-09-17 11:08:43 +02:00
Tomas Babej
73c82d0073 winsync: Add inetUser objectclass to the passsync sysaccount
https://bugzilla.redhat.com/show_bug.cgi?id=1262315

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2015-09-16 17:13:42 +02:00
Martin Basti
7f0076b9a5 Server Install: print message that client is being installed
IPA client is installed on server side during "Restarting web server"
step, which lasts too long. This commit explicitly print message that
IPA client is being installed.

Reviewed-By: Simo Sorce <ssorce@redhat.com>
2015-09-11 16:05:56 +02:00
Martin Basti
f8f5bd644a IPA Restore: allows to specify files that should be removed
Some files/directories should be removed before backup files are copied
to filesystem.

In case of DNSSEC, the /var/lib/ipa/dnssec/tokens directory has to be
removed, otherwise tokens that are backed up and existing tokens will be
mixed and SOFTHSM log in will not work

https://fedorahosted.org/freeipa/ticket/5293

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-09-11 14:57:58 +02:00
Martin Basti
5762ad951f Server Upgrade: backup CS.cfg when dogtag is turned off
Is unable to made CS.cfg when dogtag is running.

https://fedorahosted.org/freeipa/ticket/5287

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-09-11 13:54:25 +02:00
Endi S. Dewata
72cfcfa0bd Using LDAPI to setup CA and KRA agents.
The CA and KRA installation code has been modified to use LDAPI
to create the CA and KRA agents directly in the CA and KRA
database. This way it's no longer necessary to use the Directory
Manager password or CA and KRA admin certificate.

https://fedorahosted.org/freeipa/ticket/5257

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-09-07 18:01:13 +02:00
Jan Cholasta
ebdfa4380b Use six.with_metaclass to specify metaclasses
Metaclass specification is incompatible between Python 2 and 3. Use the
six.with_metaclass helper to specify metaclasses.

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2015-09-07 08:00:11 +02:00
Jan Cholasta
198908ec78 ldap: Make ldap2 connection management thread-safe again
This fixes the connection code in LDAPClient to not store the LDAP connection
in an attribute of the object, which in combination with ldap2's per-thread
connections lead to race conditions resulting in connection failures. ldap2
code was updated accordingly.

https://fedorahosted.org/freeipa/ticket/5268

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-09-04 13:31:46 +02:00
Martin Basti
e7a876d88a DNSSEC: remove ccache and keytab of ipa-ods-exporter
Reusing old ccache after reinstall causes authentication error. And
prevents DNSSEC from working.

Related to ticket: https://fedorahosted.org/freeipa/ticket/5273

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-09-03 18:15:58 +02:00
Martin Basti
b6435f2cc6 DNSSEC: backup and restore opendnssec zone list file
When zone list is not restored after unninstall, this may slow down
enbaling DNSSEC signing for zones and print unwanted
errors into log after new installation.

Related to: https://fedorahosted.org/freeipa/ticket/5273

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-09-03 18:15:58 +02:00
Martin Basti
0bcf0c1be9 Installer: do not modify /etc/hosts before user agreement
https://fedorahosted.org/freeipa/ticket/4561

As side effect this also fixes:
https://fedorahosted.org/freeipa/ticket/5266

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-09-03 16:01:30 +02:00
Martin Basti
0c5e41cc79 Server Upgrade: fix traceback caused by cidict
Traceback caused by recent py3 code migration.

https://fedorahosted.org/freeipa/ticket/5283

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2015-09-03 14:11:52 +02:00
Martin Basti
7b3bd4e85d Backup: back up the hosts file
https://fedorahosted.org/freeipa/ticket/5275

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-09-02 13:21:02 +02:00
Martin Basti
740f7fd817 DNSSEC: remove "DNSSEC is experimental" warnings
https://fedorahosted.org/freeipa/ticket/5265

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-09-02 10:26:14 +02:00
Petr Viktorin
5178e9a597 Modernize use of range()
In Python 3, range() behaves like the old xrange().
The difference between range() and xrange() is usually not significant,
especially if the whole result is iterated over.

Convert xrange() usage to range() for small ranges.
Use modern idioms in a few other uses of range().

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-09-01 11:42:01 +02:00
Petr Viktorin
d1187cbc6f Use new-style raise syntax
The form`raise Error, value` is deprecated in favor of `raise Error(value)`,
and will be removed in Python 3.
Use the new syntax.

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-09-01 11:42:01 +02:00
Petr Viktorin
8de13bd7dd Use the print function
In Python 3, `print` is no longer a statement. Call it as a function
everywhere, and include the future import to remove the statement
in Python 2 code as well.

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-09-01 11:42:01 +02:00
Petr Viktorin
ace63f4ea5 Replace uses of map()
In Python 2, map() returns a list; in Python 3 it returns an iterator.

Replace all uses by list comprehensions, generators, or for loops,
as required.

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-09-01 11:42:01 +02:00
Petr Viktorin
5a9141dc40 Replace filter() calls with list comprehensions
In Python 3, filter() returns an iterator.
Use list comprehensions instead.

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-09-01 11:42:01 +02:00
Petr Viktorin
3bf91eab25 Use Python3-compatible dict method names
Python 2 has keys()/values()/items(), which return lists,
iterkeys()/itervalues()/iteritems(), which return iterators,
and viewkeys()/viewvalues()/viewitems() which return views.

Python 3 has only keys()/values()/items(), which return views.
To get iterators, one can use iter() or a for loop/comprehension;
for lists there's the list() constructor.

When iterating through the entire dict, without modifying the dict,
 the difference between Python 2's items() and iteritems() is
negligible, especially on small dicts (the main overhead is
extra memory, not CPU time). In the interest of simpler code,
this patch changes many instances of iteritems() to items(),
iterkeys() to keys() etc.

In other cases, helpers like six.itervalues are used.

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-09-01 11:42:01 +02:00
Petr Viktorin
dd16cc98b0 Use six.string_types instead of "basestring"
Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-09-01 11:42:01 +02:00
Jan Cholasta
0914cb663e install: Fix SASL mappings not added in ipa-server-install
Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Simo Sorce <ssorce@redhat.com>
2015-08-27 16:05:11 +02:00
Jan Cholasta
43ee695195 cert renewal: Include KRA users in Dogtag LDAP update
https://fedorahosted.org/freeipa/ticket/5253

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2015-08-27 15:53:42 +02:00
Simo Sorce
f57b687241 Insure the admin_conn is disconnected on stop
If we stop or restart the server insure admin_conn gets reset or other
parts may fail to properly connect/authenticate

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-08-27 07:55:51 +02:00
Simo Sorce
20dc3a4c3f Move sasl mappings creation to dsinstance
Sasl mappings can be created directly by the DS Instance, there is
no reason to create them in the krbinstance as they do not depend on
the kdc to be configured just to be created.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-08-27 07:55:51 +02:00
Simo Sorce
23b91dddd9 Remove custom utility function from krbinstance
Remove the custom update_key_val_in_file() and instead use the common
function config_replace_variables() available from ipautil.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-08-27 07:55:51 +02:00
Endi S. Dewata
8676364ae8 Removed clear text passwords from KRA install log.
The ipa-kra-install tool has been modified to use password files
instead of clear text passwords when invoking pki tool such that
the passwords are no longer visible in ipaserver-kra-install.log.

https://fedorahosted.org/freeipa/ticket/5246

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2015-08-26 13:49:57 +02:00
Michael Simacek
aad73fad60 Port from python-krbV to python-gssapi
python-krbV library is deprecated and doesn't work with python 3. Replacing all
it's usages with python-gssapi.

- Removed Backend.krb and KRB5_CCache classes
  They were wrappers around krbV classes that cannot really work without them
- Added few utility functions for querying GSSAPI credentials
  in krb_utils module. They provide replacements for KRB5_CCache.
- Merged two kinit_keytab functions
- Changed ldap plugin connection defaults to match ipaldap
- Unified getting default realm
  Using api.env.realm instead of krbV call

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Robbie Harwood <rharwood@redhat.com>
Reviewed-By: Simo Sorce <ssorce@redhat.com>
2015-08-26 09:41:36 +02:00
David Kupka
db88985c0d Backup/resore authentication control configuration
https://fedorahosted.org/freeipa/ticket/5071

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-08-19 14:13:00 +02:00
Martin Basti
556e97bf23 Server Upgrade: Start DS before CA is started.
https://fedorahosted.org/freeipa/ticket/5232

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-08-19 11:55:21 +02:00
Jan Cholasta
ff1e66375c install: Fix replica install with custom certificates
https://fedorahosted.org/freeipa/ticket/5226

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-08-18 16:24:19 +02:00
Martin Babinsky
31776755b4 ipa-restore: check whether DS is running before attempting connection
https://fedorahosted.org/freeipa/ticket/4838

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2015-08-18 13:40:37 +02:00
Martin Babinsky
0d1f35b054 ipa-backup: archive DNSSEC zone file and kasp.db
https://fedorahosted.org/freeipa/ticket/5159

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-08-17 18:46:30 +02:00
Martin Babinsky
83db1de096 fix typo in BasePathNamespace member pointing to ods exporter config
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-08-17 18:46:30 +02:00
Tomas Babej
025303987c winsync-migrate: Add warning about passsync
https://fedorahosted.org/freeipa/ticket/5162

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-08-17 17:50:34 +02:00
David Kupka
fe91c375d0 dbus: Create empty dbus.Array with specified signature
Python DBus binding could fail to guess the type signature from empty list.
This issue was seen but we don't have a reproducer. There is no harm in making
sure that it will not happen.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-08-14 12:48:45 +02:00
Petr Viktorin
5435a8a32a Use absolute imports
In Python 3, implicit relative imports will not be supported.
Use fully-qualified imports everywhere.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-08-12 18:17:23 +02:00
Petr Viktorin
6a741b51da Replace dict.has_key with the 'in' operator
The deprecated has_key method will be removed from dicts in Python 3.

For custom dict-like classes, has_key() is kept on Python 2,
but disabled for Python 3.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-08-12 18:17:23 +02:00
Petr Viktorin
27dabb4528 Modernize 'except' clauses
The 'as' syntax works from Python 2 on, and Python 3 will
drop the "comma" syntax.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-08-12 18:17:23 +02:00
Jan Cholasta
a651be3eec install: Fix server and replica install options
https://fedorahosted.org/freeipa/ticket/5184

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-08-12 16:42:01 +02:00
Fraser Tweedale
9bbc798741 Fix default CA ACL added during upgrade
The upgrade script is adding the default CA ACL with incorrect
attributes - usercategory=all instead of servicecategory=all.  Fix
it to create the correct object.

Fixes: https://fedorahosted.org/freeipa/ticket/5185
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-08-11 17:26:24 +02:00
Martin Basti
d7be2fd1bd Fix upgrade of sidgen and extdom plugins
If configuration entries already exist, upgrade will not add them
again.

https://fedorahosted.org/freeipa/ticket/5151

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-08-10 15:03:54 +02:00
Endi S. Dewata
c8882f7d1c Fixed missing KRA agent cert on replica.
The code that exports the KRA agent certificate has been moved
such that it will be executed both on master and replica.

https://fedorahosted.org/freeipa/ticket/5174

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-08-10 13:04:34 +02:00
Tomas Babej
c906784ded dcerpc: Simplify generation of LSA-RPC binding strings
https://fedorahosted.org/freeipa/ticket/5183

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-08-07 18:06:02 +02:00
Alexander Bokovoy
ee377a20cd Fix selector of protocol for LSA RPC binding string
For Windows Server 2012R2 and others which force SMB2 protocol use
we have to specify right DCE RPC binding options.

For using SMB1 protocol we have to omit specifying SMB2 protocol and
anything else or otherwise SMB1 would be considered a pipe to connect
to. This is by design of a binding string format.

https://fedorahosted.org/freeipa/ticket/5183

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-08-07 17:55:48 +02:00
Petr Viktorin
b8c46f2a32 Modernize number literals
Use Python-3 compatible syntax, without breaking compatibility with py 2.7

- Octals literals start with 0o to prevent confusion
- The "L" at the end of large int literals is not required as they use
  long on Python 2 automatically.
- Using 'int' instead of 'long' for small numbers is OK in all cases except
  strict type checking checking, e.g. type(0).

https://fedorahosted.org/freeipa/ticket/4985

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-07-31 15:22:19 +02:00
Christian Heimes
a908be2785 Replace M2Crypto RC4 with python-cryptography ARC4
This patch removes the dependency on M2Crypto in favor for cryptography.
Cryptography is more strict about the key size and doesn't support
non-standard key sizes:

>>> from M2Crypto import RC4
>>> from ipaserver.dcerpc import arcfour_encrypt
>>> RC4.RC4(b'key').update(b'data')
'o\r@\x8c'
>>> arcfour_encrypt(b'key', b'data')
Traceback (most recent call last):
...
ValueError: Invalid key size (24) for RC4.

Standard key sizes 40, 56, 64, 80, 128, 192 and 256 are supported:

>>> arcfour_encrypt(b'key12', b'data')
'\xcd\xf80d'
>>> RC4.RC4(b'key12').update(b'data')
'\xcd\xf80d'

http://cryptography.readthedocs.org/en/latest/hazmat/primitives/symmetric-encryption/#cryptography.hazmat.primitives.ciphers.algorithms.ARC4
https://fedorahosted.org/freeipa/ticket/5148

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-07-31 13:33:02 +02:00
Tomas Babej
5df48d74a0 replication: Fix incorrect exception invocation
Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-07-24 11:27:22 +02:00
Tomas Babej
970a5535c0 dcerpc: Add get_trusted_domain_object_type method
https://fedorahosted.org/freeipa/ticket/5029

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2015-07-23 15:37:01 +02:00
Tomas Babej
cf59981cc2 dcerpc: Fix UnboundLocalError for ccache_name
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2015-07-22 14:30:22 +02:00
Tomas Babej
1299c60a83 dcerpc: Expand explanation for WERR_ACCESS_DENIED
It's possible for AD to contact a wrong IPA server in case the DNS
SRV records on the AD sides are not properly configured.

Mention this case in the error message as well.

https://fedorahosted.org/freeipa/ticket/5013

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2015-07-21 19:10:06 +02:00
Martin Basti
92828d3cf5 DNS: check if DNS package is installed
Instead of separate checking of DNS required packages, we need just
check if IPA DNS package is installed.

https://fedorahosted.org/freeipa/ticket/4058

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-07-21 17:30:10 +02:00
Martin Basti
c6c84faecf Py3: replace tab with space
python3 does not allow to mix spaces and tabs

Reviewed-By: Christian Heimes <cheimes@redhat.com>
2015-07-17 17:19:51 +02:00
Martin Basti
82aaa1e6d0 Allow value 'no' for replica-certify-all attr in abort-clean-ruv subcommand
--force option set replica-certify-all to 'no' during abort-clean-ruv
subcommand

https://fedorahosted.org/freeipa/ticket/4988

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2015-07-17 16:47:18 +02:00
Yuri Chornoivan
75fde43491 Fix minor typos
<ame> -> <name>
overriden -> overridden
ablity -> ability
enties -> entries
the the -> the

https://fedorahosted.org/freeipa/ticket/5109

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
2015-07-17 14:33:30 +02:00
Martin Babinsky
26dee66d1b ipa-ca-install: print more specific errors when CA is already installed
This patch implements a more thorough checking for already installed CAs
during standalone CA installation using ipa-ca-install. The installer now
differentiates between CA that is already installed locally and CA installed
on one or more masters in topology and prints an appropriate error message.

https://fedorahosted.org/freeipa/ticket/4492

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-07-16 15:33:43 +02:00
Alexander Bokovoy
706c003615 selinux: enable httpd_run_ipa to allow communicating with oddjobd services
A new SELinux policy allows communication between IPA framework running
under Apache with oddjobd-based services via DBus.

This communication is crucial for one-way trust support and also is required
for any out of band tools which may be executed by IPA framework.

Details of out of band communication and SELinux policy can be found in a bug
https://bugzilla.redhat.com/show_bug.cgi?id=1238165

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-07-16 12:42:43 +02:00
Christian Heimes
35e219f996 Remove tuple unpacking from except clause ipaserver/dcerpc.py
Python 3 doesn't support tuple unpacking in except clauses. All implicit
tuple unpackings have been replaced with explicit unpacking of e.args.

https://fedorahosted.org/freeipa/ticket/5120

Reviewed-By: Tomas Babej <tbabej@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2015-07-14 13:43:50 +02:00
Simo Sorce
ca6947da6f Fix DNS records installation for replicas
Ticket: https:/fedorahosted.org/freeipa/ticket/5116

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-07-14 10:50:36 +00:00
Christian Heimes
c701ab612d Start dirsrv for kdcproxy upgrade
The kdcproxy upgrade step in ipa-server-upgrade needs a running dirsrv
instance. Under some circumstances the dirsrv isn't running. The patch
rearranges some upgrade steps and starts DS before enable_kdcproxy().

https://fedorahosted.org/freeipa/ticket/5113

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-07-14 10:37:43 +00:00
Tomas Babej
5106421961 Revert "Hide topology and domainlevel features"
This reverts commit 62e8002bc4.

Hiding of the topology and domainlevel features was necessary
for the 4.2 branch only.

Reviewed-By: Simo Sorce <ssorce@redhat.com>
2015-07-10 15:26:50 +02:00
Tomas Babej
9c5df3cf76 upgrade: Enable and start oddjobd if adtrust is available
If ipa-adtrust-install has already been run on the system,
enable and start the oddjobd service.

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2015-07-08 17:14:56 +02:00
Tomas Babej
675aada2e1 adtrustinstance: Enable and start oddjobd
Enable and start the oddjobd service as part of the
ipa-adtrust-install for the new IPA installations.

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2015-07-08 17:14:56 +02:00
Martin Basti
21b04769b9 Upgrade: Do not show upgrade failed message when IPA is not installed
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-07-08 12:58:50 +00:00
Alexander Bokovoy
2dd5b46d25 trust: support retrieving POSIX IDs with one-way trust during trust-add
With one-way trust we cannot rely on cross-realm TGT as there will be none.
Thus, if we have AD administrator credentials we should reuse them.
Additionally, such use should be done over Kerberos.

Fixes:
 https://fedorahosted.org/freeipa/ticket/4960
 https://fedorahosted.org/freeipa/ticket/4959

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-07-08 01:56:52 +02:00
Alexander Bokovoy
d5aa1ee04e trusts: add support for one-way trust and switch to it by default
One-way trust is the default now, use 'trust add --two-way ' to
force bidirectional trust

https://fedorahosted.org/freeipa/ticket/4959

In case of one-way trust we cannot authenticate using cross-realm TGT
against an AD DC. We have to use trusted domain object from within AD
domain and access to this object is limited to avoid compromising the whole
trust configuration.

Instead, IPA framework can call out to oddjob daemon and ask it to
run the script which can have access to the TDO object. This script
(com.redhat.idm.trust-fetch-domains) is using cifs/ipa.master principal
to retrieve TDO object credentials from IPA LDAP if needed and then
authenticate against AD DCs using the TDO object credentials.

The script pulls the trust topology out of AD DCs and updates IPA LDAP
store. Then IPA framework can pick the updated data from the IPA LDAP
under normal access conditions.

Part of https://fedorahosted.org/freeipa/ticket/4546

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-07-08 01:56:52 +02:00
Alexander Bokovoy
47e1de7604 trusts: pass AD DC hostname if specified explicitly
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1222047

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-07-08 01:56:52 +02:00
Alexander Bokovoy
03c2d76186 ipa-adtrust-install: add IPA master host principal to adtrust agents
Fixes https://fedorahosted.org/freeipa/ticket/4951

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-07-08 01:56:52 +02:00
Tomas Babej
e8ff6a3ef6 dcerpc: Raise ACIError correctly
Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-07-08 01:56:52 +02:00
David Kupka
6a91893ff5 ipa-replica-prepare: Do not create DNS zone it automatically.
When --ip-address is specified check if relevant DNS zone exists
in IPA managed DNS server, exit with error when not.

https://fedorahosted.org/freeipa/ticket/5014

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-07-08 00:37:42 +02:00
Fraser Tweedale
462e0b9eb1 certprofile: add ability to update profile config in Dogtag
Add the `--file=FILENAME' option to `certprofile-mod' which, when
given, will update the profile configuration in Dogtag to the
contents of the file.

Fixes: https://fedorahosted.org/freeipa/ticket/5093
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-07-08 00:25:46 +02:00
Fraser Tweedale
bed6f402e2 certprofile: add option to export profile config
Add the `--out=FILENAME' option to `certprofile-show'.  When given,
it exports the profile configuration from Dogtag and writes it to
the named file.

Fixes: https://fedorahosted.org/freeipa/ticket/5091
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-07-08 00:25:46 +02:00
Tomas Babej
62e8002bc4 Hide topology and domainlevel features
* Hide topology and domainlevel commands in the CLI
* Hide topology and domainlevel in the WebUI
* Set maximum allowed domain level to 0
* Do not configure and enable the topology plugin

https://fedorahosted.org/freeipa/ticket/5097

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-07-08 00:09:09 +02:00
Petr Spacek
c0271b9c87 DNSSEC: ipa-dns-install: Detect existing master server sooner.
User should get the error before he installs missing packages etc.

https://fedorahosted.org/freeipa/ticket/4657

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-07-07 08:37:15 +02:00
Martin Basti
2e4e8d759d DNSSEC: update message
https://fedorahosted.org/freeipa/ticket/4657

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-07-07 08:37:15 +02:00
Martin Basti
e151492560 DNSSEC: allow to disable/replace DNSSEC key master
This commit allows to replace or disable DNSSEC key master

Replacing DNSSEC master requires to copy kasp.db file manually by user

ipa-dns-install:
--disable-dnssec-master  DNSSEC master will be disabled
--dnssec-master --kasp-db=FILE  This configure new DNSSEC master server,  kasp.db from old server is required for sucessful replacement
--force Skip checks

https://fedorahosted.org/freeipa/ticket/4657

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-07-07 08:37:15 +02:00
Martin Basti
884afb5d38 Server Upgrade: use debug log level for upgrade instead of info
Upgrade contains too many unnecessary info logs.

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-07-03 07:47:59 +00:00
Tomas Babej
8d30feb539 winsync_migrate: Generalize membership migration
https://fedorahosted.org/freeipa/ticket/4943

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-02 13:23:21 +02:00
Tomas Babej
e5fe79a0f4 winsync_migrate: Migrate memberships of the winsynced users
https://fedorahosted.org/freeipa/ticket/4524

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-02 13:23:21 +02:00
Tomas Babej
6462530440 idviews: Fallback to AD DC LDAP only if specifically allowed
https://fedorahosted.org/freeipa/ticket/4524

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-02 13:23:21 +02:00
Tomas Babej
19d62e9aa4 winsync-migrate: Move the tool under ipaserver.install package
https://fedorahosted.org/freeipa/ticket/4524

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-02 13:23:21 +02:00
Tomas Babej
e9a3b99717 winsync-migrate: Rename to tool to achive consistency with other tools
https://fedorahosted.org/freeipa/ticket/4524

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-02 13:23:21 +02:00
Tomas Babej
7017d9e8a6 winsync-migrate: Delete winsync agreement prior to migration
https://fedorahosted.org/freeipa/ticket/4524

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-02 13:23:21 +02:00
Tomas Babej
d584eb7001 winsync-migrate: Require explicit specification of the target server and validate existing agreement
https://fedorahosted.org/freeipa/ticket/4524

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-02 13:23:21 +02:00
Tomas Babej
0e11a87090 winsync-migrate: Require root privileges
https://fedorahosted.org/freeipa/ticket/4524

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-02 13:23:21 +02:00
Tomas Babej
e6a2a67d7a dcerpc: Add debugging message to failing kinit as http
https://fedorahosted.org/freeipa/ticket/4524

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-02 13:23:21 +02:00
Tomas Babej
69c6a33216 dcerpc: Change logging level for debug information
https://fedorahosted.org/freeipa/ticket/4524

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-02 13:23:21 +02:00
Tomas Babej
cf61e2ad94 winsync-migrate: Move the api initalization and LDAP connection to the main method
https://fedorahosted.org/freeipa/ticket/4524

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-02 13:23:21 +02:00
Tomas Babej
e7d7f01d5f migrate-winsync: Add option validation and handling
https://fedorahosted.org/freeipa/ticket/4524

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-02 13:23:21 +02:00
Tomas Babej
2104e07fa8 migrate-winsync: Create user ID overrides in place of winsynced user entries
https://fedorahosted.org/freeipa/ticket/4524

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-02 13:23:21 +02:00
Tomas Babej
4c6ff80140 winsync-migrate: Add a way to find all winsync users
https://fedorahosted.org/freeipa/ticket/4524

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-02 13:23:21 +02:00
Tomas Babej
0cb87fc31a winsync-migrate: Add initial plumbing
https://fedorahosted.org/freeipa/ticket/4524

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-02 13:23:21 +02:00
Martin Basti
2e329ecdc7 KRA Install: check replica file if contains req. certificates
https://fedorahosted.org/freeipa/ticket/5059

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-07-02 10:59:53 +00:00
Petr Vobornik
25a5e38b85 replication: fix regression in get_agreement_type
dcb6916a3b introduced a regression where
get_agreement_type does not raise NotFound error if an agreement for host
does not exist. The exception was swallowed by get_replication_agreement.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-07-01 19:44:11 +02:00
Jan Cholasta
e43296ba9a replica prepare: Do not use entry after disconnecting from LDAP
https://fedorahosted.org/freeipa/ticket/3090

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-01 13:05:30 +00:00
Jan Cholasta
2b12bca660 plugable: Specify plugin base classes and modules using API properties
https://fedorahosted.org/freeipa/ticket/3090

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-01 13:05:30 +00:00
Jan Cholasta
e39fe4ed31 plugable: Pass API to plugins on initialization rather than using set_api
https://fedorahosted.org/freeipa/ticket/3090

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-01 13:05:30 +00:00
Jan Cholasta
481f8ddaa3 plugable: Specify plugins to import in API by module names
This change removes the automatic plugins sub-package magic and allows
specifying modules in addition to packages.

https://fedorahosted.org/freeipa/ticket/3090

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-01 13:05:30 +00:00
Jan Cholasta
fe2accf776 ipalib: Load ipaserver plugins when api.env.in_server is True
https://fedorahosted.org/freeipa/ticket/3090
https://fedorahosted.org/freeipa/ticket/5073

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-01 13:05:30 +00:00
Jan Cholasta
f87ba5ee08 plugable: Move plugin base class and override logic to API
Each API object now maintains its own view of registered plugins. This change
removes the need to register plugin base classes.

This reverts commit 2db741e847.

https://fedorahosted.org/freeipa/ticket/3090
https://fedorahosted.org/freeipa/ticket/5073

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-07-01 13:05:30 +00:00
Fraser Tweedale
3827137b32 Migrate CA profiles after enabling LDAPProfileSubsystem
After enabling LDAPProfileSubsystem in Dogtag, migrate the
file-based profiles into the LDAP database.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-07-01 12:28:12 +02:00
Fraser Tweedale
6e641e8d18 Upgrade CA schema during upgrade
New schema (for LDAP-based profiles) was introduced in Dogtag, but
Dogtag does not yet have a reliable method for upgrading its schema.
Use FreeIPA's schema update machinery to add the new attributeTypes
and objectClasses defined by Dogtag.

Also update the pki dependencies to 10.2.5, which provides the
schema update file.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-07-01 12:28:12 +02:00
Martin Basti
b2f0a018b6 Sanitize CA replica install
Check if cafile exist first.

https://fedorahosted.org/freeipa/ticket/4468

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-06-30 13:41:00 +02:00
Christian Heimes
0bf4e7fb4a Fix upgrade of HTTPInstance for KDC Proxy
HTTPInstance needs a LDAP connection for KDC Proxy upgrade. The patch
ensures that an admin_conn is available.

Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2015-06-29 17:28:56 +02:00
Christian Heimes
2842a83568 Fix removal of ipa-kdc-proxy.conf symlink
installutils.remove_file() ignored broken symlinks. Now it uses
os.path.lexists() to detect and also remove dangling symlinks.

Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2015-06-29 17:24:03 +02:00
Petr Vobornik
dcb6916a3b fix force-sync, re-initialize of replica and a check for replication agreement existence
in other words limit usage of `agreement_dn` method only for manipulation
and search of agreements which are not managed by topology plugin.

For other cases is safer to search for the agreement.

https://fedorahosted.org/freeipa/ticket/5066

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-06-29 17:09:54 +02:00
David Kupka
e3d3938f44 upgrade: Raise error when certmonger is not running.
Certmonger should be running (should be started on system boot).
Either user decided to stop it or it crashed. We should just error out and
let user check & fix it.

https://fedorahosted.org/freeipa/ticket/5080

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2015-06-29 13:46:47 +02:00
Petr Vobornik
29c01e5ef4 fix handling of ldap.LDAPError in installer
'info' is optional component in LDAPError

http://www.python-ldap.org/doc/html/ldap.html#exceptions

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-06-29 13:37:30 +02:00
Christian Heimes
495da412f1 Provide Kerberos over HTTP (MS-KKDCP)
Add integration of python-kdcproxy into FreeIPA to support the MS
Kerberos KDC proxy protocol (MS-KKDCP), to allow KDC and KPASSWD
client requests over HTTP and HTTPS.

- freeipa-server now depends on python-kdcproxy >= 0.3. All kdcproxy
  dependencies are already satisfied.
- The service's state is configured in cn=KDC,cn=$FQDN,cn=masters,cn=ipa,
  cn=etc,$SUFFIX. It's enabled, when ipaConfigString=kdcProxyEnabled is
  present.
- The installers and update create a new Apache config file
  /etc/ipa/kdcproxy/ipa-kdc-proxy.conf that mounts a WSGI app on
  /KdcProxy. The app is run inside its own WSGI daemon group with
  a different uid and gid than the webui.
- A ExecStartPre script in httpd.service symlinks the config file to
  /etc/httpd/conf.d/ iff ipaConfigString=kdcProxyEnabled is present.
- The httpd.service also sets KDCPROXY_CONFIG=/etc/ipa/kdcproxy.conf,
  so that an existing config is not used. SetEnv from Apache config does
  not work here, because it doesn't set an OS env var.
- python-kdcproxy is configured to *not* use DNS SRV lookups. The
  location of KDC and KPASSWD servers are read from /etc/krb5.conf.
- The state of the service can be modified with two ldif files for
  ipa-ldap-updater. No CLI script is offered yet.

https://www.freeipa.org/page/V4/KDC_Proxy

https://fedorahosted.org/freeipa/ticket/4801

Reviewed-By: Nathaniel McCallum <npmccallum@redhat.com>
Reviewed-By: Simo Sorce <ssorce@redhat.com>
2015-06-24 10:43:58 +02:00
Simo Sorce
49d708f00f Replicas cannot define their own master password.
Seem like this slipped in during the refactoring of the install tools.

https://fedorahosted.org/freeipa/ticket/4468

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-06-24 05:24:58 +00:00
Martin Basti
d2d13826c6 ipa-ca-install fix: reconnect ldap2 after DS restart
https://fedorahosted.org/freeipa/ticket/5064

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-06-18 17:46:52 +02:00
Petr Spacek
b5b8dd6cec Clarify error messages in ipa-replica-prepare: add_dns_records()
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-06-18 15:01:31 +02:00
Petr Spacek
6259be5fd6 Clarify recommendation about --ip-address option in ipa-replica-prepapre
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-06-18 15:01:31 +02:00
Petr Spacek
3c95a5aea2 Improve error messages about reverse address resolution in ipa-replica-prepare
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-06-18 15:01:31 +02:00
Jan Cholasta
c3a3d789b5 install: Fix ipa-replica-install not installing RA cert
https://fedorahosted.org/freeipa/ticket/4468

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-06-18 14:48:31 +02:00
Martin Basti
c1d484afde Server Upgrade: disconnect ldap2 connection before DS restart
Without this patch, the invalid api.Backend.ldap2 connection
was used to communicate with DS and it raises network error
after DS restart.

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-06-15 09:54:04 +02:00
David Kupka
4d05b5d18d Use 389-ds centralized scripts.
Directory server is deprecating use of tools in instance specific paths. Instead
tools in bin/sbin path should be used.

https://fedorahosted.org/freeipa/ticket/4051

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-06-11 13:16:06 +02:00
Martin Basti
9aa6124b39 DNSSEC: Improve global forwarders validation
Validation now provides more detailed information and less false
positives failures.

https://fedorahosted.org/freeipa/ticket/4657

Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2015-06-11 13:12:31 +02:00
Fraser Tweedale
bc0c606885 Add CA ACL plugin
Implement the caacl commands, which are used to indicate which
principals may be issued certificates from which (sub-)CAs, using
which profiles.

At this commit, and until sub-CAs are implemented, all rules refer
to the top-level CA (represented as ".") and no ca-ref argument is
exposed.

Also, during install and upgrade add a default CA ACL that permits
certificate issuance for all hosts and services using the profile
'caIPAserviceCert' on the top-level CA.

Part of: https://fedorahosted.org/freeipa/ticket/57
Part of: https://fedorahosted.org/freeipa/ticket/4559

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-06-11 10:50:31 +00:00
Petr Vobornik
7cf82cf9aa move replications managers group to cn=sysaccounts,cn=etc,$SUFFIX
https://fedorahosted.org/freeipa/ticket/4302

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-06-11 12:10:40 +02:00
Jan Cholasta
e7ac57e139 vault: Fix ipa-kra-install
Use state in LDAP rather than local state to check if KRA is installed.
Use correct log file names.

https://fedorahosted.org/freeipa/ticket/3872

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-06-10 16:17:34 +00:00
Jan Cholasta
cbcd86b500 install: Initialize API early in server and replica install
https://fedorahosted.org/freeipa/ticket/4468

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-06-10 16:17:34 +00:00
Jan Cholasta
81729e22d3 vault: Move vaults to cn=vaults,cn=kra
https://fedorahosted.org/freeipa/ticket/3872

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-06-10 16:17:34 +00:00
Jan Cholasta
46cbe26b51 install: Migrate ipa-replica-install to the install framework
https://fedorahosted.org/freeipa/ticket/4468

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-06-10 07:29:58 +00:00
Jan Cholasta
1bf383e0cf install: Handle Knob cli_name and cli_aliases values consistently
https://fedorahosted.org/freeipa/ticket/4468

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-06-10 07:29:58 +00:00
Jan Cholasta
eb959221e1 install: Migrate ipa-server-install to the install framework
https://fedorahosted.org/freeipa/ticket/4468

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-06-08 15:34:11 +00:00
Jan Cholasta
08229a0c54 install: Move private_ccache from ipaserver to ipapython
https://fedorahosted.org/freeipa/ticket/4468

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-06-08 15:33:36 +00:00
Jan Cholasta
4c70590c2a install: Fix external CA server install
https://fedorahosted.org/freeipa/ticket/4468

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-06-08 15:32:33 +00:00
Jan Cholasta
90e400e57e install: Fix CA-less server install
https://fedorahosted.org/freeipa/ticket/4468

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-06-08 15:32:33 +00:00
Jan Cholasta
e01095dfb3 install: Fix missing variable initialization in replica install
https://fedorahosted.org/freeipa/ticket/4468
2015-06-08 06:24:06 +00:00
David Kupka
2acedb2d5d Move CA installation code into single module.
https://fedorahosted.org/freeipa/ticket/4468

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-06-08 06:22:54 +00:00
Petr Spacek
5bb35c1a29 Grammar fix in 'Estimated time' messages printed by installer
Proposed by Tomas Capek.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-06-05 19:25:56 +02:00
Petr Spacek
a62b37cda2 Clarify messages related to adding DNS forwarders
Proposed by Tomas Capek.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-06-05 19:25:56 +02:00
Fraser Tweedale
8b3bc99a73 Import profiles earlier during install
Currently, IPA certificate profile import happens at end of install.
Certificates issuance during the install process does work but uses
an un-customised caIPAserviceCert profile, resulting in incorrect
subject DNs and missing extensions.  Furthermore, the
caIPAserviceCert profile shipped with Dogtag will eventually be
removed.

Move the import of included certificate profiles to the end of the
cainstance deployment phase, prior to the issuance of DS and HTTP
certificates.

Part of: https://fedorahosted.org/freeipa/ticket/4002

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-06-05 19:12:46 +02:00
Fraser Tweedale
ce33f82cfe Fix certificate subject base
Profile management patches introduced a regression where a custom
certificate subject base (if configured) is not used in the default
profile.  Use the configured subject base.

Part of: https://fedorahosted.org/freeipa/ticket/4002

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-06-05 19:12:46 +02:00
Fraser Tweedale
4cf2bfcaa6 Add profile_id parameter to 'request_certificate'
Add the profile_id parameter to the 'request_certificate' function
and update call sites.

Also remove multiple occurrences of the default profile ID
'caIPAserviceCert'.

Part of: https://fedorahosted.org/freeipa/ticket/57

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-06-04 08:27:33 +00:00
Fraser Tweedale
b24fe0eb73 Import included profiles during install or upgrade
Add a default service profile template as part of FreeIPA and format
and import it as part of installation or upgrade process.

Also remove the code that modifies the old (file-based)
`caIPAserviceCert' profile.

Fixes https://fedorahosted.org/freeipa/ticket/4002

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-06-04 08:27:33 +00:00
Fraser Tweedale
ba075b195c Enable LDAP-based profiles in CA on upgrade
Part of: https://fedorahosted.org/freeipa/ticket/4560

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-06-04 08:27:33 +00:00