Skip to content

Commit aeb6bc0

Browse files
Merge pull request #175 from dulajdilshan/deployment-best-practices
Improve sections in `Deployment Best Practices` and address review comments in #169
2 parents 79dbd79 + e5408b7 commit aeb6bc0

File tree

4 files changed

+71
-59
lines changed

4 files changed

+71
-59
lines changed
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Network Level Security
22

3-
### Establish a Failover Setup
3+
## Establish a failover setup
44

55
Implement high availability (HA) and failover configurations to ensure continuous system operation and minimize downtime.
66

@@ -10,22 +10,20 @@ Implement high availability (HA) and failover configurations to ensure continuou
1010

1111
Continuously monitor the health and performance of all nodes within the cluster. Track key metrics such as resource utilization, response time anomalies, and the volume of incoming network connections. Effective monitoring helps you determine when to add failover instances or adjust network routing to prevent service disruptions.
1212

13-
### Maintain Network-Level Logging
13+
## Maintain network-level logging
1414

1515
Enable and retain logs for all network components, including proxy servers, load balancers, and other critical infrastructure devices. Regularly review these logs to detect abnormal behavior, unauthorized access attempts, or configuration changes.
1616

17-
### Audit Open Ports and Services
17+
## Audit open ports and services
1818

1919
Conduct periodic network scans to identify open ports and active services. Ensure that only the ports necessary for your WSO2 products are accessible on both internal and external networks. Disable or monitor any additional open ports that are not explicitly required.
20-
21-
> Refer to **Default Product Ports** for the complete list of ports used by WSO2 products.
2220

23-
### Enforce Device-Level Security
21+
## Enforce device-level security
2422

2523
* Regularly inspect and validate the configuration and integrity of all network devices, including routers, switches, and firewalls. Verify routing tables, access control lists, and firewall rules for correctness and consistency.
2624

2725
* Replace all default device credentials with strong, unique passwords before deploying devices in production.
2826

29-
### Apply Firmware Updates
27+
## Apply firmware updates
3028

3129
Keep network device firmware up to date to mitigate vulnerabilities and maintain optimal performance. Apply updates as recommended by the device vendor after validating them in a non-production environment.
Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,37 @@
11
# OS level Security
22

3-
### Run WSO2 Processes with a Dedicated User
3+
## Run WSO2 processes with a dedicated user
44

55
Use a dedicated OS-level user account to run WSO2 products. Assign only the minimum permissions necessary for running the product. Avoid using the root or administrator account, as these have full privileges by default and increase the risk of security breaches.
66

7-
### Minimize Installed Software
7+
## Minimize installed software
88
Install only the software and packages required for your WSO2 product deployment. Unnecessary software can introduce vulnerabilities. Regularly review and monitor installed packages.
99

10-
Refer to the Installation Prerequisites for details on the minimum required software.
10+
Refer to the [system requirements](/references/system-requirements) for details on the minimum required software.
1111

12-
### Enable the Firewall
12+
## Enable the firewall
1313
Enable and configure a host-level firewall (e.g., iptables) to protect inbound and outbound connections. Only open the ports that are required for product functionality.
1414

15-
### Restrict Access to Clustering Ports
15+
## Restrict access to clustering ports
1616

1717
Apply firewall rules to restrict access to TCP ports used for clustering (e.g., ports 4000, 4001, etc.) so that they are accessible only to other nodes within the WSO2 product cluster. Prevent access from unrecognized or external hosts.
1818

19-
### Use Secure Shell (SSH)
19+
## Use secure shell (SSH)
2020

2121
* Always use Secure Shell (SSH) for remote server access and command execution. Follow these best practices when configuring SSH:
2222
* Change the default SSH port to a non-standard, higher-numbered port.
2323
* Disable direct root or administrator logins.
2424
* Enable authentication via SSH keys instead of passwords.
2525
* Display a legal or security banner before authentication to warn unauthorized users.
2626

27-
### Keep the System Up-to-Date
27+
## Keep the system up-to-date
2828

29-
Regularly apply security patches and updates for all installed packages, including the Java runtime. Test updates in a staging environment before deploying them to production.
29+
Regularly apply security patches and updates for all installed packages. Test updates in a staging environment before deploying them to production.
3030

31-
### Monitor User Activities
31+
## Monitor user activities
3232

3333
Enable OS-level logging and review logs periodically to monitor user actions. Consider using a centralized logging or Security Information and Event Management (SIEM) solution for continuous monitoring.
3434

35-
### Perform Regular Backups
35+
## Perform regular backups
3636

3737
Back up all the critical files and data regularly, and store them securely.
38-
Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
# Best Practices for Production Deployment
22

3-
Following are the guidelines for hardening the security for production deployment.
3+
This section provides comprehensive security and operational best practices for deploying WSO2 Integrator: BI in production environments. Following these guidelines helps ensure your deployment is secure, resilient, and maintainable.
44

