Package com.cloudforgeci.api.examples
Class SecurityExample
java.lang.Object
com.cloudforgeci.api.examples.SecurityExample
Example demonstrating how to use the Security Rules system with different security profiles.
This shows how to create Jenkins deployments with DEV, STAGING, and PRODUCTION security configurations.
CloudForge 3.0.0: Updated to use ApplicationFactory with JenkinsApplicationSpec
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcreateDevJenkins(software.constructs.Construct scope, String id, DeploymentContext cfc) Example of creating a Jenkins deployment with development security settings.static voidcreateProductionJenkins(software.constructs.Construct scope, String id, DeploymentContext cfc) Example of creating a Jenkins deployment with production security settings.static voidcreateStagingJenkins(software.constructs.Construct scope, String id, DeploymentContext cfc) Example of creating a Jenkins deployment with staging security settings.static voiddemonstrateSecurityProfiles(software.constructs.Construct scope, String id, DeploymentContext cfc) Example showing how different security profiles affect the deployment: DEV Security Profile: - SSH access from anywhere (0.0.0.0/0) - Jenkins port accessible from anywhere - HTTP/HTTPS accessible from anywhere - Minimal security restrictions for development convenience STAGING Security Profile: - SSH access restricted to VPC CIDR - Jenkins port only accessible from ALB security group - HTTP/HTTPS accessible from anywhere (needed for external testing) - Moderate security restrictions PRODUCTION Security Profile: - SSH access restricted to specific bastion/VPN CIDR (10.0.1.0/24) - Jenkins port only accessible from ALB security group - HTTPS only (HTTP redirects to HTTPS) - Maximum security restrictions for compliance - WAF protection can be added (placeholder for future implementation)
-
Constructor Details
-
SecurityExample
public SecurityExample()
-
-
Method Details
-
createDevJenkins
public static void createDevJenkins(software.constructs.Construct scope, String id, DeploymentContext cfc) Example of creating a Jenkins deployment with development security settings. Development security allows broader access for easier development and testing. -
createStagingJenkins
public static void createStagingJenkins(software.constructs.Construct scope, String id, DeploymentContext cfc) Example of creating a Jenkins deployment with staging security settings. Staging security provides moderate restrictions suitable for testing environments. -
createProductionJenkins
public static void createProductionJenkins(software.constructs.Construct scope, String id, DeploymentContext cfc) Example of creating a Jenkins deployment with production security settings. Production security implements hardened configurations for SOC/HIPAA compliance. -
demonstrateSecurityProfiles
public static void demonstrateSecurityProfiles(software.constructs.Construct scope, String id, DeploymentContext cfc) Example showing how different security profiles affect the deployment: DEV Security Profile: - SSH access from anywhere (0.0.0.0/0) - Jenkins port accessible from anywhere - HTTP/HTTPS accessible from anywhere - Minimal security restrictions for development convenience STAGING Security Profile: - SSH access restricted to VPC CIDR - Jenkins port only accessible from ALB security group - HTTP/HTTPS accessible from anywhere (needed for external testing) - Moderate security restrictions PRODUCTION Security Profile: - SSH access restricted to specific bastion/VPN CIDR (10.0.1.0/24) - Jenkins port only accessible from ALB security group - HTTPS only (HTTP redirects to HTTPS) - Maximum security restrictions for compliance - WAF protection can be added (placeholder for future implementation)
-