Skip to content

feat(scheduler): add FIPS 140-3 compliance with Bouncy Castle FIPS providers#1058

Draft
silvestre wants to merge 2 commits intomainfrom
fips-java
Draft

feat(scheduler): add FIPS 140-3 compliance with Bouncy Castle FIPS providers#1058
silvestre wants to merge 2 commits intomainfrom
fips-java

Conversation

@silvestre
Copy link
Copy Markdown
Member

@silvestre silvestre commented Mar 6, 2026

Issue

The scheduler component (Java/Spring Boot) lacked FIPS 140-3 cryptographic
compliance, unlike the six Go microservices which already use GOFIPS140.

Fix

  • Add Bouncy Castle FIPS dependencies (bc-fips 2.1.2, bctls-fips 2.1.22,
    bcpkix-fips 2.1.10) to scheduler/pom.xml
  • Create FipsSecurityProviderConfig that registers BCFIPS and BCJSSE as
    the JVM's primary security providers, removes default Sun providers
    (SunJSSE, SunJCE, SunEC), and activates FIPS approved-only mode with
    fail-fast startup validation
  • Create FipsPemUtils utility for parsing PEM certificates and private
    keys (RSA and EC, both traditional and PKCS#8 formats) using BCFIPS APIs
  • Initialize FIPS providers in SchedulerApplication.main() before Spring
    Boot starts, ensuring all SSL bundle creation uses FIPS-validated crypto
  • Add unit tests for provider registration, PEM parsing, and SSL bundle
    integration under FIPS — all 187 tests pass (15 new + 172 existing)

AI Disclosure

This commit was authored with the assistance of Anthropic Claude (model:
claude-opus-4-6) via Claude Code CLI (claude.ai/code), which was used for
codebase exploration, change specification, implementation, and test execution.

@silvestre silvestre changed the title fips java feat(scheduler): add FIPS 140-3 compliance with Bouncy Castle FIPS providers Mar 6, 2026
Comment thread openspec/specs/fips-pem-certificate-handling/spec.md
Comment thread openspec/specs/fips-security-provider/spec.md
Comment thread openspec/specs/fips-security-provider/spec.md
Comment thread openspec/specs/fips-security-provider/spec.md
Comment thread openspec/specs/fips-tls-configuration/spec.md
@silvestre silvestre force-pushed the fips-java branch 4 times, most recently from 944f76b to 6bf151f Compare March 12, 2026 13:12
@silvestre silvestre force-pushed the fips-java branch 7 times, most recently from c587438 to c2d2165 Compare March 19, 2026 16:46
(cherry picked from commit 5043d49b29d03f8085aea393b37e9891964a41d8)
@silvestre silvestre force-pushed the fips-java branch 2 times, most recently from 7d91709 to 924ac46 Compare April 15, 2026 08:28
…oviders

# Issue

The scheduler component needs to run in FIPS 140-3 compliant mode to meet
security requirements. This requires replacing default Java security providers
with FIPS-validated cryptographic implementations and ensuring PEM certificate
handling works under FIPS constraints for Cloud Foundry Instance Identity
certificates.

# Fix

- Add Bouncy Castle FIPS dependencies (bc-fips 2.1.2, bctls-fips 2.1.22,
  bcpkix-fips 2.1.10) to scheduler pom.xml
- Create FipsSecurityProviderConfig that registers BCFIPS/BCJSSE providers,
  removes SunJSSE/SunEC, sets global FIPS approved-only mode, and configures
  PKIX as default KeyManager/TrustManager algorithm; made conditional via
  fips_mode config property from VCAP_SERVICES
- Create FipsPemUtils for FIPS-compliant PEM certificate and private key
  parsing using BC ASN.1 APIs (supports RSA, EC, PKCS#8 formats) with
  cached crypto provider lookup
- Create FipsSslContextBuilder that merges JVM cacerts, BOSH/CF trusted
  certs, and custom CAs into a single FIPS-compliant SSLContext; cache
  merged accepted issuers to avoid per-handshake allocation
- Create VcapServicesHelper to deduplicate VCAP_SERVICES JSON parsing
  shared between FipsSecurityProviderConfig and CloudFoundryConfigurationProcessor
- Build RestClientConfig SSLContext using FipsSslContextBuilder with
  explicit system + custom trust anchors, CF instance identity mTLS,
  and extracted KeyManagerFactory/TrustManager helpers
- Route all certificate parsing (HttpAuthFilter, FipsSslContextBuilder)
  through FipsPemUtils to ensure consistent FIPS provider usage
- Gate DebuggingX509KeyManager behind DEBUG log level
- Add configurable fips_mode across Go services (config structs,
  conditional AssertFIPSMode, autoscaler_fips_enabled Prometheus gauge)
- Add FIPS acceptance tests, CI workflow, and MTA extension support
- Update PostgreSQL password to meet FIPS 112-bit minimum requirement
- Add comprehensive unit tests for provider config, PEM utils, SSL
  bundle integration, and CF configuration processor

# AI Disclosure

This commit was developed with the assistance of Claude (Anthropic),
model claude-opus-4-6, using Claude Code CLI tooling.
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants