Commit Graph

890 Commits

Author SHA1 Message Date
Rob Crittenden
7d7322de2e Limit allowed characters in a netgroup name to alpha, digit, -, _ and .
Apply this to hostgroup names as well since they can be linked.

https://fedorahosted.org/freeipa/ticket/2221
2012-02-27 00:06:44 -05:00
Martin Kosek
cbb3bfae23 Add reverse DNS record when forward is created
Adding reverse DNS record may be a time consuming task, especially
for IPv6 addresses. Having a way to automatically create a reverse
record when a forward record is created could speed up the process.
host-add command already has this possibility.

This patch takes advantage of the new per-type API and adds new
options for A/AAAA record types: --a-create-reverse and
--aaaa-create-reverse. These commands can be used to automatically
create reverse records for new A/AAAA addresses (both forward
and reverse zones need to be managed by FreeIPA server):

ipa dnsrecord-add example.com foo --a-rec=10.0.0.1 --a-create-reverse

This command would add a new A record to record foo in zone
example.com and a PTR record to appropriate reverse zone for
IP address 10.0.0.1 (for example PTR record 1 in zone
0.0.10.in-addr.arpa. pointing to foo.example.com.).

Few modification were done to new DNS API to support this feature:
 - Refactor --ip-address option handling from host-add and place it
   to dns.py to be used by both modules
 - Add support for "extra" per-type options
 - Hide DNS record part options in dnsrecord_find command as they
   have no effect for this command

https://fedorahosted.org/freeipa/ticket/2009
2012-02-27 16:50:08 +01:00
Rob Crittenden
ac47b1ca6e Don't consider virtual attributes when validating custom objectclasses
We verify user and group default objectclasses when changing them
to be sure that required objectclasses aren't being dropped. We need
to ignore virtual attributes or it will raise an error because they
aren't defined in schema.

https://fedorahosted.org/freeipa/ticket/2406
2012-02-27 10:06:35 +01:00
Martin Kosek
16d88d79ad Add gidnumber minvalue
Do not accept invalid GID values in IPA user/group plugins.

https://fedorahosted.org/freeipa/ticket/2335
2012-02-23 21:00:15 -05:00
Martin Kosek
1c898e388b Add API for PTR sync control
New version of bind-dyndb-ldap plugin have an ability to
automatically update machine reverse address when its forward
address is updated via GSS-TSIG update. The reverse zone must be
managed by FreeIPA as well in order of this feature to work.

As it would not be secure to enable this behaviour for all zones
there is a global attribute that can enable PTR sync for all zones
and also a per-zone attribute that can enable for chosen zones
only.

This patch adds an API for this control.

https://fedorahosted.org/freeipa/ticket/2176
2012-02-24 09:40:51 +01:00
Martin Kosek
210d913eb1 Add DNS conditional forwarding
Add ability configure per-zone forwarder for DNS zones. Any data
in such zone will then be considered as non-authoritative and all
queries will be sent to specified forwarder.

https://fedorahosted.org/freeipa/ticket/2108
2012-02-24 09:40:47 +01:00
Martin Kosek
8605790225 Query and transfer ACLs for DNS zones
Provide a way to specify BIND allow-query and allow-transfer ACLs
for DNS zones.

IMPORTANT: new bind-dyndb-ldap adds a zone transfer ability. To
avoid zone information leaks to unintended places, allow-transfer
ACL for every zone is by default set to none and has to be
explicitly enabled by an Administrator. This is done both for new
DNS zones and old DNS zones during RPM update via new DNS upgrade
plugin.

https://fedorahosted.org/freeipa/ticket/1211
2012-02-24 09:40:43 +01:00
Martin Kosek
2cf5893761 Global DNS options
Implement API for DNS global options supported in bind-dyndb-ldap.
Currently, global DNS option overrides any relevant option in
named.conf. Thus they are not filled by default they are left as
a possibility for a user.

Bool encoding had to be fixed so that Bool LDAP attribute can also
be deleted and not just set to True or False.

https://fedorahosted.org/freeipa/ticket/2216
2012-02-24 09:40:40 +01:00
Rob Crittenden
d4a1dc5712 Don't allow IPA master hosts or important services be deleted.
Deleting these would cause the IPA master to blow up.

For services I'm taking a conservative approach and only limiting the
deletion of known services we care about.

https://fedorahosted.org/freeipa/ticket/2425
2012-02-23 20:17:12 +01:00
Petr Voborník
a7ced67e77 Added missing configuration options
Missing options were added to Web UI's IPA Server/Configuration page.
 * ipaconfigstring
 * ipaselinuxusermaporder
 * ipaselinuxusermapdefault

