AGENT SKILL

syslog-integration

暂无简介

License 许可
Apache-2.0
最近更新
2026-11-11
Stars
★ 13
Forks
1

03 SKILL.md 正文

/syslog-integration

When to Use

  • Forward agent audit events to system syslog (journald, rsyslog, syslog-ng)
  • Integrate yamtam audit trail with centralized SIEM (Splunk, Datadog)
  • Append-only audit log that agent cannot tamper with (syslog is external)
  • Pairs with [[append-only-event-log]] for dual-write audit strategy

Do NOT use for

  • High-frequency debug logs (syslog has overhead — use structured file logging)
  • Environments without syslog daemon (container scratch images)

Node.js syslog client

import syslog from 'node-syslog'

// Initialize once at startup
syslog.init('yamtam-agent', syslog.LOG_PID | syslog.LOG_ODELAY, syslog.LOG_DAEMON)

// Severity levels
// LOG_EMERG=0, LOG_ALERT=1, LOG_CRIT=2, LOG_ERR=3
// LOG_WARNING=4, LOG_NOTICE=5, LOG_INFO=6, LOG_DEBUG=7

export function auditLog(level: 'info' | 'warn' | 'error' | 'crit', msg: string, meta?: object) {
  const entry = JSON.stringify({ ts: new Date().toISOString(), msg, ...meta })
  const sev = {
    info:  syslog.LOG_INFO,
    warn:  syslog.LOG_WARNING,
    error: syslog.LOG_ERR,
    crit:  syslog.LOG_CRIT,
  }[level]

  syslog.log(sev, entry)
}

// Cleanup on exit
process.on('exit', () => syslog.close())

RFC5424 format over UDP (no native binding)

import dgram from 'dgram'

const SYSLOG_HOST = process.env.SYSLOG_HOST ?? '127.0.0.1'
const SYSLOG_PORT = parseInt(process.env.SYSLOG_PORT ?? '514')
const FACILITY    = 1   // USER
const SEVERITY    = 6   // INFO

function sendSyslog(msg: string): void {
  const pri     = (FACILITY * 8) + SEVERITY
  const ts      = new Date().toISOString()
  const host    = 'yamtam'
  const app     = 'agent'
  const msgid   = '-'
  const structured = '-'
  const packet  = `<${pri}>1 ${ts} ${host} ${app} ${process.pid} ${msgid} ${structured} ${msg}`

  const client  = dgram.createSocket('udp4')
  const buf     = Buffer.from(packet)
  client.send(buf, 0, buf.length, SYSLOG_PORT, SYSLOG_HOST, () => client.close())
}

Bash syslog via logger(1)

# logger is available on all Linux systems
agent_log() {
  local level="$1"; local msg="$2"
  logger -t "yamtam-agent" -p "daemon.${level}" -- "$msg"
}

agent_log info  "session started: $YAMTAM_SESSION_ID"
agent_log warn  "rate limit triggered"
agent_log err   "sandbox exec failed: exit $?"

Anti-Fake-Pass Checklist

❌ syslog.init() not called → all log() calls silently dropped
❌ syslog.close() missing on exit → socket fd leak
❌ Unstructured string → syslog message not parseable by SIEM
❌ LOG_DEBUG in production → syslog flooded with noise, rate-limited
❌ UDP syslog → fire-and-forget, no delivery guarantee (use TCP/TLS for critical)
❌ PII in syslog message → syslog stored on shared system, visible to admins

04 同仓库更多 Skills

Horonomos-laps
Horonomos-laps/Yana-AI

openai--sentry--sentry

Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry API; perform read-only queries with the bundled script and require `SENTRY_AUTH_TOKEN`.

★ 13
Horonomos-laps
Horonomos-laps/Yana-AI

ito-basket-compare

Compare Itô prediction-market baskets against a user's knowledge base, portfolio notes, financial context, watchlist, or research thesis. Use for read-only basket comparison and gap analysis without investment advice or live trading.

★ 13
Horonomos-laps
Horonomos-laps/Yana-AI

implementing-network-traffic-baselining

Build network traffic baselines from NetFlow/IPFIX data using Python pandas for statistical analysis, z-score anomaly detection, and hourly/daily traffic pattern profiling

★ 13
Horonomos-laps
Horonomos-laps/Yana-AI

detecting-evasion-techniques-in-endpoint-logs

Detects defense evasion techniques used by adversaries in endpoint logs including log tampering, timestomping, process injection, and security tool disabling. Use when investigating suspicious endpoint behavior, building detection rules for evasion tactics, or conducting threat hunting for stealthy adversary activity. Activates for requests involving evasion detection, defense evasion analysis, log tampering detection, or MITRE ATT&CK TA0005.

★ 13
Horonomos-laps
Horonomos-laps/Yana-AI

implementing-microsegmentation-with-guardicore

Implementing microsegmentation using Akamai Guardicore Segmentation to map application dependencies, create granular network policies, visualize east-west traffic flows, and enforce least-privilege communication between workloads across data centers and cloud.

★ 13
Horonomos-laps
Horonomos-laps/Yana-AI

ramdisk-tmpfs-patterns

暂无简介

★ 13