Skip to content
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

packaging: setup: Filter from logs secrets from otopi answer files #585

Merged
merged 1 commit into from
Aug 24, 2022

Conversation

didib
Copy link
Member

@didib didib commented Aug 11, 2022

When running engine-setup with an answer file generated by a previous
interactive engine-setup, without this patch, we log some secrets
unfiltered. Fix this:

  • Require a new otopi that provides LOG_FILTER_QUESTIONS.

  • Add an attribute 'asked_on' for constants. If a constant is_secret,
    require setting asked_on, to a list of question names that might
    change/set it.

  • Add a field CREDS_Q_NAME_FUNC to the various *DB_ENV_KEYS. This field
    should point at a function that should return the question name for a
    particular field.

  • Change getCredentials to not get a parameter queryprefix for
    constructing the question names, instead relying on CREDS_Q_NAME_FUNC.

  • Add functions *question_name for both passing as CREDS_Q_NAME_FUNC and
    for asked_on.

  • And finally: Patch filter_secrets.py to also loop over all the
    constants that set is_secret, and add their asked_on to
    env[LOG_FILTER_QUESTIONS]. This makes otopi filter out all the answers
    provided for these questions in answer files.

Change-Id: Ibaca2a03f2020750f96ae30a3448ea2ad17fe43c
Signed-off-by: Yedidyah Bar David didi@redhat.com

Copy link
Member

@mwperina mwperina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@didib
Copy link
Member Author

didib commented Aug 11, 2022

Sorry, not ready yet.

@didib didib force-pushed the filter-otopi-answer-file-secrets branch 2 times, most recently from cb139ac to a0ff8b4 Compare August 11, 2022 09:01
@didib didib force-pushed the filter-otopi-answer-file-secrets branch 2 times, most recently from 8dd3446 to 8ebd1dd Compare August 11, 2022 11:54
didib added a commit to didib/ovirt-engine-keycloak that referenced this pull request Aug 11, 2022
didib added a commit to didib/ovirt-dwh that referenced this pull request Aug 11, 2022
For details, see oVirt/ovirt-engine#585 .

Change-Id: Ided28013bc854474dc18ec4dfd4e20884945f86c
Signed-off-by: Yedidyah Bar David <didi@redhat.com>
@didib didib force-pushed the filter-otopi-answer-file-secrets branch from 8ebd1dd to 5bb6c78 Compare August 24, 2022 05:57
didib added a commit to didib/ovirt-engine-keycloak that referenced this pull request Aug 24, 2022
When running engine-setup with an answer file generated by a previous
interactive engine-setup, without this patch, we log some secrets
unfiltered. Fix this:

- Require a new otopi that provides LOG_FILTER_QUESTIONS.

- Conflict with older dwh/keycloak that are incompatible with the
changes in getCredentials (see below).

- Add an attribute 'asked_on' for constants. If a constant is_secret,
require setting asked_on, to a list of question names that might
change/set it.

- Add a field CREDS_Q_NAME_FUNC to the various *DB_ENV_KEYS. This field
should point at a function that should return the question name for a
particular field.

- Change getCredentials to not get a parameter queryprefix for
constructing the question names, instead relying on CREDS_Q_NAME_FUNC.

- Add functions *question_name for both passing as CREDS_Q_NAME_FUNC and
for asked_on.

- And finally: Patch filter_secrets.py to also loop over all the
constants that set is_secret, and add their asked_on to
env[LOG_FILTER_QUESTIONS]. This makes otopi filter out all the answers
provided for these questions in answer files.

Change-Id: Ibaca2a03f2020750f96ae30a3448ea2ad17fe43c
Signed-off-by: Yedidyah Bar David <didi@redhat.com>
@didib didib force-pushed the filter-otopi-answer-file-secrets branch from 5bb6c78 to cb4f5c7 Compare August 24, 2022 12:12
@didib
Copy link
Member Author

didib commented Aug 24, 2022

Conflict with older dwh/keycloak that are incompatible with current patch's getCredentials.

didib added a commit to didib/ovirt-engine-keycloak that referenced this pull request Aug 24, 2022
mwperina pushed a commit to oVirt/ovirt-dwh that referenced this pull request Aug 24, 2022
For details, see oVirt/ovirt-engine#585 .

Change-Id: Ided28013bc854474dc18ec4dfd4e20884945f86c
Signed-off-by: Yedidyah Bar David <didi@redhat.com>
mwperina pushed a commit to oVirt/ovirt-engine-keycloak that referenced this pull request Aug 24, 2022
@didib didib merged commit be73877 into oVirt:master Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants