security Module (stx.security)
scitex-security — GitHub security-alert utilities (standalone).
- Usage:
from scitex_security import check_github_alerts
alerts = check_github_alerts() if alerts:
print(f”Found {len(alerts)} security alerts!”)
- scitex.security.check_github_alerts(repo=None, *, auth_check=None, secrets_fn=None, dependabot_fn=None, code_scanning_fn=None)[source]
Check all GitHub security alerts.
- Parameters:
repo (
Optional[str]) – Repository in format ‘owner/repo’. If None, uses current repo.auth_check (
Optional[Callable[[],bool]]) –check_gh_auth-shaped callable. Override in tests.secrets_fn (
Optional[Callable]) –get_secret_alerts-shaped callable. Override in tests.dependabot_fn (
Optional[Callable]) –get_dependabot_alerts-shaped callable. Override in tests.code_scanning_fn (
Optional[Callable]) –get_code_scanning_alerts-shaped callable. Override in tests.
- Returns:
‘secrets’, ‘dependabot’, ‘code_scanning’
- Return type:
Dictionary with keys
- Raises:
GitHubSecurityError – If GitHub CLI is not installed or not authenticated
- scitex.security.save_alerts_to_file(alerts, output_dir=None, create_symlink=True)[source]
Save alerts to a timestamped file.
- scitex.security.get_latest_alerts_file(security_dir=None)[source]
Get path to the latest security alerts file.