690 Commits

Author SHA1 Message Date
Daan Hoogland
2c7e19faff coverity 1116544: a lot of the same (probably other coverity ids covered as well)
Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-07-09 21:30:24 +02:00
Daan Hoogland
f8691b2c69 coverity 1116511 and 1116513: try-with-resource on old upgrade script three issues seen by coverity as two. only one occurence of leakage
Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-07-09 21:30:24 +02:00
Daan Hoogland
3bedeeaacc coverity 1116509: heavy entanglement of prepared statements and result sets hope I got the logic right. this is for very old versions, might be worth phasing out unless someone still uses it.
Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-07-09 21:30:23 +02:00
Daan Hoogland
79709cd490 coverity 1116507: one off old upgrade code trivial fix however
Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-07-09 21:30:23 +02:00
Daan Hoogland
803d6ed7df coverity 1296982: standard prepared statement and result set leakage
Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-07-09 21:30:23 +02:00
Koushik Das
f138192c94 CLOUDSTACK-8606: DB performance impacted due to VM sync.
VM sync. generates a lot of queries on vm_instance table with 'instance_name' as filter. Since the field is not
indexed, these kind of queries will impact DB performance. Added an index for instance_name field.

This closes #553
2015-07-03 10:06:48 +05:30
Rohit Yadav
3ff92e883e database: fix upgrade paths from 4.5.2 to 4.6.0
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-06-29 12:58:47 +02:00
Rohit Yadav
107595a6a5 CLOUDSTACK-8457: SAML auth plugin improvements for production usage
* Move config options to SAML plugin
  This moves all configuration options from Config.java to SAML auth manager. This
  allows us to use the config framework.
* Make SAML2UserAuthenticator validate SAML token in httprequest
* Make logout API use ConfigKeys defined in saml auth manager
* Before doing SAML auth, cleanup local states and cookies
* Fix configurations in 4.5.1 to 4.5.2 upgrade path
* Fail if idp has no sso URL defined
* Add a default set of SAML SP cert for testing purposes
  Now to enable and use saml, one needs to do a deploydb-saml after doing a deploydb
* UI remembers login selections, IDP server

- CLOUDSTACK-8458:
    * On UI show dropdown list of discovered IdPs
    * Support SAML Federation, where there may be more than one IdP
        - New datastructure to hold metadata of SP or IdP
        - Recursive processing of IdP metadata
        - Fix login/logout APIs to get new interface and metadata data structure
        - Add org/contact information to metadata
        - Add new API: listIdps that returns list of all discovered IdPs
        - Refactor and cleanup code and tests

- CLOUDSTACK-8459:
    * Add HTTP-POST binding to SP metadata
    * Authn requests must use either HTTP POST/Artifact binding

- CLOUDSTACK-8461:
    * Use unspecified x509 cert as a fallback encryption/signing key
      In case a IDP's metadata does not clearly say if their certificates need to be
      used as signing or encryption and we don't find that, fallback to use the
      unspecified key itself.

- CLOUDSTACK-8462:
    * SAML Auth plugin should not do authorization
      This removes logic to create user if they don't exist. This strictly now
      assumes that users have been already created/imported/authorized by admins.
      As per SAML v2.0 spec section 4.1.2, the SP provider should create authn requests using
      either HTTP POST or HTTP Artifact binding to transfer the message through a
      user agent (browser in our case). The use of HTTP Redirect was one of the reasons
      why this plugin failed to work for some IdP servers that enforce this.
    * Add new User Source
      By reusing the source field, we can find if a user has been SAML enabled or not.
      The limitation is that, once say a user is imported by LDAP and then SAML
      enabled - they won't be able to use LDAP for authentication
    * UI should allow users to pass in domain they want to log into, though it is
      optional and needed only when a user has accounts across domains with same
      username and authorized IDP server
    * SAML users need to be authorized before they can authenticate
        - New column entity to track saml entity id for a user
        - Reusing source column to check if user is saml enabled or not
        - Add new source types, saml2 and saml2disabled
        - New table saml_token to solve the issue of multiple users across domains and
          to enforce security by tracking authn token and checking the samlresponse for
          the tokens
        - Implement API: authorizeSamlSso to enable/disable saml authentication for a
          user
        - Stubs to implement saml token flushing/expiry

