Commit Graph

1824 Commits

Author SHA1 Message Date
Stanislav Laznicka
427bbf6c0d The LDAP*ReverseMember shouldn't imply --all is always specified
The LDAP*ReverseMember methods would always return the whole LDAP
object even though --all is not specified.
Also had to fix some tests as objectClass will not be returned by
default now.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-06-29 10:44:30 +02:00
Stanislav Laznicka
30d054a573 Revert "Removed dead code from LDAP{Remove,Add}ReverseMember"
While the code was really dead, it should serve a purpose elsewhere.
This reverts commit c56d65b064.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-06-29 10:44:30 +02:00
Fraser Tweedale
6e4e522e52 cert-find: fix 'issuer' option
The 'issuer' option of cert-find was recently changed from Str to
DNParam, however, 'ra.find' expects a string and throws when it
receives a DN.

When constructing the dict that gets passed to 'ra.find', turn
DNParams into strings.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-06-29 09:54:18 +02:00
Fraser Tweedale
b720aa94e9 Update lightweight CA serial after renewal
For CA replicas to pick up renewed lightweight CA signing
certificates, the authoritySerial attribute can be updated with the
new serial number.

Update the renew_ca_cert script, which is executed by Certmonger
after writing a renewed CA certificate to the NSSDB, to update the
authoritySerial attribute if the certificate belongs to a
lightweight CA.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-06-29 08:52:29 +02:00
Fraser Tweedale
67f13c82d8 Skip CS.cfg update if cert nickname not known
After CA certificate renewal, the ``renew_ca_cert`` helper updates
certificate data in CS.cfg.  An unrecognised nickname will raise
``KeyError``.  To allow the helper to be used for arbitrary
certificates (e.g. lightweight CAs), do not fail if the nickname is
unrecognised - just skip the update.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-06-29 08:52:29 +02:00
Fraser Tweedale
45daffa22f Set default OCSP URI on install and upgrade
Dogtag has been updated to support a default OCSP URI when the
profile includes AuthInfoAccess with URI method but does not specify
the URI (instead of constructing one based on Dogtag's hostname and
port).

Add the pkispawn config to ensure that the OCSP URI is set before
issuing CA and system certificates, and add the config to existing
CA instances on upgrade.

Fixes: https://fedorahosted.org/freeipa/ticket/5956
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-06-28 19:15:35 +02:00
Martin Basti
5693d19550 CA replica promotion: add proper CA DNS records
Update 'ipa-ca' records with A/AAAA records of the newly added replica

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-06-28 16:56:35 +02:00
Martin Basti
104040cf36 DNS Locations: cleanup of bininstance
We don't need anymore:
* sample of zone file - list of all records required by IPa will be
provided

* NTP related params - DNS records will be updated automatically,
based on LDAP values

* CA related params - DNS records will be updated automatically based
* on LDAP values

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-06-28 15:23:51 +02:00
Jan Cholasta
8466e94440 schema: support plugin versioning
Update API schema server and client code to support plugin versioning.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-06-28 13:30:49 +02:00
Jan Cholasta
4284d4fb4d plugable: support plugin versioning
Allow multiple incompatible versions of a plugin using the same name. The
current plugins are assumed to be version '1'.

The unique identifier of plugins was changed from plugin name to plugin
name and version. By default, the highest version available at build time
is used. If the plugin is an unknown remote plugin, version of '1' is used
by default.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-06-28 13:30:49 +02:00
Jan Cholasta
79d1f58335 plugable: use plugin class as the key in API namespaces
When iterating over APINameSpace objects, use plugin class rather than its
name as the key.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-06-28 13:30:49 +02:00
Jan Cholasta
9a21964877 misc: generate plugins result directly in the command
Move the code that generated result of the `plugins` command from API to
the command itself.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-06-28 13:30:49 +02:00
Jan Cholasta
61987b66ba automember: fix automember to work with thin client
Properly mark `cn` as primary key of `automember` object.

This fixes automember crashing on output validation expecting primary key
value of None.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-06-27 16:42:42 +02:00
Jan Cholasta
055dfaf657 schema: do not crash in command_defaults if argument is None
https://fedorahosted.org/freeipa/ticket/4739

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-06-27 16:42:42 +02:00
Jan Cholasta
ac8e8ecdd3 schema: fix param default value handling
Advertise param's default value even when `autofill` is False. When
`autofill` is False, set `alwaysask` to True in the schema, as it is
semantically equivallent and removes redundancy.

This fixes default value disappearing in CLI for some params.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-06-27 16:42:42 +02:00
Martin Babinsky
7b8247a485 keep setting ipakrbprincipal objectclass on new service entries
this is required for replica promotion to work, since the ACI allowing hosts
to add their own services uses this objectclass as target filter.

