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

Database password is stored in Configmap as clear text #111

Closed
darend opened this issue Dec 7, 2018 · 4 comments · Fixed by #331
Closed

Database password is stored in Configmap as clear text #111

darend opened this issue Dec 7, 2018 · 4 comments · Fixed by #331
Labels
help wanted Extra attention is needed target/1.2.0

Comments

@darend
Copy link
Contributor

darend commented Dec 7, 2018

The password for the clair and notary databases are stored in a Configmap as clear text. It should be stored as Secret for security.

A template is used to construct the postgres URL with the password:

{{- define "harbor.database.clair" -}}
postgres://{{ template "harbor.database.username" . }}:{{ template "harbor.database.rawPassword" . }}@{{ template "harbor.database.host" . }}:{{ template "harbor.database.port" . }}/{{ template "harbor.database.clairDatabase" . }}?sslmode={{ template "harbor.database.sslmode" . }}
{{- end -}}
{{- define "harbor.database.notaryServer" -}}
postgres://{{ template "harbor.database.username" . }}:{{ template "harbor.database.rawPassword" . }}@{{ template "harbor.database.host" . }}:{{ template "harbor.database.port" . }}/{{ template "harbor.database.notaryServerDatabase" . }}?sslmode={{ template "harbor.database.sslmode" . }}
{{- end -}}
{{- define "harbor.database.notarySigner" -}}
postgres://{{ template "harbor.database.username" . }}:{{ template "harbor.database.rawPassword" . }}@{{ template "harbor.database.host" . }}:{{ template "harbor.database.port" . }}/{{ template "harbor.database.notarySignerDatabase" . }}?sslmode={{ template "harbor.database.sslmode" . }}
{{- end -}}

Its then used in the configmaps:

source: "{{ template "harbor.database.clair" . }}"

"db_url": "{{ template "harbor.database.notaryServer" . }}"

"db_url": "{{ template "harbor.database.notarySigner" . }}",

@darend darend changed the title Database password is stored in cleartext configmap Database password is stored in Configmap as clear text Dec 7, 2018
@draeron
Copy link

draeron commented Jan 22, 2019

this is critical security issue, on our cluster, all pod's stdout get collected and sent to a elasticsearch cluster which means the value of our password get indexed.

so even if the value would be stored these kind of logs will get posted.

waiting for postgres://harbor:[email protected]:5432/notary_server?sslmode=disable to come up.

@ywk253100
Copy link
Collaborator

@darend Thanks for your feedback, we'll fix it.

@ywk253100
Copy link
Collaborator

@darend The issue of password leaking is tracked by goharbor/harbor#7510.

@darend
Copy link
Contributor Author

darend commented Apr 30, 2019

The issue of password leaking is tracked by goharbor/harbor#7510.

@ywk253100 Thanks. That issue tracks logging of passwords, there is still the issue that the password is stored in a ConfigMap vs Secret

ywk253100 added a commit to ywk253100/harbor-helm that referenced this issue Aug 21, 2019
Fixes goharbor#111, store the database password of clair and notary in secret instead of configmap

Signed-off-by: Wenkai Yin <[email protected]>
ywk253100 added a commit to ywk253100/harbor-helm that referenced this issue Aug 21, 2019
Fixes goharbor#111, store the database password of clair and notary in secret instead of configmap

Signed-off-by: Wenkai Yin <[email protected]>
ywk253100 added a commit to ywk253100/harbor-helm that referenced this issue Aug 21, 2019
Fixes goharbor#111, store the database password of clair and notary in secret instead of configmap

Signed-off-by: Wenkai Yin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed target/1.2.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants