63 Commits

Author SHA1 Message Date
John Bampton
28e8e2d009
pre-commit: add hook to trim trailing whitespace (#8205) 2024-05-28 09:01:30 +02:00
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
Wilder Rodrigues
e72a79c1ce Formatting the router_proxy.sh script 2015-09-25 16:09:27 +02:00
Sheng Yang
e88cc488e5 CLOUDSTACK-5779: Move loadbalancer to use routerProxy 2014-01-20 18:48:46 -08:00
Sheng Yang
ca81e7b465 CLOUDSTACK-5779: Clean up savepassword scripts 2014-01-17 12:36:42 -08:00
Sheng Yang
0ea1c7dfc4 CLOUDSTACK-5779: Move firewall to use routerProxy 2014-01-17 12:36:42 -08:00
Sheng Yang
ce67e24d0a CLOUDSTACK-5779: Move ipAlias to use routerProxy 2014-01-17 12:36:42 -08:00
Sheng Yang
0cdf0f6f67 CLOUDSTACK-5779: Moving bumpUpPriority, edithosts.sh, dnsmasq.sh to use routeProxy 2014-01-16 16:03:09 -08:00
Marcus Sorensen
ac59a4f136 Summary: Move Xen vmdata to new, non-ssh method
Detail: KVM recently got a patch that did away with a few dozen ssh calls
when programming virtual router (CLOUDSTACK-3163), saving several seconds
for each vm served by the virtual router when the router is rebooted. This
patch updates Xen to use the same method, and cleans up the old script refs.

Reviewed-by: Sheng Yang, Prasanna Santhanam
2013-07-30 21:45:36 -06:00
Wei Zhou
e34a75005e CLOUDSTACK-3843: remove greedy results in save_password_to_domr.sh 2013-07-29 13:02:07 +02:00
Sheng Yang
17a675942c Bring back vm_data.sh which deleted by a KVM related commit
The following commit removed vm_data.sh, but the file shared by Xen as well.

Bring the file back.

commit 28855b4987c9274d15a539b9d7ae26c0073b0651
Author: Marcus Sorensen <marcus@betterservers.com>
Date:   Wed Jul 24 13:58:17 2013 -0600

    Summary: Get away from dozens of ssh/scp calls for KVM vm_data push

    Detail: userdata and vm metadata take a long time to program on KVM routers.
    This does it all in one go, processed on the router.

    BUG-ID: CLOUDSTACK-3163
    Tested-by: Wido
    Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1374695897 -0600
2013-07-25 16:34:10 -07:00
Marcus Sorensen
28855b4987 Summary: Get away from dozens of ssh/scp calls for KVM vm_data push
Detail: userdata and vm metadata take a long time to program on KVM routers.
This does it all in one go, processed on the router.

BUG-ID: CLOUDSTACK-3163
Tested-by: Wido
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1374695897 -0600
2013-07-24 14:01:02 -06:00
Bharat Kumar
d73bb22802 Incorportaed the review changes Now dhcpservice IPs are removed when last vm from the subnet is removed. Rebased with master.
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
2013-07-17 12:35:06 +05:30
Bharat Kumar
360eae3687 Cloudstack-2854 [Multiple_IP_Ranges] Failed to create ip alias on VR while deploying guest vm with ip address from new CIDR
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
2013-06-12 11:15:47 +05:30
Sheng Yang
e35ce6587a CLOUDSTACK-1461: Don't set dns server for non-default ipv6 network
The non-default parameter can be used by ipv4 as well in the future.
2013-03-08 17:43:23 -08:00
Sheng Yang
5cb9df91a1 Merge branch 'ipv6'
Conflicts:
	api/src/com/cloud/network/NetworkProfile.java
2013-01-31 15:07:33 -08:00
Jayapal
b6727e5646 CLOUDSTACK-299: Egress firewall rules feature for guest network on VR 2013-01-31 11:20:47 +05:30
Sheng Yang
8f66d266b3 IPv6: Enable VR's ability to provide DHCPv6 service 2013-01-26 23:14:42 -08:00
Sheng Yang
9300a02ba4 IPv6: Update edithosts.sh accept parameters 2013-01-26 23:14:27 -08:00
Gavin Lee
d3921139ed Patch from Gavin Lee: Change license to ASL2.0 in server and tools
Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-08-30 10:36:29 -04:00
Sheng Yang
8d4079d477 CS-6840: Add hypervisor commands for site-to-site vpn
Conflicts:

	plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
2012-07-02 16:28:44 -07:00
Alena Prokharchyk
634cd78baa Merge branch 'master' into vpc
Conflicts:
	api/src/com/cloud/api/ApiConstants.java
	api/src/com/cloud/api/BaseCmd.java
	api/src/com/cloud/api/ResponseGenerator.java
	api/src/com/cloud/api/commands/ListNetworksCmd.java
	api/src/com/cloud/api/response/NetworkResponse.java
	api/src/com/cloud/event/EventTypes.java
	api/src/com/cloud/network/NetworkService.java
	client/tomcatconf/commands.properties.in
	scripts/network/domr/getDomRVersion.sh
	scripts/network/domr/ipassoc.sh
	scripts/network/domr/l2tp_vpn.sh
	scripts/network/domr/networkUsage.sh
	scripts/network/domr/router_proxy.sh
	server/src/com/cloud/api/ApiDBUtils.java
	server/src/com/cloud/api/ApiResponseHelper.java
	server/src/com/cloud/configuration/DefaultComponentLibrary.java
	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/network/dao/IPAddressDao.java
	server/src/com/cloud/network/dao/IPAddressDaoImpl.java
	setup/apidoc/gen_toc.py
	setup/db/create-schema.sql
	wscript
2012-06-28 17:41:40 -07:00
David Nalley
d630fa8697 license header changes for scripts folder from Chip Childers 2012-06-23 00:58:00 -04:00
anthony
a4d0f91cfe VPC : use routerProxy to call l2tpVpn
Conflicts:

	core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
2012-06-15 14:26:20 -07:00
anthony
c75fe80125 VPC : use routerProxy to call networkUsage.sh
Conflicts:

	core/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
2012-06-15 14:25:21 -07:00
anthony
251a91f5b3 VCP : use routerProxy to call checkrouter script 2012-06-15 14:24:18 -07:00
anthony
a08c9e7890 VPC : move acl.sh ipassoc.sh to /opt/cloud/bin/ 2012-06-15 14:24:09 -07:00
anthony
8c1700a3a4 VPC : introduce router_proxy.sh, resource should use this as a proxy to call scripts inside domr
already did this for ipassoc and getDomRVersion
2012-06-15 14:22:49 -07:00
frank
2f634c0913 Switch to Apache license 2012-04-03 04:50:05 -07:00
frank
52610ffcb3 add copyright header to shell scripts 2012-01-11 18:41:53 -08:00
Sheng Yang
59981f71c1 bug 12883: Fix numerous NETWORK_STAT related rule in iptables
Also use script in the router for the execution.

status 12883: resolved fixed
2012-01-09 20:04:45 -08:00
Chiradeep Vittal
797836723d bug 10804: add default dns provider 2011-12-05 16:56:31 -08:00
Chiradeep Vittal
89f13ad700 bug 10804 virtual router support for per-vm default network 2011-12-05 14:53:42 -08:00
Sheng Yang
89e45bd671 bug 11130: Add GetDomRVersionCmd 2011-09-29 14:50:11 -07:00
kishan
8ffeddb020 bug 11547: Reset iptables counter when a public interface on domR is removed 2011-09-23 15:43:45 +05:30
Sheng Yang
9317033a4f Add missing files for redundant router. 2011-09-14 16:25:56 -07:00
Sheng Yang
b987123daa bug 11307: Let CheckRouterAnswer() parse the return result 2011-09-14 16:21:33 -07:00
Naredula Janardhana Reddy
b9183c0840 bug 10561: merging code from 2.2.10 to master 2011-08-16 14:20:51 +05:30
Naredula Janardhana Reddy
2fc7be14de bug 10557: implemented the TODO - opening the stats port using iptable 2011-07-28 17:24:10 +05:30
Sheng Yang
5db86e6c20 Fix CheckRouterAnswer's isMaster report
If we got invalid/unsuccessed answer from CheckRouterAnswer, set master to
false.

Also add missed scripts.
2011-06-07 14:47:46 -07:00
Chiradeep Vittal
88b453928c bug 9771: fix metadata url 2011-05-12 15:06:54 -07:00
Edison Su
1139868af9 fix vm data permission issue, by ssh to domr, chmod to 644 2011-05-02 11:01:19 -04:00
Edison Su
7e8d02defb bug 8955: add umask 022 to make sure we can get read permission for user data
status 8955: resolved fixed
2011-04-27 10:28:23 -04:00
Frank
92155522f2 Add license header to files 2011-04-14 11:23:14 -07:00
Chiradeep Vittal
10dc1c75d8 bug 8370: pass in original params when calling delete during add
status 8370: resolved fixed
2011-02-08 16:41:27 -08:00
Chiradeep Vittal
711c4eeaae bug 8209,8370,8459: cleanup scripting 2011-02-08 12:10:07 -08:00
Chiradeep Vittal
757bd0b5e4 bug 8254: point save password to right location 2011-01-28 16:01:52 -08:00
Chiradeep Vittal
8ba1b2d33a bug 7380: SNAT rules when there are multiple public interfaces 2011-01-13 15:49:23 -08:00
abhishek
239942bbe1 refactored all the commands to cater to keshav's needs, and added the new apis. the initial set of testing is complete, will now focus on corner cases 2010-11-11 13:07:26 -08:00
abhishek
e5ca5dddf9 renaming the ip forwarding commands to port forwarding commands, and beginning to work on Keshav's request to modify the current 1-1 NAT to be compatible with the Amazon apis 2010-11-11 13:07:26 -08:00