Title: feat: Add structured audit logging for MCP feature server by SIDDHESH1564 · Pull Request #6456 · feast-dev/feast · GitHub
Open Graph Title: feat: Add structured audit logging for MCP feature server by SIDDHESH1564 · Pull Request #6456 · feast-dev/feast
X Title: feat: Add structured audit logging for MCP feature server by SIDDHESH1564 · Pull Request #6456 · feast-dev/feast
Description: What this PR does / why we need it: This PR adds structured audit logging in JSONL format for the Python MCP feature server. Previously, the MCP integration only logged startup events and errors. Operators did not have a unified audit trail for MCP tool calls, internal REST requests, authentication results, authorization decisions, or request correlation. This change introduces an audit_logging configuration section under feature_server and adds structured audit events for: MCP tool invocations MCP JSON-RPC requests REST endpoint requests Authentication outcomes Authorization decisions Request correlation through X-Request-Id Client IP address and transport metadata Each audit event follows a stable schema and includes: event_type UTC timestamp request_id principal (username, roles, and auth_type) source (ip and transport) action (MCP tool name and/or HTTP path) resource (type, name, and permitted actions) outcome duration_ms Sensitive data is intentionally excluded from audit logs. Tokens, entity rows, feature values, and request payloads are not logged. Audit logging layers Layer Scope Event types McpAuditMiddleware /mcp JSON-RPC requests mcp.tools.call, mcp.request AuditLoggingMiddleware REST endpoints such as /get-online-features and /push http.request AuditLogger helpers Authentication and authorization hooks authn.success, authn.failure, authz.decision New files sdk/python/feast/audit/audit_logger.py Adds the AuditEvent model. Adds sink abstractions: StdoutAuditSink, FileAuditSink, and LoggerAuditSink. Adds AuditLogger helper methods for MCP, HTTP, authentication, and authorization events. sdk/python/feast/audit/audit_middleware.py Adds AuditLoggingMiddleware for REST endpoint auditing. Adds McpAuditMiddleware for MCP JSON-RPC request auditing. Modified files sdk/python/feast/infra/feature_servers/base_config.py Adds AuditLoggingConfig to BaseFeatureServerConfig. sdk/python/feast/feature_server.py Initializes the audit logger lifecycle. Wires the audit middleware into get_app(). Example configuration feature_server: type: mcp mcp_enabled: true audit_logging: enabled: true sink: stdout # stdout | file | logger # file_path: /var/log/feast_audit.jsonl log_successful_reads: true Example JSONL event { "event_type": "mcp.tools.call", "timestamp": "2026-05-28T12:00:00.000Z", "request_id": "...", "principal": { "username": "jane@co.com", "roles": ["reader"], "auth_type": "oidc" }, "source": { "ip": "10.0.0.1", "transport": "mcp-http" }, "action": { "mcp_tool": "get_online_features", "path": "/mcp" }, "outcome": "success", "duration_ms": 42.0 } Which issue(s) this PR fixes: Fixes #6452 Checks I've made sure the tests are passing. My commits are signed off (git commit -s) My PR title follows conventional commits format Testing Strategy Unit tests Integration tests Manual tests Testing is not required for this change Added 37 unit tests covering: AuditEvent serialization in JSONL format, including exclusion of None values AuditLogger helpers: log_mcp_call log_http_request log_authn log_authz Suppression of successful read events when log_successful_reads: false All supported sinks: StdoutAuditSink FileAuditSink LoggerAuditSink create_audit_logger_from_config factory behavior and fallback handling AuditLoggingConfig validation and inheritance through McpFeatureServerConfig AuditLoggingMiddleware behavior: HTTP request logging Health and MCP route skipping Error outcomes X-Request-Id propagation Resource mapping McpAuditMiddleware behavior: MCP tool-call extraction from JSON-RPC request bodies Generic MCP request logging Non-JSON request-body handling Misc audit_logging is defined on BaseFeatureServerConfig, making it available to both local and MCP feature server types. Principal metadata is extracted from the existing SecurityManager context and supports no_auth, oidc, and kubernetes authentication modes. Registry MCP parity and an OpenTelemetry sink are intentionally left as follow-up improvements, as noted in the linked issue.
Open Graph Description: What this PR does / why we need it: This PR adds structured audit logging in JSONL format for the Python MCP feature server. Previously, the MCP integration only logged startup events and errors. O...
X Description: What this PR does / why we need it: This PR adds structured audit logging in JSONL format for the Python MCP feature server. Previously, the MCP integration only logged startup events and errors. O...
Opengraph URL: https://github.com/feast-dev/feast/pull/6456
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ca63485a-f06f-237e-2ef3-8f9e1f20e004 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BE04:BC38B:30897C:433319:6AFE99CD |
| html-safe-nonce | 30a5241736ace401be0eb86d88c1a798d5d833a778887abf95b1ace80ce54abb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTA0OkJDMzhCOjMwODk3Qzo0MzMzMTk6NkFGRTk5Q0QiLCJ2aXNpdG9yX2lkIjoiMzAwMzkyMDA2NTg1NTY1ODQ0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 15cd34854a78e430f484770e31f76fa6b49a0eaac6b0af79dd361f648198ae37 |
| hovercard-subject-tag | pull_request:3774542656 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/feast-dev/feast/pull/6456/files |
| twitter:image | https://avatars.githubusercontent.com/u/91747482?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/91747482?s=400&v=4 |
| og:image:alt | What this PR does / why we need it: This PR adds structured audit logging in JSONL format for the Python MCP feature server. Previously, the MCP integration only logged startup events and errors. O... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/feast-dev/feast git https://github.com/feast-dev/feast.git |
| octolytics-dimension-user_id | 57027613 |
| octolytics-dimension-user_login | feast-dev |
| octolytics-dimension-repository_id | 161133770 |
| octolytics-dimension-repository_nwo | feast-dev/feast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161133770 |
| octolytics-dimension-repository_network_root_nwo | feast-dev/feast |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width