Commit Graph

4586 Commits

Author SHA1 Message Date
Martin Kosek
649d13b597 Prevent service restart failures in ipa-replica-install
Call restart() methods of appropriate services instead of calling
the system service restart command directly as service() method
has a capability to wait until the service is fully up. Without
this patch ipa-replica-install crashed on F-16 because krb5kdc
service was started before dirsrv service was fully up.

https://fedorahosted.org/freeipa/ticket/2139
2012-01-13 09:10:54 +01:00
Martin Kosek
5550ee1607 Fix LDAP add calls in replication module
Replace conn.add_s(entry) with conn.addEntry(entry) to avoid
function calls with an invalid number of parameters.

https://fedorahosted.org/freeipa/ticket/2139
2012-01-13 09:10:50 +01:00
Alexander Bokovoy
4622812a4f Validate sudo RunAsUser/RunAsGroup arguments
FreeIPA SUDO rules use --usercat/--groupcat to specify that rule
applies to all users or groups. Thus, sudorule-add-runasuser and
sudorule-add-runasgroup accept specific groups and users and do not
accept ALL reserved word.

The patch validates user and group passed to these commands and
reports appropriate errors when these are ALL.

Ticket #1496
https://fedorahosted.org/freeipa/ticket/1496
2012-01-13 10:07:27 +02:00
Rob Crittenden
638a970172 Catch exception when trying to list missing managed entries definitions
On the off chance that the definitions cannot be found we should
catch the error and not raise a backtrace.

https://fedorahosted.org/freeipa/ticket/1912
2012-01-12 05:46:13 -05:00
Rob Crittenden
64b0855e87 Document the ping plugin.
https://fedorahosted.org/freeipa/ticket/1903
2012-01-12 05:46:09 -05:00
Martin Kosek
485c3bb897 Fix maxvalue in DNS plugin
Having a Parameter maxvalue larger that 2G makes Python convert it
to "long" type instead of "int" type. Our framework than fails to
bootstrap the API when it detects long integer in Parameter
maxvalue.

Remove the clashing maxvalue out entirely as we can't transfer
values larger than 2G anyway (xmlrpc limitation).

https://fedorahosted.org/freeipa/ticket/2082
2012-01-12 17:15:00 +01:00
Martin Kosek
a22620c832 Create per-type DNS API
Use new structured DNSRecord parameters to generate per-type API
for all supported DNS RR types. This should help significantly
the end-user with manipulating complex DNS record type (MX, LOC,
etc.).

All enhancements are integrated to current DNS record commands:

1) dnsrecord-add
  - Records can be either entered as a raw value (e.g. --mx-rec=
    "1 srv1.example.com" for MX record) or per-part:
    --mx-preference=1 --mx-exchanger=srv1.example.com
  - CLI interactive help behavior was changed. It will ask for
    a record type and then ask for all DNS record part values
    (e.g. MX Preference value, MX Exchanger value).

2) dnsrecord-mod
  - This command can now operate in 2 modes. When only a raw DNS
    record is entered (e.g. --mx-rec="1 srv1.example.com") it
    operates in standard mode and replaces any previous mxrecord
    value with the --mx-rec value.

    When any structured parameter (e.g. --mx-preference) is passed
    it modifies just the specified parts of one mxrecord value
    referred by --mx-rec:
      --mx-rec="1 srv1.example.com" --mx-preference=2
  - New interactive help has been implemented. It will ask for a
    record to be modified (in the same manner as dnsrecord-del)
    and then let user change DNS record part(s) for chosen
    records.

3) All dnsrecord-* commands have now --structured option
  - When this option is passed, instead of displaying raw DNS values
    all DNS records are parsed and displayed per-part. Example:

$ ipa dnsrecord-show example.com @ --structured
  Record name: @
  Records:
    Record type: MX
    Record data: 0 server1.example.com.
    MX Preference: 0
    MX Exchanger: server1.example.com.

    Record type: NS
    Record data: ns1.example.com.
    NS Hostname: ns1.example.com.

All API changes are compatible with clients without this patch.

