128 Commits

Author SHA1 Message Date
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
Daan Hoogland
28ca93369d trailing commas in javascripts removed 2015-12-27 12:34:58 +01:00
Rohit Yadav
f30fbe9a5c Merge branch '4.6' 2015-12-07 12:44:07 +05:30
Wei Zhou
e9cc5551d3 [UI] fix bug: Cannot delete SSH keypairs in projects
Before change:
error message: ProjectId and account/domainId can't be specified together

After change:
SSH keypairs can be removed
2015-12-03 09:11:00 +01:00
Daan Hoogland
781702aea7 fix regression on 9a23229d946eb117985ef4547acccb3c11f56283, comma was actually a needed separator 2015-11-26 14:07:14 +01:00
Daan Hoogland
9a23229d94 javascript:TrailingComma sonacube issue considered blocker removed 2015-11-17 10:19:33 +01:00
Milamber
267994fa0b CLOUDSTACK-8744 Add missing localization (l10n) for several parts in the UI
- l10n for the SSH Key Pairs behavior
- l10n for Autoscaling / LB sections
- l10n for Reset password
- l10n on some strings for the installation Wizard
- l10n on some strings in VPN/VPC section
- l10n on Service offerings sections
- improve some FR translations
2015-08-18 11:16:14 +01:00
Boris Schrijver
f9e21da5dd Removed double encoding of Public Key from JS.
See Cloudstack issue CLOUDSTACK-8742 for information.
2015-08-17 22:56:17 +02:00
Kevin Dierkx
471a02d6a4 Removed leading tabs from ui/scripts/*.js 2015-08-07 11:58:13 +02:00
Kevin Dierkx
2bdbaf453e Removed trailing whitespace from ui/scripts/*.js 2015-08-07 11:25:15 +02:00
Rohit Yadav
47d2d07eb9 CLOUDSTACK-8457: SAML UI Dialog fixes to use local $form
This uses local selector to access the DOM elements, the previous commit
would find a global element which is not in the context and fail changing the
element in the opened dialog.

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

This closes #583
2015-07-15 18:36:46 +05:30
Rohit Yadav
76a10351a5 CLOUDSTACK-8457: SAML UI enhancements
Add option to authorize SAML SSO for user when adding user. Appends a domain to
user/account name if global setting is enabled, useful in case of multiple IDP
server. By default the setting is set to false (keep as it is).

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

This closes #575

(cherry picked from commit 7d11c7bc703be00c91ea267695a33756ebb14b57)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-07-14 10:20:30 +05:30
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
Rajani Karuturi
8571314406 Fixed blocker issues reported by sonarqube in js files
All of them are trailing comma in array or object

more details @
https://analysis.apache.org/component_issues?id=org.apache.cloudstack%3Acloudstack#resolved=false|severities=BLOCKER|languages=js
2015-05-20 17:19:20 +05:30
Remi Bergsma
a7f8059fd3 CLOUDSTACK-6543 Sort domain lists in UI
As recently discussed on the dev list:
This sorts the domain lists based on their path.
Especially handy when having a lot of domains,
like in a public cloud.
2015-04-12 23:21:43 -05:00
Wei Zhou
19e99848c8 CLOUDSTACK-7882: SSH Keypair Creation/Selection in UI
Thanks Ilia Shakitko for the porting and testing.
2014-12-12 14:30:34 +01:00
Brian Federle
ebd42a8435 Fix missing 'add LDAP account' label 2014-11-21 09:16:41 -08:00
vetrivelc
6a11d099cf Fix Externalization of hard-coded label strings
-Split 'dictionary.jsp' into two files -> 'dictionary.jsp' and
'dictionary2.jsp' -- this is due to JSP file constraints as the
localization object is getting quite long

-Per change above, 'dictionary' object is now split into an additonal
'dictionary2' object, which is merged with the main dict object on page
load

-All new dictionary mappings should be added to 'dictionary2' now.

Signed-off-by: Brian Federle <brian.federle@citrix.com>
2014-09-17 13:59:13 -07:00
Gabor Apati-Nagy
c200ada863 CLOUDSTACK-7463: UI: Domain Admin UI shows 'Add LDAP Users' button (should not be shown)
Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>
2014-09-02 16:09:38 +05:30
Jessica Wang
021a604493 CLOUDSTACK-6789: UI > User page > fix a bug that a domain-admin was unable to delete other domain-admin in the same domain. 2014-05-27 15:45:53 -07:00
Jessica Wang
d7291e5200 CLOUDSTACK-6379: UI > fix a bug that domain admin failed to be created when current login doesn't have visibility to root domain object. 2014-05-12 15:37:42 -07:00
Jessica Wang
aabe6f2baf CLOUDSTACK-6487: UI > Add LDAP Account - fix a bug that a LDAP account that does not have email and all LDAP accounts below it are missing from the listing. 2014-04-23 17:07:00 -07:00
Brian Federle
9b16a6dfdc CLOUDSTACK-6227: Don't show API/secret key fields in quickview 2014-03-28 10:25:06 -07:00
Gabor Apati-Nagy
e65d6bd3a8 CLOUDSTACK-6227 (Add copy-paste support for detail view fields):
DetailView widget now supports bool isCopyPaste property that can be set
for fields. If this is set to true, the text of this field is displayed
using ellipsis formatting* and a copy-paste icon is available right next
to it. On clicking this icon, the full text is displayed

*: tooltip is also enabled showing the original non-ellipsed value
2014-03-28 10:15:19 -07:00
vetrivelc
e171cb181c Fixed-Hardcoding-Issues 2014-02-14 07:44:54 -08:00
Jessica Wang
89945cd705 CLOUDSTACK-5527: UI > accounts page > support both "Add (non-LDAP) Account" and "Add LDAP Account" when LDAP is enabled. 2014-01-02 16:48:13 -08:00
Brian Federle
932758e2ef CLOUDSTACK-5551: Pass search 'name' field to listConfigurations UI
Passes search bar value (by 'name') for the settings in the following sections'
detail views:

-Account
-Primary storage
-Cluster
-Zone
2013-12-20 13:38:46 -08:00
Brian Federle
9dabad0253 Fix broken change password UI 2013-12-06 12:34:31 -08:00
Jessica Wang
0b5a6cb0cf CLOUDSTACK-1889: UI > accounts > Update Resource Count action > after action succeeds, pop up a dialog to show updated count of resources. 2013-11-27 13:07:46 -08:00
Wei Zhou
5109498783 CLOUDSTACK-4830: allow create account and user by domain admin
(cherry picked from commit 0d12e3eb9d4fb0166fc553da7366f4da786daa14)
2013-10-31 11:36:54 +01:00
Wei Zhou
0f976fd328 CLOUDSTAC.K-4923: add missing Network limits in Accounts details page 2013-10-22 15:58:17 +02:00
Brian Federle
34c04a4546 UI code cleanup: Fix trailing commas in JS 2013-09-24 11:16:13 -07:00
Ian Duffy
bdba0ddeed Bring up to date with master 2013-08-31 00:25:48 +01:00
Jessica Wang
641fb1c24e CLOUDSTACK-4269: UI > account page > hide Setting tab for regular-user/domain-admin since they don't have access to listConfigurations API. 2013-08-12 16:35:09 -07:00
Ian Duffy
532e04db1a Disable password changing when ldap is enabled
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
2013-08-02 14:20:47 +05:30
Ian Duffy
ec064b3077 New LDAP UI
Signed-off-by: Sebastien Goasguen <runseb@gmail.com>
2013-07-29 05:58:00 -04:00
Ian Duffy
eaa4143371 Merge LDAPPlugin
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
2013-07-25 17:54:52 +05:30
Jessica Wang
11dce48855 CLOUDSTACK-3789: UI - specify type when making API calls. 2013-07-24 11:50:49 -07:00
Ian Duffy
ad69bc8da3 Format JS 2013-07-18 12:34:20 -04:00
Nitin Mehta
c11dbad9c9 merge master 2013-05-11 15:28:43 +05:30
Pranav Saxena
e309a91a9b CLOUDSTACK-1941:Cannot delete users in the default admin account within the UI 2013-04-22 14:19:38 +05:30
Sanjay Tripathi
2c176ab9ea CLOUDSTACK-1592:[UI] Add support to limit newly added resourcetypes 2013-03-29 14:18:14 +05:30
Jessica Wang
9270b4335c CLOUDSTACK-1065: cloudstack UI - AWS Style Regions - remove region field from Add Account dialog since createAccount API does not take in regionid parameter. 2013-03-20 16:47:52 -07:00
Brian Federle
fdaa5b4909 User accounts UI: Support for regions
-Add region select to add account form

-Show account's region in detail view
2013-02-27 08:59:55 -08:00
Pranav Saxena
44ceff4224 CLOUDSTACK-1064:A type error occurs when trying to add account/register template: this is because of accounts conext being undefined 2013-01-25 16:42:42 +05:30
Sanjay Tripathi
fd8607d41e CLOUDSTACK-819:Changing GET request to POST while creating account/user to hide the passwords in the access logs 2013-01-07 22:29:28 +05:30
Isaac Chiang
6ce01c46fc UI: add generate key button to appropriate roles 2013-01-03 10:58:13 -08:00
Isaac Chiang
5aefd77f77 Fix for CloudStack-648
Signed-off-by: Gavin Lee <gavin.lxh@gmail.com>
2012-12-26 00:00:58 +08:00
Jessica Wang
703c5b44f2 cloudstack UI - user page - update user, change password, generate key, disable user, enable user, delete user - encode data passed to API call. 2012-10-31 15:25:32 -07:00
Jessica Wang
8692f68603 CS-16573: cloudstack UI - create user - encode data passed to API call. 2012-10-31 15:18:46 -07:00