98 Commits

Author SHA1 Message Date
John Bampton
6f4503488b
pre-commit: apply end-of-file-fixer to all files (#7551) 2023-08-02 13:47:21 +02:00
John Bampton
8e538028b2
Enable Flake8 rule W391 (#6606)
Best practice is to have one blank line at the end of Python files.

Remove unneeded blank lines from the end of files
2022-11-13 11:00:07 +01:00
John Bampton
182899d0b5
Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687)
* refactor: remove trailing whitespace from Python files

* Add the GitHub Super-Linter

Add Python flake8 linting for W291 trailing whitespace

* Add licenses
2022-03-28 11:40:26 -03:00
Richard Lawley
d70f574a7e plugins: fix removing SRX port forwarding rules, improve add/remove logic (#3393)
This PR partially fixes the logic around port forwarding rules on the Juniper SRX plugin. The code in the plugin is based on JunOS 10, which is very old. The changes here should not break compatibility, but should enable the plugin to be used on newer devices. Note that an additional change to a script file is required to be able to add port forwarding rules, but as this PR was targetted for 4.11.3, I thought it best not to include this change as it might break compatibility for anyone still using JunOS 10.

I've made the logic better and consistent for adding/removing static nat and port forwarding rules - these were multi-step processes which did not check each individual step. This would aid in manually fixing rules in case of further problems.

I've also improved the logging for communication with the SRX by stripping out the Apache header before sending it, and indicating the name of the template filename in use.

To be able to add port forwarding rules, the <dst-port> tags in dest-nat-rule-add.xml must be changed to <low>.

Fixes: #3379
2019-07-08 15:46:12 +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
Högni Ingimarsson
fde0b6aa57 writeIfNotHere requires an array of strings, not a string 2016-03-30 11:17:13 +00:00
Wilder Rodrigues
e72a79c1ce Formatting the router_proxy.sh script 2015-09-25 16:09:27 +02:00
Frank Zhang
01dada100a CLOUDSTACK-6278
Baremetal Advanced Networking support
2014-10-06 16:03:19 -07:00
Hugo Trippaers
6687727b76 Frank forgot the license header 2014-09-19 10:14:38 +02:00
Frank Zhang
8b89494a35 CLOUDSTACK-6278
Baremetal Advanced Networking support
2014-09-18 16:54:37 -07:00
Frank.Zhang
12ad254069 CLOUDSTACK-6278
Baremetal Advanced Networking support

    add missing license header
2014-08-05 11:11:02 -07:00
Frank.Zhang
1ee7e0c77e CLOUDSTACK-6278
Baremetal Advanced Networking support
2014-08-04 15:00:44 -07: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
Jayapal
c22e7d0052 CLOUDSTACK-1578 SRX: Egress default policy configurable using network offering on SRX firewall 2013-06-24 13:37:01 +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
Nitin Mehta
c11dbad9c9 merge master 2013-05-11 15:28:43 +05:30
Jayapal
a4a059c043 CLOUDSTACK-779 Egress firewall rules support for Juniper SRX 2013-04-10 10:54:04 -07:00
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
frank
31d6e5465e CloudStack CLOUDSTACK-774
Supporting kickstart in CloudStack baremetal

make kikcstart working with ubuntu
2013-03-01 17:55:49 -08:00
Mice Xia
dae57c1ab2 add missing license header reported by rat 2013-02-22 13:22:14 +08:00
frank
55b77c7c8f CloudStack CLOUDSTACK-774
Supporting kickstart in CloudStack baremetal

adding missing scripts back

Conflicts:

	client/pom.xml
	client/tomcatconf/commands.properties.in
	server/src/com/cloud/server/ManagementServerImpl.java
2013-02-21 15:46:11 -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
Marcus Sorensen
8c5b82dfb4 Summary: several scripts are not mode executable
Detail: several scripts in the scripts directory weren't marked executable.
Normally this is handled/fixed in the packaging, but harder to deal with in
development environments, so marking them executable.

Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1358446902 -0700
2013-01-17 11:21:42 -07:00
Sheng Yang
3d9dc36463 The other xml license fix 2013-01-04 20:03:16 -08:00
Sheng Yang
51502e9f06 Fix license issue of new added xml files 2013-01-04 19:52:21 -08:00
Sheng Yang
717f9dcd4d CLOUDSTACK-306: Implement SRX firewall
Use SRX firewall filter as SRX firewall. The old security policy mechanism
cannot be used as IP based. This would enable SRX's ability to control traffic
for F5 behind it.
2013-01-04 19:17:50 -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
Alena Prokharchyk
5a72044dc7 Merge branch 'master' into vpc 2012-08-03 14:30:54 -07:00
Chip Childers
09bdd3b6c3 License header updates for the scripts folder. 2012-08-03 09:38:28 -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