- CLOUDSTACK-8463:
    * Use username attribute specified in global setting
      Use username attribute defined by admin from a global setting
      In case of encrypted assertion/attributes:
      - Decrypt them
      - Check signature if provided to check authenticity of message using IdP's
        public key and SP's private key
      - Loop through attributes to find the username

- CLOUDSTACK-8538:
    * Add new global config for SAML request sig algorithm

- CLOUDSTACK-8539:
    * Add metadata refresh timer task and token expiring
        - Fix domain path and save it to saml_tokens
        - Expire hour old saml tokens
        - Refresh metadata based on timer task
        - Fix unit tests

This closes #489

(cherry picked from commit 20ce346f3acb794b08a51841bab2188d426bf7dc)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	client/WEB-INF/classes/resources/messages_hu.properties
	plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/xenbase/CitrixCheckHealthCommandWrapper.java
	plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/SAML2LoginAPIAuthenticatorCmd.java
	ui/scripts/ui-custom/login.js
2015-06-29 12:31:51 +02:00
Daan Hoogland
582687fb3f 4.4.4 to 4.5.2 upgrade
Conflicts:
	engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #529
2015-06-26 00:07:44 +02:00
Rafael da Fonseca
53e42fb45e Fix findbugs SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING warning in Upgrade410to420.java
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #505
2015-06-22 10:55:29 +02:00
Rafael da Fonseca
58eac0b49d Fix 2 more findbugs DM_BOXED_PRIMITIVE_FOR_PARSING in Upgrade218to22.java
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #500
2015-06-22 10:49:35 +02:00
Rafael da Fonseca
f038a740a5 Fix 2 findbugs occurences of DM_BOXED_PRIMITIVE_FOR_PARSING in Upgrade218to22.java
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #499
2015-06-22 10:48:49 +02:00
Rafael da Fonseca
b84093f691 Fix findbugs SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING warning in PrimaryDataStoreDaoImpl.java
Remove trailing spaces that checkstyle complained about

Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #474
2015-06-17 22:46:58 +02:00
Rafael da Fonseca
1407033cc2 Fix findbugs SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING warning in UserVmDaoImpl.java detail field was vulnerable
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #473
2015-06-17 22:38:19 +02:00
Daan Hoogland
9f02531212 CLOUDSTACK-8537 add check for unique public key and account on ssh keypair registration
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-06-17 20:47:57 +02:00
Rafael da Fonseca
ce506000cd Re-run travis
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #453
2015-06-17 12:14:31 +02:00
Rafael da Fonseca
4a333e452a Fix findbugs RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE in AgentManagerImpl.java Assert isn't used in prod runtime
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-06-17 12:14:31 +02:00
Rafael da Fonseca
acab743aa1 Re-run travis
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #452
2015-06-17 12:13:46 +02:00
Rafael da Fonseca
380ac0cf24 Fix findbugs RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE in ServiceOfferingVO.java Assert isn't used in prod runtime
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-06-17 12:13:46 +02:00
Rafael da Fonseca
5a3e57e6b2 Re-run travis
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #450
2015-06-17 12:12:41 +02:00
Rafael da Fonseca
b3d49d9135 Fix findbugs RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE in DataCenterVO.java Assert isn't used in prod runtime
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-06-17 12:12:41 +02:00
Rafael da Fonseca
874aa8d15a Fix findbugs RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE in HostVO.java Assert isn't used in prod runtime
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #451
2015-06-15 12:28:00 +03:00
Rafael da Fonseca
117870c121 Fix 3 findbugs SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING warnings in Upgrade410to420.java There was no risk of sql injection here, nor any need to use PreparedStatement, still this fixes the warnings
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #443
2015-06-15 12:17:51 +03:00
Rafael da Fonseca
4eaa613a0b Fix findbugs SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING warning in Upgrade30xBase.java There was no risk of sql injection here, nor any need to use PreparedStatement, still, this fixes the warning
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #442
2015-06-15 12:17:49 +03:00
Rafael da Fonseca
869cc0c9f2 Fix findbugs SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING warning in Upgrade2214to30.java There was no risk of sql injection here, nor any need to use PreparedStatement, still this fixes the warninG
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #441
2015-06-15 12:17:47 +03:00
Rafael da Fonseca
e409bc3e60 Fix findbugs warning in Upgrade421to430.java Was creating Integer to assign to int
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #419
2015-06-15 12:09:27 +03:00
Rafael da Fonseca
a299674831 Fix 4 findbugs warnings in Upgrade218to22.java Was creating boxed Integers when only int is required
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #418
2015-06-15 12:09:26 +03:00
wilderrodrigues
c3b4c7a9cf Coverity issue 1116509 - Assigning the the new returned ResultSet to the rs variable in order to get it closed in the finally block
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-06-04 12:34:04 +02:00
wilderrodrigues
abe0990259 Formatting the code - Adding final modifier and indenting the code
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-06-04 12:34:04 +02:00
Rohit Yadav
6c1dde8f86 schema: Encode URL safe random vnc password string
/+= may break on some environments, url safe encoded passwords will have -_,
characters which are more acceptable

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 19cc5eb9e6f1b5127bf01e4c1ae061875e61cb4c)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-06-01 14:23:42 +02:00
Jayapal
733ac2b728 CLOUDSTACK-8324: Added vm ip fetch logic 2015-05-28 15:42:08 +05:30
Koushik Das
d423df66cc CLOUDSTACK-8301: Enable configuring local storage use for system VMs at zone level
Code cleanup, added helper method to get default system offering based on "system.vm.use.local.storage".
2015-05-19 21:32:14 +05:30
Koushik Das
3f7e31ed05 CLOUDSTACK-8301: Enable configuring local storage use for system VMs at zone level
Made system.vm.use.local.storage a zone level configuration.
2015-05-19 21:32:14 +05:30
Devdeep Singh
a99c9d0e68 Implementation for the ability to disable a storage pool for provisioning
... of new volumes. Following changes are implemented 1. Disable or enable a pool with the
updateStoragePool api. A new 'enabled' parameter added for the same. 2. When a
pool is disabled the state of the pool is updated to 'Disabled' in the db. On
enabling it is updated back to 'Up'. Alert is raised when a pool is disabled or
enabled. 3. Updated other storage providers to also honour the disabled state.
4. A disabled pool is skipped by allocators for provisioing of new volumes. 5.
Since the allocators skip a disabled pool for provisioning of volumes, the
volumes are also not listed as a destination for volume migration.

