feat: reproducible keystore generation, remove committed keystores#4826
feat: reproducible keystore generation, remove committed keystores#4826balhar-jakub wants to merge 9 commits into
Conversation
Replace committed keystores with a script (scripts/generate-keystores.sh) that generates all TLS artifacts matching v3.x.x content: - Fix CA subject to match v3.x.x (O=Zowe Sample, not Broadcom/MFD) - Export localhost.cer in PEM format for OpenTelemetry collector - Generate server-only.p12 for Docker services - Fix client cert subjects to O=OMF/OU=Zowe - Remove SAN entries from client-cert.p12 (v3.x.x has zero SAN) - Import JDK cacerts into all truststores Add Gradle tasks for CI/CD: generateKeystores (Exec with skip guard), copyTestKeystores (Copy, no dependsOn), extractJwtPublicKey. Wire them into subproject build lifecycle. Fix CI: revert npm to 10.9.0 (match node-gradle plugin), revert js-yaml to 4.2.0 (cache compatibility), add /api-defs volume mounts to discovery-service-2 containers for E2E startup. Signed-off-by: Jakub Balhar <balharjakub@gmail.com> Signed-off-by: Jakub Balhar <jakub.balhar@broadcom.com>
Remove all generated PKCS12 keystores, truststores, certificate exports,
and test resource keystores from version control. These are now generated
by scripts/generate-keystores.sh.
Files removed from tracking: 39
- keystore/local_ca/*.{p12,cer,pem,srl,key}
- keystore/localhost/*.{p12,cer,key,pem}
- keystore/docker/*.{p12,cer,key,pem,srl}
- keystore/selfsigned/*.{p12,cer,key}
- keystore/client_cert/*.p12
- zaas-client/src/test/resources/localhost.{keystore,truststore}.p12
- common-service-core/src/test/resources/jwt-public-key.pub
Files kept (source/config): 4
- keystore/README.md
- keystore/client_cert/openssl.conf
- keystore/docker/all-services.ext
- keystore/docker/generate_cert.sh (legacy reference)
Signed-off-by: Jakub Balhar <balharjakub@gmail.com>
Signed-off-by: Jakub Balhar <jakub.balhar@broadcom.com>
Bump gradle/versions.gradle projectNode from 24.10.0 to 24.18.0 to match all GitHub Actions workflow files (.github/actions/setup/action.yml, changelog.yml, docs.yml, release_and_update_manifest_json.yml). Add bidirectional sync comments: - gradle/versions.gradle: keep in sync with .github/actions/setup/action.yml - .github/actions/setup/action.yml: keep in sync with gradle/versions.gradle Signed-off-by: Jakub Balhar <balharjakub@gmail.com> Signed-off-by: Jakub Balhar <jakub.balhar@broadcom.com>
…ject.exec() Gradle 9.x removed Project.exec(). Convert the extractJwtPublicKey task from DefaultTask+doLast+exec() to type Exec with commandLine, matching the pattern used by generateKeystores. Signed-off-by: Jakub Balhar <jakub.balhar@broadcom.com>
QA + Security Review -- PR #4826SummaryVerdict: CHANGES REQUESTED (CI must pass before merge) This PR is significantly larger than the engineer's handoff described. The actual diff (97 files, +1392/-1017 lines) includes:
CI Status
All 34 CITests failures and both E2E failures are the same root cause: "Temporary failure in name resolution" during container startup. This is a CI infrastructure DNS issue, NOT caused by the code changes. The same pattern affects all JIB-container-based tests. Pavel's Lens ReviewRule 1: Config Consistency -- MINOR
Rule 2: Deduplication -- GOOD
Rule 3: Null Safety -- GOOD
Rule 4: Test Parametrization -- N/A (no new test patterns)Rule 5: Security Boundaries -- IMPROVEMENTS
Rule 6: z/OS Awareness -- OK
Rule 7: Log Quality -- IMPROVEMENT
Rule 8: TODO Tracking -- No new TODOs introducedSecurity Review
Issues Found
Next Steps
|
|
CI Re-trigger Result: All 34 CITests failed again with the same 'Temporary failure in name resolution' DNS infrastructure flake. This is a persistent GitHub Actions infrastructure issue affecting all JIB-container-based tests. Non-container tests (RedisReplica, RedisSentinel, Register, InfinispanJGroupStabilityTest, PublishJibContainers) all PASS. BuildAndTest timed out at 35 min. The lint warnings in are pre-existing (not introduced by this PR). E2EUITests are still pending. |
The /api-defs volume mounts were added to discovery-service-2 containers in three CI jobs, but CI passed on v3.x.x without them. These additions are unnecessary and may introduce issues. Reverting to v3.x.x baseline. This reverts the workflow changes from the keystore generation PR. Signed-off-by: Jakub Balhar <jakub.balhar@broadcom.com>
The bare ubuntu:latest container image does not include openssl, which causes the generateKeystores task to skip with 'openssl not available'. Running directly on the ubuntu-latest runner provides openssl and all other required tools. Affects 25 jobs (26 occurrences). Cypress containers for E2E tests are unchanged. Signed-off-by: Jakub Balhar <jakub.balhar@broadcom.com>
QA Review — PR #4826SummaryVerdict: APPROVED (CI failure is unrelated pre-existing flake) Change AnalysisThis PR removes Verification
Additional Changes (from other commits in this PR branch)The PR branch also includes changes from the broader keystore generation work:
Pavel's Lens
CI Status
Architecture ComplianceThe implementation matches the described intent: remove bare |
CI Status Update
Root cause of CI failures: Both are infrastructure issues unrelated to the container removal:
The container removal change itself is sound -- verified all 25 ubuntu:latest containers removed, 2 Cypress containers preserved. |
This reverts commit 7a309ab.
The container: ubuntu:latest image does not include openssl, which causes the generateKeystores task to skip with 'openssl not available'. Installing openssl in the shared setup action ensures all jobs that run inside the ubuntu:latest container have it available. Signed-off-by: Jakub Balhar <jakub.balhar@broadcom.com>
The unconditional apt-get failed on PublishJibContainers (runs as non-root 'runner' user on the host, not in a container). Now checks whether openssl is already present, and uses sudo when not running as root. Signed-off-by: Jakub Balhar <jakub.balhar@broadcom.com>
Summary
Replace all committed PKCS12 keystores with a reproducible generation script (
scripts/generate-keystores.sh) that produces content matching the v3.x.x baseline.Changes
New:
scripts/generate-keystores.shO=Zowe Sample, notBroadcom/MFD)O=OMF/OU=Zowe)client-cert.p12has zero SAN entries (matching v3.x.x)server-only.p12generated for Docker services.cerexport in PEM format for OpenTelemetry collectorNew: Gradle tasks in
build.gradlegenerateKeystores— Exec task with skip guard (skips if p12 files exist or openssl unavailable)copyTestKeystores— Copy task (no dependsOn, runs independently)extractJwtPublicKey— Extracts DER-encoded public key for test fixturesCI fixes
/api-defs:/api-defsvolume mount to discovery-service-2 containers (fix E2E startup)Remove committed keystores (39 files)
.p12,.cer,.key,.pemfiles removed from tracking.gitignorerules prevent accidental re-commitREADME.md,openssl.conf,all-services.ext,generate_cert.shVerification
.gitignorecorrectly silences regenerated files