5-
* [Runtime Security](/deploy/deployment-best-practices/runtime-security)
6-
* [OS level security](/deploy/deployment-best-practices/os-level-security)
7-
* [Network level security](/deploy/deployment-best-practices/network-level-security)
5+
## Runtime security
86

7+
Runtime security focuses on securing your BI application and the services it generates during execution, including application-level configurations, patches, secrets management, TLS/SSL protocols, and logging.
8+
9+
[Learn more about runtime security →](/deploy/deployment-best-practices/runtime-security)
10+
11+
## OS level security
12+
13+
Operating system security addresses the hardening of the underlying operating system where BI is deployed, covering user accounts, firewalls, SSH configuration, system updates, and monitoring.
14+
15+
[Learn more about OS level security →](/deploy/deployment-best-practices/os-level-security)
16+
17+
## Network level security
18+
19+
Network security covers the infrastructure and network-level protections for your BI deployment, including high availability, failover configurations, network logging, port auditing, and device security.
20+
21+
[Learn more about network level security →](/deploy/deployment-best-practices/network-level-security)
22+
23+
## Getting started
24+
25+
Review each category above to understand the security considerations for your deployment. Implement these practices based on your specific environment, compliance requirements, and security policies. These guidelines are applicable to both cloud-native (containerized) and traditional VM-based deployments.
Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,97 @@
11
# Runtime Security
22

3-
### 1. Apply Security Patches Regularly
3+
## Apply security patches regularly
44

5-
* **VSCode Plugin**: Always use the latest release for `WSO2 Integrator: BI` and `Ballerina` VSCode plugin.
6-
* **Ballerina:** Use the latest patch release of the relevant Ballerina distribution version.
5+
Keeping all software components up to date is a critical part of maintaining runtime security. Security patches often address newly discovered vulnerabilities that attackers can exploit if left unpatched.
76