https://fedorahosted.org/freeipa/ticket/2285
https://fedorahosted.org/freeipa/ticket/2400
2012-02-20 15:47:39 -06:00
Petr Voborník
8ad295a554 Redirection to PTR records from A,AAAA records
Address column in A, AAAA DNS records was exented of redirection capabilities.
Redirection dialog is shown after a click on a value.
Dialog does following steps:
 1) fetch all dns zones
 2) find most accurate reverse zone for IP address
    2 -fail) show error message, stop
 3) checks if target record exists in the zone
    3 -fail) show 'dns record create link', stop
 4) redirects

Click on 'dns record create link':
 1) creates record
   1 -fail) show error, stop
 2) redirects

https://fedorahosted.org/freeipa/ticket/1975
2012-02-15 09:23:26 +01:00
Petr Voborník
eb87b8c319 UI support for ssh keys
To user and host details pages was added ipasshpubkey attribute.

New widget for ssh public keys was created.

https://fedorahosted.org/freeipa/ticket/2340
2012-02-15 09:23:05 +01:00
Jan Cholasta
ca3f304110 Base64-decode unicode values in Bytes parameters.
Fix wrong handling of strings in --setattr/--addattr/--delattr.

These changes make it possible to use Bytes in --setattr/--addattr/
--delattr without errors.

Fixes managing SSH keys on command-line

https://fedorahosted.org/freeipa/ticket/754
2012-02-13 22:21:50 -05:00
Jan Cholasta
3c2b0fc28a Add support for SSH public keys to user and host objects.
This patch adds a new multivalue param "sshpubkey" for specifying SSH public
keys to both user and host objects. The accepted value is base64-encoded
public key blob as specified in RFC4253, section 6.6.

Additionaly, host commands automatically update DNS SSHFP records when
requested by user.

https://fedorahosted.org/freeipa/ticket/754
2012-02-13 22:21:27 -05:00
Petr Viktorin
528a94f839 Internationalization for HBAC and ipalib.output
* hbacrule: Internationalize HBAC rule "all" category exceptions
  https://fedorahosted.org/freeipa/ticket/2267

* hbactest: Use internationalized names (doc) instead of names
  for output items
  Also don't convert result to bool, `not` does it implicitly

* ipalib.output: Internationalize descriptions of some standard entries
2012-02-14 19:08:40 +01:00
Petr Voborník
2755709f2e Removed question marks from field labels
In user group adder dialog, the "Is this a POSIX group?" was replaced with "POSIX group".
In host search facet, the "Enrolled?" was replaced with "Enrolled".

https://fedorahosted.org/freeipa/ticket/2353
2012-02-14 08:35:49 -06:00
Petr Viktorin
90d99f6017 Clean up i18n strings
This patch switches to named ("%(name)s") instead of positional ("%s")
substitutions for internationalized strings, so translators can
reorder the words.
This fixes https://fedorahosted.org/freeipa/ticket/2179 (xgettext no
longer gives warnings).

Also, some i18n calls are rewritten to translate the template before
substitutions, not after.
2012-02-10 11:53:40 +01:00
Petr Viktorin
d706c411ef Honor default home directory and login shell in user_add
The homedirectory argument had a default_from '/home/<name>', ignoring
the ipahomesrootdir config setting. This patch removes that default,
and adds a test case for ipahomesrootdir.

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

The login shell had the same problem. Again this patch removes the
client-side default and adds a test.

Building the home directory from the default is changed to use
posixpath.join instead of string formatting and ad-hoc cleanup,
and to use '/home' instead of failing when the ipahomesrootdir
setting is not present for some reason.
2012-02-09 18:11:57 +01:00
Rob Crittenden
44c69ef33e Make ipaconfigstring modifiable by users.
Convert from a freeform string into a enumeration.

Only values currently allowed are AllowLMhash and AllowNThash.

To add more than one value on the command-line either specify
--ipaconfigstring multiple times or add the values comma-separated.

https://fedorahosted.org/freeipa/ticket/1433
2012-02-09 08:29:09 +01:00
Ondrej Hamada
616d543a54 Memberof attribute control and update
Checking of parameters used by _make_aci funcion was rewritten.
Additional attributes of ACI(type, attribute, memberof, targetgroup,
subtree, filter) could be unset.

Permission plugin now allows to unset memberof value.
https://fedorahosted.org/freeipa/ticket/2255

Added checking of existence of groups that are specified in permission
and delegation module.

https://fedorahosted.org/freeipa/ticket/2286
https://fedorahosted.org/freeipa/ticket/2305
2012-02-08 10:43:25 +01:00
Rob Crittenden
304b70843a Consolidate external member code into two functions in baseldap.py
External members (users and hosts) are assumed when doing member
management on certain attributes. If the member isn't in IPA it
is assumed to be external. When doing member management we need
to sift through the list of failures and pull out all those
that were simply not found in IPA.

https://fedorahosted.org/freeipa/ticket/1734
2012-02-08 09:12:53 +01:00
Petr Voborník
cbd77cae0a Automember UI - Fixed I18n labels
Hard-coded labels in Automember UI have been moved into internal.py to
allow translation.

https://fedorahosted.org/freeipa/ticket/2195
2012-02-07 00:48:10 -06:00
Petr Viktorin
01929015e0 Switch --group and --membergroup in example for delegation
The example mistakenly showed how to allow "employees" to edit
addresses of "managers".
This fixes the example by switching the two options.

https://fedorahosted.org/freeipa/ticket/2317
2012-02-06 14:13:33 +01:00
Martin Kosek
b32d320922 Return proper DN in netgroup-add
This patch fixes netgroup unit test failures which expect the
original DN.

https://fedorahosted.org/freeipa/ticket/2069
2012-02-06 13:51:23 +01:00
Rob Crittenden
3684929270 Make submount automount maps work.
Indirect automount nesting is achieved by adding a key that references
another map. This isn't heirarchical, in fact, you can have multiple
duplicate keys all pointing at the same map, which itself is mounted
in other places. It can be a real mess if you want.

In any case, a submount map has its information set to
"-fstype=autofs <type>:<map>"

The type can be any valid automount type: file, nis, yp, ldap, etc. We
are going to hardcode ldap in when we create these using
automountmap-add-indirect. If a user wants a different type they can
create the key themselves (or edit it later).

Here is an example of creating a submount:

$ ipa automountlocation-add baltimore
$ ipa automountmap-add-indirect baltimore auto.share --mount=/share
$ ipa automountmap-add-indirect baltimore --parentmap=auto.share --mount=sub auto.sub
$ ipa automountkey-add baltimore auto.sub --key=share --info=attic:/share
$ ls /share/sub/share
builds  lost+found

This looks like:

etc/auto.master:
/-      /etc/auto.direct
/share  /etc/auto.share
---------------------------
/etc/auto.direct:
---------------------------
/etc/auto.share:
sub     -fstype=autofs ldap:auto.sub

maps not connected to /etc/auto.master:
---------------------------
/etc/auto.sub:
share   attic:/share

I've also added a catch-all when using the tofiles function. We were
missing any maps that weren't attached to auto.master. They will now
be shown along with whatever keys they have.

https://fedorahosted.org/freeipa/ticket/1268
2012-02-06 10:50:40 +01:00
Martin Kosek
d4272ce374 Add argument help to CLI
CLI command help contains a documentation for all options that can
be passed to commands. However, help strings for positional
arguments are not included.

This patch uses an OptionParser description field to list all
command arguments as OptionParser does not have a native support
to provide such information to user.

https://fedorahosted.org/freeipa/ticket/1974
2012-02-06 08:57:07 +01:00
Martin Kosek
3bd36af36e Remove debug messages
https://fedorahosted.org/freeipa/ticket/2010
https://fedorahosted.org/freeipa/ticket/2323
https://fedorahosted.org/freeipa/ticket/2228
https://fedorahosted.org/freeipa/ticket/2232
2012-02-06 08:49:31 +01:00
Martin Kosek
cf12f3106a Fix raw format for ACI commands
ACI plugins (permission, selfservice and delegation) were not
prepared to serve ACIs in a raw format, i.e. raw "aci" attribute
taken from LDAP. This patch fixes all these plugins and their
commands to provide provide this format. Few ACI raw format unit
tests were added for all these plugins.

https://fedorahosted.org/freeipa/ticket/2010
https://fedorahosted.org/freeipa/ticket/2223
https://fedorahosted.org/freeipa/ticket/2228
https://fedorahosted.org/freeipa/ticket/2232
2012-02-03 17:04:51 +01:00
Martin Kosek
b2239d533d Improve migration help
Improve migration help topic so that it easier understandable:
  - Add missing list of Topic commands
  - Add one more example to demonstrate migration abilities
  - Add breaks to too long lines to improve readibility

https://fedorahosted.org/freeipa/ticket/2174
2012-02-03 16:39:27 +01:00
Martin Kosek
de9a0df508 Improve dnszone-add error message
When a new DNS record is being added to DNS zone via command
  ipa dnsrecord-add ZONE @
