Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Better control for function logs #463

Open
marktani opened this issue Jan 25, 2018 · 9 comments
Open

Better control for function logs #463

marktani opened this issue Jan 25, 2018 · 9 comments

Comments

@marktani
Copy link
Contributor

marktani commented Jan 25, 2018

Issue by marktani
Thursday Sep 14, 2017 at 08:27 GMT
Originally opened as https://github.com/graphcool/prisma/issues/556


What feature are you missing?

Currently, all functions are logged, including input and output data. This might contain sensitive data. An option to disable or redact logs for a specific function could would be helpful here.

Note that function logs are only accessible to the collaborators of a project.

@marktani
Copy link
Contributor Author

Comment by kbrandwijk
Sunday Oct 29, 2017 at 03:47 GMT


I propose adding a logLevel key to the function definitions in graphcool.yml (verbose, info, warning, error, none)

@marktani
Copy link
Contributor Author

Comment by lastmjs
Wednesday Nov 01, 2017 at 17:47 GMT


It would also be nice to control the number of logs that are returned to the terminal, if your function has thousands of instances then that will be a lot of logs.

@marktani
Copy link
Contributor Author

Comment by Jannis
Monday Nov 06, 2017 at 14:02 GMT


I guess one question is where sensitive information can appear in the system. I'd argue that in most cases it is either part of mutations (e.g. sensitive variables such as a password passed to a mutation such as signupUser) and query results (e.g. specific model attributes being returned).

CI systems like Travis allow you to mark environment vars as private and then they substitute them with their names in logging output. Of course we're not dealing with env vars here. But still, is there some feasible way to annotate the attributes and function parameters in the GraphQL schema to mark them as private? The Graphcool service could then substitute such attributes/variables with something non-sensitive.

@marktani
Copy link
Contributor Author

Comment by kbrandwijk
Monday Nov 06, 2017 at 14:08 GMT


@Jannis I think it's a great idea to mark fields as sensitive in your schema, and in resolver function parameters.

type User @model {
   id: ID!
   bankAccount: String @private
}

And:

type SignInPayload {
  id: ID!
  token: String! @private
}

extend type Query {
   signIn(username: String!, password: String! @private): SignInPayload
}

Attribute could be named @private, @sensitive or whatever.

@marktani marktani changed the title [CLOSED] Better control for function logs Better control for function logs Jan 25, 2018
@apertureless
Copy link

Hey @marktani,
any updates on this?

In my mind this is quite critical, as sensitive user data like, passwords are stored unencrypted. Which will be problematic with the GDPR coming in may. And is in general a high security issue.

Especially because a lot of people are using the email-password auth templates.

@vutran
Copy link

vutran commented Apr 17, 2018

Seems like this need to be escalated. The @Private directive seems to be an ideal solution.

@omnibrain
Copy link

While I like the idea of marking certain fields as private I would still like to reduce the logging to error messages on production systems. I would even disable the super verbose logging by default for NODE_ENV=production

@traviscrist
Copy link

Couldn't prisma simply move to using debug for logging so that the user of prisma can expose prisma logs if they choose to or not via filtering. To debug prisma it would be as simple as adding DEBUG=prisma* or to remove prisma logs it could be DEBUG=-prisma assuming debug was used as require('debug')('prisma')

Its a dependency of bigger projects so using debug would just make sense and not require lots of changes on the prisma side. I don't need every query prima does logged in my production logs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

5 participants