Commit Graph

8503 Commits

Author SHA1 Message Date
Jan Cholasta
01dd951ddc vault: Add container information to vault command results
https://fedorahosted.org/freeipa/ticket/5150

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2015-08-19 10:39:25 +02:00
Jan Cholasta
29cee7a4bc vault: Fix vault-find with criteria
https://fedorahosted.org/freeipa/ticket/5212

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2015-08-19 10:28:27 +02:00
David Kupka
8ba1392a39 client: Add support for multiple IP addresses during installation.
https://fedorahosted.org/freeipa/ticket/4249

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-08-18 22:50:18 +02:00
Martin Babinsky
3506938a75 improve the handling of krb5-related errors in dnssec daemons
ipa-dnskeysync* and ipa-ods-exporter handle kerberos errors more gracefully
instead of crashing with tracebacks.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-08-18 21:11:58 +02:00
Fraser Tweedale
27988f1b83 Prohibit deletion of predefined profiles
Deletion of predefined profiles, including the default profile,
should not be allowed.  Detect this case and raise an error.

Also update the predefined profiles collection to use namedtuple,
making it easier to access the various components.

Fixes: https://fedorahosted.org/freeipa/ticket/5198
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2015-08-18 19:44:43 +02:00
David Kupka
65b8c62207 user-undel: Fix error messages.
https://fedorahosted.org/freeipa/ticket/5207

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-08-18 19:27:01 +02:00
Alexander Bokovoy
3692a1c57f trusts: harden trust-fetch-domains oddjobd-based script
When ipa-getkeytab is used to fetch trusted domain object credentials,
the fetched entry has always kvno 1. ipa-getkeytab always adds a key to
keytab which means older key versions will be in the SSSD keytab and
will confuse libkrb5 ccache initialization code as all kvno values are
equal to 1. Wrong key is picked up then and kinit fails.

To solve this problem, always remove existing
/var/lib/sss/keytabs/forest.keytab before retrieving a new one.

To make sure script's input cannot be used to define what should be
removed (by passing a relative path), make sure we retrieve trusted
forest name from LDAP. If it is not possible to retrieve, the script
will issue an exception and quit. If abrtd is running, this will be
recorded as a 'crash' and an attempt to use script by malicious user
would be recorded as well in the abrtd journal.

