Commit Graph

5229 Commits

Author SHA1 Message Date
Sumit Bose
ee936431c8 Move some krb5 keys related functions from ipa-client to util 2012-06-11 12:04:05 +02:00
Sumit Bose
20fce97dfa ipasam: remove unused struct elements 2012-06-11 12:03:09 +02:00
Sumit Bose
b367c9ee7e Use exop instead of kadmin.local 2012-06-11 09:40:59 +02:00
Petr Viktorin
6f1baf8b16 Only allow root to run update plugins
Several plugins need restarting the DS (or they currently do
an external bind).
Rather than disabling plugins (possibly partially), refuse
to run them when run as an unprivileged user.

This means running ipa-ldap-updater as non-root requires specifying
a list of files, and omiting the --upgrade and --plugins options.

https://fedorahosted.org/freeipa/ticket/2621
2012-06-07 05:02:22 -04:00
Petr Vobornik
1fcbad4bcb Update of serverconfig ipaconfigstring options
Patch "Add options to reduce writes from KDC" adds two more possible values to config plugins ipaconfigstring configuration options.

These are:
 * KDC:Disable Last Success
 * KDC:Disable Lockout

This patch adds them to Web UI

https://fedorahosted.org/freeipa/ticket/2734
2012-06-06 22:14:12 -04:00
Simo Sorce
f602ad270d Add support for disabling KDC writes
Add two global ipaConfig options to disable undesirable writes that have
performance impact.
The "KDC:Disable Last Success" will disable writing back to ldap the last
successful AS Request time (successful kinit)
The "KDC:Disable Lockout" will disable completely writing back lockout
related data. This means lockout policies will stop working.

https://fedorahosted.org/freeipa/ticket/2734
2012-06-06 22:12:22 -04:00
Petr Viktorin
f8e7b516d9 Prevent deletion of the last admin
Raise an error when trying to delete the last user in the
'admins' group, or remove the last member from the group,
or delete the group itself.

https://fedorahosted.org/freeipa/ticket/2564
2012-06-06 21:57:12 -04:00
Petr Viktorin
cf72738b21 Add samba4-python to BuildRequires 2012-06-07 11:42:39 +02:00
Petr Vobornik
e61d0ada04 Removal of illegal options in association dialog
Association dialogs were using non-existent options for find commands. It causes error when #2509 is implemented.

Now when creating a find command a check for options existence is performend. Option is not used if not present in metadata. It fixes the issue.

https://fedorahosted.org/freeipa/ticket/2760
2012-06-07 11:22:21 +02:00
Petr Vobornik
88170087e1 Change json serialization to serialize useful data
json_metadata command creates and sends metadata needed by Web UI. It uses __json__ method for serialization of commands, options, objects... . A lot of data sent was useless for Web UI and some usefull information were missing. We
 * mostly CLI specific option attribues are not send.
 * attributes evaluated to false or None are not send
 * options which are send are not got from takes_aptions attribute but by get_options() method. It finally sends usefull option collection for commands part of metadata.

In the end the raw amount of data send is aproximately the same.

This patch is needed for Web UI to determine which option it can use in which commands.

https://fedorahosted.org/freeipa/ticket/2760
2012-06-07 11:22:15 +02:00
Alexander Bokovoy
e3d171126f Add python-crypto to build requires for AD server-side code 2012-06-07 09:39:11 +02:00
sbose
e6d638b6cf Set samba_portmapper SELinux boolean during ipa-adtrust-install 2012-06-07 09:39:11 +02:00
Alexander Bokovoy
27c24ff7be ipa-sam: update sid_to_id() interface to follow passdb API changes in Samba
Commit a6e29f23f09ba5b6b6d362f7683ae8088bc0ba85 in Samba changed id mapping
API in passdb interface to use 'struct unixid'. The change replaced three arguments
(uid, gid, type) by one (struct unixid). As result, ipa-sam became broken.

Without this change ipa-sam introduces stack corruption in Samba post 4.0.0alpha18
leading to corrupted security context stack as well and then crashing in setgroups(3).
2012-06-07 09:39:10 +02:00
Alexander Bokovoy
4c92d0e729 get_fqdn() moved to ipaserver.installutils 2012-06-07 09:39:10 +02:00
Alexander Bokovoy
bd0d858043 Add trust-related ACIs
A high-level description of the design and ACIs for trusts is available at
https://www.redhat.com/archives/freeipa-devel/2011-December/msg00224.html
and
https://www.redhat.com/archives/freeipa-devel/2011-December/msg00248.html

Ticket #1731
2012-06-07 09:39:10 +02:00
Simo Sorce
000bcfe34f ipa-kdb: Add MS-PAC on constrained delegation. 2012-06-07 09:39:10 +02:00
Alexander Bokovoy
ae2d5edd1a Restart KDC after installing trust support to allow MS PAC generation
Also make sure all exceptions are captured when creating CIFS service
record. The one we care about is duplicate entry and we do nothing
in that case anyway.

