Class SecurityExample

java.lang.Object
com.cloudforgeci.api.examples.SecurityExample

public class SecurityExample extends Object
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    createDevJenkins(software.constructs.Construct scope, String id, DeploymentContext cfc)
    Example of creating a Jenkins deployment with development security settings.
    static void
    createProductionJenkins(software.constructs.Construct scope, String id, DeploymentContext cfc)
    Example of creating a Jenkins deployment with production security settings.
    static void
    createStagingJenkins(software.constructs.Construct scope, String id, DeploymentContext cfc)
    Example of creating a Jenkins deployment with staging security settings.
    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)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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)