Additionally, as com.redhat.idm.trust-fetch-domains will create
ID ranges for the domains of the trusted forest if they don't exist,
it needs permissions to do so. The permission should be granted only
to cifs/ipa.master@IPA.REALM services which means they must have
krbprincipalname=cifs/*@IPA.REALM,cn=services,... DN and be members of
cn=adtrust agents,cn=sysaccounts,... group.

Solves https://bugzilla.redhat.com/show_bug.cgi?id=1250190

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-08-18 18:48:12 +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
Petr Vobornik
6941f4eec7 vault: validate vault type
https://fedorahosted.org/freeipa/ticket/5211

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-08-18 13:28:32 +02:00
Petr Vobornik
76ab7d9bae vault: normalize service principal in service vault operations
https://fedorahosted.org/freeipa/ticket/5233

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-08-18 13:28:32 +02:00
Endi S. Dewata
419754b1c1 Fixed vault container ownership.
The vault-add command has been fixed such that if the user/service
private vault container does not exist yet it will be created and
owned by the user/service instead of the vault creator.

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

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2015-08-18 12:24:51 +02:00
Jan Cholasta
d9e9e5088f vault: Fix param labels in output of vault owner commands
https://fedorahosted.org/freeipa/ticket/5214

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2015-08-18 11:17:29 +02:00
Jan Cholasta
d2da0d89d1 baseldap: Allow overriding member param label in LDAPModMember
https://fedorahosted.org/freeipa/ticket/5214

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2015-08-18 11:17:29 +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
0f8ff007b4 winsync-migrate: Expand the man page
https://fedorahosted.org/freeipa/ticket/5162

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-08-17 17:50:34 +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
Tomas Babej
1f62ab72ca trusts: Detect missing Samba instance
In the event of invocation of trust related commands, IPA server needs to
contact local Samba instance. This is not possible on servers that
merely act as AD trust agents, since they do not have Samba instance
running.

Properly detect the absence of the Samba instance and output
user-friendly
message which includes list of servers that are capable of running
the command, if such exist.

List of commands affected:
* ipa trust-add
* ipa trust-fetch-domains
* all of the trustdomain commands available via CLI

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

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-08-17 17:14:29 +02:00
Tomas Babej
9ce074b36a trusts: Detect domain clash with IPA domain when adding a AD trust
When IPA is deployed in the same domain as AD, trust-add fails since
the names of the local domain and trusted domain ranges is the same
- it's always DOMAIN.NAME_id_range.

When adding a trusted domain, we look for previous ranges for
this domain (which may have been left behind by previous trust
attempts). Since AD and IPA are in the same domain, we find
a local domain range, which does not have a SID.

Detect such domain collisions early and bail out with an appropriate
error message.

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

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-08-17 17:09:02 +02:00
Endi S. Dewata
0dd95a19ee Added CLI param and ACL for vault service operations.
The CLIs to manage vault owners and members have been modified
to accept services with a new parameter.

A new ACL has been added to allow a service to create its own
service container.

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Martin Kosek <mkosek@redhat.com>
2015-08-17 08:10:59 +02:00
Fraser Tweedale
6fa14fd21e Add permission for bypassing CA ACL enforcement
Add the "Request Certificate ignoring CA ACLs" permission and
associated ACI, initially assigned to "Certificate Administrators"
privilege.

Update cert-request command to skip CA ACL enforcement when the bind
principal has this permission.

Fixes: https://fedorahosted.org/freeipa/ticket/5099
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-08-14 14:02:05 +02:00
Petr Vobornik
6b978d74ae add permission: System: Manage User Certificates
usercertificate attr was moved from "System Modify Users" to this
new permission.

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

Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
2015-08-14 12:57:42 +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
Stanislav Laznicka
592e437fc7 ipa-client-install: warn when IP used in --server
ipa-client-install fails when an IP address is passed
to ipa-join instead of a FQDN

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-08-14 11:03:04 +02:00
Christian Heimes
e4dff25838 Asymmetric vault: validate public key in client
The ipa vault commands now load and validate the public key for
asymmetric encryption, before sending it to the server. This prevents
invalid vaults and prohibits accidental exposure of private key
material.

https://fedorahosted.org/freeipa/ticket/5142
https://fedorahosted.org/freeipa/ticket/5143

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2015-08-13 19:18:19 +02:00
Jan Cholasta
391ccabb9f ULC: Prevent preserved users from being assigned membership
https://fedorahosted.org/freeipa/ticket/5170

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-08-13 16:41:03 +02:00
Fraser Tweedale
f6b32d8eea certprofile: add profile format explanation
Part of: https://fedorahosted.org/freeipa/ticket/5089

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-08-12 18:24:34 +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
262faec70a Import 'reduce' from functools
The reduce function is no longer a built-in in Python 3.
Importing it from functools works on both py2 and py3.

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
8b88caa110 Modernize function and method attribute names
Python 3 uses double-underscored names for internal function attributes.
In Python 2.7, these names exist as aliases to the old 'func_*' and
'im_*' names.

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
Martin Babinsky
55feea500b idranges: raise an error when local IPA ID range is being modified
also show the message about the way UID/GID ranges are managed in FreeIPA in
the idrange-mod's help message

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-08-12 16:38:27 +02:00
Petr Vobornik
7d7ffb6252 validate mutually exclusive options in vault-add
https://fedorahosted.org/freeipa/ticket/5195

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-08-12 16:27:57 +02:00
Petr Vobornik
196ef09bd2 adjust search so that it works for non-admin users
Non-admin user can now search for:
- hosts
- hostgroups
- netgroups
- servers
- services

(Fixes ACI issue where search returns nothing when user does't have
read rights for an attribute in search_attributes.

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-08-12 16:14:21 +02:00
Fraser Tweedale
ba7e5df194 Fix KRB5PrincipalName / UPN SAN comparison
Depending on how the target principal name is conveyed to the
command (i.e. with / without realm), the KRB5PrincipalName / UPN
subjectAltName validation could be comparing unequal strings and
erroneously rejecting a valid request.

Normalise both side of the comparison to ensure that the principal
names contain realm information.

Fixes: https://fedorahosted.org/freeipa/ticket/5191
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-08-11 17:31:25 +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
Tomas Babej
1fc21e980b adtrust-install: Correctly determine 4.2 FreeIPA servers
We need to detect a list of FreeIPA 4.2 (and above) servers, since
only there is the required version of SSSD present.

Since the maximum domain level for 4.2 is 0 (and not 1), we can filter
for any value of ipaMaxDomainLevel / ipaMinDomainLevel attributes
to generate the list.

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

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2015-08-11 16:59:22 +02:00
Fraser Tweedale
e92f25bd50 Work around python-nss bug on unrecognised OIDs
A bug in python-nss causes an error to be thrown when converting an
unrecognised OID to a string.  If cert-request receives a PKCS #10
CSR with an unknown extension, the error is thrown.

Work around this error by first checking if the OID is recognised
and, if it is not, using a different method to obtain its string
representation.

Once the python-nss bug is fixed, this workaround should be
reverted.  https://bugzilla.redhat.com/show_bug.cgi?id=1246729

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-08-11 15:28:28 +02:00
Fraser Tweedale
812ab600a3 Add profile for DNP3 / IEC 62351-8 certificates
The DNP3 smart-grid standard uses certificate with the IEC 62351-8
IECUserRoles extension.  Add a profile for DNP3 certificates which
copies the IECUserRoles extension from the CSR, if present.

Also update cert-request to accept CSRs containing this extension.

Fixes: https://fedorahosted.org/freeipa/ticket/4752
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-08-11 14:57:41 +02:00
Fraser Tweedale
aafc0e980b Allow SAN extension for cert-request self-service
Users cannot self-issue a certificate with a subjectAltName
extension (e.g. with rfc822Name altNames).  Suppress the
cert-request "request certificate with subjectaltname" permission
check when the bind principal is the target principal (i.e.
cert-request self-service).

Fixes: https://fedorahosted.org/freeipa/ticket/5190
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-08-11 12:25:51 +02:00
Fraser Tweedale
6f8b0ed4fa Give more info on virtual command access denial
The current error message upon a virutal command access denial does
not give any information about the virtual operation that was
prohibited.  Add more information to the ACIError message.

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-08-11 12:25:51 +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
Petr Vobornik
ebc7ab1efe webui: add LDAP vs Kerberos behavior description to user auth types
https://fedorahosted.org/freeipa/ticket/4935

Reviewed-By: David Kupka <dkupka@redhat.com>
2015-08-10 14:54:16 +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
Tomas Babej
7688bbcc33 Fix incorrect type comparison in trust-fetch-domains
Value needs to be unpacked from the list and converted before comparison.

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

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2015-08-06 10:16:30 +02:00