https://fedorahosted.org/freeipa/ticket/2082
2012-01-12 09:44:00 +01:00
Martin Kosek
2188dae0c9 Improve CLI output for complex commands
Complex commands may have many options or non-standard output. This
patch adds 2 improvements to handle these commands better:
  1) Add "option_group" parameter attribute
     Make command help more readable by specifying an option group
     for the parameter. All parameters in the same option group are
     then placed to one named option group
  2) Allow nested entries in the output
     Current CLI output module cannot handle a list of nested entries
     (dictionaries) contained in an entry attribute. Make sure they
     are printed properly (with indentation)

https://fedorahosted.org/freeipa/ticket/2082
2012-01-12 09:43:13 +01:00
Martin Kosek
1f36ab1b78 Fix Parameter csv parsing
CSV values were not parsed in ipalib.parameters.normalize method
properly when passed as a list and not as a basestring.

Based on Jan Cholasta's contribution.
2012-01-12 09:43:10 +01:00
Martin Kosek
52ea3a6b29 Refactor dnsrecord processing
Current DNS record processing architecture has many flaws,
including custom execute() methods which does not take advantage
of base LDAP commands or nonstandard and confusing DNS record
option processing.

This patch refactors DNS record processing with the following
improvements:
 * Every DNS record has now own Parameter type. Each DNS record
   consists from one or more "parts" which are also Parameters.
   This architecture will enable much easier implementation of
   future per-DNS-type API.
 * Validation is now not written as a separate function for
   every parameter but is delegated to DNS record parts.
 * Normalization is also delegated to DNS record parts.
 * Since standard LDAP base commands execute method is now used,
   dnsrecord-add and dnsrecord-mod correctly supports --setattr
   and --addattr options.
 * In order to prevent confusion unsupported DNS record types
   are now hidden. They are still present in the plugin so that
   old clients receive proper validation error.

The patch also contains several fixes:
 * Fix domain-name validation and normalization- allow domain
   names that are not fully qualified. For example --cname-rec=bar
   is a valid domain-name for bind which will translate it then
   as bar.<owning-domain>. This change implies, that fully qualified
   domain names must end with '.'.
 * Do not let user accidentally remove entire zone with command
   "ipa dnsrecord-del @ --del-all".
 * Fix --ttl and --class option processing in dnsrecord-add and
   dnsrecord-mod.

All API changes are compatible with clients without this patch.

https://fedorahosted.org/freeipa/ticket/2082
2012-01-12 09:43:05 +01:00
Simo Sorce
91c10419f8 ipa-kdb: Create PAC's KDC checksum with right key
Fixes: https://fedorahosted.org/freeipa/ticket/2170
2012-01-11 17:34:21 -05:00
Simo Sorce
417b9fb9c1 ipa-kdb: Verify the correct checksum in PAC validation
This patch requires a forthcoming change in MIT libraries which allows to pass
NULL for the server_key to the krb5_pac_verify() function.

In most cases we should always only check the KDC checksum to verify the PAC
validity.

The only exception is when we are releasing a ticket to a client from another
realm. In this case the only signature we can check is the server checksum, and
we use the cross-realm key to validate in this case.

The previous code was working for normal cases because the kdc uses the same
key to create the server and the kdc checksum for a TGT, but that is not true
for evidence tickets (s4u2proxy) or cross-realm TGTs.

Fixes: https://fedorahosted.org/freeipa/ticket/2169
2012-01-11 17:34:15 -05:00
Rob Crittenden
c08296adff Configure s4u2proxy during installation.
This creates a new container, cn=s4u2proxy,cn=etc,$SUFFIX

Within that container we control which services are allowed to
delegate tickets for other services. Right now that is limited
from the IPA HTTP to ldap services.

Requires a version of mod_auth_kerb that supports s4u2proxy

https://fedorahosted.org/freeipa/ticket/1098
2012-01-10 22:39:26 -05:00
Petr Vobornik
74857a8ee4 Added IP address validator to Host and DNS record adder dialog
Also fixed minor issues reagarding IP addresses or multivalued field:
 - removed unnecessary method overrides from multivalued_field
 - fixed extract_child_value method in multivalued_widget to return '' instead of empty arrays when value array is empty
 - net.js - changed method name and error message from 'trailing zeros' to 'leading zeros'

https://fedorahosted.org/freeipa/ticket/1466
2012-01-11 00:48:44 -06:00
Petr Vobornik
05345ce8c8 Added support for memberof attribute in permission
The attribute was added to adder dialog and details facet. It uses entity select (group) widget.

https://fedorahosted.org/freeipa/ticket/2101
2012-01-11 00:48:36 -06:00
Endi Sukma Dewata
9dff149830 Load user data and policies in a single batch.
The user details facet has been modified to load the user data,
password policy and Kerberos ticket policy in a single batch
command.

Ticket #703
2012-01-10 18:44:35 +01:00
Endi Sukma Dewata
74e31cd985 Added policies into user details page.
The user details page has been modified to show the password policy
and Kerberos ticket policy that apply to the user. The policies are
currently displayed as read-only.

Ticket #703
2012-01-10 18:42:26 +01:00
Ondrej Hamada
0e037f24ce HBAC test optional sourcehost option
New version of SSSD begins ignoring sourcehost value of HBAC rules by
default. In order to match this behaviour the sourcehost option in
hbactest is optional now, but the value of sourcehost is ignored in all
rules. Every rule's sourcehost value is set to 'ALL' what turns sourchost
value comparation off. If srchost option is used, warning is displayed to
inform the user about changes. Text of plugin help was also updated.

Also the unit tests for hbactest plugin were updated. Every test was
doubled. The second ones test the plugin without sourcehost option. They
are supposed to have the same result.

https://fedorahosted.org/freeipa/ticket/2085
2012-01-09 08:49:10 +02:00
Endi Sukma Dewata
2a00393712 Added account status into user search facet.
The user search facet has been modified to show the account status.
The IPA.boolean_format has been converted into a class to allow
behavior customization.

Ticket #1996
2012-01-06 15:25:43 +01:00
Rob Crittenden
1b1aad2b02 Fix two typos in role help.
Contributed by Jérôme Fenal
2012-01-04 21:04:56 -05:00
Rob Crittenden
64ee2464e8 Display the value of memberOf ACIs in permission plugin.
There were two problems:

1. memberof wasn't in the list of things we looked for in the return value
   from aci_show()
2. The value wasn't being translated into a group name.

Use the DN class to retrieve the group name from the memberof URI.

Note that I changed the parsing for targetgroup as well. We now save a lookup
and potentially returning a NotFound if an aci points to a group that no
longer exists.

https://fedorahosted.org/freeipa/ticket/2100
2012-01-04 20:27:26 -05:00
Simo Sorce
de0444defe ipa-cldap: Support clients asking for default domain 2012-01-05 09:38:04 -05:00
Martin Kosek
d0648f1fd4 Add DNS check to conncheck port probe
It is pointless to report failures for all checked ports when the
target hostname is not resolvable - user may get easily confused.
This patch changes this behavior so that conncheck fails with
a proper error and does not even continue to port probing part.

https://fedorahosted.org/freeipa/ticket/1984
2012-01-03 16:41:15 -05:00
John Dennis
a071257ed2 update i18n pot file for branch master 2012-01-03 16:36:34 -05:00
Petr Vobornik
ceee08faa1 Fixed IPv6 validation special case: single colon
IPv6 parsing was incorrectly evaluating ':' as a valid IPv6 address.

https://fedorahosted.org/freeipa/ticket/1466
2012-01-03 21:28:53 -06:00
Petr Vobornik
c7ae0c20db Added client-side validation of A and AAAA DNS records
https://fedorahosted.org/freeipa/ticket/1466
2012-01-03 21:28:49 -06:00
Petr Vobornik
911f396604 Added validation logic to multivalued text field
https://fedorahosted.org/freeipa/ticket/1466
2012-01-03 21:28:45 -06:00
Petr Vobornik
747c069c45 Added support of custom field validators
Current validation logic supports only validation based on metadata. It can be extended only by overriding field's validation method. This approach requires creating subclasses of field for each different format of desired value. It's inconvenient for cases like adding the same validation logic to two different subclasses of field.

This patch is adding support for creating custom validators.

Validator is an object which contains validation logic. Validation is executed in a validate(value, context) method. This method checks if the value is valid and returns a validation result. Validation result is a simple object which contains valid property and an error message if valid is false.

Field is extended by validators property. It can be set in spec object or later. It should contain instances of validators for the field. Validators are run in field's validation method.

