Skip to content

Update and fix cert bug - #12

Merged
Jeffreyhung merged 2 commits into
mainfrom
update-and-fix-cert-bug
Aug 12, 2026
Merged

Update and fix cert bug#12
Jeffreyhung merged 2 commits into
mainfrom
update-and-fix-cert-bug

Conversation

@Jeffreyhung

Copy link
Copy Markdown
Member

No description provided.

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

Terraform plan in terraform

Plan: 0 to add, 1 to change, 0 to destroy.
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
!~  update in-place
 <= read (data resources)

Terraform will perform the following actions:

  # data.kubernetes_service.socket_firewall will be read during apply
  # (depends on a resource or a module with changes pending)
 <= data "kubernetes_service" "socket_firewall" {
+       id     = (known after apply)
+       spec   = (known after apply)
+       status = (known after apply)

+       metadata {
+           generation       = (known after apply)
+           name             = "socket-firewall"
+           namespace        = "socket-firewall"
+           resource_version = (known after apply)
+           uid              = (known after apply)
        }
    }

  # helm_release.socket_firewall will be updated in-place
!~  resource "helm_release" "socket_firewall" {
        id                         = "socket-firewall"
!~      metadata                   = [
-           {
-               app_version    = "2.0.14"
-               chart          = "socket-firewall"
-               first_deployed = 1781303659
-               last_deployed  = 1786470795
-               name           = "socket-firewall"
-               namespace      = "socket-firewall"
-               notes          = <<-EOT
                    Socket Firewall deployed successfully!
                    
                    ## Self-Signed Certificates
                    
                    Self-signed certificates were generated. Extract the CA certificate:
                    
                      kubectl exec -n socket-firewall \
                        $(kubectl get pod -n socket-firewall -l app.kubernetes.io/name=socket-firewall -o jsonpath='{.items[0].metadata.name}') \
                        -- cat /etc/nginx/ssl/ca.crt > socket-ca.crt
                    
                    Then trust the CA on developer machines or use a real certificate for production.
                    
                    ## Accessing the Firewall
                    For testing, use port-forward:
                    
                      kubectl port-forward svc/socket-firewall 8443:443 -n socket-firewall
                    
                    For production, expose via Ingress or change service.type to LoadBalancer.
                    
                    ## Usage
                    
                    Path-based routing is enabled on domain: sfw.security.sentry.io
                    
                    Configure package managers to use path prefixes:
                      npm: https://sfw.security.sentry.io/npm/
                      pypi: https://sfw.security.sentry.io/pypi/
                      maven: https://sfw.security.sentry.io/maven/
                    
                    Example:
                      npm config set registry https://sfw.security.sentry.io/npm/
                      pip config set global.index-url https://sfw.security.sentry.io/pypi/simple
                    
                    ## Verify
                    
                    Test the health endpoint:
                    
                      curl -sk https://<firewall-ip>/health
                    
                    ## Metrics
                    
                    Prometheus metrics are exposed on port 9145 at /metrics (plain HTTP, no auth).
                    Set metrics.serviceMonitor.enabled=true (Prometheus Operator) or metrics.podAnnotations=true
                    (annotation-based) to scrape it. The endpoint is unauthenticated — restrict access with a NetworkPolicy.
                    
                    See deployment recommendations in README.md for production setup.
                EOT
-               revision       = 18
-               values         = jsonencode(
                    {
-                       affinity           = {
-                           podAntiAffinity = {
-                               preferredDuringSchedulingIgnoredDuringExecution = [
-                                   {
-                                       podAffinityTerm = {
-                                           labelSelector = {
-                                               matchLabels = {
-                                                   "app.kubernetes.io/instance" = "socket-firewall"
                                                }
                                            }
-                                           topologyKey   = "kubernetes.io/hostname"
                                        }
-                                       weight          = 100
                                    },
                                ]
                            }
                        }
-                       autoscaling        = {
-                           enabled = true
                        }
-                       extraConfig        = {
-                           resilience = {
-                               circuit_breaker = {
-                                   enabled = true
                                }
                            }
                        }
-                       image              = {
-                           pullPolicy = "IfNotPresent"
-                           repository = "socketdev/socket-registry-firewall"
-                           tag        = "2.1.0"
                        }
-                       initContainers     = {
-                           certGenerator = {
-                               securityContext = {
-                                   allowPrivilegeEscalation = false
-                                   capabilities             = {
-                                       drop = [
-                                           "ALL",
                                        ]
                                    }
-                                   readOnlyRootFilesystem   = true
-                                   runAsNonRoot             = true
-                                   runAsUser                = 1001
-                                   seccompProfile           = {
-                                       type = "RuntimeDefault"
                                    }
                                }
                            }
                        }
-                       pathRouting        = {
-                           domain  = "sfw.security.sentry.io"
-                           enabled = true
-                           routes  = [
-                               {
-                                   path     = "/npm"
-                                   registry = "npm"
-                                   upstream = "https://registry.npmjs.org"
                                },
-                               {
-                                   path     = "/pypi"
-                                   registry = "pypi"
-                                   upstream = "https://pypi.org"
                                },
-                               {
-                                   path     = "/maven"
-                                   registry = "maven"
-                                   upstream = "https://repo1.maven.org/maven2"
                                },
                            ]
                        }
-                       podSecurityContext = {
-                           fsGroup = 1001
                        }
-                       redis              = {
-                           enabled                 = true
-                           existingSecret          = "socket-firewall-redis-auth"
-                           existingSecretKey       = "REDIS_PASSWORD"
-                           host                    = "10.236.196.99"
-                           port                    = 6378
-                           ssl                     = true
-                           sslCaCertExistingSecret = "socket-firewall-redis-ca"
-                           sslServerName           = "10.236.196.99"
-                           sslVerify               = true
-                           ttl                     = 86400
                        }
-                       replicaCount       = 2
-                       resources          = {
-                           limits   = {
-                               cpu    = "1"
-                               memory = "768Mi"
                            }
-                           requests = {
-                               cpu    = "500m"
-                               memory = "512Mi"
                            }
                        }
-                       service            = {
-                           httpsTargetPort = "http"
-                           type            = "ClusterIP"
                        }
-                       socket             = {
-                           cacheTtl          = 600
-                           existingSecret    = "socket-api-token"
-                           existingSecretKey = "SOCKET_SECURITY_API_TOKEN"
-                           failOpen          = true
-                           failOpenUnscanned = false
                        }
-                       tls                = {
-                           generateSelfSigned = true
                        }
                    }
                )
-               version        = "0.11.1"
            },
        ] -> (known after apply)
        name                       = "socket-firewall"
!~      values                     = [
!~          <<-EOT
                "affinity":
                  "podAntiAffinity":
                    "preferredDuringSchedulingIgnoredDuringExecution":
                    - "podAffinityTerm":
                        "labelSelector":
                          "matchLabels":
                            "app.kubernetes.io/instance": "socket-firewall"
                        "topologyKey": "kubernetes.io/hostname"
                      "weight": 100
                "autoscaling":
                  "enabled": true
                "extraConfig":
                  "resilience":
                    "circuit_breaker":
                      "enabled": true
                "image":
                  "pullPolicy": "IfNotPresent"
                  "repository": "socketdev/socket-registry-firewall"
              -   "tag": "2.1.0"
              +   "tag": "2.1.1"
                "initContainers":
                  "certGenerator":
                    "securityContext":
                      "allowPrivilegeEscalation": false
                      "capabilities":
                        "drop":
                        - "ALL"
                      "readOnlyRootFilesystem": true
                      "runAsNonRoot": true
                      "runAsUser": 1001
                      "seccompProfile":
                        "type": "RuntimeDefault"
                "pathRouting":
                  "domain": "sfw.security.sentry.io"
                  "enabled": true
                  "routes":
                  - "path": "/npm"
                    "registry": "npm"
                    "upstream": "https://registry.npmjs.org"
                  - "path": "/pypi"
                    "registry": "pypi"
                    "upstream": "https://pypi.org"
                  - "path": "/maven"
                    "registry": "maven"
                    "upstream": "https://repo1.maven.org/maven2"
                "podSecurityContext":
                  "fsGroup": 1001
                "redis":
                  "enabled": true
                  "existingSecret": "socket-firewall-redis-auth"
                  "existingSecretKey": "REDIS_PASSWORD"
                  "host": "10.236.196.99"
                  "port": 6378
                  "ssl": true
                  "sslCaCertExistingSecret": "socket-firewall-redis-ca"
                  "sslServerName": "10.236.196.99"
                  "sslVerify": true
                  "ttl": 86400
                "replicaCount": 2
                "resources":
                  "limits":
                    "cpu": "1"
                    "memory": "768Mi"
                  "requests":
                    "cpu": "500m"
                    "memory": "512Mi"
                "service":
                  "httpsTargetPort": "http"
                  "type": "ClusterIP"
                "socket":
                  "cacheTtl": 600
                  "existingSecret": "socket-api-token"
                  "existingSecretKey": "SOCKET_SECURITY_API_TOKEN"
                  "failOpen": true
                  "failOpenUnscanned": false
                "tls":
                  "generateSelfSigned": true
            EOT,
        ]
!~      version                    = "0.11.1" -> "0.11.2"
#        (25 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

✅ Plan applied in Terraform Apply #24

Outputs
cluster_name                 = "socket-firewall"
firewall_domain              = "sfw.security.sentry.io"
firewall_health_url          = "https://sfw.security.sentry.io/health"
firewall_load_balancer_ip    = "34.98.104.179"
firewall_namespace           = "socket-firewall"
firewall_service_name        = "socket-firewall"
kubeconfig_command           = "gcloud container fleet memberships get-credentials socket-firewall --project sentry-socket"
redis_host                   = "10.236.196.99"
redis_port                   = 6378
tls_certificate_name         = "socket-firewall-cert"
tls_dns_authorization_record = {
    data = "6a407a91-86a0-4dc8-a434-e72cdc012e0e.9.authorize.certificatemanager.goog."
    name = "_acme-challenge.sfw.security.sentry.io."
    type = "CNAME"
}

@Jeffreyhung
Jeffreyhung merged commit 3280024 into main Aug 12, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant