Logging

From RedHatProductSecurity/prodsec-skills · View interactive version

Logging is an AI agent skill from the GitHub repository RedHatProductSecurity/prodsec-skills. Enforce logging of access to sensitive external data sources in AI systems. Use when designing, building, or reviewing audit and logging capabilities for AI systems accessing external databases or data services.

How to use this skill

Skill file

Logging for External Data Source Access

Security Requirement

If the data contained and served by external data sources is sensitive, accesses to them MUST be logged. The product SHOULD have the functionality to send these events to an external logging facility using industry standards.

What to Log

| Event | Details to Capture |

|---|---|

| Data access | Who accessed what data, when, from where |

| Data modification | Who modified what data, what changed |

| Access denial | Failed access attempts (authentication or authorization failures) |

| Bulk operations | Large data exports or queries |

| Connection events | Connection establishment and teardown |

| Schema changes | Structural changes to data sources |

Logging Requirements

| Requirement | Details |

|---|---|

| External logging facility | Logs must be sendable to an external SIEM or logging platform |

| Industry standard protocols | Use syslog, OTLP, Fluentd, or equivalent |

| Structured format | JSON with consistent field names |

| Principal identity | Every log entry includes the authenticated principal |

| Configurable | Customers must be able to configure the external log destination |

| Non-repudiation | Logs should not be modifiable by the application |

Log Safety

| Rule | Rationale |

|---|---|

| No secrets in logs | Credentials, API keys, and session tokens must never appear in log output |

| No PII in logs | Personally identifiable information creates compliance and privacy risks |

| No session identifiers | Session IDs in logs can enable session hijacking |

| Log injection prevention | Untrusted input in logs can exploit log viewers (XSS, RCE in parsers); sanitize all values before logging |

| Trusted system logging | Logging controls must run on a trusted system (server-side), not client-side |

What to Log

Log both success and failure of security events:

Log Transport

Implementation Checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.