This patch is a prerequisite for:
https://fedorahosted.org/freeipa/ticket/1466
2012-01-03 21:28:41 -06:00
Jan Cholasta
9beb467d98 Fix attempted write to attribute of read-only object.
Add new class "cachedproperty" for creating property-like attributes
that cache the return value of a method call.

Also fix few issues in the unit tests to enable them to succeed.

ticket 1959
2012-01-02 11:51:26 +03:00
Endi Sukma Dewata
46d3abc450 Reload UI on server upgrade.
The JSON server has been modified to return the version number
in all responses. The UI has been modified to keep the version
obtained during env operation and check the version returned
in subsequent operations. If the version changes the UI will
reload itself.

Ticket #946
2011-12-21 13:23:08 -06:00
Endi Sukma Dewata
edd37d2019 Reload UI when the user changes.
The JSON server has been modified to return the principal name
in all responses. The UI has been modified to keep the principal
obtained during whoami operation and check the principal returned
in subsequent operations. If the principal changes the UI will
reload itself.

Ticket #1400
2011-12-21 13:22:45 -06:00
Petr Vobornik
78e93c11f6 Parsing of IPv4 and IPv6 addresses
Added support of parsing and validation of IPv4 and IPv6 addresses.
Class IP.address can also create reverse address from any valid IPv4 or IPv6 address.

This functionality is needed for tickets:
https://fedorahosted.org/freeipa/ticket/1466
https://fedorahosted.org/freeipa/ticket/1975
2011-12-21 13:13:06 -06:00
Endi S. Dewata
5fc064f13e Refactored entity object resolution.
The IPA.get_entity() has been modified to accept either entity name
or entity object. If it receives an entity object it will return
the object itself. Otherwise, it will resolve the name in the entity
registry.

The other_entity variables have been modified to store a reference
to the entity object instead of its name. The test cases have been
modified to use real entity objects instead of just the names.

Ticket #2042
2011-12-21 14:59:49 +01:00
Petr Vobornik
49e5555b11 Fixed labels in Sudo, HBAC rules
Fixed regression in labels introduced by refactoring #1515.

https://fedorahosted.org/freeipa/ticket/1515
2011-12-20 21:05:53 +00:00
Petr Vobornik
689f7ba01a Better table column width computing
Columns can have width set or not. Without setting the width it was computed based on tbody width and number of columns. This method is working well if no column has width set. The disadvantage of this approach is that all columns have the same width and so they are not reflecting their possible usage. Flag columns such as 'external' in rule association tables or various 'enable' flags in search facets can be narrower. If we set them fixed small width it will have different size because this width is not currently added to the computation.

This is fixing this problem so dynamic and fixed width can be combined and the columns have desired width.

https://fedorahosted.org/freeipa/ticket/2200
2011-12-17 02:42:45 +00:00
Petr Vobornik
8cb211a24f Distinguishing of external values in association tables
Problem:
Rule association widget was displaying standard records with external records in one table. User couldn't distinguish the values. When clicking on the external record link it navigated to appropriate page for that entity. But for external value there is no record to show so it displayed error.

Solution:
* For tables with possible external values a 'external' column was added. It displays "True" if the value is external and nothing if not. Displaying nothing is intentional. If user sees some text in external column he imidiately knows that the record is external without even reading the "True" text.
* Rows with external values don't have a link for navigating to record page. This prevents showing the error as no record exists.

Additional changes:
* Association table widget was stripped of get_records method. Loading records isn't its resposibility it's a resposibility of field.
* Column was extended by possible suppressing of link creation. It's done by optional suppress_link argument in setup method.
* To allow setting suppress_link attribute in inherited tables a new overridable method was created - setup_column.

Posible future improvements:
* Table is using dynamic setting of width for columns. Each column has the same width. For flag columns such as 'external' the width of the column is too big. It would be better to be able to set smaller fixed width and the rest of the columns width (without the width set) would be computed (to fit the table).
* When a table has displayed buttons in its last column header the cells in column header have different vertical alignmnent. It should be united.

https://fedorahosted.org/freeipa/ticket/1993
2011-12-15 20:00:02 +00:00
Petr Vobornik
187bedafd0 Fixed displaying of external records in rule association widgets
It's a fix for regression introduced by widget refactoring #2040.

