Commit Graph

5543 Commits

Author SHA1 Message Date
Rob Crittenden
cbb262dc07 Add LDAP server fallback to client installer
Change the discovery code to validate all servers, regardless of where
the originated (either via SRV records or --server). This will prevent
the client installer from failing if one of those records points to a
server that is either not running or is not an IPA server.

If a server is not available it is not removed from the list of configured
servers, simply moved to the end of the list.

If a server is not an IPA server it is removed.

https://fedorahosted.org/freeipa/ticket/3388
2013-02-07 16:49:31 -05:00
Ana Krivokapic
076775a0f8 Take into consideration services when deleting replicas
When deleting a replica from IPA domain:
* Abort if the installation is about to be left without CA
* Warn if the installation is about to be left without DNS

Ticket: https://fedorahosted.org/freeipa/ticket/2879
2013-02-06 16:20:37 -05:00
Petr Viktorin
b27267b00a Don't add another nsDS5ReplicaId on updates if one already exists
Modify update file to use default: rather than add: in
cn=replication,cn=etc,$SUFFIX.

Drop quotes around nsDS5ReplicaRoot because default: values
are not parsed as CSV.

https://fedorahosted.org/freeipa/ticket/3394
2013-02-06 12:22:00 +01:00
Rob Crittenden
53c94361d6 Improve migration performance
Add new users to the default users group in batches of 100. The
biggest overhead of migration is in calculating the modlist when
managing the default user's group and applying the changes. A
significant amount of time can be saved by not doing this on every
add operation.

Some other minor improvements include:

Add a negative cache for groups not found in the remote LDAP server.
Replace call to user_mod with a direct LDAP update.
Catch some occurances of LimitError and handle more gracefully.

I also added some debug logging to report on migration status and
performance.

https://fedorahosted.org/freeipa/ticket/3386
2013-02-05 17:18:13 +01:00
Petr Viktorin
9b7930b93d Make ipapython.dogtag log requests at debug level, not info 2013-02-01 13:45:03 -05:00
Petr Viktorin
26c498736e Port ipa-replica-prepare to the admintool framework
Break the script into several smaller methods.

Use modern idioms: os.path.join instead of string addition; the with statement
for closing files.

