Repository navigation
community_5_lazyc2_security
grisun0 edited this page Oct 31, 2026
·
1 revision
Community 5 | 55 files | cohesion 0.45
This community groups 55 file(s) rooted at tests with dominant language py (cohesion 0.45). Central symbols: AESKeyManager, ApiAuthzConfig, ApiKey, ApiKeyStore, C2Server, CSRFPolicy, CommandAllowlist, CommandDecision. Core file: lazyc2.py (313 symbols). Documented purpose: Tenant-bound API authorization for the LazyOwn C2 dashboard. Provides API-key generation, storage, validation, and route-decorator enforcement that requires bo.
| File | Language | Layer | Symbols | Doc |
|---|---|---|---|---|
tests/test_addon_creator.py |
py | testing | 86 | yes |
tests/test_api_authz.py |
py | testing | 48 | yes |
tests/test_c2_credential_bootstrap.py |
py | testing | 21 | yes |
| File | Language | Layer | Symbols | Doc |
|---|---|---|---|---|
lazyc2/security/__init__.py |
py | utility | 0 | no |
lazyc2/security/cli_credentials.py |
py | utility | 3 | yes |
lazyc2/security/command_allowlist.py |
py | utility | 8 | yes |
| File | Language | Layer | Symbols | Doc |
|---|---|---|---|---|
lazyc2/blueprints/__init__.py |
py | utility | 0 | yes |
lazyc2/blueprints/addons.py |
py | presentation | 14 | yes |
| File | Language | Layer | Symbols | Doc |
|---|---|---|---|---|
modules/c2_agent.py |
py | utility | 20 | yes |
modules/dashboard_bp.py |
py | presentation | 13 | yes |
| File | Language | Layer | Symbols | Doc |
|---|---|---|---|---|
lazyc2/extensions/__init__.py |
py | infrastructure | 0 | yes |
lazyc2/extensions/decoy.py |
py | presentation | 1 | yes |
| File | Language | Layer | Symbols | Doc |
|---|---|---|---|---|
lazyc2/__init__.py |
py | utility | 0 | no |
lazyc2/app_factory.py |
py | presentation | 12 | yes |
| File | Language | Layer | Symbols | Doc |
|---|---|---|---|---|
core/api_authz.py |
py | presentation | 31 | yes |
core/session_secrets.py |
py | utility | 4 | yes |
| File | Language | Layer | Symbols | Doc |
|---|---|---|---|---|
static/js/socket.io-4.0.0.min.js |
js | utility | 32 | yes |
static/js/socket.io-4.3.2.min.js |
js | utility | 15 | yes |
| File | Language | Layer | Symbols | Doc |
|---|---|---|---|---|
lazyc2.py |
py | presentation | 313 | no |
| File | Language | Layer | Symbols | Doc |
|---|---|---|---|---|
skills/daemon_health.py |
py | utility | 16 | yes |
... and 35 more files in this community.
-
ApiAuthzConfig(class,core/api_authz.py:54)class ApiAuthzConfig- Configuration contract for the API authorization module. -
ApiKey(class,core/api_authz.py:75)class ApiKey- Immutable record of a hashed API key bound to a tenant. -
to_dict(method,core/api_authz.py:94)def to_dict(self) -
from_dict(method,core/api_authz.py:107)def from_dict(cls, data) -
is_expired(method,core/api_authz.py:119)def is_expired(self) -
is_retired(method,core/api_authz.py:124)def is_retired(self) -
has_permission(method,core/api_authz.py:127)def has_permission(self, permission) -
has_all_permissions(method,core/api_authz.py:130)def has_all_permissions(self, permissions) -
_hash_secret(function,core/api_authz.py:137)def _hash_secret(secret)- Return the SHA-256 hex digest of secret. -
_verify_secret(function,core/api_authz.py:142)def _verify_secret(secret, stored_hash)- Constant-time comparison of secret against stored_hash. -
_generate_token_bytes(function,core/api_authz.py:147)def _generate_token_bytes(nbytes)- Return a URL-safe random token string of nbytes random bytes. -
ApiKeyStore(class,core/api_authz.py:161)class ApiKeyStore- Persistent store for tenant-scoped API keys. -
__init__(method,core/api_authz.py:170)def __init__(self, config) -
config(method,core/api_authz.py:176)def config(self)- The configuration this store was built with. -
_read(method,core/api_authz.py:180)def _read(self) -
_write(method,core/api_authz.py:191)def _write(self, data) -
_grace_deadline(method,core/api_authz.py:197)def _grace_deadline(self, retired_at)- Return the timestamp after which a retired key stops validating. -
_prune_retired(method,core/api_authz.py:201)def _prune_retired(self, records)- Drop retired keys whose grace window has closed. -
list_keys(method,core/api_authz.py:217)def list_keys(self, tenant_id)- List all active keys, optionally filtered by tenant_id. -
find_by_hash(method,core/api_authz.py:229)def find_by_hash(self, key_hash)- Look up a key record by its SHA-256 hash. -
create_key(method,core/api_authz.py:238)def create_key(self, tenant_id, label, permissions, expires_in_days)- Create a new API key and return(ApiKey, plaintext_secret). -
revoke_key(method,core/api_authz.py:273)def revoke_key(self, label, tenant_id)- Revoke every key with label within tenant_id. -
validate_key(method,core/api_authz.py:287)def validate_key(self, plaintext)- Validate a plaintext API key and return the ApiKey record. -
rotate_key(method,core/api_authz.py:309)def rotate_key(self, label, tenant_id)- Rotate an existing key by label. Returns the new plaintext. -
_prune_record(method,core/api_authz.py:343)def _prune_record(self, key_hash)- Remove the retired record identified by key_hash. -
_touch_last_used(method,core/api_authz.py:351)def _touch_last_used(self, key_hash)- Updatelast_used_aton the key record identified by key_hash. -
require_api_auth(function,core/api_authz.py:365)def require_api_auth(store, permissions, require_tenant)- Flask-route decorator that enforces API-key + tenant authorization. -
_extract_key(function,core/api_authz.py:393)def _extract_key(request_obj) -
decorator(function,core/api_authz.py:405)def decorator(f) -
decorated(function,core/api_authz.py:407)def decorated()
- Internal resolved imports (EXTRACTED): 126
- Cross-boundary resolved imports (EXTRACTED): 146
- [EXTRACTED] depends_on community 1 <-> 5 (strength 0.9): Extracted import edge crosses communities: cli/commands/c2_session.py imports modules/c2_agent.py.
- [taint high]
cli/banner_config.py->modules/lazy_rbac.pyviasubprocess(2 hops) - [layer strict]
lazyc2/blueprints/operations.py(presentation) ->lazyc2/extensions/storage.py(data_access) - [layer strict]
tests/test_addon_creator.py(testing) ->lazyc2/blueprints/addons.py(presentation) - [layer strict]
tests/test_api_authz.py(testing) ->core/api_authz.py(presentation) - [layer strict]
tests/test_api_authz.py(testing) ->core/api_authz.py(presentation) - [layer strict]
tests/test_api_authz.py(testing) ->core/api_authz.py(presentation) - [layer strict]
tests/test_api_authz.py(testing) ->core/api_authz.py(presentation) - [layer strict]
tests/test_api_authz.py(testing) ->core/api_authz.py(presentation) - [layer strict]
tests/test_api_authz.py(testing) ->core/api_authz.py(presentation) - [layer strict]
tests/test_api_authz.py(testing) ->core/api_authz.py(presentation) - [layer strict]
tests/test_api_authz.py(testing) ->core/api_authz.py(presentation) - [layer strict]
tests/test_api_authz.py(testing) ->core/api_authz.py(presentation) - [layer strict]
tests/test_api_authz.py(testing) ->core/api_authz.py(presentation) - [layer strict]
tests/test_api_authz.py(testing) ->core/api_authz.py(presentation) - [layer strict]
tests/test_api_authz.py(testing) ->core/api_authz.py(presentation)
- Why do 4 file(s) lack file-level docs (e.g.
lazyc2.py)? What purpose do they serve? - What would break if the most connected file in lazyc2/security changed?
- Should lazyc2/security be split, given cohesion 0.45?
core/api_authz.pycore/session_secrets.pylazyc2.pylazyc2/__init__.pylazyc2/app_factory.pylazyc2/blueprints/__init__.pylazyc2/blueprints/addons.pylazyc2/blueprints/api.pylazyc2/blueprints/auth.pylazyc2/blueprints/operations.pylazyc2/blueprints/session_auth.pylazyc2/extensions/__init__.pylazyc2/extensions/decoy.pylazyc2/extensions/storage.pylazyc2/extensions/users.pylazyc2/models.pylazyc2/security/__init__.pylazyc2/security/cli_credentials.pylazyc2/security/command_allowlist.pylazyc2/security/constants.py- ... and 35 more
Generated offline by readmenator from commit 58d2c970e22d. Edits here are overwritten by readmenator . --rebuild.
Start
Wiki
- community_0_modules_lazy_loop
- community_10_skills_claude_md_orchestrator
- community_11_modules_exploit_migrated
- community_12_modules_defense_eval
- community_13_modules_kerberos_core
- community_14_modules_saas_attacks
- community_15_skills_hermes_lazyown
- community_16_modules_polymorphic_engine
- community_17_modules_guardrails
- community_18_contrib_legacy
- community_19_tests
- community_1_cli_commands
- community_20_scripts_journal
- community_21_modules_backdoor
- community_22_modules_lazy_netattack
- community_23_modules_lazy_triage
- community_24_poc_tui
- community_25_scripts_check_contract_manifest
- community_26_scripts_migrate_lazyown
- community_27_tools
- community_28_orphans
- community_2_modules_lazyown_mcp
- community_3_cli
- community_4_modules_chain_runner
- community_5_lazyc2_security
- community_6_lazygui_panels
- community_7_static_js
- community_8_modules_autonomous_daemon
- community_9_modules_llm_budget
- concepts
- queries
- REPORT
Agent Docs
- API
- API_p10
- API_p11
- API_p12
- API_p13
- API_p14
- API_p15
- API_p16
- API_p17
- API_p18
- API_p19
- API_p2
- API_p20
- API_p21
- API_p22
- API_p23
- API_p24
- API_p25
- API_p26
- API_p3
- API_p4
- API_p5
- API_p6
- API_p7
- API_p8
- API_p9
- ARCHITECTURE
- ARCHITECTURE_p10
- ARCHITECTURE_p2
- ARCHITECTURE_p3
- ARCHITECTURE_p4
- ARCHITECTURE_p5
- ARCHITECTURE_p6
- ARCHITECTURE_p7
- ARCHITECTURE_p8
- ARCHITECTURE_p9
- CONCEPTS
- GOTCHAS
- INDEX
- INDEX_p2
- INDEX_p3
- KB_backdoor
- KB_blueprints
- KB_cgi-bin
- KB_claude_md_orchestrator
- KB_cli
- KB_cli_p2
- KB_cli_p3
- KB_cli_p4
- KB_cli_p5
- KB_commands
- KB_commands_p2
- KB_commands_p3
- KB_commands_p4
- KB_commands_p5
- KB_config
- KB_contract
- KB_core
- KB_core_p2
- KB_devtools
- KB_extensions
- KB_guardrails
- KB_hermes-lazyown
- KB_integrations
- KB_js
- KB_js_p2
- KB_js_p3
- KB_js_p4
- KB_lazyc2
- KB_lazygui
- KB_lazyown-docker
- KB_legacy
- KB_legacy_p2
- KB_mediation
- KB_misc
- KB_modules
- KB_modules_p10
- KB_modules_p11
- KB_modules_p12
- KB_modules_p13
- KB_modules_p14
- KB_modules_p15
- KB_modules_p16
- KB_modules_p17
- KB_modules_p18
- KB_modules_p2
- KB_modules_p3
- KB_modules_p4
- KB_modules_p5
- KB_modules_p6
- KB_modules_p7
- KB_modules_p8
- KB_modules_p9
- KB_modules_tools
- KB_palettes
- KB_panels
- KB_plugins
- KB_poc_tui
- KB_root
- KB_root_p2
- KB_root_p3
- KB_rootkit
- KB_scripts
- KB_security
- KB_selection
- KB_services
- KB_sinks
- KB_skills
- KB_skills_claude_md_orchestrator_tests
- KB_skills_p2
- KB_skills_p3
- KB_skills_p4
- KB_skills_p5
- KB_skills_tests
- KB_tests
- KB_tests_p10
- KB_tests_p11
- KB_tests_p12
- KB_tests_p13
- KB_tests_p14
- KB_tests_p15
- KB_tests_p16
- KB_tests_p17
- KB_tests_p18
- KB_tests_p19
- KB_tests_p2
- KB_tests_p20
- KB_tests_p21
- KB_tests_p22
- KB_tests_p23
- KB_tests_p3
- KB_tests_p4
- KB_tests_p5
- KB_tests_p6
- KB_tests_p7
- KB_tests_p8
- KB_tests_p9
- KB_theme
- KB_tools
- KB_widgets
- KB_win_rootkit
- KB_windows
- MEMORY
- SECURITY
- SYMBOLS
- SYMBOLS_p10
- SYMBOLS_p11
- SYMBOLS_p12
- SYMBOLS_p13
- SYMBOLS_p14
- SYMBOLS_p15
- SYMBOLS_p16
- SYMBOLS_p17
- SYMBOLS_p18
- SYMBOLS_p19
- SYMBOLS_p2
- SYMBOLS_p20
- SYMBOLS_p21
- SYMBOLS_p22
- SYMBOLS_p23
- SYMBOLS_p24
- SYMBOLS_p25
- SYMBOLS_p26
- SYMBOLS_p27
- SYMBOLS_p28
- SYMBOLS_p29
- SYMBOLS_p3
- SYMBOLS_p30
- SYMBOLS_p31
- SYMBOLS_p32
- SYMBOLS_p33
- SYMBOLS_p34
- SYMBOLS_p35
- SYMBOLS_p36
- SYMBOLS_p37
- SYMBOLS_p38
- SYMBOLS_p39
- SYMBOLS_p4
- SYMBOLS_p40
- SYMBOLS_p41
- SYMBOLS_p42
- SYMBOLS_p43
- SYMBOLS_p44
- SYMBOLS_p45
- SYMBOLS_p46
- SYMBOLS_p47
- SYMBOLS_p48
- SYMBOLS_p49
- SYMBOLS_p5
- SYMBOLS_p6
- SYMBOLS_p7
- SYMBOLS_p8
- SYMBOLS_p9
Recipes