https://fedorahosted.org/freeipa/ticket/2040
2011-12-15 19:59:57 +00:00
Petr Vobornik
cb649f2de2 Added facet tabs coloring
Facet tabs are now colored according to their group.

https://fedorahosted.org/freeipa/ticket/1976
2011-12-14 15:44:36 +00:00
Rob Crittenden
2d6eeb205e Require an HTTP Referer header in the server. Send one in ipa tools.
This is to prevent a Cross-Site Request Forgery (CSRF) attack where
a rogue server tricks a user who was logged into the FreeIPA
management interface into visiting a specially-crafted URL where
the attacker could perform FreeIPA oonfiguration changes with the
privileges of the logged-in user.

https://bugzilla.redhat.com/show_bug.cgi?id=747710
2011-12-12 17:36:45 -05:00
Ondrej Hamada
da4b4fc4d9 User-add random password support
I've used code from ipalib/plugins/host.py to add support for random
password generation. The '--random' option is now available in user-add
and user-mod commands. If both the 'password' and 'random' options are
used the 'random' option will be ignored.

Two test cases were added to unit test's module test_user_plugin.py -
they test creating and modifying user with random password. Two fuzzy tests
were added: test for password(string that doesn't start or end with
whitespace and doesn't containt other whitespace than ' ') and for whatever
string(because of krbextradata).

I've slightly modified ipa_generate_password in order to make passwords for
users more user-friendly(reduce number of non-letters). It has two optional
parameters now - first one is string of characters that should be used for
generating the passwd and second one is length of password. If none
parameter is set default values will be used so there's no need to modify
other plugins that use random password generator.

https://fedorahosted.org/freeipa/ticket/1979
2011-12-12 00:17:07 -05:00
Petr Vobornik
7710bfb5bd Association facets are read only in self service
This patch works with assumption that user in self-service mode doesn't have rights for enrolling/un-enrolling himself to/from group, role, hbac rule, net group, sudo rule. He can only read the attributes. Therefore in self service mode all user association facets are set read only.

Checkingi and working with the actual rights would require significantly bigger effort.

https://fedorahosted.org/freeipa/ticket/1972
2011-12-12 19:14:46 +00:00
Endi Sukma Dewata
433cf5b5e7 Fixed combobox search icon position.
A recent CSS change inadvertently changes position of the combobox
search icon. This has been fixed now.

Ticket #388
2011-12-10 01:20:26 +00:00
Endi Sukma Dewata
e8f0c5b9eb Fixed combobox icon position.
A recent CSS change inadvertently changes position of the combobox
icon. This has been fixed now.

Ticket #388
2011-12-09 22:49:34 +00:00
Endi Sukma Dewata
6af4d09e7e Fixed unmatched checkbox name.
The name of the Unmatched checkbox in HBAC Test has been corrected.

Ticket #388
2011-12-09 22:46:40 +00:00
Petr Vobornik
91dc7c3d9a Reordered facets in ACI
Facets in ACI have new order:
* Roles: members, privileges, settings
* Privileges: permissions, settings, roles
* Permissions: settings, privileges

https://fedorahosted.org/freeipa/ticket/2104
2011-12-09 22:46:19 +00:00
Petr Vobornik
34e357e713 Additional better displaying of long names
- facet group headers, error dialog, non-scrollable tables, can manage long names

 Size calculation of scrollable and non-scrollable tables was united. Now these types of tables differ only by style.

https://fedorahosted.org/freeipa/ticket/1821
2011-12-09 22:46:12 +00:00
Alexander Bokovoy
790ffc42a8 Check through all LDAP servers in the domain during IPA discovery
When discovering IPA LDAP servers through DNS records, look through all
servers found until first success. A master might be not available or
denied access but replica may succeed.

Ticket #1827
https://fedorahosted.org/freeipa/ticket/1827
2011-12-09 00:19:57 -05:00
Sumit Bose
808e75c13d Add a second module init call for newer samba versions 2011-12-09 15:57:49 -05:00
Simo Sorce
771a524525 ipa-kdb: return properly when no PAC is available 2011-12-09 14:20:46 -05:00
Alexander Bokovoy
0e45fb9ab1 Merge branch 'master' of git+ssh://git.fedorahosted.org/git/freeipa 2011-12-09 17:22:37 +02:00