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

Add secret for private git #94

Merged
merged 19 commits into from
May 16, 2019
Merged

Conversation

keigohtr
Copy link
Member

@keigohtr keigohtr commented May 8, 2019

What is this PR for?

Add Git SSH Key management function for accessing a private git repository.

This PR includes

  • Use Kubernetes Secret to store Git SSH Key
  • Add WebUI for Git SSH Key
  • Add test

What type of PR is it?

Feature

What is the issue?

#76

How should this be tested?

Run unittest

@keigohtr keigohtr self-assigned this May 8, 2019
@keigohtr keigohtr mentioned this pull request May 10, 2019
@yoquankara
Copy link
Member

It looks like you don't use encryption. Could you provide rationale for that decision?

@keigohtr
Copy link
Member Author

@yoquankara Thank you for your review.
Kubernetes Client does encryption automatically.

        v1_secret = client.V1Secret(
            api_version="v1",
            kind="Secret",
            metadata=client.V1ObjectMeta(
                name=name,
                namespace=service_level,
                labels={"rekcurd-worker": "True", "id": application_model.application_id,
                        "name": application_model.application_name}
            ),
            string_data=string_data,
            type="Opaque")

And when we use them, we need to decode it -> https://github.com/rekcurd/dashboard/pull/94/files#diff-6e60f8497f16de75099b3715931c19c8R944

@yoquankara
Copy link
Member

Base64 is simple to decode, so I wondered if it was better to add extra encryption as suggested here.

https://kubernetes.io/docs/concepts/configuration/secret/#risks
https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/

That said, encrypt data at rest is beta feature in v1.13 though. So we may consider it later.

@keigohtr
Copy link
Member Author

@yoquankara Yes I think so too.
This is current Kubernetes spec, so they will improve secret in the future. I know this situation and I expect to use a better encryption algorithm like bcrypt in the future.

Copy link
Member

@yoquankara yoquankara left a comment

Choose a reason for hiding this comment

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

LGTM

I added #101 for later improvement

@keigohtr
Copy link
Member Author

@yoquankara Thank you veeeeery much!! :)

@codecov-io
Copy link

Codecov Report

Merging #94 into master will increase coverage by 0.68%.
The diff coverage is 94.93%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
+ Coverage   83.69%   84.38%   +0.68%     
==========================================
  Files          42       43       +1     
  Lines        2098     2235     +137     
==========================================
+ Hits         1756     1886     +130     
- Misses        342      349       +7
Impacted Files Coverage Δ
rekcurd_dashboard/models/application.py 93.75% <ø> (ø) ⬆️
rekcurd_dashboard/apis/__init__.py 91.93% <100%> (+5.26%) ⬆️
rekcurd_dashboard/apis/common.py 100% <100%> (ø) ⬆️
rekcurd_dashboard/apis/api_application.py 100% <100%> (ø) ⬆️
rekcurd_dashboard/apis/api_project.py 98.66% <100%> (ø) ⬆️
rekcurd_dashboard/apis/api_kubernetes.py 88.7% <100%> (ø) ⬆️
rekcurd_dashboard/apis/api_service.py 96.25% <100%> (-2.49%) ⬇️
rekcurd_dashboard/apis/kubernetes_handler.py 84.09% <89.55%> (+1.14%) ⬆️
rekcurd_dashboard/apis/api_kubernetes_secret.py 98.33% <98.33%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa4f7e5...bc23584. Read the comment docs.

@keigohtr keigohtr merged commit 0202d6b into master May 16, 2019
@keigohtr keigohtr deleted the feature/add-secret-for-private-git branch May 16, 2019 22:22
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.

4 participants