Skip to content

chore: bump socket-firewall chart and image versions - #6

Merged
Jeffreyhung merged 1 commit into
mainfrom
chore/bump-firewall-versions-f0799d355acfb2ec1266529d995681edca83f0b8
Jul 22, 2026
Merged

chore: bump socket-firewall chart and image versions#6
Jeffreyhung merged 1 commit into
mainfrom
chore/bump-firewall-versions-f0799d355acfb2ec1266529d995681edca83f0b8

Conversation

@getsantry

@getsantry getsantry Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Automated weekly version check found newer releases.

Updates

  • helm_chart_version: 0.6.00.9.0
  • firewall_image_tag: 2.0.42.0.6

Follow-up

  • Review the terraform plan check on this PR.
  • Confirm the new image is allowed by Binary Authorization before merging to main.

Triggered by check-firewall-versions.

@github-actions

github-actions Bot commented Jul 20, 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.3"
-               chart          = "socket-firewall"
-               first_deployed = 1781303659
-               last_deployed  = 1783436588
-               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
                    
                    See deployment recommendations in README.md for production setup.
                EOT
-               revision       = 13
-               values         = jsonencode(
                    {
-                       affinity           = {
-                           podAntiAffinity = {
-                               preferredDuringSchedulingIgnoredDuringExecution = [
-                                   {
-                                       podAffinityTerm = {
-                                           labelSelector = {
-                                               matchLabels = {
-                                                   "app.kubernetes.io/instance" = "socket-firewall"
                                                }
                                            }
-                                           topologyKey   = "kubernetes.io/hostname"
                                        }
-                                       weight          = 100
                                    },
                                ]
                            }
                        }
-                       autoscaling        = {
-                           enabled = true
                        }
-                       image              = {
-                           pullPolicy = "IfNotPresent"
-                           repository = "socketdev/socket-registry-firewall"
-                           tag        = "2.0.4"
                        }
-                       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
                        }
-                       replicaCount       = 2
-                       resources          = {
-                           limits   = {
-                               cpu    = "1"
-                               memory = "768Mi"
                            }
-                           requests = {
-                               cpu    = "500m"
-                               memory = "512Mi"
                            }
                        }
-                       service            = {
-                           httpsTargetPort = "http"
-                           type            = "ClusterIP"
                        }
-                       socket             = {
-                           existingSecret    = "socket-api-token"
-                           existingSecretKey = "SOCKET_SECURITY_API_TOKEN"
-                           failOpen          = false
-                           failOpenUnscanned = false
                        }
-                       tls                = {
-                           generateSelfSigned = true
                        }
                    }
                )
-               version        = "0.6.0"
            },
        ] -> (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
                "image":
                  "pullPolicy": "IfNotPresent"
                  "repository": "socketdev/socket-registry-firewall"
              -   "tag": "2.0.4"
              +   "tag": "2.0.6"
                "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
                "replicaCount": 2
                "resources":
                  "limits":
                    "cpu": "1"
                    "memory": "768Mi"
                  "requests":
                    "cpu": "500m"
                    "memory": "512Mi"
                "service":
                  "httpsTargetPort": "http"
                  "type": "ClusterIP"
                "socket":
                  "existingSecret": "socket-api-token"
                  "existingSecretKey": "SOCKET_SECURITY_API_TOKEN"
                  "failOpen": false
                  "failOpenUnscanned": false
                "tls":
                  "generateSelfSigned": true
            EOT,
        ]
!~      version                    = "0.6.0" -> "0.9.0"
#        (25 unchanged attributes hidden)
    }

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

✅ Plan applied in Terraform Apply #18

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"
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"
}

replica_count = 2
helm_chart_version = "0.6.0"
firewall_image_tag = "2.0.4"
helm_chart_version = "0.9.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The Helm chart version bump from 0.6.0 to 0.9.0 may break critical value overrides in helm.tf, potentially causing a service outage due to a UID mismatch CrashLoop.
Severity: CRITICAL

Suggested Fix

Before merging, verify that all keys for the value overrides in helm.tf are still valid for the new Helm chart version (0.9.0). Check the chart's values.yaml and changelog for any changes to keys like initContainers.certGenerator.securityContext. If keys have changed, update the Terraform configuration accordingly.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: terraform/terraform.tfvars#L16

Potential issue: Bumping the Helm chart from version 0.6.0 to 0.9.0 introduces a risk of
service outage. The `helm.tf` configuration overrides chart values like
`initContainers.certGenerator.securityContext` to prevent a known UID mismatch issue
that causes pods to CrashLoop. If the structure or keys for these overridden values have
changed in the new chart version, Helm will silently ignore the overrides. This would
reintroduce the original bug, where the init container writes certificates as UID 1000,
which the main container (running as UID 1001) cannot read, leading to "Permission
denied" errors and a complete service outage.

Did we get this right? 👍 / 👎 to inform future reviews.

helm_chart_version = "0.6.0"
firewall_image_tag = "2.0.4"
helm_chart_version = "0.9.0"
firewall_image_tag = "2.0.6"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The new firewall image may not be attested for Binary Authorization, which the auto-apply workflow doesn't check, risking a deployment failure and service outage.
Severity: CRITICAL

Suggested Fix

Manually attest the new image version (2.0.6) for the project's Binary Authorization policy before merging this pull request. For a long-term solution, add an automated step to the tf-apply.yaml workflow to check for or create the necessary attestation before running terraform apply.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: terraform/terraform.tfvars#L17

Potential issue: The new firewall image version `2.0.6` may not be attested by the
project's Binary Authorization policy, which is enforced on the GKE cluster. The CI/CD
pipeline automatically applies Terraform changes on merge to `main` with `auto_approve:
true` without an attestation step. If the image is not attested, GKE will reject all new
pods during the rolling update. Because old pods are terminated during the update, this
will lead to a complete firewall service outage until the issue is manually remediated.

Did we get this right? 👍 / 👎 to inform future reviews.

@Jeffreyhung
Jeffreyhung merged commit 91d0262 into main Jul 22, 2026
13 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