93 Commits

Author SHA1 Message Date
Rohit Yadav
072dbc0720 Updating pom.xml version numbers for master to 4.12.0.0-SNAPSHOT
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2018-01-15 17:43:45 +05:30
Rohit Yadav
9aa7d4e818 CLOUDSTACK-10013: SystemVM.iso refactoring and cleanups
- Removes old/dead files
- Refactors file path/location, backward compatible to filepaths in
  systemvm.isoa
- Fixes failures around apache2
2017-12-23 09:22:44 +05:30
Rohit Yadav
7ce54bf7a8 CLOUDSTACK-9993: Securing Agents Communications (#2239)
This introduces a new certificate authority framework that allows
pluggable CA provider implementations to handle certificate operations
around issuance, revocation and propagation. The framework injects
itself to `NioServer` to handle agent connections securely. The
framework adds assumptions in `NioClient` that a keystore if available
with known name `cloud.jks` will be used for SSL negotiations and
handshake.

This includes a default 'root' CA provider plugin which creates its own
self-signed root certificate authority on first run and uses it for
issuance and provisioning of certificate to CloudStack agents such as
the KVM, CPVM and SSVM agents and also for the management server for
peer clustering.

Additional changes and notes:
- Comma separate list of management server IPs can be set to the 'host'
  global setting. Newly provisioned agents (KVM/CPVM/SSVM etc) will get
  radomized comma separated list to which they will attempt connection
  or reconnection in provided order. This removes need of a TCP LB on
  port 8250 (default) of the management server(s).
- All fresh deployment will enforce two-way SSL authentication where
  connecting agents will be required to present certificates issued
  by the 'root' CA plugin.
- Existing environment on upgrade will continue to use one-way SSL
  authentication and connecting agents will not be required to present
  certificates.
- A script `keystore-setup` is responsible for initial keystore setup
  and CSR generation on the agent/hosts.
- A script `keystore-cert-import` is responsible for import provided
  certificate payload to the java keystore file.
- Agent security (keystore, certificates etc) are setup initially using
  SSH, and later provisioning is handled via an existing agent connection
  using command-answers. The supported clients and agents are limited to
  CPVM, SSVM, and KVM agents, and clustered management server (peering).
- Certificate revocation does not revoke an existing agent-mgmt server
  connection, however rejects a revoked certificate used during SSL
  handshake.
- Older `cloudstackmanagement.keystore` is deprecated and will no longer
  be used by mgmt server(s) for SSL negotiations and handshake. New
  keystores will be named `cloud.jks`, any additional SSL certificates
  should not be imported in it for use with tomcat etc. The `cloud.jks`
  keystore is stricly used for agent-server communications.
- Management server keystore are validated and renewed on start up only,
  the validity of them are same as the CA certificates.

New APIs:
- listCaProviders: lists all available CA provider plugins
- listCaCertificate: lists the CA certificate(s)
- issueCertificate: issues X509 client certificate with/without a CSR
- provisionCertificate: provisions certificate to a host
- revokeCertificate: revokes a client certificate using its serial

Global settings for the CA framework:
- ca.framework.provider.plugin: The configured CA provider plugin
- ca.framework.cert.keysize: The key size for certificate generation
- ca.framework.cert.signature.algorithm: The certificate signature algorithm
- ca.framework.cert.validity.period: Certificate validity in days
- ca.framework.cert.automatic.renewal: Certificate auto-renewal setting
- ca.framework.background.task.delay: CA background task delay/interval
- ca.framework.cert.expiry.alert.period: Days to check and alert expiring certificates

Global settings for the default 'root' CA provider:
- ca.plugin.root.private.key: (hidden/encrypted) CA private key
- ca.plugin.root.public.key: (hidden/encrypted) CA public key
- ca.plugin.root.ca.certificate: (hidden/encrypted) CA certificate
- ca.plugin.root.issuer.dn: The CA issue distinguished name
- ca.plugin.root.auth.strictness: Are clients required to present certificates
- ca.plugin.root.allow.expired.cert: Are clients with expired certificates allowed

UI changes:
- Button to download/save the CA certificates.

Misc changes:
- Upgrades bountycastle version and uses newer classes
- Refactors SAMLUtil to use new CertUtils

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-28 12:15:11 +02:00
Rohit Yadav
98dc4eb96a CLOUDSTACK-9782: New Background Polling Task Manager (#2218)
CloudStack has several background polling tasks that are spread across
the codebase, the aim of this work is to provide a single manager to
handle submission, execution and handling of background tasks. With
the framework implemented, existing oobm background task has been
refactored to use this manager.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2017-08-03 11:53:45 +02:00
Rajani Karuturi
4bc7c270fa Updating pom.xml version numbers for release 4.11.0.0-SNAPSHOT
Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>
2017-07-12 12:09:38 +05:30
Rajani Karuturi
9d2893d44a Updating pom.xml version numbers for release 4.10.0.0
Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>
2017-07-03 10:06:43 +05:30
Rohit Yadav
edf4fe951d
Merge branch '4.9' 2016-11-28 16:01:54 +05:30
Rohit Yadav
7a96d32c7e
CLOUDSTACK-9584: run component tests in Travis run
This would run additional component tests in Travis run

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-11-28 13:47:50 +05:30
Rohit Yadav
9555492b4d Merge branch '4.9' 2016-08-23 14:16:53 +05:30
Rohit Yadav
f13c224da1 Updating pom.xml version numbers for release 4.9.1.0-SNAPSHOT
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-08-19 13:53:39 +05:30
Will Stevens
62aa3b2bfa Updating pom.xml version numbers for release 4.10.0-SNAPSHOT
Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-07-29 10:11:34 -04:00
Will Stevens
227ff3884d Updating pom.xml version numbers for release 4.9.0
Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-07-25 16:56:04 -04:00
Rohit Yadav
4d5e8df2f9 travis: Use patched version of ipmitool for tests
- For out-of-band management feature (CLOUDSTACK-9299) use patched version of
  ipmitool that would work on trusty travis machines
- The ipmitool used is from xenial/16.04 release with patch from RedHat
  https://bugzilla.redhat.com/show_bug.cgi?id=1286035
- Installs ipmitool from xenial repositories to get all the dependencies
  and then install patched deb version
- Skip test if the known failure occurs

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-05-12 11:05:40 +05:30
Rohit Yadav
07564469e9 CLOUDSTACK-9299: Out-of-band Management for CloudStack
Support access to a host’s out-of-band management interface (e.g. IPMI, iLO,
DRAC, etc.) to manage host power operations (on/off etc.) and querying current
power state in CloudStack.

Given the wide range of out-of-band management interfaces such as iLO and iDRA,
the service implementation allows for development of separate drivers as plugins.
This feature comes with a ipmitool based driver that uses the
ipmitool (http://linux.die.net/man/1/ipmitool) to communicate with any
out-of-band management interface that support IPMI 2.0.

This feature allows following common use-cases:
- Restarting stalled/failed hosts
- Powering off under-utilised hosts
- Powering on hosts for provisioning or to increase capacity
- Allowing system administrators to see the current power state of the host

For testing this feature `ipmisim` can be used:
https://pypi.python.org/pypi/ipmisim

FS:
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Out-of-band+Management+for+CloudStack

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-05-12 11:05:40 +05:30
Rohit Yadav
4347776ac6 CLOUDSTACK-8562: DB-Backed Dynamic Role Based API Access Checker
This feature allows root administrators to define new roles and associate API
permissions to them.

A limited form of role-based access control for the CloudStack management server
API is provided through a properties file, commands.properties, embedded in the
WAR distribution. Therefore, customizing API permissions requires unpacking the
distribution and modifying this file consistently on all servers. The old system
also does not permit the specification of additional roles.

FS:
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Dynamic+Role+Based+API+Access+Checker+for+CloudStack

DB-Backed Dynamic Role Based API Access Checker for CloudStack brings following
changes, features and use-cases:
- Moves the API access definitions from commands.properties to the mgmt server DB
- Allows defining custom roles (such as a read-only ROOT admin) beyond the
  current set of four (4) roles
- All roles will resolve to one of the four known roles types (Admin, Resource
  Admin, Domain Admin and User) which maintains this association by requiring
  all new defined roles to specify a role type.
- Allows changes to roles and API permissions per role at runtime including additions or
  removal of roles and/or modifications of permissions, without the need
  of restarting management server(s)

Upgrade/installation notes:
- The feature will be enabled by default for new installations, existing
  deployments will continue to use the older static role based api access checker
  with an option to enable this feature
- During fresh installation or upgrade, the upgrade paths will add four default
  roles based on the four default role types
- For ease of migration, at the time of upgrade commands.properties will be used
  to add existing set of permissions to the default roles. cloud.account
  will have a new role_id column which will be populated based on default roles
  as well

Dynamic-roles migration tool: scripts/util/migrate-dynamicroles.py
- Allows admins to migrate to the dynamic role based checker at a future date
- Performs a harder one-way migrate and update
- Migrates rules from existing commands.properties file into db and deprecates it
- Enables an internal hidden switch to enable dynamic role based checker feature

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-05-11 09:45:19 +05:30
Rohit Yadav
87b431c0f3 travis: Fix simulator tests and optimize default global configs
- Migrate to trusty based Travis VMs
- Increase tests across five build matrices
- Fix xunit-reader output, include time
- Fix pip/python usage, pkg installation
- Build CloudStack in parallel with -T4
- Deploy database with optimized global settings

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-04-07 02:19:52 +05:30
Remi Bergsma
43ab98d823 Updating pom.xml version numbers for release 4.9.0-SNAPSHOT
Signed-off-by: Remi Bergsma <github@remi.nl>
2016-01-26 15:12:20 +01:00
Remi Bergsma
32fcc47117 Updating pom.xml version numbers for release 4.8.1-SNAPSHOT
Signed-off-by: Remi Bergsma <github@remi.nl>
2016-01-26 09:39:00 +01:00
Remi Bergsma
62f218b7bd Updating pom.xml version numbers for release 4.8.0
Signed-off-by: Remi Bergsma <github@remi.nl>
2016-01-20 23:43:35 +01:00
Remi Bergsma
8f5a2920e8 Updating pom.xml version numbers for release 4.8.0-SNAPSHOT
Signed-off-by: Remi Bergsma <github@remi.nl>
2015-12-21 22:09:31 +01:00
Remi Bergsma
1f53f2a93e Updating pom.xml version numbers for release 4.7.0-SNAPSHOT
Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-15 18:54:13 +01: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
Rohit Yadav
b81361c0f1 developer: avoid deploying with cloudbridge sqls
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-05-06 15:22:04 +02:00
Rohit Yadav
58999daafe CLOUDSTACK-8433: remove awsapi rpm and debian packaging
- Removes awsapi packaging rules for debian, centos63, centos7, fedora 20/21
- Removes catalina port 7080 service configs
- Fixes build replace properties for AWSAPILOG
- Removes maven profile for building awsapi and deploying db in developer profile

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-05-06 15:22:04 +02:00
Rohit Yadav
6b4652133b developer: re-add deleted configuration
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 59b2cbafa1f0c3033655112d348bb9523e0e8ef0)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-01-15 20:09:25 +05:30
Rohit Yadav
71a0148565 CLOUDSTACK-7219: Fix NPE, log warning when config item is missing from scope
- Cherry picked from Daan's fix 63fbd16dd11388bd93cdbec4ea7fe6de37aa7fc5
- Added another check if configDepot returned null
- Removed developer prefill values

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 188924751ed87a01541a094e03e958cd8d01653b)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-01-15 19:19:46 +05:30
Rohit Yadav
3dccbe3dc0 developer: increase disable thresholds global settings for developers
- Increases the disable thresholds for developers
- Removes the use local storage for systemvms

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 314e2daceeeecccdbdc34973d039d16817d2d166)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2014-12-08 21:59:52 +05:30
Hugo Trippaers
4ebaf0a583 Bump master version to 4.6.0-SNAPSHOT after branching 4.5.0-SNAPSHOT 2014-10-29 14:54:23 +01:00
Rohit Yadav
6379ca4548 CLOUDSTACK-6738: pre-seed expunge delay and interval to 60s
(cherry picked from commit 723eaefdf9c139d920a94202962cfd691589c304)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2014-09-15 14:48:14 +02:00
Rohit Yadav
3df104e20d developer: enable saml plugin for developers by default
Deploydb with a -P developer profile will run developer-prefill, in that we
enable the SAML plugin by default but only for developers

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2014-09-12 13:40:20 +02:00
Rohit Yadav
137655d4e1 developer: add commonly used glboal config in developer-prefill.sql
This commit adds three commonly used config that developers usually set
after fresh deployment. The account cleanup timeout is set to 60s to speed up
BVT runs.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit a68d8986829c462d655bf59a0cbcc0d4e8b1cc3e)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2014-08-01 16:54:10 +02:00
Hugo Trippaers
4402685e11 Update master to 4.5.0-SNAPSHOT 2014-03-14 14:55:26 +01:00
John Kinsella
7d8d1e9597 Last commit broke developer/pom.xml. fixing that. 2014-02-26 09:33:58 -08:00
John Kinsella
c68834635c Fix the developer database simulator deploy procedure so it includes the mysql database driver 2014-02-26 09:04:56 -08:00
Hugo Trippaers
e883877c7a Fix the developer database deploy procedure so it includes the mysql database driver 2014-02-25 11:58:02 +01:00
Hugo Trippaers
ac00ab0087 Cleanup all mysql dependencies and set all to provided. 2014-02-21 14:55:11 +01:00
Hugo Trippaers
cf715ff491 Bump 4.3.0 to 4.4.0 in master 2013-11-21 16:01:15 +01:00
David Grizzanti
dfb81ac127 CLOUDSTACK-5080: Hypervisor Capabilities table missing entry for Simulator
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-11-11 12:11:28 +05:30
Hugo Trippaers
15a97ec412 Cleanup pom.xml in various projects to properly use managed versions and other defaults 2013-09-21 17:21:06 +08:00
Alex Huang
66cca4d9ac Fixed up the pom.xml to use dependencies specified in cloudstack pom 2013-08-02 13:51:47 -07:00
Chip Childers
8225374138 Updating pom.xml version numbers for release 4.3.0-SNAPSHOT
Signed-off-by: Chip Childers <chipchilders@apache.org>
2013-08-01 10:35:00 -04:00
Alex Huang
486e0d02f8 Fixed the applicationcontext.xml because I removed a class. oh kelven oh kelven, when can we get back our java based config for core components...this is so bad for refactoring 2013-07-29 19:13:33 -07:00
Edison Su
58f0007f75 turn on simulator code, only when -Psimulator is used 2013-07-10 14:31:47 -07:00
Prasanna Santhanam
f1134da8df Group storage subsystem components for spring
Breaking down storage components among oss, nonoss and simulator
contexts. The default components are loaded by

OSS - applicationContext + componentContext
NonOSS - applicationContext + nonossComponentContext
Simulator - applicationContext + simulatorComponentContext

provider beans are are selectively overridden for simpler configuration.
Where possible beans are loaded by local reference.

<list merge=true> does not unfortunately work perfectly for bean merging
the providers causing a bit of bloat. Explore for later.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-06-29 13:53:41 +05:30
Min Chen
18aeef3ef1 Merge branch 'master' (up to commit
c30d9be3cea30339cfff40c1002906634291b373) into object_store.
2013-06-12 11:20:32 -07:00
Prasanna Santhanam
25fac83326 developer pom is for developer environment
Naming the developer project to "Apache CloudStack developer mode"
instead of tools. Tools are cli, marvin, etc

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-06-04 14:26:40 +05:30
Edison Su
4e4112fcec fix attach volume for kvm 2013-05-23 13:51:46 -07:00
Vijayendra Bhamidipati
2dbdc46337 CLOUDSTACK-1734: Make SHA1 default password encoding mechanism
Description:

	Making SHA256SALT the default encoding algorithm to encode
	passwords when creating/updating users.

	Introducing a new configurable list to allow admins to
	separately configure the order of preference for encoding
	and authentication schemes.

	Since passwords are now sent by clients as clear text,
	fixing the Plain text authenticator to check against the
	password passed in rather than its md5 digest.
2013-04-02 17:40:50 -07:00
Prasanna Santhanam
792db8b5cc simulator: removing cyclic dependency from simulator
The database creator caused a cyclic dependecny in the simulator which
is removed with this commit. Additionally the simulator profile is now
merged with developer profile and a test for server health is included

Steps to run:
$ mvn -Pdeveloper clean install
$ mvn -Pdeveloper -pl developer -Ddeploydb
$ mvn -Pdeveloper -pl developer -Ddeploydb-simulator
$ mvn -pl client jetty:run

To deploy an adv. zone and test the server health:
$ mvn -Pdeveloper,marvin -Dmarvin.config=`find . -name simulator.cfg` -pl :cloud-marvin test

Conflicts:
	pom.xml

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-03-20 10:36:43 +05:30
Rohit Yadav
a32c6d5c9d db: Fix deploydb, make sure scripts are in path
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-02-25 11:00:56 +05:30