-
Notifications
You must be signed in to change notification settings - Fork 7
912 better method for making sure jsonschema logging does not dump pii into logs #949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
jaydeepsingh25
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too many issues, I will try to summarize everthying here:
- Please make sure your source branch is in sync with main branch. Currently it is reverting a lot of code in main branch (Microservices Queue changes, healthchecks, text-followup preprocessor and handler)
- There should be no changes in build.yml and docker compose files (other than setting logging env variable)
- No change in dockerfiles apart from copying config folder
- For the preprocessors/handlers where are setting debug log level, need to make sure we are not removing it - need to confirm if it still prints debug statements if you set log level to PII
Please feel free to raise a new PR if that's easier for you - just make sure you don't change any other code which is not related to logging!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we removing text-followup preprocessor and handler?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, these should not removed from docker compose
| text-followup: | ||
| environment: | ||
| LOG_PII: "true" | ||
| - SERVER_NAME=unicorn.cim.mcgill.ca |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we set PII_LOGGING_ENABLED true here?
| # Copy the build output from the previous stage to the Nginx HTML directory | ||
| COPY --from=build /app/dist/editor/ /usr/share/nginx/html | ||
|
|
||
| # Add a static health check file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep health checks
| COPY /handlers/high-charts/ /usr/src/app | ||
| RUN npm ci | ||
|
|
||
| COPY /handlers/high-charts/package*.json ./ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line is not required
| EXPOSE 8080 | ||
|
|
||
| USER node | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add back healthcheck
| if (data["preprocessors"] === undefined) { | ||
| data["preprocessors"] = {}; | ||
| } | ||
| let currentPriorityGroup: number | undefined = undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add back this code
| configure_logging() | ||
|
|
||
| app = Flask(__name__) | ||
| logging.basicConfig(level=logging.DEBUG) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, just confirm if removing this will still log debug statements?
| "ajv": "^8.9.0", | ||
| "express": "^4.19.2", | ||
| "uuid": "^8.3.2" | ||
| "node-fetch": "^2.7.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are adding extra packages and they are not related to logging.
sure you still need them?
| @@ -1,6 +1,6 @@ | |||
| FROM pytorch/pytorch:1.12.1-cuda11.3-cudnn8-runtime | |||
|
|
|||
| RUN apt-get update && apt-get install -y libsndfile1 espeak-ng build-essential curl && rm -rf /var/lib/apt/lists/* | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add back healthchecks
Please ensure you've followed the checklist and provide all the required information before requesting a review.
If you do not have everything applicable to your PR, it will not be reviewed!
If you don't know what something is or if it applies to you, ask!
Don't delete below this line.
Required Information
I referenced the issue addressed in this PR. --> Currently, logging behavior is not properly differentiated between Unicorn and Pegasus. This leads to unnecessary and potentially sensitive logs appearing in production. The goal of this PR is to ensure that:
Unicorn logs can be more verbose and include detailed error messages for debugging, including what may constitute PII-related logging, particularly when errors are thrown.
Pegasus logs are minimal, avoiding unnecessary verbosity particularly when errors are thrown.
I described the changes made and how these address the issue. --> configured logging_utils.ts and logging_utils.py to handle PII logging separately for Unicorn and Pegasus.
I described how I tested these changes. --> verified that logs correctly identify whether the service is running in Unicorn (PII logging enabled) or Pegasus (PII logging disabled). toggled the
to discern output for pegasus/unicorn. Next, need to address how it will be picked up if pii logging is enabled.
Coding/Commit Requirements
New Component Checklist (mandatory for new microservices)
docker-compose.ymlandbuild.yml..github/workflows. --> I updated the workflows to copy the config directory, which contains the script for PII logging, to ensure it is available during the build process; before,config/logging_utils.tswasn’t found, breaking the build. (Similar to copying schemas likerun: cp -R ../../schemas src/)README.mdfile that describes what the component does and what it depends on (other microservices, ML models, etc.).OR