This partially reverts changes from commit
705f66f749

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-06-27 13:38:07 +02:00
Martin Basti
7bf3b1d546 DNS Locations: optimization: use server-find to get information
Because separated calls for of server-show, getting server data is quite
slow. This commit replaces several server-show with one server-find
command. There are future plans to improve speed of server-find that
will be beneficial for DNS locations.

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-06-27 13:35:00 +02:00
Martin Basti
218734ba5a DNS Locations: hide option --no-msdcs in adtrust-install
Since DNS location mechanism is active, this option has no effect,
because records are generate dynamically.

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-06-27 13:35:00 +02:00
Martin Basti
e42f662b78 Revert "DNS Locations: do not generate location records for unused locations"
This reverts commit bbf8227e3f.

After deeper investigation, we found out that empty locations are needed
for clients, because clients may have cached records for longer time for
that particular location. Only way how to remove location is to remove
it using location-del

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-06-27 13:35:00 +02:00
Fraser Tweedale
47d33f3650 Fix IssuerDN presence check in cert search result
When checking for presence of IssuerDN in certificate search result,
we mistakenly check for the presence of the SubjectDN field, then
unsafely index into the IssuerDN field.  Check the presence of
IssuerDN correctly.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-06-27 13:11:57 +02:00
Martin Babinsky
9392b21271 Fix incorrect construction of service principal during replica cleanup
https://fedorahosted.org/freeipa/ticket/5985

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-06-27 12:59:48 +02:00
Martin Basti
c6f7d94d5b DNS Locations: server-mod: fix if statement
Statement used for detection if objeclass change is needed was logically
wrong, this fixes it.

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

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2016-06-27 10:22:39 +02:00
Stanislav Laznicka
13328bc751 topo segment-add: validate that both masters support target suffix
This patch removes the ability to add segment between hosts where
either does not support the requested suffix.

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

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2016-06-24 13:32:02 +02:00
Stanislav Laznicka
5b5258b010 Fix topologysuffix-verify failing connections
topologysuffix-verify would have checked connectivity even between hosts that
are not managed by the given suffix.

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

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2016-06-24 13:32:02 +02:00
Martin Basti
926462d335 Server-del: fix system records removal
Services on replica to be removed  must be deleted first, otherwise
update of system records will not take this change into account

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-06-23 12:33:43 +02:00
Martin Babinsky
1bba2ed45d set krbcanonicalname on host entry during krbinstance configuration
part of https://fedorahosted.org/freeipa/ticket/3864

Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Simo Sorce <ssorce@redhat.com>
2016-06-23 09:48:06 +02:00
Martin Babinsky
705f66f749 IPA API: set krbcanonicalname instead of ipakrbprincipalalias on new entities
Hosts, services, and (stage)-users will now have krbcanonicalname attribute
set to the same value as krbprincipalname on creation. Moreover, new services
will not have ipakrbprincipalalias set anymore.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Simo Sorce <ssorce@redhat.com>
2016-06-23 09:48:06 +02:00
Florence Blanc-Renaud
517964f746 Report missing certificate in external trust chain
When ipa-server-install is called with an external CA, but the cert chain is
incomplete, the command exits with the following error:
ERROR CA certificate chain in <list of --external-cert-file> is incomplete

The fix adds in the log the name of the missing certificate:
ERROR    CA certificate chain in <list of --external-cert-file> is incomplete: missing certificate with subject '<dn of the missing certificate>'

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-06-23 07:36:57 +02:00
Stanislav Laznicka
9a8c5c9dfd host/service-show/find shouldn't fail on invalid certificate
host/service-show/find methods would have failed if the first
certificate they had in userCertificate attribute were invalid.
Expected behavior is that they just show the rest of the reqested
attributes.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-06-22 17:43:14 +02:00
Martin Babinsky
be3ad1ed7a server-del: harden check for last roles
The current implementation of check for last CA/DNS server and DNSSec key
master in `server-del` is quite fragile and wroks with quite a few assumptions
which may not be always true (CA and DNS is always configured etc.).

This patch hardens the check so that it does not break when the above
assuptions do not hold.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-06-22 17:26:56 +02:00
Martin Basti
9ae98420e9 Replica promotion: use the correct IPA domain for replica
IPA domain is detected from LDAP for replica promote installation.
If local domain and IPA domain does not match, installer refuses
to install replica.

IPA versions 4.3.0 and 4.3.1 allow to specify different domain for
replica. Only one IPA domain is allowed (domain used with master)
and different domain may cause issues.

This commit prevents to install new replica if multiple domains was
used in past. User action is required to fix this issue and remove
incorrect IPA domains from LDAP.

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
2016-06-21 17:09:06 +02:00
David Kupka
a5f48476ad schema: return fingerprint as unicode text
https://fedorahosted.org/freeipa/ticket/4739

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-06-21 16:23:43 +02:00
David Kupka
d0e708cba2 schema: Cache schema in api instance
To avoid generating schema for every schema command call store schema in
api instance when first generated and reuse it in next calls.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-06-21 15:11:19 +02:00
David Kupka
4b97cabb52 schema: Add known_fingerprints option to schema command
When client requests schema it can list fingerprints of cached schemas
and server responds with SchemaUpToDate exception specifying fingeprint
of schema to use.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-06-21 15:11:19 +02:00
David Kupka
034a111972 schema: Add fingerprint and TTL
Calculate fingerprint for schema in deterministic way. Send fingerprint
value together with schema. Send TTL with schema to inform client about
caching interval.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2016-06-21 15:11:19 +02:00
Pavel Vomacka
f85c347f4d Add placeholder to add segment dialog
'Autogenerated' placeholder is shown when adding new segment.

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

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2016-06-21 14:15:56 +02:00
Petr Spacek
22f4045f72 DNS: Fix realm domains integration with DNS zone add.
Realmdomains integration into DNS commands pre-dates split of DNS forward zones
and DNS master zones into two distinct commands.

There was an forgotten condition in dnszone_add command which caused omission
of DNS master zones with non-empty forwarders from realmdomain list.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-06-21 13:46:15 +02:00
Martin Babinsky
702ab0008b Do not update result of *-config-show with empty server attributes
If a server attribute such as DNSSec Key master is unset, None is passed as
the attribute value into the upper API layers and displayed in the output of
`dnsconfig-show` et al. We should not show this and leave the attribute empty
instead.

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

Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-06-21 13:07:24 +02:00
Jan Cholasta
894be1bd50 dns: fix dns_update_system_records to work with thin client
https://fedorahosted.org/freeipa/ticket/2008
https://fedorahosted.org/freeipa/ticket/4739

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-06-21 13:03:14 +02:00
Petr Spacek
f2974b8d96 DNS: Warn about restart when default TTL setting DNS is changed
bind-dyndb-ldap 10.0 has to be restarted after each change to default
TTL.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-06-21 12:38:00 +02:00
Petr Spacek
eefdcc6b07 DNS: Support default TTL setting for master DNS zones
https://fedorahosted.org/freeipa/ticket/2956

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-06-21 12:38:00 +02:00
Jan Cholasta
b00dbca98f cert: allow search by certificate
Allow search by certificate data or file in cert-find.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
2016-06-21 09:45:20 +02:00
Jan Cholasta
9b2146be40 cert: add owner information
Get owner information from LDAP in cert-show and cert-find. Allow search by
owner in cert-find.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
2016-06-21 09:45:20 +02:00
Jan Cholasta
d44ffdad42 cert: add object plugin
Implement cert as an object with methods rather than a bunch of loosely
related commands.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
2016-06-21 09:45:20 +02:00
Martin Basti
fe689e9938 Fix possibly undefined variable in ipa_smb_conf_exists()
There was missing else statement what may result in undefined conf_fd
variable.

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2016-06-20 20:49:35 +02:00
Petr Spacek
b6bab8d4e0 DNS Locations: make ipa-ca record generation more robust
__add_ca_records_from_hostname() now skips over DNS exceptions and
retries resolution until timeout of 120 seconds is reached.

Luckily current logic fails safe: In cases where resolution failed for
all the CA servers, the resulting zone object will not contain ipa-ca
record at all and the update logic will skip update for this name.
I.e. the original values in ipa-ca record set will be left in place.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-06-20 20:03:47 +02:00
Oleg Fayans
0ba9e72057 Increased certmonger timeout
https://fedorahosted.org/freeipa/ticket/5758

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-06-20 19:36:45 +02:00
Jan Cholasta
91d6d87ca7 replica install: fix thin client regression
Fix a regression introduced by commit
3157eec28f.

https://fedorahosted.org/freeipa/ticket/4739
https://fedorahosted.org/freeipa/ticket/5985

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: David Kupka <dkupka@redhat.com>
2016-06-20 18:45:26 +02:00
Jan Cholasta
8cc8b6fb10 schema: remove no_cli from command schema
Instead, support excluding commands from specified contexts and exclude
commands with NO_CLI set from the 'cli' context.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-06-20 16:39:12 +02:00
Jan Cholasta
cbe73c6d28 schema: remove redundant information
Remove the `autofill` kwarg from param schema. On the server, include
default value only if autofill is set. On the client, set autofill if param
has a default value.

Remove the `deprecated_cli_aliases`, `hint` and `sortorder` kwargs, and the
`dnsrecord_extra`, `dnsrecord_part` and `suppress_empty` flags from param
schema, as they are now handled exclusively on the client.

Replace the `no_option` and `no_output` flags in param schema with
exclusion of the param in 'cli' and 'webui' contexts.

Remove the `no_display` flag from output schema, as it is now handled
exclusively on the client.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
2016-06-20 16:39:12 +02:00