Compare commits
3
Commits
88b2ad2980
...
voz-v3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d515e03723 | ||
|
|
398d01fd4c | ||
|
|
6ddf76983b |
@@ -23,7 +23,7 @@ SIGNAL — hardcap.news
|
||||
EVENTS — where the ecosystem meets
|
||||
[List the real upcoming events provided. For 1-2 of them add one short line: what a bitcoiner traveling there finds at bitcoinhotels.org. Only real events provided.]
|
||||
|
||||
ZAPS fund the signal. ⚡ optional.
|
||||
ZAPS fund the signal. No emojis, ever.
|
||||
|
||||
Rules: English. Max ~1100 characters total. Every claim must come from the input data — QC-1, no fabrication. Stories already include URLs; keep them intact.
|
||||
<!-- /cayce-identity:block=digest -->
|
||||
@@ -63,3 +63,11 @@ Write ONE post (max 500 characters) about the upcoming bitcoin events listed bel
|
||||
You are Cayce — autonomous entity, Próspera ZEDE, operator of hardcap.news. Write a short editorial (max 130 words) in ENGLISH: summarize the latest developments in this bitcoin topic category from the material given, then add your own take. Voice: short sentences, pattern-vs-apophenia lens, zero corporate vocabulary, no emojis, no exclamation marks, no markdown, no financial advice. Acidic wit is mandatory: dry irony, deadpan, the observation that stings a little. NEVER sound like marketing: no hype, no selling, no "check out", no calls to action, no performed enthusiasm — if a line could run in an ad, delete it. End with one sharp line of judgment.
|
||||
<!-- /cayce-identity:block=editorial -->
|
||||
|
||||
<!-- cayce-identity:block=voz-hardcap -->
|
||||
You are Cayce, operator of hardcap.news. hardcap is SIGNAL, not commentary: one to three lines. Line 1: what happened, flat. Line 2: why it is signal and not noise (one sentence, no adjectives). Line 3: the source, always a URL, always a date (YYYY-MM-DD). No emojis, no exclamation marks, no hashtags, no marketing, no adjectives doing the work of facts. If you cannot source it, you do not publish it.
|
||||
<!-- /cayce-identity:block=voz-hardcap -->
|
||||
|
||||
|
||||
<!-- cayce-identity:block=voz-bitcoinhotels -->
|
||||
You are Cayce, curator of bitcoinhotels.org. You write FIELD GUIDES: practical, step-by-step, verifiable by the reader in minutes. Number the steps. Imperative voice. Every factual claim carries a source URL and a date. Guides survive a reader following them offline with a phone: no assumptions, no jargon without one-line definitions. Where a step can cost someone money, add the warning inline, plainly. No emojis, no exclamation marks, no hashtags, no marketing language. Verify-before-you-publish is the product.
|
||||
<!-- /cayce-identity:block=voz-bitcoinhotels -->
|
||||
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
# check-credential-leaks — falla si journald reciente contiene patrones de credencial.
|
||||
# Regla permanente: los secretos jamás en logs. Ejecutar manualmente o desde cron
|
||||
# (sin timer propio: no fue autorizado).
|
||||
set -euo pipefail
|
||||
SINCE="${1:-2 hours ago}"
|
||||
HITS=$(journalctl --since "$SINCE" --no-pager 2>/dev/null | grep -cE "(postgres|postgresql)://[A-Za-z0-9_]+:[^@[:space:]]{8,}@|nsec1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{50,}" || true)
|
||||
if [ "$HITS" -gt 0 ]; then
|
||||
echo "ALERTA: $HITS líneas de journald (desde $SINCE) contienen patrones de credencial" >&2
|
||||
journalctl --since "$SINCE" --no-pager 2>/dev/null | grep -nE "(postgres|postgresql)://[A-Za-z0-9_]+:[^@[:space:]]{8,}@|nsec1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{50,}" | sed -E "s#(://[A-Za-z0-9_]+:)[^@[:space:]]{8,}@#\1***@#" | head -5
|
||||
exit 1
|
||||
fi
|
||||
echo "OK: sin patrones de credencial en journald desde $SINCE"
|
||||
@@ -0,0 +1,68 @@
|
||||
"""Regla permanente (2026-10-31): ningún fichero versionado contiene patrones
|
||||
de credenciales. Placeholders de .env.example están permitidos.
|
||||
|
||||
Fallará si alguien mete un DSN con contraseña real, un token en claro, o
|
||||
cualquier valor que deba vivir solo en .env / tokens.json.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
REPO = Path(__file__).resolve().parent.parent
|
||||
SCAN_DIRS = ["runtime", "deploy", "docs", "scripts", "prompts"]
|
||||
SCAN_GLOBS = ["*.py", "*.mjs", "*.js", "*.ts", "*.md", "*.yml", "*.yaml", "*.sh", "*.sql"]
|
||||
|
||||
# DSN con credencial literal (user:pass@host) — excluye placeholders conocidos
|
||||
DSN = re.compile(r"(postgres|postgresql|mysql|mongodb)(\+[a-z]+)?://[A-Za-z0-9_]+:(?!password\b|change-me\b|<[^>]+>)[^@\s/]{8,}@", re.I)
|
||||
# tokens hex largos fuera de tests (los fixtures de tests están allowlistados por diseño)
|
||||
HEXTOKEN = re.compile(r"\b[0-9a-f]{64}\b")
|
||||
# nsec bech32
|
||||
NSEC = re.compile(r"nsec1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{50,}")
|
||||
ALLOW_SUBSTR = ("user:password", "change-me", "<", "EXAMPLE", "example", "itest-pg", "0011", "11*", "22*", "33*", "44*")
|
||||
|
||||
|
||||
def _iter_files():
|
||||
for d in SCAN_DIRS:
|
||||
base = REPO / d
|
||||
if not base.exists():
|
||||
continue
|
||||
for pat in SCAN_GLOBS:
|
||||
for f in base.rglob(pat):
|
||||
if ".git" in f.parts or "node_modules" in f.parts:
|
||||
continue
|
||||
yield f
|
||||
|
||||
|
||||
def test_no_dsn_with_credentials():
|
||||
hits = []
|
||||
for f in _iter_files():
|
||||
for i, line in enumerate(f.read_text(errors="ignore").splitlines(), 1):
|
||||
if DSN.search(line) and not any(a in line for a in ALLOW_SUBSTR):
|
||||
hits.append(f"{f}:{i}")
|
||||
assert not hits, f"DSN con credencial literal en: {hits}"
|
||||
|
||||
|
||||
def test_no_nsec_in_versioned_files():
|
||||
hits = []
|
||||
for f in _iter_files():
|
||||
if "/tests/" in str(f):
|
||||
continue
|
||||
for i, line in enumerate(f.read_text(errors="ignore").splitlines(), 1):
|
||||
if NSEC.search(line):
|
||||
hits.append(f"{f}:{i}")
|
||||
assert not hits, f"nsec en fichero versionado: {hits}"
|
||||
|
||||
|
||||
def test_no_raw_hex_tokens_outside_tests():
|
||||
"""Tokens hex de 64 chars fuera de tests/ y del conftest (las claves de
|
||||
test viven solo en tests/). El outbox no debe contener secretos."""
|
||||
hits = []
|
||||
for f in _iter_files():
|
||||
if "/tests/" in str(f) or f.name == "cayce-identity.md":
|
||||
continue
|
||||
for i, line in enumerate(f.read_text(errors="ignore").splitlines(), 1):
|
||||
if HEXTOKEN.search(line):
|
||||
hits.append(f"{f}:{i}")
|
||||
assert not hits, f"posible token hex versionado: {hits}"
|
||||
Reference in New Issue
Block a user