Skip to content

fix(benchmarks): enforce Security/Governance benchmarks in build profile - #4634

Merged
makr-code merged 2 commits into
developfrom
copilot/add-security-governance-benchmarks
Apr 13, 2026
Merged

makr-code merged 2 commits into
developfrom
copilot/add-security-governance-benchmarks

Conversation

Copilot AI commented Apr 13, 2026 •

Copy link
Copy Markdown
Contributor

Three security/governance benchmark targets (bench_security, bench_policy_evaluation, bench_governance_policy_latency, bench_compliance_security_governance) were silently absent from standard benchmark builds due to a missing CMake target, an overly restrictive suite gate, and no dedicated CI job.

Root Causes & Fixes

1. Missing bench_policy_evaluation CMake target (benchmarks/CMakeLists.txt)

bench_policy_evaluation.cpp had no add_executable() in benchmarks/CMakeLists.txt — only a dead if(FALSE) block in cmake/CMakeLists.txt. Added explicit target; no themis_core needed since the file uses a self-contained mock PolicyEngine.

add_executable(bench_policy_evaluation bench_policy_evaluation.cpp)
target_link_libraries(bench_policy_evaluation PRIVATE ${BENCHMARK_LIBS} Threads::Threads)

2. Overly restrictive security suite gate (cmake/SuiteGating.cmake)

The security group required THEMIS_ENABLE_HSM_REAL, THEMIS_ENABLE_S3, THEMIS_ENABLE_AZURE, THEMIS_ENABLE_WEBDAV, THEMIS_ENABLE_TRACING, or ENTERPRISE edition. This blocked all four targets from themis_benchmarks_all_eligible and auto-registration in any standard CI config. Changed to unconditionally enabled — these benchmarks only need OpenSSL + themis_core.

# Before: gated behind HSM/cloud features or ENTERPRISE edition
# After:
elseif(suite_group STREQUAL "security")
    # AES-GCM, RBAC, policy eval, audit log — no hardware/cloud deps
    set(_enabled TRUE)

3. No dedicated CI job

Added .github/workflows/02-feature-modules_security_security-governance-benchmark-ci.yml — builds all four targets explicitly and smoke-runs each binary. Triggers on PR/push to src/security/**, src/governance/**, benchmark sources, benchmarks/CMakeLists.txt, or cmake/SuiteGating.cmake.

4. Audit coverage (tools/perf_expectations_audit.py)

Extended check #3 to also verify bench_policy_evaluation source + CMake target, so the CI guard enforces all four security/governance benchmarks going forward.

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • Benchmarks run (if performance-sensitive change)

📚 Research & Knowledge (wenn applicable)

  • Diese PR basiert auf wissenschaftlichen Paper(s) oder Best Practices?
    • Falls JA: Research-Dateien in /docs/research/ angelegt?
    • Falls JA: Im Modul-README unter "Wissenschaftliche Grundlagen" verlinkt?
    • Falls JA: In /docs/research/implementation_influence/ eingetragen?

Relevante Quellen:

  • Paper:
  • Best Practice:
  • Architecture Decision:

Type of Change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Refactoring (non-breaking)
  • Documentation
  • Breaking change (requires MAJOR version bump — see VERSIONING.md)
  • Security fix
  • Other:

Breaking Change Checklist

  • MAJOR version bump planned in VERSION and CMakeLists.txt
  • Migration guide added in docs/migration/
  • Announcement prepared for GitHub Discussions (≥ 2 weeks before release)
  • CHANGELOG ### Removed / ### Changed section updated

Linked Issues

Checklist

  • Code follows project style guidelines (clang-format / clang-tidy)
  • Self-review completed
  • Documentation updated (if needed)
  • CHANGELOG.md updated under [Unreleased]
  • No new warnings introduced
  • Security-sensitive paths reviewed by security maintainer (if applicable)

…te gate, add CI workflow

- Add explicit add_executable(bench_policy_evaluation) to benchmarks/CMakeLists.txt.
  The file only uses a mock PolicyEngine (no real deps), so it only links
  ${BENCHMARK_LIBS} + Threads::Threads.

- Fix cmake/SuiteGating.cmake: security suite group was gated behind enterprise
  features (THEMIS_ENABLE_HSM_REAL, THEMIS_ENABLE_S3, etc.) or ENTERPRISE edition.
  Core security benchmarks (AES-GCM, RBAC, policy evaluation, audit log) rely
  only on OpenSSL + themis_core, so the gate is now unconditional (set TRUE).
  This ensures bench_security, bench_policy_evaluation,
  bench_governance_policy_latency, and bench_compliance_security_governance are
  included in themis_benchmarks_all_eligible in every build configuration.

- Update tools/perf_expectations_audit.py check #3 to also verify
  bench_policy_evaluation source + CMake target.

- Add .github/workflows/02-feature-modules_security_security-governance-benchmark-ci.yml:
  dedicated CI job that builds all four security/governance benchmark targets and
  smoke-runs them (--benchmark_min_time=0.1s). Triggers on PR/push touching
  security/governance sources, benchmarks/CMakeLists.txt, or SuiteGating.cmake.

Agent-Logs-Url: https://github.com/makr-code/ThemisDB/sessions/d6e2f482-7cef-4e7c-9aa1-4761870b3176

Co-authored-by: makr-code <[email protected]>
Copilot AI changed the title [WIP] Add targets for security and governance benchmarks in build profile fix(benchmarks): enforce Security/Governance benchmarks in build profile Apr 13, 2026
Copilot AI requested a review from makr-code April 13, 2026 17:39
@makr-code
makr-code marked this pull request as ready for review April 13, 2026 18:14
@makr-code
makr-code merged commit 52681dd into develop Apr 13, 2026
11 checks passed
makr-code added a commit that referenced this pull request Apr 14, 2026
…ile (#4634)

* Initial plan

* fix(benchmarks): add bench_policy_evaluation target, fix security suite gate, add CI workflow

- Add explicit add_executable(bench_policy_evaluation) to benchmarks/CMakeLists.txt.
  The file only uses a mock PolicyEngine (no real deps), so it only links
  ${BENCHMARK_LIBS} + Threads::Threads.

- Fix cmake/SuiteGating.cmake: security suite group was gated behind enterprise
  features (THEMIS_ENABLE_HSM_REAL, THEMIS_ENABLE_S3, etc.) or ENTERPRISE edition.
  Core security benchmarks (AES-GCM, RBAC, policy evaluation, audit log) rely
  only on OpenSSL + themis_core, so the gate is now unconditional (set TRUE).
  This ensures bench_security, bench_policy_evaluation,
  bench_governance_policy_latency, and bench_compliance_security_governance are
  included in themis_benchmarks_all_eligible in every build configuration.

- Update tools/perf_expectations_audit.py check #3 to also verify
  bench_policy_evaluation source + CMake target.

- Add .github/workflows/02-feature-modules_security_security-governance-benchmark-ci.yml:
  dedicated CI job that builds all four security/governance benchmark targets and
  smoke-runs them (--benchmark_min_time=0.1s). Triggers on PR/push touching
  security/governance sources, benchmarks/CMakeLists.txt, or SuiteGating.cmake.

Agent-Logs-Url: https://github.com/makr-code/ThemisDB/sessions/d6e2f482-7cef-4e7c-9aa1-4761870b3176

Co-authored-by: makr-code <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: makr-code <[email protected]>
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.

[Agentic AI][Benchmarks] Security/Governance-Benchmarks im Buildprofil erzwingen

2 participants