8-
> Community users are encouraged to use the latest product versions to receive all resolved security issues.
7+
| Category | Guidelines |
8+
|-----------|-------------|
9+
| **WSO2 Integrator: BI** | Always use the latest stable release of [Visual Studio Code](https://code.visualstudio.com/).<br><br>Keep [WSO2 Integrator: BI](https://marketplace.visualstudio.com/items?itemName=WSO2.ballerina-integrator) and [Ballerina](https://marketplace.visualstudio.com/items?itemName=WSO2.ballerina) extensions updated to ensure compatibility with the latest security and functionality enhancements. |
10+
| **Ballerina Distribution** | Use the latest patch release of the relevant [Ballerina distribution](https://ballerina.io/downloads/) to ensure runtime and library-level vulnerabilities are fixed.<br><br>Follow Ballerina and WSO2 product release notifications to stay informed about new security advisories. |
11+
| **Operating System and Dependencies** | Regularly apply security updates to the host operating system, *container base images*, and *runtime dependencies* (e.g., database clients, third-party libraries).<br><br>If deploying via Docker, track and update base image versions (e.g., `ubuntu`, `alpine`, or `ballerina`) to the latest stable, patched releases.|
12+
| **Automation and CI/CD Integration** | Integrate automated patch verification and dependency vulnerability scanning into CI/CD pipelines.<br><br>Use dependency management tools (e.g., *Dependabot*, *Renovate*) to receive automated pull requests for new patches.<br><br>Maintain a rollback plan and a staging environment to safely test patches before deploying to production. |
13+
| **Community and Security Feeds** | Follow [WSO2 Security Docs](https://security.docs.wso2.com/en/latest/) for timely notifications of vulnerabilities and fixes. |
914

10-
> Subscribe to the official security mailing lists and follow WSO2/Ballerina release announcements.
15+
## Use keystores and truststores correctly
1116

12-
* **OS and Dependencies:** Keep the operating system, container base images, Java (JDK/JRE), and database clients updated with security patches.
13-
* **Automation:** Integrate patch checks into CI/CD pipelines and maintain a rollback plan for emergency patches.
14-
15-
### 2. Use Keystores and Truststores Correctly
16-
17-
* Configure BI and the generated Ballerina services to use **separate keystores** for service certificates and **truststores** for trusted CAs.
17+
* Configure BI and the generated Ballerina services to use separate keystores for service certificates and truststores for trusted CAs.
1818
* Use strong passwords and store them securely (e.g., as Kubernetes secrets or environment variables).
19-
* Always replace default keystore files shipped with samples.
19+
* Always replace the default keystore files shipped with samples.
2020

21-
### 3. Manage Secrets Securely
21+
## Manage secrets securely
2222

2323
* Never hardcode passwords, tokens, or keys in source code, configuration files, or repositories.
24-
2524
* Use platform-specific secret management systems such as:
26-
* **Kubernetes Secrets**
27-
* **HashiCorp Vault**
28-
* **AWS Secrets Manager** or similar cloud stores.
29-
* Pass secrets into BI runtime via configuration values.
25+
* Kubernetes Secrets
26+
* HashiCorp Vault
27+
* AWS Secrets Manager or similar cloud stores.
28+
* Pass secrets into the BI runtime via configuration values.
3029

31-
### 4. Change Default Ports and Credentials
30+
## Change default ports and credentials
3231

33-
* Change all **default listener ports** used by BI components and generated Ballerina services.
32+
* Change all default listener ports used by BI components and generated Ballerina services.
3433
Example: modify configurations or `Config.toml` to run on custom, non-standard ports.
3534
* Disable unused ports and protocols to minimize the attack surface.
3635
* Replace any default credentials used by admin or management consoles.
3736

38-
### 5. Secure Communication with External Services
37+
## Secure communication with external services
3938

4039
When BI connects to external systems such as user stores, databases, or other APIs:
4140

42-
* Always enable **TLS/SSL** for data-in-transit protection.
41+
* Always enable TLS/SSL for data-in-transit protection.
4342
* Validate external service certificates using the truststore.
4443
* Verify hostnames and certificate chains to avoid man-in-the-middle attacks.
4544
* Restrict outbound network access to only approved endpoints.
4645

47-
---
48-
49-
### 6. Use Least-Privilege Credentials for DBs and User Stores
46+
## Use least-privilege credentials for DBs and user stores
5047

5148
* Never connect to databases, LDAP, or user stores using `root` or administrator credentials.
5249
* Create dedicated application-level accounts with only the minimal privileges required:
5350
* Read/write on specific schemas or tables.
5451
* No administrative permissions (e.g., `DROP DATABASE`, `GRANT ALL`).
5552
* Rotate credentials periodically and disable accounts no longer in use.
5653

57-
### 7. Strengthen TLS Security
54+
## Strengthen TLS security
5855

59-
* Enforce **TLS 1.2 or TLS 1.3** for all HTTPS and secure socket communications.
56+
* Enforce TLS 1.2 or TLS 1.3 for all HTTPS and secure socket communications.
6057
* Disable older or insecure protocol versions (e.g., TLS 1.0/1.1, SSLv3).
61-
* Require strong cipher suites only (see below).
58+
* Require strong cipher suites only (Refer to [Use cipher suites](#use-cipher-suites)).
6259

63-
### 8. Use Cipher Suites
60+
## Use cipher suites
6461

65-
* Configure Ballerina to use secure cipher suites see [Ballerina Crypto](https://central.ballerina.io/ballerina/crypto/latest) for more details.
62+
* Configure Ballerina to use secure cipher suites. Refer to [Ballerina Crypto](https://central.ballerina.io/ballerina/crypto/latest) for more details.
6663
* Periodically review cipher configurations against current security standards (NIST, OWASP).
6764

68-
### 9. Logging and Monitoring
65+
## Logging and monitoring
6966

7067
* Comprehensive logs and telemetry, when correlated with access controls and alerting, enhance the ability to identify unauthorized usage or data exfiltration attempts in production environments.
7168
* Integrate with standardized observability tools (e.g., Prometheus, Jaeger, ELK Stack) so that you can unify your security-monitoring posture across BI deployment models.
7269

7370
Follow the below guides to configure logging and observability.
71+
7472
* [Configure Logging](https://ballerina.io/spec/log/#3-configure-logging)
75-
* [Observability in BI](https://bi.docs.wso2.com/observability-and-monitoring/overview/)
73+
* [Observability in BI](/observability-and-monitoring/overview)
7674

77-
### 10. Prevent Log Forging
75+
## Prevent log forging
7876

7977
* Sanitize all user-provided data before writing to logs.
8078
* Configure the logging framework to escape newline and control characters.
8179
* Use structured logging where possible to make parsing safer.
8280
* Restrict log file write permissions to the BI runtime user only.
8381

84-
### 11. Set Secure JVM Parameters
82+
## Set secure JVM parameters
8583

8684
Since Ballerina runs on the JVM, tune the JVM for security and stability:
8785

88-
* Use a **supported JDK version** with the latest security patches.
86+
* Use a supported JDK version with the latest security patches.
8987
* Limit heap size and enable garbage-collection logs for troubleshooting.
9088
* Run BI under a non-root user with limited filesystem and network permissions.
9189

92-
### 12. Additional Hardening Recommendations
90+
## Additional hardening recommendations
9391

9492
* **Run as Non-Root:** Configure containers or services to run as a non-root OS user.
9593
* **File Permissions:** Restrict access to configuration files, keystores, and logs (`chmod 600`).
9694
* **Network Segmentation:** Place BI and databases on private networks/VPCs.
9795
* **Audit and Compliance:** Periodically audit configurations and review access logs.
9896
* **Backup and Recovery:** Encrypt and test backups regularly.
99-
* **Validate the code with `scan tool`:** Use [Ballerina scan tool](https://bi.docs.wso2.com/developer-guides/tools/other-tools/scan-tool/) to identify potential issues such as code smells, bugs, and vulnerabilities.
97+
* **Validate the code with scan tool:** Use [Ballerina scan tool](https://bi.docs.wso2.com/developer-guides/tools/other-tools/scan-tool/) to identify potential issues such as code smells, bugs, and vulnerabilities.

0 commit comments

Comments
 (0)