-
Notifications
You must be signed in to change notification settings - Fork 28
Module Development Guide
WebbinRoot edited this page May 9, 2026
·
1 revision
This guide reflects the current package layout and helper APIs.
- Runtime modules:
gcpwn/modules/<service>/<category>/... - Service helpers:
gcpwn/modules/<service>/utilities/helpers.py - Static service data:
gcpwn/modules/<service>/utilities/data/* - Module index metadata:
gcpwn/mappings/module-mappings.json
- Add module file with
run_module(user_args, session)entrypoint. - Use argparse in-module (
allow_abbrev=False). - Use shared helpers from
gcpwn/core/utils/service_runtime.pywhen possible. - Store discovered rows with
session.insert_data(...). - Record useful permissions/actions via shared IAM/action helpers used by existing modules.
- Register module in
gcpwn/mappings/module-mappings.json. - Add tests (at least focused unit coverage where feasible).
def run_module(user_args, session):
parser = argparse.ArgumentParser(...)
# add flags
args = parser.parse_args(user_args)
# enumerate/list/get/testIamPermissions/download
# write rows via session.insert_data(...)
return 0- Prefer existing helper utilities over one-off implementations.
- Keep service API error handling consistent (
403 denied,404, API disabled, generic errors). - Keep CLI output concise and table-aware.
- Respect workspace/project context and project selectors.
Interactive module listing and info use:
gcpwn/mappings/module-mappings.json
If you add a module but do not add this mapping, modules list/info/run behavior will be incomplete.
Run current suites:
python -m pytest -q -ra tests/unit tests/module_contractsRelevant areas:
tests/unit/core/tests/unit/opengraph/tests/unit/everything/tests/module_contracts/
If adding new dangerous-path logic:
- Update rule definitions (
og_privilege_escalation_paths.json) - Update permission map coverage (
og_permission_to_roles_map.json) - Add/adjust OpenGraph unit tests:
- rule variants
- combo path emission
- coverage warnings and skip logic
- Authentication Reference
- Workspace Instructions
- CLI Module Reference
- Downloads to Disk
- Data View/Export
- IAM Enumeration and Analysis Workflow
- Troubleshooting and FAQ