Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 40376200CCB for ; Thu, 20 Jul 2017 14:09:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3EB3A16B2B1; Thu, 20 Jul 2017 12:09:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5BE6216B2AB for ; Thu, 20 Jul 2017 14:09:07 +0200 (CEST) Received: (qmail 72804 invoked by uid 500); 20 Jul 2017 12:09:06 -0000 Mailing-List: contact dev-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cayenne.apache.org Delivered-To: mailing list dev@cayenne.apache.org Received: (qmail 72789 invoked by uid 99); 20 Jul 2017 12:09:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Jul 2017 12:09:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 4B5251A1BFA for ; Thu, 20 Jul 2017 12:09:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.379 X-Spam-Level: ** X-Spam-Status: No, score=2.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id WCCmu2pIYzK8 for ; Thu, 20 Jul 2017 12:08:59 +0000 (UTC) Received: from mail-ua0-f170.google.com (mail-ua0-f170.google.com [209.85.217.170]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 09AE75F5B3 for ; Thu, 20 Jul 2017 12:08:59 +0000 (UTC) Received: by mail-ua0-f170.google.com with SMTP id 80so21364154uas.0 for ; Thu, 20 Jul 2017 05:08:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=allXOKccLtIZU3gr/Q85+ncGMGA9CkMdt4C6CbagGQ8=; b=uTXJmqxxBxBgc5oWSFycpwvcadiAeLyfi0J1++p59S5Zv/D4TfvxXKGxEwT/XvZaRy cTuF/kPyLPCs+6Im3Z7IZh7eIGddlqK5i5vlx83Sxzpa3GqIx/8mvYMApyOaChKigKjJ 51yA1sEkNvaPlthFBy6EqjtbmpOzpSIYPhQSAvp8Vvs/N7egkMeEHHdLAf48bKJyT9zK tH/5xnpyCN/mK/229lXph/yfbxu8T+xbl7ZDORQz0pQrAolEo5lGEtydy+1oCrZ3M5tZ IUIT2BGoAqlDDzut7svNY1TQYuBH41vkZSpAmcxM79kmFazNTtUUxvRMhPGDecdMIVw0 Nhjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=allXOKccLtIZU3gr/Q85+ncGMGA9CkMdt4C6CbagGQ8=; b=XVFnR4ZhTzIligfbC561BRh72L9vY7cigQDDx99QMsvQBRu3MSJkMvFqai97eFg/Pe 1wMjuPBz1n4uTyfVoN+UJ+HvJHR7qL99PjabbmavLx/1cFoR58o23lNlw3hvJcF4Z74E v0QOnvvul4YCUnV1aevCgFoRQpjsTVd/PEkZ30AFRjTaRV5V6oHE5IiihukVcQwvzJ1j 3A8Ec3bMVPNRc3BcyQwAQ4/v2krxK0bJdVCOjjrqIlXcvCnOBz/x1kFxN8L5s8qDuQee xmdKbKduM8vgAl8is/miIA280Cr3kd5AJA1TUt7v0O1AZ09keuXgTD2EnJx+HGxkw0pg U6qg== X-Gm-Message-State: AIVw113y68m1bHhqc4z01rr73lsdzGylBqa8IL8RcfOXhb4mRPjq1Xca JHsnAk2PaPhc8ta+8n8N+Wwfu06blQ== X-Received: by 10.176.23.104 with SMTP id k40mr1668316uaf.77.1500552538329; Thu, 20 Jul 2017 05:08:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.102.67 with HTTP; Thu, 20 Jul 2017 05:08:27 -0700 (PDT) In-Reply-To: References: <8EDE83B4-CB4F-4B17-A4FD-9F25984B8947@objectstyle.org> From: Michael Gentry Date: Thu, 20 Jul 2017 08:08:27 -0400 Message-ID: Subject: Re: Sensitive Logging To: Cayenne Development Content-Type: multipart/alternative; boundary="f403043620840395d30554be9da5" archived-at: Thu, 20 Jul 2017 12:09:08 -0000 --f403043620840395d30554be9da5 Content-Type: text/plain; charset="UTF-8" Yes, that would be nice. I've given it a little thought in the new modeler I've started, but only a little. Probably at least two extension points needed: 1) Completely separate window (the easiest). 2) Access to existing editors (much harder and more fragile if the UI layout changes). Perhaps I should give it some more thought and make the current editors themselves plugins... On Thu, Jul 20, 2017 at 7:57 AM, Nikita Timofeev wrote: > Best way to have everything needed in the Modeler is to support plugins :) > Though it won't be an easy task to properly create plugin model (at > least in current Modeler) > > On Thu, Jul 20, 2017 at 2:06 PM, Michael Gentry > wrote: > > That'll be something for me to look into. > > > > That said, I'll throw out a pro-CM argument to see what people think. > > > > Maybe I'm odd, but I keep CM open quite often when I'm working because it > > gives a good overall view of my data object layer. A concise > > presentation. When we push more things to code and other configuration > > files, it becomes more of a mental burden, at least for me, to bounce > > between lots of different and often bloated sources to track things down. > > I understand the desire to keep CM from becoming too bloated, but I also > > think CM provides a lot of value, too. > > > > Thanks, > > > > mrg > > > > > > On Wed, Jul 19, 2017 at 10:46 AM, Nikita Timofeev < > ntimofeev@objectstyle.com > >> wrote: > > > >> Hi Michael, > >> > >> Yes I have some new code for extension mechanics in project's XML, it > >> can store and load arbitrary data along with model and do it in such > >> way that it can be totally disabled at runtime. > >> It's used as a proof of concept to store comments and reverse > >> engineering config. > >> > >> But in your case it's really better to create new JdbcLogging > >> implementation that can skip some attributes defined by pluggable > >> strategy as suggested by Andrus. > >> > >> On Wed, Jul 19, 2017 at 3:49 PM, Michael Gentry > >> wrote: > >> > I'll look forward to seeing what is introduced. Ultimately, there > aren't > >> > that many sensitive fields in an application and a pluggable module to > >> > obscure those fields would likely be fine. > >> > > >> > > >> > On Wed, Jul 19, 2017 at 8:41 AM, Andrus Adamchik < > andrus@objectstyle.org > >> > > >> > wrote: > >> > > >> >> Hi Mike, > >> >> > >> >> While I totally support solving this problem, I am not keen on > >> overloading > >> >> the core model with extra properties. We had this discussion under > few > >> >> different subjects, but it really comes down to the fact that there > can > >> be > >> >> an infinite number of meanings one can associate with their model > >> >> attributes (e.g. cayenne-crypto treats certain attributes as > encrypted; > >> a > >> >> serialization framework may treat certain attributes as transient, > etc., > >> >> etc.). We just can't support all these things in the core. So I > suggest > >> >> that we don't. > >> >> > >> >> Instead we may design this as an extension that can work on top of > the > >> >> core model. Kind of like cayenne-crypto, that determines which > columns > >> need > >> >> to be encrypted not from the DataMap, but using a pluggable strategy > >> >> (column naming convention by default). > >> >> > >> >> Also in 4.1 we will have a much more flexible model extension > mechanism, > >> >> which Nikita is about to present. All those requests that we had over > >> the > >> >> years of adding model comments and other arbitrary metadata will > likely > >> be > >> >> fulfilled soon. So it will be easier to write extensions like the one > >> you > >> >> propose. > >> >> > >> >> Andrus > >> >> > >> >> > >> >> > >> >> > On Jul 19, 2017, at 3:28 PM, Michael Gentry > >> wrote: > >> >> > > >> >> > Right now, everything is logged. It would be useful to be able to > >> >> > configure certain column values to not be logged, especially in a > >> >> > production environment. The main use case for this would be PII > >> >> > (Personally Identifiable Information -- passwords, birthdays, > social > >> >> > security numbers, etc). Arguably, that information should be > >> >> > hashed/encrypted, but it is still not something you'd want leaked > >> into a > >> >> > log file. Whenever a value isn't to be logged, put "[skipped]" in > the > >> >> log > >> >> > output. > >> >> > > >> >> > I think it should work something like this: > >> >> > > >> >> > DataMap: > >> >> > > >> >> > Add a "Sensitive Logging" checkbox. Perhaps right under the > >> "Optimistic > >> >> > Logging" checkbox. Default = ON. > >> >> > > >> >> > > >> >> > DbEntity / Entity Tab: > >> >> > > >> >> > Add a "Sensitive Logging" checkbox (basically mirroring the > ObjEntity > >> >> > "Optimistic Logging" checkbox). Default = ON. > >> >> > > >> >> > > >> >> > DbEntity / Attributes Tab: > >> >> > > >> >> > Add a "Sensitive Logging" checkbox column (beside PK and > Mandatory). > >> >> > Default = OFF. (OFF means log the value normally. ON means > >> >> conditionally > >> >> > log per behavior below). > >> >> > > >> >> > > >> >> > Upgrading older models: > >> >> > > >> >> > Default DataMap and DbEntity to ON. Leave DbEntity attributes OFF. > >> >> > > >> >> > > >> >> > Behavior: > >> >> > > >> >> > skipped = > >> >> > DataMap.ON && > >> >> > DbEntity.Entity.ON && > >> >> > DbEntity.Entity.Attribute.ON && > >> >> > Log.Level > DEBUG > >> >> > > >> >> > if skipped > >> >> > log [skipped] > >> >> > else > >> >> > log value > >> >> > > >> >> > > >> >> > In a production environment, log levels are typically > >> >> > INFO/WARN/ERROR/FATAL, so factor that into the skipping equation. > When > >> >> > developing, log levels are typically DEBUG/TRACE, and in that case, > >> log > >> >> the > >> >> > value. > >> >> > > >> >> > Also, given that all of the above can be changed at run-time, it > >> allows > >> >> > flexibility in a production environment to turn the sensitive > logging > >> >> > on/off through admin interfaces should the need arise. > >> >> > > >> >> > Thoughts? > >> >> > > >> >> > Thanks, > >> >> > > >> >> > mrg > >> >> > >> >> > >> > >> > >> > >> -- > >> Best regards, > >> Nikita Timofeev > >> > > > > -- > Best regards, > Nikita Timofeev > --f403043620840395d30554be9da5--