and the target ZONE does not exist it returns ObjectclassViolation
which may confuse users. Make sure that standard DNS Zone NotFound
exception is returned.

https://fedorahosted.org/freeipa/ticket/2270
2012-02-03 16:31:00 +01:00
Martin Kosek
f411ed1e47 Add data field for A6 record
Since A6 is an obsolete RR type, no DNS part option was created.
This is, however, not consistent with the rest of per-type API
and may cause problems. This patch adds at least a DNS part for
raw A6 record data so that the record type is treated consistently.

This patch also fixes interactive mode for A6 records. Their data
were not detected correctly as dnsrecord_add didn't expect
a number in DNS part option name.

https://fedorahosted.org/freeipa/ticket/2309
2012-02-03 16:26:20 +01:00
Martin Kosek
e1fecfaf6a Add SRV record target validator
Add missing SRV record target validator to filter out possible
user errors.

https://fedorahosted.org/freeipa/ticket/2308
2012-02-03 16:25:53 +01:00
Martin Kosek
cb4b2e6fac Fix NSEC record conversion
NSEC record needs special treatment as it is not composed from
a fixed set of DNS parts divided by space, but it contains
a multivalued DNS part "types" containing a list of RR types
it covers.

There was already a special method for parsing raw NSEC record
to DNS parts, but the other direction was missing. This patch
adds special NSEC convertor to fix this issue.

https://fedorahosted.org/freeipa/ticket/2307
2012-02-03 16:25:26 +01:00
Martin Kosek
e41282fbc6 Fix TXT record parsing
TXT record validation fails to parse the record if it contains
spaces. Standard DNS part parser uses a space to divide record
parts. A special parser thus need to be implemented for this RR
type.

https://fedorahosted.org/freeipa/ticket/2306
2012-02-03 16:24:54 +01:00
Martin Kosek
2a667d94ec Improve netgroup-add error messages
These two situations in netgroup-add need to be distinguished:
 1) Netgroup cannot be added because a hostgroup with the same name
    created a colliding managed netgroup
 2) Another native netgroup with the same name exists

This patch checks the colliding netgroup and raise appropriate
error message based on this finding.

https://fedorahosted.org/freeipa/ticket/2069
2012-02-03 16:05:56 +01:00
Endi Sukma Dewata
b73fc6e550 Show password expiration date.
The user details page was modified to show the password expiration
date next to the existing password field.

Fixed problem resetting password in self-service mode. The JSON
interface for the passwd command requires the username to be
specified although the equivalent CLI command doesn't require it.

Ticket #2064
2012-02-01 15:51:50 +01:00
Petr Voborník
1f3d8003f7 Modifying DNS UI to benefit from new DNS API
DNS UI was modified to offer structured way of defining DNS records.

https://fedorahosted.org/freeipa/ticket/2208
2012-01-30 17:47:07 -06:00
Petr Voborník
71f9343480 Added refresh button for UI
Web UI is caching records. Currently only possible ways how to display updated record which was changed elsewhere - ie. in CLI are:
 * refresh page in browser (takes really long on slow vpns)
 * search facet: change filter, find, change filter back, find
 * entity details: go to search, select other entry, go back to search, select original entry
 * association facet: same as entity details

These are unconvenient methods.

This patch adds Refresh button to search, details and association facet. This button executes facets refresh method.

https://fedorahosted.org/freeipa/ticket/2051
2012-01-30 17:46:57 -06:00
Martin Kosek
0b9279a30a Add missing managing hosts filtering options
Host object has a virtual attribute "managing" containing all hosts
it manages (governed by managedBy attribute). This patch also adds
standard membership filtering options:
  --man-hosts=HOSTS: Only hosts managing _all_ HOSTS are returned
  --not-man-hosts=HOSTS: Only hosts which do not manage _any_ host
    in HOSTS are returned

https://fedorahosted.org/freeipa/ticket/1675
2012-01-26 10:17:39 -06:00
Rob Crittenden
52e3488b75 Add support for storing MAC address in host entries.
macaddress is a multi-valued attribute and we allow multiple entries.
This is from the objectclass ieee802device. This is added manually when
doing a mod or add and not as a default to support existing host entries
that do not have this objectclass. If this were added to the defaults
then existing hosts missing this objectclass would not be found by
host-find.

It is possible to get ethers data out of nss by configuring nsswitch.conf
to use ldap for ethers and running getent ethers <hostname>

I tested nslcd and it only returned one macaddress value.