Add --quiet, --verbose, and --log-file options. Use logging instead of print
statements. (http://freeipa.org/page/V3/Logging_and_output)

Part of: https://fedorahosted.org/freeipa/ticket/2652
Fixes: https://fedorahosted.org/freeipa/ticket/3285
2013-02-01 13:44:59 -05:00
Petr Viktorin
55cfd06e3a Better logging for AdminTool and ipa-ldap-updater
- Automatically add a "Logging and output options" group with the --quiet,
    --verbose, --log-file options.
- Set up logging based on these options; details are in the setup_logging
    docstring and in the design document.
- Don't bind log methods as individual methods of the class. This means one
    less linter exception.
- Make the help for command line options consistent with optparse's --help and
    --version options.

Design document: http://freeipa.org/page/V3/Logging_and_output
2013-02-01 13:44:55 -05:00
Jan Cholasta
86dde3a38e Add support for RFC 6594 SSHFP DNS records.
https://fedorahosted.org/freeipa/ticket/2642
2013-02-01 09:16:09 -05:00
Jan Cholasta
c1735e1c80 Drop ipapython.compat. 2013-02-01 09:16:06 -05:00
Martin Kosek
893064f613 Use fully qualified CCACHE names
Some parts of install scripts used only ccache name as returned by
krbV.CCache.name attribute. However, when this name is used again
to initialize krbV.CCache object or when it is used in KRB5CCNAME
environmental variable, it fails for new DIR type of CCACHE.

We should always use both CCACHE type and name when referring to
them to avoid these crashes. ldap2 backend was also updated to
accept directly krbV.CCache object which contains everything we need
to authenticate with ccache.

https://fedorahosted.org/freeipa/ticket/3381
2013-02-01 08:13:50 +01:00
Martin Kosek
3ad8d7c1fb Remove unused krbV imports
https://fedorahosted.org/freeipa/ticket/3381
2013-02-01 08:13:17 +01:00
Martin Kosek
959b276e7d Fix migration for openldap DS
openldap server does not store its schema in cn=schema entry, but
rather in cn=subschema. Add a fallback to ldap2 plugin to read from
this entry when cn=schema is not found. ldap2 plugin uses the schema
when doing some of the automatic encoding, like an automatic
encoding of DN object.

IPA migration plugin DN attribute processing is now also more
tolerant when it finds that some DN attribute was not autoencoded.
It tries to convert it to DN on its own and report a warning and
continue with user processing when the conversion fails instead of
crashing with AssertionError and thus abandoning the whole
migration run.

https://fedorahosted.org/freeipa/ticket/3372
2013-02-01 08:09:46 +01:00
Tomas Babej
0beaad9686 Fix a typo in ipa-adtrust-install help
"Add SIDs for existing users andgroups as the final step" changed
to "Add SIDs for existing users and groups as the final step".
2013-01-31 14:11:30 +01:00
Rob Crittenden
045b6e6ed9 Use new certmonger locking to prevent NSS database corruption.
dogtag opens its NSS database in read/write mode so we need to be very
careful during renewal that we don't also open it up read/write. We
basically need to serialize access to the database. certmonger does the
majority of this work via internal locking from the point where it generates
a new key/submits a rewewal through the pre_save and releases the lock after
the post_save command. This lock is held per NSS database so we're save
from certmonger. dogtag needs to be shutdown in the pre_save state so
certmonger can safely add the certificate and we can manipulate trust
in the post_save command.

Fix a number of bugs in renewal. The CA wasn't actually being restarted
at all due to a naming change upstream. In python we need to reference
services using python-ish names but the service is pki-cad. We need a
translation for non-Fedora systems as well.

Update the CA ou=People entry when he CA subsystem certificate is
renewed. This certificate is used as an identity certificate to bind
to the DS instance.

https://fedorahosted.org/freeipa/ticket/3292
https://fedorahosted.org/freeipa/ticket/3322
2013-01-29 11:16:38 -05:00
Petr Viktorin
b382a77fc3 Add the CA cert to LDAP after the CA install
The DS is installed before the CA cert is generated. Trying to
add the cert to LDAP before it exists resulted in a nasty-looking
error message.

This moves the cert upload to after the CA cert is ready and the
certdb is created.

Move the cert upload to after thecertdb is generated.

https://fedorahosted.org/freeipa/ticket/3375
2013-01-29 15:42:24 +01:00
Jan Cholasta
77bb4b5177 Pylint cleanup.
Add more dynamic attribute info to IPATypeChecker in make-lint. Remove
unnecessary pylint comments. Fix false positivies introduced by Pylint 0.26.

https://fedorahosted.org/freeipa/ticket/3379
2013-01-29 15:39:49 +01:00
Rob Crittenden
41d11f443b Make certmonger a (pre) requires on server, restart it before upgrading
certmonger may provide new CAs, as in the case from upgrading IPA 2.2
to 3.x. We need these new CAs available during the upgrade process.

The certmonger package does its own condrestart as part of %postun
which runs after the %post script of freeipa-server, so we need to
restart it ourselves before upgrading.

https://fedorahosted.org/freeipa/ticket/3378
2013-01-25 10:08:37 +01:00
Rob Crittenden
d5966bde80 Update anonymous access ACI to protect secret attributes.
Update anonymous access ACI so that no users besides Trust Admins
users can read AD Trust key attributes (ipaNTTrustAuthOutgoing,
ipaNTTrustAuthIncoming). The change is applied both for updated
IPA servers and new installations.
2013-01-23 15:31:48 -05:00
Rob Crittenden
31e41eea6c Don't initialize NSS if we don't have to, clean up unused cert refs
Check to see if NSS is initialized before trying to do so again.

If we are temporarily creating a certificate be sure to delete it in order
to remove references to it and avoid NSS shutdown issues.

In the certificate load validator shut down NSS if we end up initializing
it. I'm not entirely sure why but this prevents a later shutdown issue
if we are passed the --ca-cert-file option.
2013-01-23 14:26:42 -05:00
John Dennis
a1991aeac1 Use secure method to acquire IPA CA certificate
Major changes ipa-client-install:

* Use GSSAPI connection to LDAP server to download CA cert (now
  the default method)

* Add --ca-cert-file option to load the CA cert from a disk file.
  Validate the file. If this option is used the supplied CA cert
  is considered definitive.

* The insecure HTTP retrieval method is still supported but it must be
  explicitly forced and a warning will be emitted.

* Remain backward compatible with unattended case (except for aberrant
  condition when preexisting /etc/ipa/ca.crt differs from securely
  obtained CA cert, see below)

* If /etc/ipa/ca.crt CA cert preexists the validate it matches the
  securely acquired CA cert, if not:

  - If --unattended and not --force abort with error

  - If interactive query user to accept new CA cert, if not abort

  In either case warn user.

* If interactive and LDAP retrieval fails prompt user if they want to
  proceed with insecure HTTP method

* If not interactive and LDAP retrieval fails abort unless --force

* Backup preexisting /etc/ipa/ca.crt in FileStore prior to execution,
  if ipa-client-install fails it will be restored.

Other changes:

* Add new exception class CertificateInvalidError

* Add utility convert_ldap_error() to ipalib.ipautil

* Replace all hardcoded instances of /etc/ipa/ca.crt in
  ipa-client-install with CACERT constant (matches existing practice
  elsewhere).

* ipadiscovery no longer retrieves CA cert via HTTP.

* Handle LDAP minssf failures during discovery, treat failure to check
  ldap server as a warninbg in absebce of a provided CA certificate via
  --ca-cert-file or though existing /etc/ipa/ca.crt file.

Signed-off-by: Simo Sorce <simo@redhat.com>
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
2013-01-23 14:26:42 -05:00
Rob Crittenden
91f4af7e6a Do SSL CA verification and hostname validation. 2013-01-23 14:26:42 -05:00
Alexander Bokovoy
a40285c5a0 Update plugin to upload CA certificate to LDAP
Define post-update plugin to upload public CA certificate to IPA LDAP server.
The plugin includes also update file that creates default container for the
certificate.
2013-01-23 14:26:41 -05:00
Simo Sorce
18eea90ebb Upload CA cert in the directory on install
This will later allow clients to securely download the CA cert by
performaing mutual auth using LDAP with GSSAPI
2013-01-23 14:26:41 -05:00
Petr Vobornik
69c2f077df Fix BuildRequires: rhino replaced with java-1.7.0-openjdk
Rhino is needed for Web UI build. Rhino needs java, but from package perspective
java-1.7.0-openjdk requires rhino. So the correct BuildRequires is
java-1.7.0-openjdk.
2013-01-22 17:05:29 +01:00
Martin Kosek
51f9ed0239 Installer should not connect to 127.0.0.1
IPA installer sometimes tries to connect to the Directory Server
via loopback address 127.0.0.1. However, the Directory Server on
pure IPv6 systems may not be listening on this address. This address
may not even be available.

Rather use the FQDN of the server when connecting to the DS to fix
this issue and make the connection consistent ldapmodify calls which
also use FQDN instead of IP address.

https://fedorahosted.org/freeipa/ticket/3355
2013-01-21 12:13:09 -05:00
Petr Vobornik
5d919c9556 Change tests to use AMD loader
Test were modified accordingly to AMD changes.

https://fedorahosted.org/freeipa/ticket/112
2013-01-18 15:10:37 +01:00
Petr Vobornik
c71937fc0c Updated makefiles to build FreeIPA Web UI layer
Updated makefiles to comply to new directory structure and also to use builder
for building Web UI.

FreeIPA package spec is modified to use the output of the builder.

https://fedorahosted.org/freeipa/ticket/112
2013-01-18 15:10:37 +01:00
Petr Vobornik
5e90c98849 Change Web UI sources to simple AMD modules
Web UI sources were wrapped by AMD definition. Listed dependencies were changed
accordingly.

https://fedorahosted.org/freeipa/ticket/112
2013-01-18 15:10:36 +01:00
Petr Vobornik
e3ce3e4f39 AMD config file
Added configuration file for DOJO loader. Removal of JS links from index.html of
files which were changed to AMD modules.

https://fedorahosted.org/freeipa/ticket/112
2013-01-18 15:10:36 +01:00
Petr Vobornik
be0a120134 Update JavaScript Lint configuration file
Update is needed because various files were moved to different directories.

https://fedorahosted.org/freeipa/ticket/112
2013-01-18 15:10:36 +01:00
Petr Vobornik
b9ef6ab0c4 Move of core Web UI files to AMD directory
SSIA

https://fedorahosted.org/freeipa/ticket/112
2013-01-18 15:10:36 +01:00
Petr Vobornik
8f8e790d94 Move of Web UI non AMD dep. libs to libs subdirectory
Third party JS libraries which are not AMD modules were moved to src/libs/
directory. Links in html files were changed accordingly.

https://fedorahosted.org/freeipa/ticket/112
2013-01-18 15:10:36 +01:00
Petr Vobornik
65301fe3f3 Web UI Sync development utility
Add util/sync.sh utility. It serves for copying source codes or compiled code
of Web UI to testing servers. Useful for development.

https://fedorahosted.org/freeipa/ticket/112
2013-01-18 15:10:36 +01:00
Petr Vobornik
92de64ec73 Web UI development environment directory structure and configuration
Added symbolic links which points to directories which should contain files of
Web UI layers. By changing those links we can switch between debugging (using
source codes) or testing (compiled version).

util/change-profile.sh utility serves for changing symbolic links in js/ dir
and therefore for switching between debugging and testing.

Default configuration for development is:
 * freeipa source files
 * libs as in git
 * compiled Dojo layer

https://fedorahosted.org/freeipa/ticket/112
2013-01-18 15:10:36 +01:00
Petr Vobornik
217341560c Minimal Dojo layer
Added configuration files for building Dojo library and built library itself.

This configuration contains only modules currently needed.

make-dojo.sh script should be used for rebuilding the library when additional
modules or an update are needed.

https://fedorahosted.org/freeipa/ticket/112
2013-01-18 15:10:36 +01:00
Petr Vobornik
339790ec8e Config files for builder of FreeIPA UI layer
* Added package configuration and build profile of FreeIPA UI layer for
  Dojo Builder.
* Added script (util/make-ui.sh) which builds the layer

https://fedorahosted.org/freeipa/ticket/112
2013-01-18 15:10:35 +01:00
Petr Vobornik
9d3364719d Dojo Builder
Added support for Dojo builder.

 * Includes built builder and patches required to build the builder.
 * _base/configRhino.js is required by the builder to run under rhino.
 * added utility scripts for running the builder
    * build.sh
    * clean.sh
    * compile.sh
    * make-builder.sh
    * prepare-dojo.sh

https://fedorahosted.org/freeipa/ticket/112
2013-01-18 15:10:35 +01:00
Petr Vobornik
8c59ddbcbe Use Uglify.js for JS optimization
Uglify.js library was included in ui/util folder. A wrapper script
util/uglifyjs/uglify was created to run Uglify.js in Rhino enviroment.

https://fedorahosted.org/freeipa/ticket/112
2013-01-18 15:10:35 +01:00
Petr Vobornik
c19af96cb8 Enable mod_deflate
Enabled mod_deflate for:
* text/html (HTML files)
* text/plain (for future use)
* text/css (CSS files)
* text/xml (XML RPC)
* application/javascript (JavaScript files)
* application/json (JSON RPC)
* application/x-font-woff (woff fonts)

Added proper mime type for woff fonts.
Disabled etag header because it doesn't work with mod_deflate.

https://fedorahosted.org/freeipa/ticket/3326
2013-01-17 17:19:29 +01:00
Rob Crittenden
94153bc093 Add Ana Krivokapic to Contributors.txt 2013-01-17 10:33:03 -05:00
Ana Krivokapic
3bd96ddf05 Add crond as a default HBAC service
Ticket: https://fedorahosted.org/freeipa/ticket/3215
2013-01-17 09:50:48 -05:00
Martin Kosek
476aacd699 Upgrade process should not crash on named restart
When either dirsrv or krb5kdc is down, named service restart in
ipa-upgradeconfig will fail and cause a crash of the whole upgrade
process.

Rather only report a failure to restart the service and continue
with the upgrade as it does not need the named service running. Do
the same precaution for pki-ca service restart.

https://fedorahosted.org/freeipa/ticket/3350
2013-01-15 16:35:41 +01:00
Timo Aaltonen
ed84963927 convert the base platform modules into packages 2013-01-14 14:39:54 +01:00
Ana Krivokapic
38dded7db6 Raise ValidationError for incorrect subtree option.
Ticket: https://fedorahosted.org/freeipa/ticket/3233
2013-01-14 14:09:54 +01:00
Martin Kosek
1d2d1e1af1 Sort LDAP updates properly
LDAP updates were sorted by number of RDNs in DN. This, however,
sometimes caused updates to be executed before cn=schema updates.
If the update required an objectClass or attributeType added during
the cn=schema update, the update operation failed.

Fix the sorting so that the cn=schema updates are always run first
and then the other updates sorted by RDN count.

https://fedorahosted.org/freeipa/ticket/3342
2013-01-11 11:29:04 -05:00
Martin Kosek
79bcf904a5 Avoid CRL migration error message
When CRL files are being migrated to a new directory, the upgrade
log may contain an error message raised during MasterCRL.bin symlink
migration. This is actually being caused by `chown' operation which
tried to chown a symlinked file that was not migrated yet.

Sort migrated files before the migration process and put symlinks
at the end of the list. Also do not run chown on the symlinks as
it is a redundant operation since the symlinked file will be
chown'ed on its own.

https://fedorahosted.org/freeipa/ticket/3336
2013-01-11 10:54:10 +01:00
Martin Kosek
cb7e93bb91 permission-find no longer crashes with --targetgroup
Target Group parameter was not processed correctly which caused
permission-find to always crash when this search parameter was used.
Fix the crash and create a unit test case to avoid future regression.

https://fedorahosted.org/freeipa/ticket/3335
2013-01-11 10:51:31 +01:00
Rob Crittenden
746181a88d Convert uniqueMember members into DN objects.
We were asserting that they should be DN objects but weren't converting
them anywhere.

https://fedorahosted.org/freeipa/ticket/3339
2013-01-11 10:43:38 +01:00
JR Aquino
cfe18944d6 Allow PKI-CA Replica Installs when CRL exceeds default maxber value
https://fedorahosted.org/freeipa/ticket/3314
2013-01-08 10:52:50 -05:00
Petr Vobornik
14b353b097 Focus first input element after 'Add and Add another'
When using 'Add and Add Another' button in entity adder dialog the dialog lose focus when an item is successfully added.

It caused by search dialog filter input. It gets focus in search facet's refresh. The refresh is happening when item is added.

This patch is disabling this focus and additionally is focusing first input element to allow imidiate definion of another item
2013-01-07 10:53:59 +01:00