Skip to content

Deploy and infra hardening: NetworkPolicy, image signing, mainnet guard, registry admin init - #1478

Merged
fejilaup-cloud merged 4 commits into
AtomicIP:mainfrom
uchechithelmaonye-cpu:issues-1256-1259-deploy-security
Nov 22, 2026
Merged

fejilaup-cloud merged 4 commits into
AtomicIP:mainfrom
uchechithelmaonye-cpu:issues-1256-1259-deploy-security

Conversation

@uchechithelmaonye-cpu

Copy link
Copy Markdown
Contributor

Four independent fixes for the deployment and infrastructure backlog. Each is one commit with its own test script.

Changes

  • Add a NetworkPolicy to deploy/k8s/base #1256 NetworkPolicy (deploy/k8s/base/networkpolicy.yaml): default-deny ingress for the namespace. The api-server accepts ingress only from ingress-nginx (HTTP) and monitoring (metrics). Test: scripts/test_k8s_networkpolicy.sh.
  • Sign Container Images and Attach SBOM and Provenance #1257 Image signing, SBOM, provenance (.github/workflows/gitops-promote.yml): the build job signs the pushed digest with keyless cosign, attaches an SPDX SBOM attestation, and attests build provenance. Production promotion runs cosign verify pinned to this workflow's OIDC identity before opening the PR. Test: scripts/test_image_signing_workflow.sh.
  • Guard the FRESH_DEPLOY Deployer-Key Deletion on Mainnet #1258 Mainnet FRESH_DEPLOY guard (scripts/deploy.sh): mainnet requires --confirm-network mainnet. --fresh on mainnet also requires --allow-mainnet-fresh. The guard runs before any key operation. Test: scripts/test_deploy_fresh_guard.sh.
  • Initialize the IP Registry Admin in deploy.sh #1259 IP Registry admin (scripts/deploy.sh, scripts/verify_deployment.sh): deploy now calls initialize on the IP Registry with the deployer as admin, before the swap init. verify_deployment.sh confirms the admin is set by simulating initialize with --send=no and expecting AlreadyInitialized (error 37). Test: scripts/test_ip_registry_init.sh.

Notes

  • The registry has no public admin getter, so the admin check uses the simulated initialize probe described above.
  • deploy/k8s/base does not render with kubectl kustomize by default because jobs/ loads scripts from outside its directory. This was already the case before this PR. The new test uses --load-restrictor=LoadRestrictionsNone.
  • The ingress-controller and monitoring namespace names are assumed to be ingress-nginx and monitoring. Adjust them if the cluster uses different names.

Closes

Closes #1256
Closes #1257
Closes #1258
Closes #1259

Closes AtomicIP#1256

Adds a default-deny ingress policy for the namespace and allows ingress
to the api-server only from the ingress-nginx namespace (HTTP) and the
monitoring namespace (metrics). Includes a test script that checks the
policy shape and that kustomize renders it.
Closes AtomicIP#1257

Build job now signs the pushed image digest with keyless cosign, attaches
an SPDX SBOM as a cosign attestation, and attests build provenance. The
production promotion verifies the signature, pinned to this workflow's
OIDC identity, before opening the promotion PR. Includes a structural test
for the workflow.
Closes AtomicIP#1258

Mainnet deployments must now pass --confirm-network mainnet. --fresh on
mainnet additionally requires --allow-mainnet-fresh, since it deletes the
deployer key that administers live contracts. The guard runs before any
tool check or key operation. Adds a test script covering the refusal and
pass-through cases.
Closes AtomicIP#1259

deploy.sh now calls initialize on the IP Registry with the deployer as
admin before initializing the atomic swap contract. The new
scripts/verify_deployment.sh confirms the admin is set by simulating
initialize with --send=no and expecting AlreadyInitialized (error 37).
It submits nothing. The check runs in the deploy validation step. Tests
use a stub stellar binary.
@drips-wave

drips-wave Bot commented Nov 19, 2026

Copy link
Copy Markdown

@uchechithelmaonye-cpu Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@fejilaup-cloud
fejilaup-cloud merged commit 5b71884 into AtomicIP:main Nov 22, 2026
0 of 3 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

2 participants