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

[Improve][Zeta] Handle user privacy when submitting a task print config logs #7247

Merged
merged 2 commits into from
Aug 24, 2024

Conversation

hawk9821
Copy link
Contributor

@hawk9821 hawk9821 commented Jul 23, 2024

Purpose of this pull request

Contribution Checklist

#6987
#6980
privacy keywords should be desensitized instead of deleting log prints directly

Does this PR introduce any user-facing change?

How was this patch tested?

tests case: ConfigShadeTest.testUsePrivacyHandler

Check list

@github-actions github-actions bot added the core SeaTunnel core module label Jul 23, 2024
@hawk9821 hawk9821 changed the title [improve] Handle user privacy when submitting a task print configuration logs [improve][seatunnel-client] Handle user privacy when submitting a task print configuration logs Jul 23, 2024
@Hisoka-X
Copy link
Member

cc @EricJoy2048 @chl-wxp


/** Used to build the {@link Config} from config file. */
@Slf4j
public class ConfigBuilder {

public static final ConfigRenderOptions CONFIG_RENDER_OPTIONS =
ConfigRenderOptions.concise().setFormatted(true);
public static List<String> KEYWORDS =
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure whether we need this feature as different key names need to be maintained

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it is necessary to print the configuration log for easy troubleshooting. We can start by maintaining generic keywords such as "password" and "secret".

Copy link
Member

Choose a reason for hiding this comment

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

how about reuse

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

configure privacy keywords in seatunnel's profile,i will modified.

Comment on lines 41 to 46
<dependency>
<groupId>org.apache.seatunnel</groupId>
<artifactId>seatunnel-engine-common</artifactId>
<version>${project.version}</version>
</dependency>

Copy link
Member

Choose a reason for hiding this comment

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

-1. we should not include this dependency. The starter for all engine, not only for zeta.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

get

return config;
}

public static Map<String, Object> privacyHandler(Map<String, Object> configMap) {
List<String> logPrivacyKeyword = seaTunnelConfig.getEngineConfig().getLogPrivacyKeyword();
Copy link
Member

Choose a reason for hiding this comment

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

Please just use

as value for now.

Copy link
Member

Choose a reason for hiding this comment

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

@@ -22,6 +22,7 @@ seatunnel:
queue-type: blockingqueue
print-execution-info-interval: 60
print-job-metrics-info-interval: 60
log-privacy-keyword: username,password,passwd,token,jwt,secret
Copy link
Member

Choose a reason for hiding this comment

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

At this stage, there is no need to introduce this parameter, because the configuration printing config is effective for all engines, but this configuration file is only used for zeta.

@github-actions github-actions bot removed the Zeta label Aug 15, 2024
@hawk9821 hawk9821 force-pushed the logPrivacy branch 2 times, most recently from b3bb458 to 20a28d2 Compare August 21, 2024 03:00
return config;
}

public static Map<String, Object> privacyHandler(Map<String, Object> configMap) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public static Map<String, Object> privacyHandler(Map<String, Object> configMap) {
public static Map<String, Object> configDesensitization(Map<String, Object> configMap) {

@Hisoka-X Hisoka-X changed the title [improve][seatunnel-client] Handle user privacy when submitting a task print configuration logs [Improve][Zeta] Handle user privacy when submitting a task print config logs Aug 21, 2024
@github-actions github-actions bot added the Zeta label Aug 22, 2024
@hawk9821 hawk9821 force-pushed the logPrivacy branch 3 times, most recently from 38713f6 to 7e63669 Compare August 23, 2024 05:38
…ion logs

[improve] Handle user privacy when submitting a task print configuration logs

[improve] Handle user privacy when submitting a task print configuration logs

[improve] Handle user privacy when submitting a task print configuration logs

[improve] Handle user privacy when submitting a task print configuration logs

[improve] Handle user privacy when submitting a task print configuration logs

[improve] Handle user privacy when submitting a task print configuration logs

[improve] Handle user privacy when submitting a task print configuration logs

[improve] Handle user privacy when submitting a task print configuration logs

[improve] Handle user privacy when submitting a task print configuration logs

[improve] Handle user privacy when submitting a task print configuration logs

[improve] Handle user privacy when submitting a task print configuration logs

[improve] Handle user privacy when submitting a task print configuration logs

[improve] Handle user privacy when submitting a task print configuration logs
Copy link
Member

@Hisoka-X Hisoka-X left a comment

Choose a reason for hiding this comment

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

LGTM if ci passes. Thanks @hawk9821

@Hisoka-X Hisoka-X added this to the 2.3.8 milestone Aug 24, 2024
@hailin0 hailin0 merged commit 6145da9 into apache:dev Aug 24, 2024
5 checks passed
hawk9821 added a commit to hawk9821/seatunnel that referenced this pull request Aug 29, 2024
hawk9821 added a commit to hawk9821/seatunnel that referenced this pull request Aug 29, 2024
@hawk9821 hawk9821 deleted the logPrivacy branch September 12, 2024 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants