allowlist
๐ค AI-Generated Content
This documentation was generated with AI assistance and is still being audited. Some, or potentially a lot, of this information may be inaccurate. Learn more.
wrknv.security.allowlist
¶
Security Allowlist Manager¶
Generate security scanner configuration files from a unified allowlist.
Classes¶
SecurityAllowlistManager
¶
Manages security scanner allowlist configurations.
Generates configuration files for: - TruffleHog (.trufflehog-exclude-paths.txt) - Gitleaks (.gitleaks.toml) - GitGuardian (.gitguardian.yaml)
Initialize the manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_dir
|
Path | None
|
Project directory to work with |
None
|
config
|
SecurityConfig | None
|
Security configuration (optional, can be set later) |
None
|
Source code in wrknv/security/allowlist.py
Functions¶
generate_gitguardian
¶
Generate .gitguardian.yaml content.
Returns:
| Type | Description |
|---|---|
str
|
Content for GitGuardian configuration file |
Source code in wrknv/security/allowlist.py
generate_gitleaks
¶
Generate .gitleaks.toml content.
Returns:
| Type | Description |
|---|---|
str
|
Content for Gitleaks configuration file |
Source code in wrknv/security/allowlist.py
generate_trufflehog
¶
Generate .trufflehog-exclude-paths.txt content.
Returns:
| Type | Description |
|---|---|
str
|
Content for TruffleHog exclusion file |
Source code in wrknv/security/allowlist.py
preview
¶
Preview generated configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tool
|
str | None
|
Specific tool to preview (trufflehog, gitleaks, gitguardian) If None, preview all |
None
|
Returns:
| Type | Description |
|---|---|
str
|
Preview content |
Source code in wrknv/security/allowlist.py
set_config
¶
Set the security configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
SecurityConfig
|
Security configuration object |
required |
validate
¶
Validate the security configuration.
Returns:
| Type | Description |
|---|---|
tuple[bool, list[str]]
|
Tuple of (is_valid, list of error messages) |
Source code in wrknv/security/allowlist.py
write_all
¶
Write all security scanner configuration files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dry_run
|
bool
|
If True, don't write files, just report what would be done |
False
|
Returns:
| Type | Description |
|---|---|
dict[str, bool]
|
Dict mapping filename to success status |
Source code in wrknv/security/allowlist.py
Functions¶
glob_to_regex
¶
Convert glob pattern to regex pattern.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern
|
str
|
Glob pattern (e.g., "tests/certs/.key", "docs/**/.md") |
required |
Returns:
| Type | Description |
|---|---|
str
|
Regex pattern suitable for TruffleHog and Gitleaks |