https://fedorahosted.org/freeipa/ticket/1132
2012-01-26 14:11:33 +01:00
Rob Crittenden
dbd87af80b Fix deletion of HBAC Rules when there are SELinux user maps defined
When deleting an HBAC rule we need to ensure that an SELinux user
map isn't pointing at it. We need to take what is the cn of the HBAC
rule and see if that rule exists, then return the dn to that rule.

The search was not being done properly and wasn't enforcing uniqueness.
It could have returned partial matches as well (so tests for the
search test).

https://fedorahosted.org/freeipa/ticket/2269
2012-01-24 21:09:09 -05:00
Martin Kosek
635f0a464c Mark optional DNS record parts
All DNS record part options in dnsrecord commands need to be
optional so that all of them are not required in every dnsrecord
command. However, FreeIPA API then does not include an information
which DNS record part options are optional in term of creating
a new DNS record. For example, LOC record option "latitude seconds"
is not needed to add a new LOC record.

This patch adds a flag "dnsrecord_optional" to all such options so
that this information is available for any other UI reading the
FreeIPA API.

https://fedorahosted.org/freeipa/ticket/2208
2012-01-24 16:55:05 +01:00
Martin Kosek
ef68c02c6a Fix selfservice-find crashes
Ignore empty options when performing an ACI search so that the
find command does not crash. Update ipa(1) man page to mention
this common behavior of find commands.

https://fedorahosted.org/freeipa/ticket/2011
https://fedorahosted.org/freeipa/ticket/2012
2012-01-24 16:52:41 +01:00
Endi Sukma Dewata
b353239e59 Fixed inconsistent status labels.
This patch modifies the status attributes in users, DNS zones,
HBAC/sudo rules, HBAC test, and SELinux User Map to use the same
label (i.e. Status) and values (i.e. Enabled/Disabled). The method
to change the status will be modified separately.

Ticket #2247
2012-01-23 15:38:41 +01:00
Martin Kosek
ae2e49a222 Improve host-add error message
host-add command allows to add a host and its IP address via
--ip-address option. When the address is invalid, it throws
an error and refuses to operate. However, the invalid IP address
error message is always the same which is not right as it forces
a user to guess the reason of rejection (loopback address,
link-local address or invalid address at all was passed, etc.).

This patch changes host-add validator to print the error message.

https://fedorahosted.org/freeipa/ticket/2229
2012-01-20 16:28:09 +01:00
Martin Kosek
092dd8db12 Replace float with Decimal
Having float type as a base type for floating point parameters in
ipalib introduces several issues, e.g. problem with representation
or value comparison. Python language provides a Decimal type which
help overcome these issues.

This patch replaces a float type and Float parameter with a
decimal.Decimal type in Decimal parameter. A precision attribute
was added to Decimal parameter that can be used to limit a number
of decimal places in parameter representation. This approach fixes
a problem with API.txt validation where comparison of float values
may fail on different architectures due to float representation error.

In order to safely transfer the parameter value over RPC it is
being converted to string which is then converted back to
decimal.Decimal number on a server side.

https://fedorahosted.org/freeipa/ticket/2260
2012-01-20 08:13:44 +01:00
Petr Voborník
d906fa50c1 UI for SELinux user mapping
This patch adds UI for SELinux user mapping. Its design is based on HBAC Rule design.

https://fedorahosted.org/freeipa/ticket/2145
2012-01-18 17:08:46 +01:00
Rob Crittenden
2c1f21a14b In sudo when the category is all do not allow members, and vice versa.
This is what we already do in the HBAC plugin, this ports it to Sudo.

If a category (user, host, etc) is u'all' then we don't allow individual
members be added. Conversely if there are members we don't allow the
category be set to u'all'.

https://fedorahosted.org/freeipa/ticket/1440
2012-01-18 10:02:50 +01:00
Martin Kosek
7f6c9ac04c Add missing --pkey-only option for selfservice and delegation
pkey-only functionality has to be implemented separately for these
modules as they are based on crud.Search instead of standard
LDAPSearch.

Delegation moduled was also fixed to support new format of ACI's
memberof attribute introduced in patch "Display the value of
memberOf ACIs in permission plugin."

https://fedorahosted.org/freeipa/ticket/2092
2012-01-16 20:08:13 +01:00
Rob Crittenden
f7753bf55c Add labels so HBAC and Sudo rules show under hosts/hostgroups.
Also fix a bunch of trailing whitespace.

https://fedorahosted.org/freeipa/ticket/1751
2012-01-16 12:37:12 +01:00