FS: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Disabling+Storage+Pool+for+Provisioning

This closes #257

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-05-19 11:16:49 +01:00
Koushik Das
3100fc1554 CLOUDSTACK-8438: Proper enforcement of hypervisor capability "max. guest limit"
VMs in transition states - Starting, Stopping, Migrating - are also taken into account for enforcing "max. guest limit"
2015-05-01 12:49:56 +05:30
Anshul Gangwar
866cc41145 CLOUDSTACK-8423: [Xenserver] Improved the performance for processing of ClusterVMMetaDataSync command which can cause slowness in DB if there are huge number of VMs
this closes #204
2015-04-30 14:44:36 +05:30
Anshul Gangwar
2133c302f4 CLOUDSTACK-8413: Fixed resource tags on disk are lost when migrate to another storage
During cold volume migration we are duplicating volume entry in volumes table.
When migration is complete, we update the uuid of new entry and expunge the older entry.
This results in removal of resource tags on volume as its resource id still pointing to older volume.
As part of fix while updating uuid for volume, we are updating resource_id for tags also.

This closes #194
2015-04-30 14:34:20 +05:30
Rajani Karuturi
0b8355920e Merge branch 'volume-upload' into master
This closes #206
2015-04-29 11:12:53 +05:30
Rohit Yadav
06e353e5c7 vmware: support vmfs as local storage pool type
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 752d784d92b4ce461ec6a19a6b54220bb967d4d0)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-16 17:36:52 +05:30
Rohit Yadav
a70947f9b1 CLOUDSTACK-7593: in 450to451 upgrade path copy vm_details from template for vmware
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 8e1507078052b8068b828d336f8d0358915047e1)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-13 15:47:59 +05:30
KC Wang
01864ef77c CLOUDSTACK-6697: bigswitch networking plugin update
1. provide compatibility with the Big Cloud Fabric (BCF) controller
   L2 Connectivity Service in both VPC and non-VPC modes
