quietfail-sh 0.2.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- quietfail/__init__.py +8 -0
- quietfail/cli.py +100 -0
- quietfail/finding.py +31 -0
- quietfail/keywords.py +30 -0
- quietfail/scanners/__init__.py +0 -0
- quietfail/scanners/bash.py +232 -0
- quietfail/scanners/cron.py +59 -0
- quietfail/scanners/github_actions.py +107 -0
- quietfail/scanners/systemd.py +67 -0
- quietfail_sh-0.2.5.dist-info/METADATA +145 -0
- quietfail_sh-0.2.5.dist-info/RECORD +15 -0
- quietfail_sh-0.2.5.dist-info/WHEEL +5 -0
- quietfail_sh-0.2.5.dist-info/entry_points.txt +2 -0
- quietfail_sh-0.2.5.dist-info/licenses/LICENSE +21 -0
- quietfail_sh-0.2.5.dist-info/top_level.txt +1 -0
quietfail/__init__.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"""quietfail — encuentra jobs que fallan en silencio.
|
|
2
|
+
|
|
3
|
+
Escanea scripts bash, unidades systemd, crontabs y workflows de GitHub
|
|
4
|
+
Actions en busca de un patrón concreto: algo detectó y registró un error,
|
|
5
|
+
pero el job/step/servicio igualmente terminó reportándose como éxito.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
__version__ = "0.2.5"
|
quietfail/cli.py
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import sys
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
from . import __version__
|
|
8
|
+
from .finding import Finding, Unparseable
|
|
9
|
+
from .keywords import DEFAULT_KEYWORDS
|
|
10
|
+
from .scanners import bash, cron, github_actions, systemd
|
|
11
|
+
|
|
12
|
+
_SKIP_DIRS = {".git", "node_modules", ".venv", "venv", "__pycache__", ".tox", "dist", "build"}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _iter_files(root: Path):
|
|
16
|
+
if root.is_file():
|
|
17
|
+
yield root
|
|
18
|
+
return
|
|
19
|
+
for path in root.rglob("*"):
|
|
20
|
+
if path.is_dir():
|
|
21
|
+
continue
|
|
22
|
+
# Solo cuentan las carpetas por debajo de la raíz analizada: con la ruta absoluta, un proyecto
|
|
23
|
+
# dentro de una carpeta llamada «build» o «venv» se saltaba entero («sin hallazgos»).
|
|
24
|
+
if any(part in _SKIP_DIRS for part in path.relative_to(root).parts[:-1]):
|
|
25
|
+
continue
|
|
26
|
+
yield path
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _scan_path(root: Path, keywords: tuple[str, ...]) -> tuple[list[Finding], list[tuple[Path, str]]]:
|
|
30
|
+
findings: list[Finding] = []
|
|
31
|
+
skipped: list[tuple[Path, str]] = []
|
|
32
|
+
for path in _iter_files(root):
|
|
33
|
+
try:
|
|
34
|
+
if bash.looks_like_shell_script(path):
|
|
35
|
+
findings.extend(bash.scan_file(path, keywords=keywords))
|
|
36
|
+
elif systemd.looks_like_unit_file(path):
|
|
37
|
+
findings.extend(systemd.scan_file(path))
|
|
38
|
+
elif cron.looks_like_crontab(path):
|
|
39
|
+
findings.extend(cron.scan_file(path))
|
|
40
|
+
elif path.name.endswith((".yml", ".yaml")) and ".github/workflows" in str(path):
|
|
41
|
+
findings.extend(github_actions.scan_file(path))
|
|
42
|
+
except Unparseable as e:
|
|
43
|
+
findings.extend(e.findings)
|
|
44
|
+
skipped.append((path, str(e)))
|
|
45
|
+
except (OSError, UnicodeDecodeError) as e:
|
|
46
|
+
# Un fichero que no se puede leer es un hueco del análisis: se avisa, no se calla
|
|
47
|
+
skipped.append((path, f"no se puede leer: {e.strerror if isinstance(e, OSError) else e}"))
|
|
48
|
+
return findings, skipped
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
52
|
+
parser = argparse.ArgumentParser(
|
|
53
|
+
prog="quietfail",
|
|
54
|
+
description=(
|
|
55
|
+
"Encuentra scripts, unidades systemd, crontabs y workflows de CI "
|
|
56
|
+
"que registran un error pero terminan en éxito de todas formas."
|
|
57
|
+
),
|
|
58
|
+
)
|
|
59
|
+
parser.add_argument("--version", action="version", version=f"%(prog)s {__version__}")
|
|
60
|
+
parser.add_argument("path", nargs="?", default=".", help="Fichero o directorio a analizar")
|
|
61
|
+
parser.add_argument(
|
|
62
|
+
"--keyword",
|
|
63
|
+
action="append",
|
|
64
|
+
dest="keywords",
|
|
65
|
+
help=f"Palabra clave de error adicional (repetible). Por defecto: {', '.join(DEFAULT_KEYWORDS)}",
|
|
66
|
+
)
|
|
67
|
+
parser.add_argument("--quiet", action="store_true", help="Solo imprime si hay hallazgos")
|
|
68
|
+
return parser
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def main(argv: list[str] | None = None) -> int:
|
|
72
|
+
parser = build_parser()
|
|
73
|
+
args = parser.parse_args(argv)
|
|
74
|
+
|
|
75
|
+
keywords = DEFAULT_KEYWORDS
|
|
76
|
+
if args.keywords:
|
|
77
|
+
keywords = tuple(keywords) + tuple(k.upper() for k in args.keywords)
|
|
78
|
+
|
|
79
|
+
root = Path(args.path)
|
|
80
|
+
if not root.exists():
|
|
81
|
+
print(f"quietfail: no existe la ruta '{root}'", file=sys.stderr)
|
|
82
|
+
return 2
|
|
83
|
+
|
|
84
|
+
findings, skipped = _scan_path(root, keywords)
|
|
85
|
+
for path, reason in skipped: # siempre, también con --quiet: es un hueco del análisis
|
|
86
|
+
print(f"quietfail: no se pudo analizar {path}: {reason}", file=sys.stderr)
|
|
87
|
+
|
|
88
|
+
if not findings:
|
|
89
|
+
if not args.quiet:
|
|
90
|
+
print("quietfail: sin hallazgos.")
|
|
91
|
+
return 0
|
|
92
|
+
|
|
93
|
+
for f in sorted(findings, key=lambda f: (f.path, f.line)):
|
|
94
|
+
print(f.format())
|
|
95
|
+
print(f"\n{len(findings)} posible(s) fallo(s) silencioso(s) encontrado(s).")
|
|
96
|
+
return 1
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
if __name__ == "__main__":
|
|
100
|
+
raise SystemExit(main())
|
quietfail/finding.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""Modelo de datos compartido por todos los scanners."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@dataclass(frozen=True)
|
|
9
|
+
class Finding:
|
|
10
|
+
"""Un caso detectado de fallo silencioso."""
|
|
11
|
+
|
|
12
|
+
scanner: str
|
|
13
|
+
path: str
|
|
14
|
+
line: int
|
|
15
|
+
message: str
|
|
16
|
+
snippet: str
|
|
17
|
+
|
|
18
|
+
def format(self) -> str:
|
|
19
|
+
return f"{self.path}:{self.line}: [{self.scanner}] {self.message}\n {self.snippet}"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class Unparseable(Exception):
|
|
23
|
+
"""El fichero parece de un tipo que analizamos pero no se pudo leer (entero) su sintaxis.
|
|
24
|
+
|
|
25
|
+
Antes se devolvía una lista vacía y el informe parecía limpio: un fichero sin analizar es
|
|
26
|
+
justo el tipo de fallo silencioso que esta herramienta busca. La CLI los lista aparte.
|
|
27
|
+
`findings` trae lo que sí se pudo analizar (análisis parcial)."""
|
|
28
|
+
|
|
29
|
+
def __init__(self, reason: str, findings: list[Finding] | None = None) -> None:
|
|
30
|
+
super().__init__(reason)
|
|
31
|
+
self.findings = findings or []
|
quietfail/keywords.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""Palabras clave que marcan un mensaje como 'esto fue un error'.
|
|
2
|
+
|
|
3
|
+
Deliberadamente conservador por defecto: solo términos que casi siempre
|
|
4
|
+
significan que algo salió mal, no ruido como WARN/AVISO que a menudo son
|
|
5
|
+
solo informativos. Se puede ampliar con --keyword.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import re
|
|
11
|
+
|
|
12
|
+
DEFAULT_KEYWORDS = ("ERROR", "CRITICAL", "FATAL", "FAIL", "FAILED")
|
|
13
|
+
|
|
14
|
+
# Comandos cuyo primer argumento de texto se interpreta como un mensaje
|
|
15
|
+
# a inspeccionar en busca de palabras clave de error.
|
|
16
|
+
LOG_COMMANDS = frozenset({"echo", "printf", "logger", "log", "print"})
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def build_keyword_regex(keywords: tuple[str, ...] = DEFAULT_KEYWORDS) -> re.Pattern[str]:
|
|
20
|
+
escaped = [re.escape(k) for k in keywords]
|
|
21
|
+
return re.compile(r"\b(" + "|".join(escaped) + r")\b", re.IGNORECASE)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# Lo que no es texto del mensaje: expansiones ($var, ${var:-x}, $(cmd), `cmd`) y opciones (--critical).
|
|
25
|
+
# Sin esto, `echo "fallidos: ${failed}"` o `echo "Usage: -c|--critical"` contaban como errores.
|
|
26
|
+
_NOT_MESSAGE = re.compile(r"\$\{[^}]*\}|\$\([^)]*\)|`[^`]*`|\$\w+|(?<![\w-])--?[\w-]+")
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def message_looks_like_error(text: str, pattern: re.Pattern[str]) -> bool:
|
|
30
|
+
return bool(pattern.search(_NOT_MESSAGE.sub(" ", text)))
|
|
File without changes
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"""Detecta el patrón: una rama registra un error pero no propaga el fallo.
|
|
2
|
+
|
|
3
|
+
Enfoque deliberadamente estrecho (igual que staleif): en vez de intentar
|
|
4
|
+
un análisis de flujo de control completo, solo mira el *bloque inmediato*
|
|
5
|
+
que contiene el mensaje de error (el cuerpo del if/elif/else, una rama de
|
|
6
|
+
case, el bucle, la función, un grupo `{ ...; }` o subshell, o el nivel
|
|
7
|
+
superior del script) y comprueba si ese mismo bloque contiene, después del
|
|
8
|
+
mensaje, un `exit`/`return` cuyo código no sea literalmente 0. No sigue el
|
|
9
|
+
fallo a bloques exteriores ni evalúa variables — eso da falsos negativos en
|
|
10
|
+
casos complejos, pero mantiene el check 100% mecánico y sin falsos
|
|
11
|
+
positivos por ambigüedad de flujo.
|
|
12
|
+
|
|
13
|
+
El análisis usa tree-sitter-bash. Antes era bashlex, que no entiende
|
|
14
|
+
construcciones normales de bash (`[[ ... ]]`, `$(( ))`, heredocs con
|
|
15
|
+
'EOF', muchos `case`) y solo podía leer un tercio de los scripts reales;
|
|
16
|
+
el resto se descartaba sin avisar. tree-sitter se recupera de los errores:
|
|
17
|
+
si el script tiene alguno, se analiza lo que se pudo leer y la CLI avisa
|
|
18
|
+
de que el análisis fue parcial.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
from __future__ import annotations
|
|
22
|
+
|
|
23
|
+
import re
|
|
24
|
+
from pathlib import Path
|
|
25
|
+
|
|
26
|
+
import tree_sitter_bash
|
|
27
|
+
from tree_sitter import Language, Node, Parser
|
|
28
|
+
|
|
29
|
+
from ..finding import Finding, Unparseable
|
|
30
|
+
from ..keywords import DEFAULT_KEYWORDS, LOG_COMMANDS, build_keyword_regex, message_looks_like_error
|
|
31
|
+
|
|
32
|
+
_PARSER = Parser(Language(tree_sitter_bash.language()))
|
|
33
|
+
# Hijos de un bloque que no son sentencias: palabras reservadas, separadores y comentarios
|
|
34
|
+
_NOT_STATEMENTS = {"comment"}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _text(node: Node) -> str:
|
|
38
|
+
return node.text.decode("utf-8", errors="replace")
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _unquote(text: str) -> str:
|
|
42
|
+
if len(text) >= 2 and text[0] == text[-1] and text[0] in "\"'":
|
|
43
|
+
return text[1:-1]
|
|
44
|
+
return text
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _unwrap(node: Node) -> Node:
|
|
48
|
+
"""`echo "ERROR" >&2` es un redirected_statement con el comando dentro."""
|
|
49
|
+
if node.type == "redirected_statement":
|
|
50
|
+
body = node.child_by_field_name("body")
|
|
51
|
+
if body is not None:
|
|
52
|
+
return body
|
|
53
|
+
return node
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _command_words(node: Node) -> list[str]:
|
|
57
|
+
"""[nombre, argumentos...] de un `command`; [] si no lo es."""
|
|
58
|
+
if node.type == "pipeline":
|
|
59
|
+
# `echo "ERROR" | tee -a log`: el mensaje es el del primer comando de la tubería
|
|
60
|
+
first = next(iter(node.named_children), None)
|
|
61
|
+
return _command_words(first) if first is not None else []
|
|
62
|
+
extra: list[str] = []
|
|
63
|
+
if node.type == "redirected_statement":
|
|
64
|
+
# `echo >&2 "ERROR: …"`: tree-sitter toma el texto como un destino más de la redirección
|
|
65
|
+
for redirect in node.children_by_field_name("redirect"):
|
|
66
|
+
extra += [_unquote(_text(d)) for d in redirect.children_by_field_name("destination")[1:]]
|
|
67
|
+
node = _unwrap(node)
|
|
68
|
+
if node.type != "command":
|
|
69
|
+
return []
|
|
70
|
+
name = node.child_by_field_name("name")
|
|
71
|
+
if name is None:
|
|
72
|
+
return []
|
|
73
|
+
return [_text(name), *(_unquote(_text(c)) for c in node.children_by_field_name("argument")), *extra]
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def _exit_arg(node: Node) -> str | None:
|
|
77
|
+
"""Si `node` es un `exit`/`return`, devuelve su argumento (o '' si no tiene)."""
|
|
78
|
+
words = _command_words(node)
|
|
79
|
+
if not words or words[0] not in ("exit", "return"):
|
|
80
|
+
return None
|
|
81
|
+
return words[1] if len(words) > 1 else ""
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def _is_protective_exit(arg: str | None) -> bool:
|
|
85
|
+
"""True si este exit/return SÍ propaga el fallo (o no podemos estar seguros de que no)."""
|
|
86
|
+
if arg is None:
|
|
87
|
+
return False
|
|
88
|
+
if arg == "":
|
|
89
|
+
# `exit` a secas hereda $? de lo anterior — asumimos que puede ser
|
|
90
|
+
# no-cero (beneficio de la duda, evita falsos positivos).
|
|
91
|
+
return True
|
|
92
|
+
try:
|
|
93
|
+
return int(arg) != 0
|
|
94
|
+
except ValueError:
|
|
95
|
+
# Argumento dinámico ($?, $RESULT...) — no evaluable estáticamente,
|
|
96
|
+
# mismo criterio: asumir que puede propagar el fallo.
|
|
97
|
+
return True
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def _statements(children: list[Node]) -> list[Node]:
|
|
101
|
+
"""Sentencias de una secuencia de nodos; `a && b || c` (list) cuenta como varias."""
|
|
102
|
+
out: list[Node] = []
|
|
103
|
+
for child in children:
|
|
104
|
+
if not child.is_named or child.type in _NOT_STATEMENTS:
|
|
105
|
+
continue
|
|
106
|
+
if child.type == "list":
|
|
107
|
+
out.extend(_statements(child.children))
|
|
108
|
+
else:
|
|
109
|
+
out.append(child)
|
|
110
|
+
return out
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def _if_branches(node: Node) -> list[list[Node]]:
|
|
114
|
+
"""Cuerpos then/elif/else de un if_statement (o elif_clause) como bloques separados."""
|
|
115
|
+
branches: list[list[Node]] = []
|
|
116
|
+
body: list[Node] | None = None
|
|
117
|
+
for child in node.children:
|
|
118
|
+
if child.type == "then":
|
|
119
|
+
body = []
|
|
120
|
+
elif child.type in ("elif_clause", "else_clause", "fi"):
|
|
121
|
+
if body is not None:
|
|
122
|
+
branches.append(_statements(body))
|
|
123
|
+
body = None
|
|
124
|
+
if child.type == "elif_clause":
|
|
125
|
+
branches.extend(_if_branches(child))
|
|
126
|
+
elif child.type == "else_clause":
|
|
127
|
+
branches.append(_statements(child.children[1:]))
|
|
128
|
+
elif body is not None:
|
|
129
|
+
body.append(child)
|
|
130
|
+
if body is not None: # elif_clause: su cuerpo llega hasta el final
|
|
131
|
+
branches.append(_statements(body))
|
|
132
|
+
return branches
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def _case_branches(node: Node) -> list[list[Node]]:
|
|
136
|
+
"""Cuerpo de cada rama de un case: lo que va después del `)` del patrón."""
|
|
137
|
+
branches: list[list[Node]] = []
|
|
138
|
+
for item in node.children:
|
|
139
|
+
if item.type != "case_item":
|
|
140
|
+
continue
|
|
141
|
+
kids = item.children
|
|
142
|
+
start = next((i for i, c in enumerate(kids) if c.type == ")"), None)
|
|
143
|
+
if start is not None:
|
|
144
|
+
branches.append(_statements(kids[start + 1:]))
|
|
145
|
+
return branches
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def _nested_blocks(node: Node) -> list[list[Node]]:
|
|
149
|
+
"""Bloques anidados dentro de esta sentencia, a inspeccionar recursivamente."""
|
|
150
|
+
node = _unwrap(node)
|
|
151
|
+
if node.type == "if_statement":
|
|
152
|
+
return _if_branches(node)
|
|
153
|
+
if node.type == "case_statement":
|
|
154
|
+
return _case_branches(node)
|
|
155
|
+
if node.type in ("function_definition", "for_statement", "c_style_for_statement", "while_statement"):
|
|
156
|
+
body = node.child_by_field_name("body")
|
|
157
|
+
return _nested_blocks(body) if body is not None else []
|
|
158
|
+
if node.type in ("compound_statement", "subshell", "do_group"):
|
|
159
|
+
return [_statements(node.children)]
|
|
160
|
+
return []
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
def _scan_block(statements: list[Node], source: str, path: str, pattern: re.Pattern[str]) -> list[Finding]:
|
|
164
|
+
findings: list[Finding] = []
|
|
165
|
+
lines = source.splitlines()
|
|
166
|
+
|
|
167
|
+
for idx, stmt in enumerate(statements):
|
|
168
|
+
words = _command_words(stmt)
|
|
169
|
+
if words and words[0] in LOG_COMMANDS:
|
|
170
|
+
args = words[1:]
|
|
171
|
+
while args and args[0].startswith("-"): # echo -e, printf --, logger -t …
|
|
172
|
+
args = args[1:]
|
|
173
|
+
message = " ".join(args)
|
|
174
|
+
if message_looks_like_error(message, pattern):
|
|
175
|
+
protected = any(_is_protective_exit(_exit_arg(later)) for later in statements[idx + 1:])
|
|
176
|
+
if not protected:
|
|
177
|
+
line = stmt.start_point[0] + 1
|
|
178
|
+
findings.append(
|
|
179
|
+
Finding(
|
|
180
|
+
scanner="bash",
|
|
181
|
+
path=path,
|
|
182
|
+
line=line,
|
|
183
|
+
message=(
|
|
184
|
+
f"registra un mensaje de error ('{message.strip()[:60]}') "
|
|
185
|
+
"pero este bloque no termina en exit/return con código != 0"
|
|
186
|
+
),
|
|
187
|
+
snippet=lines[line - 1].strip() if line <= len(lines) else "",
|
|
188
|
+
)
|
|
189
|
+
)
|
|
190
|
+
|
|
191
|
+
# recursión: cualquier bloque anidado dentro de esta sentencia
|
|
192
|
+
for nested in _nested_blocks(stmt):
|
|
193
|
+
findings.extend(_scan_block(nested, source, path, pattern))
|
|
194
|
+
|
|
195
|
+
return findings
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def _first_error(node: Node) -> Node | None:
|
|
199
|
+
if node.type == "ERROR" or node.is_missing:
|
|
200
|
+
return node
|
|
201
|
+
for child in node.children:
|
|
202
|
+
if child.has_error:
|
|
203
|
+
found = _first_error(child)
|
|
204
|
+
if found is not None:
|
|
205
|
+
return found
|
|
206
|
+
return None
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def scan_file(path: Path, keywords: tuple[str, ...] = DEFAULT_KEYWORDS) -> list[Finding]:
|
|
210
|
+
source = path.read_text(errors="replace")
|
|
211
|
+
pattern = build_keyword_regex(keywords)
|
|
212
|
+
tree = _PARSER.parse(source.encode("utf-8"))
|
|
213
|
+
findings = _scan_block(_statements(tree.root_node.children), source, str(path), pattern)
|
|
214
|
+
if tree.root_node.has_error:
|
|
215
|
+
error = _first_error(tree.root_node)
|
|
216
|
+
line = error.start_point[0] + 1 if error is not None else 0
|
|
217
|
+
raise Unparseable(f"análisis parcial: sintaxis de bash no válida cerca de la línea {line}",
|
|
218
|
+
findings=findings)
|
|
219
|
+
return findings
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
def looks_like_shell_script(path: Path) -> bool:
|
|
223
|
+
if path.suffix in (".sh", ".bash"):
|
|
224
|
+
return True
|
|
225
|
+
if path.suffix:
|
|
226
|
+
return False
|
|
227
|
+
try:
|
|
228
|
+
with path.open("rb") as f:
|
|
229
|
+
first_line = f.readline(200)
|
|
230
|
+
except OSError:
|
|
231
|
+
return False
|
|
232
|
+
return first_line.startswith(b"#!") and (b"sh" in first_line)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"""Detecta líneas de crontab que silencian salida y error por completo.
|
|
2
|
+
|
|
3
|
+
Patrón: `>/dev/null 2>&1` (o `&>/dev/null`) sin ningún mecanismo visible de
|
|
4
|
+
notificación (curl/wget a un servicio de heartbeat, `mail`, etc.) a
|
|
5
|
+
continuación en la misma línea. Si el comando falla, nadie se entera nunca
|
|
6
|
+
— ni por email de cron (que también se ha silenciado), ni por ningún otro
|
|
7
|
+
canal.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import re
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
from ..finding import Finding
|
|
16
|
+
|
|
17
|
+
_CRON_LINE_RE = re.compile(
|
|
18
|
+
r"^\s*(?:@\w+|(?:\S+\s+){5})(?P<command>.+)$"
|
|
19
|
+
)
|
|
20
|
+
_FULL_SILENCE_RE = re.compile(r"(>\s*/dev/null\s+2>&1)|(&>\s*/dev/null)|(>\s*/dev/null\s+2>/dev/null)")
|
|
21
|
+
_HEARTBEAT_HINT_RE = re.compile(
|
|
22
|
+
r"(curl|wget)\s+.*(healthcheck|heartbeat|cronitor|deadmanping|cronping|hc-ping|betteruptime)",
|
|
23
|
+
re.IGNORECASE,
|
|
24
|
+
)
|
|
25
|
+
_COMMENT_OR_BLANK_RE = re.compile(r"^\s*(#.*)?$")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def scan_file(path: Path) -> list[Finding]:
|
|
29
|
+
findings: list[Finding] = []
|
|
30
|
+
lines = path.read_text(errors="replace").splitlines()
|
|
31
|
+
|
|
32
|
+
for lineno, raw in enumerate(lines, start=1):
|
|
33
|
+
if _COMMENT_OR_BLANK_RE.match(raw):
|
|
34
|
+
continue
|
|
35
|
+
m = _CRON_LINE_RE.match(raw)
|
|
36
|
+
if not m:
|
|
37
|
+
continue
|
|
38
|
+
command = m.group("command")
|
|
39
|
+
if _FULL_SILENCE_RE.search(command) and not _HEARTBEAT_HINT_RE.search(command):
|
|
40
|
+
findings.append(
|
|
41
|
+
Finding(
|
|
42
|
+
scanner="cron",
|
|
43
|
+
path=str(path),
|
|
44
|
+
line=lineno,
|
|
45
|
+
message=(
|
|
46
|
+
"silencia stdout y stderr por completo sin ningún heartbeat/ping "
|
|
47
|
+
"posterior — si el comando falla, no hay forma de enterarse"
|
|
48
|
+
),
|
|
49
|
+
snippet=raw.strip(),
|
|
50
|
+
)
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
return findings
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def looks_like_crontab(path: Path) -> bool:
|
|
57
|
+
if path.name == "crontab" or path.suffix == ".crontab":
|
|
58
|
+
return True
|
|
59
|
+
return "cron" in str(path.parent).lower() and path.suffix == ""
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"""Detecta pasos de GitHub Actions cuyo fallo se descarta sin comprobarlo.
|
|
2
|
+
|
|
3
|
+
Dos patrones, ambos 100% mecánicos:
|
|
4
|
+
|
|
5
|
+
1. `continue-on-error: true` en un step con `id:` cuyo `steps.<id>.outcome`
|
|
6
|
+
(o `.conclusion`) nunca se referencia en ningún paso/condición
|
|
7
|
+
posterior del mismo job — el resultado del step se pierde sin más.
|
|
8
|
+
2. Un `run:` cuyo comando termina en `|| true` (o `; true`) — silencia
|
|
9
|
+
cualquier fallo incondicionalmente, sin importar la causa.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import re
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
|
|
17
|
+
import yaml
|
|
18
|
+
|
|
19
|
+
from ..finding import Finding, Unparseable
|
|
20
|
+
|
|
21
|
+
_SWALLOW_RE = re.compile(r"(?:\|\|\s*(?:true|:|exit\s+0)|;\s*true)\s*$", re.MULTILINE)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _line_of_key(source: str, needle: str, start_from: int = 0) -> int:
|
|
25
|
+
idx = source.find(needle, start_from)
|
|
26
|
+
if idx == -1:
|
|
27
|
+
return 1
|
|
28
|
+
return source.count("\n", 0, idx) + 1
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def scan_file(path: Path) -> list[Finding]:
|
|
32
|
+
source = path.read_text(errors="replace")
|
|
33
|
+
try:
|
|
34
|
+
data = yaml.safe_load(source)
|
|
35
|
+
except yaml.YAMLError as e:
|
|
36
|
+
raise Unparseable(f"YAML no válido ({str(e).splitlines()[0]})") from None
|
|
37
|
+
|
|
38
|
+
if not isinstance(data, dict):
|
|
39
|
+
return []
|
|
40
|
+
|
|
41
|
+
findings: list[Finding] = []
|
|
42
|
+
jobs = data.get("jobs")
|
|
43
|
+
if not isinstance(jobs, dict):
|
|
44
|
+
return findings
|
|
45
|
+
|
|
46
|
+
for job_name, job in jobs.items():
|
|
47
|
+
if not isinstance(job, dict):
|
|
48
|
+
continue
|
|
49
|
+
steps = job.get("steps")
|
|
50
|
+
if not isinstance(steps, list):
|
|
51
|
+
continue
|
|
52
|
+
|
|
53
|
+
job_text_after: dict[str, str] = {}
|
|
54
|
+
ids_with_continue: list[tuple[str, dict]] = []
|
|
55
|
+
|
|
56
|
+
for i, step in enumerate(steps):
|
|
57
|
+
if not isinstance(step, dict):
|
|
58
|
+
continue
|
|
59
|
+
|
|
60
|
+
if step.get("continue-on-error") is True and step.get("id"):
|
|
61
|
+
step_id = step["id"]
|
|
62
|
+
remaining_yaml = yaml.dump(steps[i + 1 :])
|
|
63
|
+
ids_with_continue.append((step_id, step))
|
|
64
|
+
job_text_after[step_id] = remaining_yaml
|
|
65
|
+
|
|
66
|
+
run = step.get("run")
|
|
67
|
+
match = _SWALLOW_RE.search(run.strip()) if isinstance(run, str) else None
|
|
68
|
+
if match:
|
|
69
|
+
# La línea que silencia (no la última del bloque, que antes era la que se señalaba)
|
|
70
|
+
bad = run.strip()[: match.end()].splitlines()[-1].strip()
|
|
71
|
+
line = _line_of_key(source, bad)
|
|
72
|
+
findings.append(
|
|
73
|
+
Finding(
|
|
74
|
+
scanner="github_actions",
|
|
75
|
+
path=str(path),
|
|
76
|
+
line=line,
|
|
77
|
+
message=(
|
|
78
|
+
f"job '{job_name}': el step "
|
|
79
|
+
f"'{step.get('name', step.get('id', f'n.º {i + 1}'))}' termina en `|| true`/`|| :`/`|| exit 0`/`; true`, "
|
|
80
|
+
"silencia cualquier fallo del comando incondicionalmente"
|
|
81
|
+
),
|
|
82
|
+
snippet=bad,
|
|
83
|
+
)
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
for step_id, step in ids_with_continue:
|
|
87
|
+
remaining = job_text_after[step_id]
|
|
88
|
+
referenced = (f"steps.{step_id}.outcome" in remaining) or (
|
|
89
|
+
f"steps.{step_id}.conclusion" in remaining
|
|
90
|
+
)
|
|
91
|
+
if not referenced:
|
|
92
|
+
line = _line_of_key(source, f"id: {step_id}") or _line_of_key(source, f"id: '{step_id}'")
|
|
93
|
+
findings.append(
|
|
94
|
+
Finding(
|
|
95
|
+
scanner="github_actions",
|
|
96
|
+
path=str(path),
|
|
97
|
+
line=line,
|
|
98
|
+
message=(
|
|
99
|
+
f"job '{job_name}': step '{step_id}' usa continue-on-error pero "
|
|
100
|
+
f"ningún paso posterior comprueba steps.{step_id}.outcome — "
|
|
101
|
+
"el fallo se descarta sin más"
|
|
102
|
+
),
|
|
103
|
+
snippet=f"id: {step_id} # continue-on-error: true",
|
|
104
|
+
)
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
return findings
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"""Detecta unidades systemd cuyo ExecStart silencia el fallo directamente.
|
|
2
|
+
|
|
3
|
+
Patrón: `ExecStart=... || true` (o `|| :`) en el propio fichero de unidad —
|
|
4
|
+
por muy mal que le vaya al comando, systemd siempre lo ve como éxito
|
|
5
|
+
(`Deactivated successfully`), exactamente el aviso engañoso que systemctl/
|
|
6
|
+
journalctl muestran para un job que en realidad no hizo nada.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import re
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
|
|
14
|
+
from ..finding import Finding
|
|
15
|
+
|
|
16
|
+
_EXEC_LINE_RE = re.compile(r"^\s*ExecStart(?:Pre|Post)?\s*=\s*(?P<command>.+)$")
|
|
17
|
+
# `|| true` / `|| :` / `|| exit 0` al final, también dentro de `sh -c '…'` (systemd no interpreta `||`
|
|
18
|
+
# por sí mismo: solo tiene efecto dentro de un shell, y entonces la línea acaba en comilla)
|
|
19
|
+
_SWALLOW_SUFFIX_RE = re.compile(r"\|\|\s*(?:true|:|exit\s+0)\s*['\"]?\s*$")
|
|
20
|
+
# Prefijo `-` de systemd: ignora el código de salida (puede combinarse con @, :, + y !)
|
|
21
|
+
_IGNORE_PREFIX_RE = re.compile(r"^[@:+!]*-")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def scan_file(path: Path) -> list[Finding]:
|
|
25
|
+
findings: list[Finding] = []
|
|
26
|
+
lines = path.read_text(errors="replace").splitlines()
|
|
27
|
+
|
|
28
|
+
for lineno, raw in enumerate(lines, start=1):
|
|
29
|
+
m = _EXEC_LINE_RE.match(raw)
|
|
30
|
+
if not m:
|
|
31
|
+
continue
|
|
32
|
+
command = m.group("command").strip()
|
|
33
|
+
# El `-` en ExecStartPre/Post suele ser un paso opcional legítimo; en ExecStart oculta que el
|
|
34
|
+
# propio servicio falló
|
|
35
|
+
is_main = raw.strip().split("=", 1)[0].strip() == "ExecStart"
|
|
36
|
+
if is_main and _IGNORE_PREFIX_RE.match(command):
|
|
37
|
+
findings.append(
|
|
38
|
+
Finding(
|
|
39
|
+
scanner="systemd",
|
|
40
|
+
path=str(path),
|
|
41
|
+
line=lineno,
|
|
42
|
+
message=(
|
|
43
|
+
"el prefijo `-` hace que systemd ignore el código de salida — el servicio "
|
|
44
|
+
"se da por bueno aunque el comando falle"
|
|
45
|
+
),
|
|
46
|
+
snippet=raw.strip(),
|
|
47
|
+
)
|
|
48
|
+
)
|
|
49
|
+
elif _SWALLOW_SUFFIX_RE.search(command):
|
|
50
|
+
findings.append(
|
|
51
|
+
Finding(
|
|
52
|
+
scanner="systemd",
|
|
53
|
+
path=str(path),
|
|
54
|
+
line=lineno,
|
|
55
|
+
message=(
|
|
56
|
+
"ExecStart termina en `|| true`/`|| :`/`|| exit 0` — el servicio siempre se "
|
|
57
|
+
"reporta como éxito aunque el comando real falle"
|
|
58
|
+
),
|
|
59
|
+
snippet=raw.strip(),
|
|
60
|
+
)
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
return findings
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def looks_like_unit_file(path: Path) -> bool:
|
|
67
|
+
return path.suffix in (".service", ".timer")
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: quietfail-sh
|
|
3
|
+
Version: 0.2.5
|
|
4
|
+
Summary: Encuentra scripts, unidades systemd, crontabs y workflows de CI que registran un error pero igualmente terminan en éxito (exit 0).
|
|
5
|
+
Author: José Luis Segura Yuste
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/jl-segurayuste/quietfail
|
|
8
|
+
Project-URL: Source, https://github.com/jl-segurayuste/quietfail
|
|
9
|
+
Project-URL: Issues, https://github.com/jl-segurayuste/quietfail/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/jl-segurayuste/quietfail/releases
|
|
11
|
+
Keywords: bash,ci,static-analysis,sysadmin,systemd
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: System Administrators
|
|
16
|
+
Classifier: Natural Language :: Spanish
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
24
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
25
|
+
Classifier: Topic :: System :: Systems Administration
|
|
26
|
+
Requires-Python: >=3.11
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Requires-Dist: tree-sitter>=0.23
|
|
30
|
+
Requires-Dist: tree-sitter-bash>=0.23
|
|
31
|
+
Requires-Dist: pyyaml>=6.0
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: pytest>=7.4; extra == "dev"
|
|
34
|
+
Requires-Dist: pytest-cov>=5; extra == "dev"
|
|
35
|
+
Requires-Dist: ruff==0.17.6; extra == "dev"
|
|
36
|
+
Dynamic: license-file
|
|
37
|
+
|
|
38
|
+
# quietfail
|
|
39
|
+
|
|
40
|
+
[](https://pypi.org/project/quietfail-sh/)
|
|
41
|
+
[](https://github.com/jl-segurayuste/quietfail/actions/workflows/ci.yml)
|
|
42
|
+
[](https://github.com/jl-segurayuste/quietfail/blob/main/pyproject.toml)
|
|
43
|
+
[](https://github.com/jl-segurayuste/quietfail/blob/main/LICENSE)
|
|
44
|
+
|
|
45
|
+
Encuentra scripts, unidades systemd, crontabs y workflows de GitHub Actions
|
|
46
|
+
que **registran un error pero terminan en éxito de todas formas**.
|
|
47
|
+
|
|
48
|
+
Este es el patrón: un job corre cada noche, algo dentro de él detecta que
|
|
49
|
+
falta configuración o que una operación no se pudo completar, lo escribe en
|
|
50
|
+
el log con un `echo "ERROR: ..."` bien visible... y el script sigue adelante
|
|
51
|
+
hasta su final natural sin llamar nunca a `exit 1`. `systemd`/`cron`/CI solo
|
|
52
|
+
miran el código de salida, así que el job se marca como un éxito rotundo —
|
|
53
|
+
puede llevar así semanas o meses sin que nadie se entere, porque no hay nada
|
|
54
|
+
roto que salte a la vista: solo un mensaje de error enterrado entre miles de
|
|
55
|
+
líneas de log que nadie lee a menos que ya sospeche algo.
|
|
56
|
+
|
|
57
|
+
`quietfail` es un análisis estático: no ejecuta nada, no necesita historial
|
|
58
|
+
de ejecuciones ni un servicio de "ping" al que avisar — lee el código fuente
|
|
59
|
+
y comprueba si ese error, una vez detectado, tiene realmente un camino hacia
|
|
60
|
+
un exit code que no sea 0.
|
|
61
|
+
|
|
62
|
+
## Así se ve
|
|
63
|
+
|
|
64
|
+

|
|
65
|
+
|
|
66
|
+
<sub>Ejecución real sobre un script de backup, una unidad systemd, un crontab y un workflow de CI que esconden sus fallos (todos los datos son ficticios).</sub>
|
|
67
|
+
|
|
68
|
+
## Instalación
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pipx install quietfail-sh # recomendado para herramientas de línea de comandos
|
|
72
|
+
# o bien
|
|
73
|
+
pip install quietfail-sh
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
El paquete se llama `quietfail-sh` porque el nombre `quietfail` ya estaba ocupado en PyPI;
|
|
77
|
+
el comando sigue siendo `quietfail`.
|
|
78
|
+
|
|
79
|
+
## Uso
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
quietfail . # analiza el directorio actual
|
|
83
|
+
quietfail scripts/backup.sh # o un fichero suelto
|
|
84
|
+
quietfail --keyword AVISO . # añade una palabra clave de error propia
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Sale con código 1 si encuentra algo (útil como paso de CI), 0 si está limpio.
|
|
88
|
+
|
|
89
|
+
## Qué detecta
|
|
90
|
+
|
|
91
|
+
| Formato | Patrón |
|
|
92
|
+
|---|---|
|
|
93
|
+
| Scripts bash/sh | Una rama `if`/`elif`/`else` o de `case`, un bucle, el cuerpo de una función o un grupo `{ …; }`/subshell (como en `cmd \|\| { echo ERROR; }`) registra un mensaje de error (`echo`/`printf`/`logger`, ERROR/CRITICAL/FATAL/FAIL por defecto, sin contar variables ni opciones como `--critical`) y ese mismo bloque no contiene después ningún `exit`/`return` con código != 0 |
|
|
94
|
+
| Unidades systemd (`.service`) | `ExecStart=-…` (el prefijo `-` ignora el código de salida) y `\|\| true` / `\|\| :` / `\|\| exit 0` al final, también dentro de `sh -c '…'` — el comando real puede fallar, systemd siempre lo ve como éxito. Las unidades de la distribución (`/usr/lib/systemd/system`) usan `ExecStart=-` a propósito (gettys…): analiza las tuyas, `/etc/systemd/system` |
|
|
95
|
+
| Crontabs | Una entrada silencia stdout y stderr por completo (`>/dev/null 2>&1`) sin ningún heartbeat/ping posterior — si falla, nadie se entera nunca |
|
|
96
|
+
| Workflows de GitHub Actions | Un step con `continue-on-error: true` cuyo `steps.<id>.outcome` nunca se comprueba después, o un `run:` con una línea que termina en `\|\| true`, `\|\| :`, `\|\| exit 0` o `; true` |
|
|
97
|
+
|
|
98
|
+
## Qué NO detecta (a propósito)
|
|
99
|
+
|
|
100
|
+
Es un check mecánico y de precisión alta, no un analizador de flujo de
|
|
101
|
+
control completo — el mismo criterio que llevó a acotar
|
|
102
|
+
[`staleif`](https://github.com/jl-segurayuste/staleif) a un subconjunto
|
|
103
|
+
100% comprobable en vez de intentar "juicio semántico" general:
|
|
104
|
+
|
|
105
|
+
- Solo mira el bloque *inmediato* que contiene el mensaje de error (la
|
|
106
|
+
rama del if, el cuerpo del bucle/función). No sigue la propagación a
|
|
107
|
+
bloques exteriores ni evalúa el contenido de variables.
|
|
108
|
+
- No sabe qué imprime `echo "$mensaje_dinamico"` — solo texto literal.
|
|
109
|
+
- Un `exit`/`return` con argumento dinámico (`exit $?`, `exit "$status"`)
|
|
110
|
+
se asume "puede propagar el fallo" (beneficio de la duda) para no
|
|
111
|
+
generar falsos positivos.
|
|
112
|
+
|
|
113
|
+
Menos casos detectados, pero los que reporta son reales.
|
|
114
|
+
|
|
115
|
+
## Por qué esto y no un servicio de monitorización tipo "dead man's switch"
|
|
116
|
+
|
|
117
|
+
Herramientas como Healthchecks.io/Cronitor/etc. avisan cuando un job
|
|
118
|
+
**no llega a ejecutarse o no manda su ping** — muy útil, pero es
|
|
119
|
+
monitorización en producción: necesita que el job ya esté desplegado,
|
|
120
|
+
corriendo, y fallando de verdad durante un tiempo antes de que salte
|
|
121
|
+
la alarma. `quietfail` es lo contrario: un check estático sobre el
|
|
122
|
+
propio código, que se puede correr en CI antes de desplegar nada,
|
|
123
|
+
sin necesitar ninguna ejecución real.
|
|
124
|
+
|
|
125
|
+
## Arquitectura
|
|
126
|
+
|
|
127
|
+
Cuatro scanners independientes bajo `quietfail/scanners/` (`bash.py`,
|
|
128
|
+
`systemd.py`, `cron.py`, `github_actions.py`), cada uno con su propia
|
|
129
|
+
lógica de detección y sus propios tests. `cli.py` solo decide, por
|
|
130
|
+
extensión/ubicación del fichero, a qué scanner mandarlo.
|
|
131
|
+
|
|
132
|
+
Los scripts se leen con [tree-sitter-bash](https://github.com/tree-sitter/tree-sitter-bash),
|
|
133
|
+
que entiende el bash real (`[[ … ]]`, `$(( … ))`, heredocs, `case`) y se recupera de
|
|
134
|
+
los errores de sintaxis. Si un fichero no se pudo leer entero, `quietfail` lo dice
|
|
135
|
+
por stderr (`no se pudo analizar …: análisis parcial`) y analiza lo que sí pudo: un
|
|
136
|
+
fichero saltado en silencio sería justo el tipo de fallo que busca.
|
|
137
|
+
|
|
138
|
+
## Desarrollo
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
python -m venv .venv && source .venv/bin/activate
|
|
142
|
+
pip install -e ".[dev]"
|
|
143
|
+
ruff check .
|
|
144
|
+
pytest
|
|
145
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
quietfail/__init__.py,sha256=czAWJjdQWbSVUcCFD_ToQSInoLRkuSTtobjpSN0GuTA,305
|
|
2
|
+
quietfail/cli.py,sha256=5-YzQTqhJPi0ndqZd7P57qcIyfac5KniDndyNkhr8bc,3753
|
|
3
|
+
quietfail/finding.py,sha256=hAMXf6Zcd6-EPIrQuHtpe8T68BTQQsOjHfVxostv-eM,967
|
|
4
|
+
quietfail/keywords.py,sha256=Nsz4Vn1sH1yBgepw5qX0UgWr_CtYXEH0yKljO7UuTdI,1224
|
|
5
|
+
quietfail/scanners/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
quietfail/scanners/bash.py,sha256=HnvAaGA0kTH_Whe78jKA2pw_QJeopKlRRCcBVMB9Lkk,9184
|
|
7
|
+
quietfail/scanners/cron.py,sha256=V382pXFQpmhfe29g-kDsifhcUb9GBvVPr43uxYjo1nQ,2011
|
|
8
|
+
quietfail/scanners/github_actions.py,sha256=UJHCxa7HHd1sN2nD46S5p6Oqggt-NirUjqvbX7t36V4,3983
|
|
9
|
+
quietfail/scanners/systemd.py,sha256=B6ykG0HwQRnxy56GT3X_3KyYxVZn6VnTK2lEDKv39Tg,2625
|
|
10
|
+
quietfail_sh-0.2.5.dist-info/licenses/LICENSE,sha256=70acRqGbi12E-RBHctB4yHLzZOoCFayZUXlhAUvwaAM,1080
|
|
11
|
+
quietfail_sh-0.2.5.dist-info/METADATA,sha256=mD_hvfHZq0teTVPSDg7RbaiPU1ZabVCxexWRbqGNves,7494
|
|
12
|
+
quietfail_sh-0.2.5.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
13
|
+
quietfail_sh-0.2.5.dist-info/entry_points.txt,sha256=miHm-tuPH2FX10xYjgPbQ13xA0O8eDs5daKcObNzIjE,49
|
|
14
|
+
quietfail_sh-0.2.5.dist-info/top_level.txt,sha256=nxNra2dwcu6KmaKq1ugPk1fWbDwR2hBrObebzhwUlcU,10
|
|
15
|
+
quietfail_sh-0.2.5.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 José Luis Segura Yuste
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
quietfail
|