Skip to content

Add Hetzner Object Storage bucket-cataloger module (#1876)#3073

Open
ChrisJr404 wants to merge 3 commits intoblacklanternsecurity:devfrom
ChrisJr404:feat/bucket-hetzner-1876
Open

Add Hetzner Object Storage bucket-cataloger module (#1876)#3073
ChrisJr404 wants to merge 3 commits intoblacklanternsecurity:devfrom
ChrisJr404:feat/bucket-hetzner-1876

Conversation

@ChrisJr404
Copy link
Copy Markdown

Summary

Closes #1876 ("Module TODO: Hetzner Buckets", filed by @TheTechromancer).

Hetzner offers S3-compatible Object Storage at three locations (Falkenstein fsn1, Nuremberg nbg1, Helsinki hel1), addressed at https://<bucket>.<location>.your-objectstorage.com/. cloudcheck already ships a Hetzner provider, so this PR just plugs a new bucket_hetzner module into the existing bucket_template.

Module

bbot/modules/bucket_hetzner.py — same shape as bucket_digitalocean.py:

  • regions = ['fsn1', 'nbg1', 'hel1'] — all three Hetzner Object Storage locations documented here.
  • base_domains = ['your-objectstorage.com']
  • supports_open_check = True (S3-style ListBucketResult protocol).
  • delimiters = ('', '-') — Hetzner bucket names allow dot/hyphen/underscore ([a-z0-9][a-z0-9-_\\.]{1,61}[a-z0-9] per cloudcheck regex), but only the no-delimiter and single-hyphen forms are useful for permutation enum.

Tests

test_module_bucket_hetzner.py is a focused smoke test:

  • module loads without error
  • cloudcheck_provider_name == 'Hetzner', base_domains, regions match expectations
  • build_url('examplebucket', 'your-objectstorage.com', 'fsn1') returns 'https://examplebucket.fsn1.your-objectstorage.com/'
  • the cloudcheck Hetzner provider is reachable from the module instance
$ pytest bbot/test/test_step_2/module_tests/test_module_bucket_hetzner.py
1 passed in 2.42s

Note for the maintainer

I started by extending `Bucket_Amazon_Base` like the other bucket tests, but the shared base depends on the cloudcheck provider regex separating bucket name and host into two groups. The current cloudcheck Hetzner regex matches `.your-objectstorage.com` without a region segment, so a fixture URL of `.fsn1.your-objectstorage.com` (which is what real Hetzner buckets look like) gets parsed with bucket-name = `.fsn1`, and the bucket-template's brute force then explodes the storage-bucket count past the asserts in the shared base test. Two ways to handle that down the road:

  1. Extend the cloudcheck Hetzner regex to capture region as a separate group, then fold this test into the shared base, OR
  2. Keep this minimal smoke-test shape and rely on the broader bucket_template tests for the cross-region brute-force coverage.

Happy to do (1) as a follow-up MR against blacklanternsecurity/cloudcheck if you'd prefer that path before this lands.

…ity#1876)

Closes blacklanternsecurity#1876.

Hetzner offers S3-compatible Object Storage at three locations (Falkenstein
fsn1, Nuremberg nbg1, Helsinki hel1), addressed at
https://<bucket>.<location>.your-objectstorage.com/. cloudcheck already
ships a Hetzner provider, so this just plugs a new bucket_hetzner module
into the existing bucket_template:

- regions = ['fsn1', 'nbg1', 'hel1'] - all three Object Storage locations
  documented at https://docs.hetzner.com/storage/object-storage/overview/
- base_domains = ['your-objectstorage.com']
- supports_open_check = True (S3 list-bucket protocol)

Adds a focused smoke test verifying the module wires up to the cloudcheck
Hetzner provider and emits the documented URL shape. The shared
Bucket_Amazon_Base inherited test pattern depends on the cloudcheck regex
capturing bucket + host as separate groups, but Hetzner's current
cloudcheck regex matches <bucket>.your-objectstorage.com without a region
segment - so the smoke-test layout is used here until the cloudcheck
regex is region-aware.
@TheTechromancer
Copy link
Copy Markdown
Collaborator

@ChrisJr404 Thanks for doing this!! I'll see about updating the regexes on the cloudcheck side, then circle back around.

@TheTechromancer
Copy link
Copy Markdown
Collaborator

Upstream cloudcheck PR:

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


1 out of 2 committers have signed the CLA.
✅ (ChrisJr404)[https://github.com/ChrisJr404]
@TheTechromancer
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

❌ Patch coverage is 96.96970% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91%. Comparing base (5be4993) to head (61b7a29).
⚠️ Report is 4 commits behind head on dev.

Files with missing lines Patch % Lines
bbot/modules/internal/cloudcheck.py 90% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##             dev   #3073   +/-   ##
=====================================
- Coverage     91%     91%   -0%     
=====================================
  Files        437     439    +2     
  Lines      37509   37533   +24     
=====================================
+ Hits       33925   33943   +18     
- Misses      3584    3590    +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ChrisJr404
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

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.

2 participants