-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adapt git-authentication enhancements
Signed-off-by: Christian Kotzbauer <[email protected]>
- Loading branch information
1 parent
a8e1cd3
commit de8fc72
Showing
10 changed files
with
83 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,9 @@ | ||
FROM alpine:3.16@sha256:bc41182d7ef5ffc53a40b044e725193bc10142a1243f395ee852a8d9730fc2ad as alpine | ||
|
||
ARG TARGETARCH | ||
|
||
RUN set -eux; \ | ||
apk add -U --no-cache ca-certificates | ||
|
||
|
||
FROM scratch | ||
FROM ghcr.io/ckotzbauer/distroless-git-slim | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY dist/vulnerability-operator_${TARGETOS}_${TARGETARCH}*/vulnerability-operator /usr/local/bin/vulnerability-operator | ||
COPY hack/git-ask-pass.sh /usr/local/bin/git-ask-pass.sh | ||
|
||
ENTRYPOINT ["/usr/local/bin/vulnerability-operator"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
# This script is used as the commaned supplied to GIT_ASKPASS as a way to supply username/password | ||
# credentials to git, without having to use git credentials helpers, or having on-disk config. | ||
case "$1" in | ||
Username*) echo "${GIT_USERNAME}" ;; | ||
Password*) echo "${GIT_PASSWORD}" ;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,49 @@ | ||
package vuln | ||
|
||
type Config struct { | ||
Cron string `yaml:"cron" env:"VULN_CRON" flag:"cron"` | ||
Sources []string `yaml:"sources" env:"VULN_SOURCES" flag:"sources"` | ||
Targets []string `yaml:"targets" env:"VULN_TARGETS" flag:"targets"` | ||
GrypeConfigFile string `yaml:"grypeConfigFile" env:"VULN_GRYPE_CONFIG_FILE" flag:"grype-config-file"` | ||
OnlyFixed bool `yaml:"onlyFixes" env:"VULN_ONLY_FIXED" flag:"only-fixed"` | ||
MinSeverity string `yaml:"minSeverity" env:"VULN_MIN_SEVERITY" flag:"min-severity"` | ||
GitWorkingTree string `yaml:"gitWorkingTree" env:"VULN_GIT_WORKINGTREE" flag:"git-workingtree"` | ||
GitRepository string `yaml:"gitRepository" env:"VULN_GIT_REPOSITORY" flag:"git-repository"` | ||
GitBranch string `yaml:"gitBranch" env:"VULN_GIT_BRANCH" flag:"git-branch"` | ||
GitPath string `yaml:"gitPath" env:"VULN_GIT_PATH" flag:"git-path"` | ||
GitAccessToken string `yaml:"gitAccessToken" env:"VULN_GIT_ACCESS_TOKEN" flag:"git-access-token"` | ||
ReportsDir string `yaml:"reportsDir" env:"VULN_REPORTS_DIR" flag:"reports-dir"` | ||
PodLabelSelector string `yaml:"podLabelSelector" env:"VULN_POD_LABEL_SELECTOR" flag:"pod-label-selector"` | ||
NamespaceLabelSelector string `yaml:"namespaceLabelSelector" env:"VULN_NAMESPACE_LABEL_SELECTOR" flag:"namespace-label-selector"` | ||
Verbosity string `env:"VULN_VERBOSITY" flag:"verbosity"` | ||
Cron string `yaml:"cron" env:"VULN_CRON" flag:"cron"` | ||
Sources []string `yaml:"sources" env:"VULN_SOURCES" flag:"sources"` | ||
Targets []string `yaml:"targets" env:"VULN_TARGETS" flag:"targets"` | ||
GrypeConfigFile string `yaml:"grypeConfigFile" env:"VULN_GRYPE_CONFIG_FILE" flag:"grype-config-file"` | ||
OnlyFixed bool `yaml:"onlyFixes" env:"VULN_ONLY_FIXED" flag:"only-fixed"` | ||
MinSeverity string `yaml:"minSeverity" env:"VULN_MIN_SEVERITY" flag:"min-severity"` | ||
GitWorkingTree string `yaml:"gitWorkingTree" env:"VULN_GIT_WORKINGTREE" flag:"git-workingtree"` | ||
GitRepository string `yaml:"gitRepository" env:"VULN_GIT_REPOSITORY" flag:"git-repository"` | ||
GitBranch string `yaml:"gitBranch" env:"VULN_GIT_BRANCH" flag:"git-branch"` | ||
GitPath string `yaml:"gitPath" env:"VULN_GIT_PATH" flag:"git-path"` | ||
GitAccessToken string `yaml:"gitAccessToken" env:"VULN_GIT_ACCESS_TOKEN" flag:"git-access-token"` | ||
GitUserName string `yaml:"gitUserName" env:"VULN_GIT_USERNAME" flag:"git-username"` | ||
GitPassword string `yaml:"gitPassword" env:"VULN_GIT_PASSWORD" flag:"git-password"` | ||
GitFallbackClone bool `yaml:"gitFallbackClone" env:"VULN_GIT_FALLBACK_CLONE" flag:"git-fallback-clone"` | ||
GitHubAppId string `yaml:"githubAppId" env:"VULN_GITHUB_APP_ID" flag:"github-app-id"` | ||
GitHubAppInstallationId string `yaml:"githubAppInstallationId" env:"VULN_GITHUB_APP_INSTALLATION_ID" flag:"github-app-installation-id"` | ||
GitHubPrivateKey string `yaml:"githubAppPrivateKey" env:"VULN_GITHUB_APP_PRIVATE_KEY"` | ||
ReportsDir string `yaml:"reportsDir" env:"VULN_REPORTS_DIR" flag:"reports-dir"` | ||
PodLabelSelector string `yaml:"podLabelSelector" env:"VULN_POD_LABEL_SELECTOR" flag:"pod-label-selector"` | ||
NamespaceLabelSelector string `yaml:"namespaceLabelSelector" env:"VULN_NAMESPACE_LABEL_SELECTOR" flag:"namespace-label-selector"` | ||
Verbosity string `env:"VULN_VERBOSITY" flag:"verbosity"` | ||
} | ||
|
||
var ( | ||
ConfigKeyCron = "cron" | ||
ConfigKeySources = "sources" | ||
ConfigKeyTargets = "targets" | ||
ConfigKeyGrypeConfigFile = "grype-config-file" | ||
ConfigKeyOnlyFixed = "only-fixed" | ||
ConfigKeyMinSeverity = "min-severity" | ||
ConfigKeyGitWorkingTree = "git-workingtree" | ||
ConfigKeyGitRepository = "git-repository" | ||
ConfigKeyGitBranch = "git-branch" | ||
ConfigKeyGitPath = "git-path" | ||
ConfigKeyGitAccessToken = "git-access-token" | ||
ConfigKeyReportsDir = "reports-dir" | ||
ConfigKeyPodLabelSelector = "pod-label-selector" | ||
ConfigKeyNamespaceLabelSelector = "namespace-label-selector" | ||
ConfigKeyCron = "cron" | ||
ConfigKeySources = "sources" | ||
ConfigKeyTargets = "targets" | ||
ConfigKeyGrypeConfigFile = "grype-config-file" | ||
ConfigKeyOnlyFixed = "only-fixed" | ||
ConfigKeyMinSeverity = "min-severity" | ||
ConfigKeyGitWorkingTree = "git-workingtree" | ||
ConfigKeyGitRepository = "git-repository" | ||
ConfigKeyGitBranch = "git-branch" | ||
ConfigKeyGitPath = "git-path" | ||
ConfigKeyGitAccessToken = "git-access-token" | ||
ConfigKeyGitUserName = "git-username" | ||
ConfigKeyGitPassword = "git-password" | ||
ConfigKeyGitFallbackClone = "git-fallback-clone" | ||
ConfigKeyGitHubAppId = "github-app-id" | ||
ConfigKeyGitHubAppInstallationId = "github-app-installation-id" | ||
ConfigKeyReportsDir = "reports-dir" | ||
ConfigKeyPodLabelSelector = "pod-label-selector" | ||
ConfigKeyNamespaceLabelSelector = "namespace-label-selector" | ||
|
||
OperatorConfig *Config | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters