-
Notifications
You must be signed in to change notification settings - Fork 159
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
Filter build-info and modules properties #716
Conversation
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 don't merge this code before my final approval. I want to go through it again.
build-info-extractor/src/main/java/org/jfrog/build/extractor/BuildInfoExtractorUtils.java
Outdated
Show resolved
Hide resolved
build-info-extractor/src/main/java/org/jfrog/build/extractor/BuildInfoExtractorUtils.java
Outdated
Show resolved
Hide resolved
...fo-extractor/src/main/java/org/jfrog/build/extractor/clientConfiguration/PatternMatcher.java
Outdated
Show resolved
Hide resolved
...fo-extractor/src/main/java/org/jfrog/build/extractor/clientConfiguration/PatternMatcher.java
Show resolved
Hide resolved
...fo-extractor/src/main/java/org/jfrog/build/extractor/packageManager/PackageManagerUtils.java
Outdated
Show resolved
Hide resolved
...xtractor/src/test/java/org/jfrog/build/extractor/packageManager/PackageManagerUtilsTest.java
Outdated
Show resolved
Hide resolved
...xtractor/src/test/java/org/jfrog/build/extractor/packageManager/PackageManagerUtilsTest.java
Outdated
Show resolved
Hide resolved
...fo-extractor/src/main/java/org/jfrog/build/extractor/packageManager/PackageManagerUtils.java
Outdated
Show resolved
Hide resolved
private static final String apiKeySecretPrefix = "AKCp8"; | ||
private static final int apiKeySecretMinimalLength = 73; | ||
private static final String referenceTokenSecretPrefix = "cmVmdGtuOjAxOj"; | ||
private static final int referenceTokenSecretMinimalLength = 64; |
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.
I almost sure that reference tokens are 64 characters fixed
@@ -107,16 +114,10 @@ public static Properties stripPrefixFromProperties(Properties source, String pre | |||
} | |||
|
|||
public static Properties getEnvProperties(Properties startProps, Log log) { | |||
IncludeExcludePatterns patterns = new IncludeExcludePatterns( |
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.
Removing the filtering code from this method sounds very risky to me. Let's do the "get" and the "filter" logic in one place to enforce filtering in all flows.
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.
I understand the concern, but this is not the place to do filtering. According to the name of this function, it returns all environment variables. By moving the filter logic to a new location, we can filter not only the environment variables, but also modules. Putting the filter logic here would prevent us from filtering things unrelated to environment variables, so we would have to split the logic across the code, and that will cause a mess in the code.
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.
Due to security risks, we will return the filter logic to here despite the above comment .
Prior to this PR, build-info properties were filtered only for environment variables and system properties.
The PR moves all filter logic into one place and performs exclude/include logic for all properties, including:
buildInfo.env
prefix)