forked from bchanot/claude
feat(guardrails): exposure domain (EXP-*): console data, source maps (config, public dir, large files), hydrated state, shipped comments, data attributes, error bodies in routes, debug mode, wide responses
This commit is contained in:
1 parent
7500a618fe
commit
d46201c561
6 files changed
+380
-33
No files matched your search
@@ -98,7 +98,7 @@ def _weak_hash(project, files):
|
||||
]
|
||||
|
||||
|
||||
def _log_args(args):
|
||||
def log_args(args):
|
||||
"""Call arguments with string literals reduced to their interpolations."""
|
||||
return STRING.sub(
|
||||
lambda m: " ".join(re.findall(r"\{([^}]*)\}", m.group())), args)
|
||||
@@ -110,7 +110,7 @@ def _logged(project, files):
|
||||
Rule(DOMAIN, "API-PASSWORD-LOGGED", "FAIL"), path, m.start(),
|
||||
"password reaches a log: never log credentials")
|
||||
for path, m in project.matches(LOG_CALL, files)
|
||||
if LOGGED_NAME.search(_log_args(m.group(1)))
|
||||
if LOGGED_NAME.search(log_args(m.group(1)))
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user