v1.7.14: LLM/SIEM domain allowlists, SRI hashes, auth misconfig warning, Azure Key Vault integration
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
from secrets_manager import load_key_vault_secrets
|
||||
|
||||
# Pre-load Azure Key Vault secrets into os.environ before pydantic-settings reads them.
|
||||
# This is a no-op if AZURE_KEY_VAULT_NAME is not set.
|
||||
load_key_vault_secrets()
|
||||
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict # noqa: E402
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
@@ -80,6 +86,15 @@ class Settings(BaseSettings):
|
||||
DOCS_ENABLED: bool = False
|
||||
METRICS_ALLOWED_IPS: str = "127.0.0.1,::1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
|
||||
|
||||
# LLM endpoint restriction (comma-separated domains, e.g. "api.openai.com,*.openai.azure.com")
|
||||
LLM_ALLOWED_DOMAINS: str = ""
|
||||
|
||||
# SIEM webhook restriction (comma-separated domains)
|
||||
SIEM_ALLOWED_DOMAINS: str = ""
|
||||
|
||||
# Optional Azure Key Vault integration for secrets
|
||||
AZURE_KEY_VAULT_NAME: str = ""
|
||||
|
||||
|
||||
_settings = Settings()
|
||||
|
||||
@@ -134,3 +149,8 @@ RATE_LIMIT_WINDOW_SECONDS = _settings.RATE_LIMIT_WINDOW_SECONDS
|
||||
|
||||
DOCS_ENABLED = _settings.DOCS_ENABLED
|
||||
METRICS_ALLOWED_IPS = _settings.METRICS_ALLOWED_IPS
|
||||
|
||||
LLM_ALLOWED_DOMAINS = [d.strip().lower() for d in _settings.LLM_ALLOWED_DOMAINS.split(",") if d.strip()]
|
||||
SIEM_ALLOWED_DOMAINS = [d.strip().lower() for d in _settings.SIEM_ALLOWED_DOMAINS.split(",") if d.strip()]
|
||||
|
||||
AZURE_KEY_VAULT_NAME = _settings.AZURE_KEY_VAULT_NAME
|
||||
|
||||
Reference in New Issue
Block a user