<div dir="ltr">Hello,<div><br><div>I am currently looking into how to remove sensitive information from JFR events. The main events that typically contain sensitive information: jdk.SystemProcess,  jdk.InitialSystemProperty, jdk.JVMInformation. Passwords from command lines can typically be found in these events.</div><div><p></p><p>Dropping these events altogether is not ideal, as we need them to make relevant performance recommendations to users (e.g. suggesting JVM or system setting adjustments).</p><p></p><p>Dropping them or scrubbing them on the backend side (after the fact) requires decompressing and re-writing these events, which is wasteful in terms of both compute and storage. The approach is not perfect, as we still end up intaking and temporarily storing sensitive information.</p><p></p><p>Ideally, we would like to be able to scrub or redact only the sensitive fields within these events (for example, using a simple regex or pattern-based rule), rather than dropping the whole event. We also want to avoid handling this only after the event has already been written to the JFR file, as that does not fully mitigate the risk of exposing sensitive data.</p><p></p><p>At present, it appears there is no public API or supported mechanism to intercept or scrub JFR events in-process, before they are persisted. What would you think of an API accepting custom scrubbing patterns so that sensitive data never leaves the JVM in an unredacted state?</p><p></p><p>Are there any plans or discussions in this area? I am fairly new to the JFR world, so it is likely that I missed previous discussions around this.</p><p></p><p>Thank you, Best regards,</p><p>Erwan Viollet, <br></p><p>Profiling team, Datadog</p></div></div></div>