Also make uniform use of action descriptors.
2012-06-07 09:39:10 +02:00
Alexander Bokovoy
6950629465 Properly handle multiple IP addresses per host when installing trust support
resolve_host() function returns a list of IP addresses. Handle it all rather
than expecting that there is a single address.

It wouldn't hurt to make a common function that takes --ip-address into account
when resolving host addresses and use it everywhere.
2012-06-07 09:39:10 +02:00
Alexander Bokovoy
cbb1d626b9 Perform case-insensitive searches for principals on TGS requests
We want to always resolve TGS requests even if the user mistakenly sends a
request for a service ticket where the fqdn part contain upper case letters.

The actual implementation follows hints set by KDC. When AP_REQ is done, KDC
sets KRB5_FLAG_ALIAS_OK and we obey it when looking for principals on TGS requests.

https://fedorahosted.org/freeipa/ticket/1577
2012-06-07 09:39:10 +02:00
Alexander Bokovoy
27517c2008 Use fully qualified PDC name when contacting for extended DN information 2012-06-07 09:39:09 +02:00
Alexander Bokovoy
a7420c1e83 Add trust management for Active Directory trusts 2012-06-07 09:39:09 +02:00
Alexander Bokovoy
dd244c02dd Use dedicated keytab for Samba
Samba just needs the cifs/ key on the ipa server. Configure samba to use a
different keytab file so that we do not risk samba commands (net, or similar)
to mess up the system keytab.

https://fedorahosted.org/freeipa/ticket/2168
2012-06-07 09:39:09 +02:00
Alexander Bokovoy
b32204fccc Add separate attribute to store trusted domain SID
We need two attributes in the ipaNTTrustedDomain objectclass to store different
kind of SID. Currently ipaNTSecurityIdentifier is used to store the Domain-SID
of the trusted domain. A second attribute is needed to store the SID for the
trusted domain user. Since it cannot be derived safely from other values and
since it does not make sense to create a separate object for the user a new
attribute is needed.

https://fedorahosted.org/freeipa/ticket/2191
2012-06-07 09:39:09 +02:00
Martin Kosek
52a9eb7a9c Fix dnszone-mod --forwader option help string
Help should not point to global forwarders but rather to per-zone
conditional forwarders.

https://fedorahosted.org/freeipa/ticket/2717
2012-06-05 10:46:42 +02:00
Martin Kosek
d31f0c2d33 Improve migration NotFound error
When no user/group was found, migration plugin reported an ambiguous
error about invalid container. But the root cause may be for example
in a wrong list of user/group objectclasses. Report both in the error
message to avoid user confusion.

User/group objectclass attribute is now also marked as required.
Without the list of objectclasses, an invalid LDAP search is
produced.

https://fedorahosted.org/freeipa/ticket/2206
2012-06-05 08:51:30 +02:00
Martin Kosek
c06cbb12ac Fill new DNS zone update policy by default
For security reasons, dynamic updates are not enabled for new DNS
zones. In order to enable the dynamic zone securely, user needs to
allow dynamic updates and create a zone update policy.

The policy is not easy to construct for regular users, we should
rather fill it by default and let users just switch the policy
on or off.

https://fedorahosted.org/freeipa/ticket/2441
2012-06-05 08:41:46 +02:00
Petr Vobornik
7d9abecbb6 Text widget's dirty state is changed on various input methods
on_value_changed event in textboxes and textareas was raised only on keyboard input. If user used different input method such as paste or browser undo and redo functions widget's on_value_changed event wasn't raised and so dirty state wasn't changed as well.

This patch adds listener to text's and textarea's 'input' event. Input is a HTML 5 event which is raises on user initiated action.
Some of user initiated actions :
 * Cut
 * Copy
 * Paste
 * Undo
 * Redo
 * Clear
 * Typing (like keyup)
 * Form AutoFill
 * User-invoked spellcheck corrections
 * Input from Input Method Editor

It should be supported by all recent versions of major browsers. IE doesn't support it up to version 8.

Listener for 'keyup' event was left in implementation for backward compatibility with older browsers. This may cause firing on_value_change twice but so far it shouldn't cause troubles.

https://fedorahosted.org/freeipa/ticket/2647
2012-06-04 11:26:47 +02:00
Petr Vobornik
664d33cef6 Added links to netgroup member tables
Tables with members in netgroup were missing links for navigation to associated details pages. This patch adds these links.

https://fedorahosted.org/freeipa/ticket/2670
2012-06-04 11:26:34 +02:00
Petr Vobornik
27b1dace2d Removal of illegal options in JSON-RPC calls
Ticket https://fedorahosted.org/freeipa/ticket/2509 bans using non existent options. If such option is supplied command ends with error. It uncovered several cases in Web UI. This patch is fixing these cases.

