Skip to content

Allow fluentbit forwarding - #870

Merged
mayafleischer merged 9 commits into
google:mainfrom
mayafleischer:telemtry-updates
Jul 29, 2026
Merged

Allow fluentbit forwarding#870
mayafleischer merged 9 commits into
google:mainfrom
mayafleischer:telemtry-updates

Conversation

@mayafleischer

@mayafleischer mayafleischer commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Create a dedicated fluent-bit config file to accept forwarded logs and enable additional collection and filtration.

Key changes:

  • [new] bc-fluent-bit.config:
    Collect and filter kernel, network logs and WSD
    Configure fluent-bit forward receiver

  • bc-entrypoint.sh
    Update iptables firewall rules to allow incoming TCP port 24224 traffic exclusively from the KPS vm.
    Update to use newly created config file

Additional filtering logic is expected to be added.
See GoogleCloudPlatform/key-protection-module#64 for corresponding KPS VM change.

@mayafleischer

Copy link
Copy Markdown
Collaborator Author

/gcbrun

@mayafleischer

Copy link
Copy Markdown
Collaborator Author

/gcbrun

@mayafleischer
mayafleischer requested a review from jkl73 July 16, 2026 18:04
@mayafleischer

Copy link
Copy Markdown
Collaborator Author

/gcbrun

atulpatildbz added a commit to GoogleCloudPlatform/key-protection-module that referenced this pull request Jul 20, 2026
tail KPS services journal and forward the logs to the workload VM's Fluent Bit, which relays them onward.

### Key Changes:
* **Fluent Bit Configuration (`fluent-bit-kps.conf`)**:
  * Tails `keymanager.service` (agent container stdout) and `attestation.service`.
  * Explicitly filters and tags logs with their respective `service.name` (`key_protection_service` and `attestation_service`).
  * Forwards logs to the workload VM at `192.168.100.2:24224`.
  * Uses `storage.type memrb` (Memory Ring Buffer) with a 32MB limit per input. If the receiver is unreachable, Fluent Bit drops the oldest logs instead of pausing, preventing backpressure from stalling the KPS services.
* **Service Management (`entrypoint.sh`)**:
  * Uses a custom `fluent-bit-kps.service` instead of the base image's unit (which relies on metadata the VM cannot reach).
  * Starts the relay *after* the KPS units so a failing relay cannot stop the KPS from serving keys. 
  * If the relay fails to start, the entrypoint logs a non-fatal `ERROR` and continues execution without crashing the VM.
* **CI Validation**:
  * Added an `image-config` CI job to validate the Fluent Bit config (`fluent-bit --dry-run`) and systemd units (`systemd-analyze verify`). This ensures typos or invalid properties are caught, as both tools can otherwise exit `0` on invalid configs.

corresponding changes on workload VM are here: google/go-tpm-tools#870
@mayafleischer

Copy link
Copy Markdown
Collaborator Author

/gcbrun

@atulpatildbz atulpatildbz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for taking up this implementation

@mayafleischer

Copy link
Copy Markdown
Collaborator Author

/gcbrun

@mayafleischer

Copy link
Copy Markdown
Collaborator Author

/gcbrun

@mayafleischer
mayafleischer merged commit 233ec15 into google:main Jul 29, 2026
18 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.

3 participants