2. virtual network terminology updates: VNS --> BCF_SEGMENT
3. uses HTTPS with trust-always certificate handling
4. topology sync support with BCF controller
5. support multiple (two) BCF controllers with HA
6. support VM migration
7. support Firewall, Static NAT, and Source NAT with NAT enabled option
8. add VifDriver for Indigo Virtual Switch (IVS)

This closes #151

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-09 13:02:02 +05:30
wilderrodrigues
3d22a16c4f Bump priority stragety is no longer used for redundant virtual routers
- With the changes added by the rVPC work, the bump priority became deprecated.
     This commit includes a refactor to get it removed from the following resources:
     * Java classes
     * domain_router table - removing the is_priority_bumpup column
     * Fixing unit tests

All changes were tested with:

XenServer 6.2 running under our VMWare zone
CloudStack Management Server running on MacBook Pro
MySql running on MackBook Pro
Storage Type: Local
2015-04-02 21:50:49 +02:00
Rohit Yadav
caba04d173 engine: add DB upgrade path from 4.4.3 to 4.5.0/4.5.1
Upgrade path extends over upgrade path from 4.4.2 to 4.5.0

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit e3e59c544cc62c53f276595068226d70d5dd87a4)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
2015-03-25 11:38:39 +05:30
Rohit Yadav
3c429ee6b5 Merge remote-tracking branch 'sbp/feature/persisten-systemvm-redundant-vpc-REBASE'
This closes #118

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-03-17 15:44:57 +05:30
wilderrodrigues
0a133c06f8 Adding nre method to NetworkDao
- listVpcNetworks() to be used for the router check task
2015-03-16 11:40:01 +01:00
wilderrodrigues
e350f1e76f Turn a single VPC into a redundant VPC
- when restarting a VPC, the user can check the option Make Redundant in order to change
    the VPC offering and make it redundant
2015-03-16 11:39:57 +01:00
wilderrodrigues
460204fa9f Fixing CsDhcp.py
Fixing assign IPv4 on GuestNetworkGuru.java
Fixing getRouters() on VpcVirtualRouterElement.java
Fixing Fixing paths on keepalived.conf.templ

Refactor on the other files
2015-03-16 11:39:17 +01:00
Antonio Fornie
09bd847040 Vpc redundancy enabled. Including Vpc & Vpc Offering creation. Marvin tests and UI. 2015-03-16 11:38:05 +01:00
Rajani Karuturi
843f6b1691 CLOUDSTACK-5236 : ability to identify where the user is from (ex. LDAP)
Added a source column to the user table.

Source now has only two values UNKNOWN,LDAP with UNKNOWN being the
default and is an enum is com.cloud.User.

When the source is UNKNOWN, the old method of authenticating against all
the available authenticators is used. If a source is available, only
that particular authenticator will be used.

added overloaded methods in AccountService to createUserAccount and
createUser with source specified.

(cherry picked from commit 5da733072e838c830720909ef5ba27ef6ce6d0b0)
2015-03-16 14:53:53 +05:30
Nitin Mehta
765622658a Avoid distributing private key for realhostip.com
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit d94a5720efbadb2e538dc68c45c88288486b68f6)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-03-13 15:02:27 +05:30