Automember, Self-service and Delegation don't support 'pkey-only', 'size-limit' and 'rights' option. Pagination and rights check were disabled for them.

Automount map adder dialog was sending options for indirect map even if chosen type was direct (when those for indirect was filled earlier), also it was sending non-existant 'method' option.

https://fedorahosted.org/freeipa/ticket/2760
2012-06-04 11:26:28 +02:00
Petr Vobornik
870627de9a Added cancel button to service unprovision dialog
Service unprovision dialog was missing a cancel button. The button was added.

https://fedorahosted.org/freeipa/ticket/1811
2012-06-04 11:25:45 +02:00
Petr Vobornik
bf9234dbd1 Enable reset password action according to attribute perrmission
This patch creates state_evaluator which creates permission states for defined attribute. The state format is: attributeName_permissionChar.

This evaluator is used for user_password attribute and it control enabling/disabling of related action in user account action panel.

https://fedorahosted.org/freeipa/ticket/2318
2012-06-04 10:45:08 +02:00
Petr Vobornik
bf0c6ff697 Add shadow to dialog
This patch adds shadow to dialog used in Web UI. It looks cooler.

https://fedorahosted.org/freeipa/ticket/2248
2012-06-04 10:45:08 +02:00
Petr Vobornik
496fbbd919 Added missing i18n in action list and action panel
This patch adds strings to internal.py which were not translated in action list/panel patches.

https://fedorahosted.org/freeipa/ticket/2248
2012-06-04 10:45:08 +02:00
Petr Vobornik
888797ffac Action panel for user
This patch adds action panel to user account section. The panel contain an action for reseting user password.

https://fedorahosted.org/freeipa/ticket/2248
2012-06-04 10:45:08 +02:00
Petr Vobornik
ea5ae4b1cf User password widget modified.
Currently the user password is shown as follows in the details page:
    Password: Reset Password

This is inconsistent with the rest of the page because the 'Reset Password' is an action, not the value of the password.

Now password is shown as follows:
    Password: *******   (if set)
    Password:           (if not set)

Reset password link was removed as well the dialog for reset password was removed from password widget. The dialog was moved to its own object and can be now showed independently. An action for showing this dialog should be created.

https://fedorahosted.org/freeipa/ticket/2248
2012-06-04 10:45:07 +02:00
Petr Vobornik
890151dca8 Action panel
This patch implements action panel. Action panel is a box located in facet details section which contains actions related to that object/section.

In spec file can be configured actions and title used in action panel. Default title is 'Actions'. Actions are specified by their name. They have to be defined in action collection in facet.

https://fedorahosted.org/freeipa/ticket/2248
2012-06-04 10:45:07 +02:00
Petr Vobornik
bd36600efe Refactored entities to use changed actions concept
It's continuation of previous refactoring effort. This part is changing specs in entities to used changed concept.

https://fedorahosted.org/freeipa/ticket/2248
2012-06-04 10:45:07 +02:00
Petr Vobornik
306f380258 Refactored action list and control buttons to use shared list of actions
This is a first step for implementing action panels which will also use the shared list of actions.

This effor changes the way how action list and control buttons are defined. First all actions are defined on facet level - attribute 'actions' in spec file. Implementation of action list widget is not specified on facet level. It is left in facet header. A list of action names used in action list can be now specified in facet spec in 'header_actions' attribute.
Control buttons use similar concept. Facet by default is using control_buttons_widget. Details and search facet are defining their own default actions (refresh/add/remove/update/reset). Additional buttons can be defined as array of action names on facet level in control_buttons attribute.

state_evaluators and state_listeners were united. They are called state_evaluators but they uses state_listener concept, they are attached to an event. For former state_evaluator the event is post_load. They are defined in spec in state attribute. State object purpose is to aggregate states from all state evaluators. It offers changed event to which can other objects subscribe. It also has summary evaluator which evaluation conditions.  Summary evaluator creates summary status with human readable description. It can be used by facet header.

https://fedorahosted.org/freeipa/ticket/2248
2012-06-04 10:45:07 +02:00
Petr Viktorin
c799f6a0bf Add more automount tests
This adds tests for the automountlocation_tofiles and
automountlocation_import commands, and to automountmap_add_indirect
with the --parentmap option.

The tofiles test checks not only the XML-RPC output, but also the
output_for_cli method.

The import tests load data from tofiles output to the directory
and check that tofiles output matches.
This only works when all maps are connected to auto.master.

Two minor touches to the automount plugin itself: remove an extra
space, and don't hide the traceback when re-raising an exception.
2012-05-31 20:16:29 -04:00
Martin Kosek
895203c477 Allow relative DNS name in NS validator
Precallback validator was failing when a zone-relative name was
used as a NS record (for example record "ns" in a zone "example.com").
However, this is valid in BIND and we should allow it as well.

Imports in dns module had to be switched to absolute imports
(available from Python 2.5) to deal with a conflict of IPA dns
module and dnspython module.

https://fedorahosted.org/freeipa/ticket/2630
2012-06-01 12:26:57 +02:00
Martin Kosek
6ff5f28142 permission-find missed some results with --pkey-only option
When permission-find post callback detected a --pkey-only option,
it just terminated. However, this way the results that could have
been added from aci_find matches were not included.

Fix the post callback to go through the entire matching process.
Also make sure that DNS permissions have a correct objectclass
(ipapermission), otherwise such objects are not matched by the
permission LDAP search.

https://fedorahosted.org/freeipa/ticket/2658
2012-06-01 07:51:59 +02:00
Petr Viktorin
0ca29fac9a Move install script error handling to a common function
All of our install/admin scripts had a try/except block calling the
main function and handling common exceptions. These were copy-pasted
from each other and modified to various levels of sophistication.
This refactors them out of installers to a single function, which
includes a final pass/fail message for all of the scripts.

Non-install scripts that set up the same log handler levels for
stderr and log file are not changed, as it's not possible to log
to only the logfile without changing the logger configuration.

https://fedorahosted.org/freeipa/ticket/2071
2012-05-31 14:37:27 +02:00
Rob Crittenden
9e877585e2 If SELinux is enabled ensure we also have restorecon.
We don't have a specific requires on the policycoreutils package. It
gets pulled in as a dependency on the server anyway, but checking
there is like a belt and suspenders.

On the client we don't require SELinux at all. If SELinux is enabled
however we need to set things up properly. This is provided by the
policycoreutils package so fail if that isn't available.

https://fedorahosted.org/freeipa/ticket/2368
2012-05-31 14:07:05 +02:00
Martin Kosek
5b465811ce Add rename option for DNS records
This option will make renaming DNS records much easier.
Add a unit test for this new functionality.

https://fedorahosted.org/freeipa/ticket/2600
2012-05-31 12:45:47 +02:00
Rob Crittenden
8d00d7c130 Enforce sizelimit in permission-find, post_callback returns truncated
We actually perform two searches in permission-find. The first looks
for matches within the permission object itself. The second looks at
matches in the underlying aci.

We need to break out in two places. The first is if we find enough
matches in the permission itself. The second when we are appending
matches from acis.

The post_callback() definition needed to be modified to return
the truncated value so a plugin author can modify that value.

https://fedorahosted.org/freeipa/ticket/2322
2012-05-30 08:46:21 +02:00
Jan Cholasta
d62b2d9be5 SSH configuration fixes.
Use GlobalKnownHostsFile instead of GlobalKnownHostsFile2 in ssh_config, as the
latter has been deprecated in OpenSSH 5.9.

If DNS host key verification is enabled, restrict the set of allowed host
public key algorithms to ssh-rsa and ssh-dss, as DNS SSHFP records support only
these algorithms.

Make sure public key user authentication is enabled in both ssh and sshd.

ticket 2769
2012-05-30 07:47:27 +02:00
Simo Sorce
43701d2735 Fix setting domain_sid
'sid' is a stack variable, by assigning its address to the domain_sid pointer
we were later referencing grabage (whatever on the stack ha[ppened to be at
that address.
Properly copy the sid and allocate it on the provided memory context.
2012-05-29 18:01:21 -04:00
Petr Viktorin
51bd68eaf5 Provide a better error message when deleting nonexistent attributes
If --delattr is used on an attribute that's not present on an entry,
and --{set,add}attr isn't being used on that same attribute,
say that there's "no such attribute" instead of "<attribute> does
not contain <value>".

https://fedorahosted.org/freeipa/ticket/2699
2012-05-29 00:38:40 -04:00
Petr Viktorin
1af36da933 Disallow setattr on no_update/no_create params
Make --{set,add,del}attr fail on parameters with the no_update/no_create
flag for the respective command.

For attributes that can be modified, but we just don't want to display
in the CLI, use the 'no_option' flag. These are "locking" attributes
(ipaenabledflag, nsaccountlock) and externalhost.

Document the 'no_option' flag. Add some tests.

https://fedorahosted.org/freeipa/ticket/2580
2012-05-29 09:23:26 +02:00
Martin Kosek
e0930d42a5 Reset krbtpolicy when a unit test is finished
Kerberos ticket maximum life was being set to 1 hour which then
affected lifetime of Kerberos tickets returned by IPA server under
the test.

Make sure that the policy is reset before and after the unit test to
keep the IPA server settings clean and not to disrupt development
environment.
2012-05-28 17:24:08 +02:00