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

Enables Kerberos sidecar support #11130

Merged
merged 3 commits into from
Sep 27, 2020

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Sep 24, 2020

Enables Kerberos sidecar support

Some of the users of Airflow are using Kerberos to authenticate
their worker workflows. Airflow has a basic support for Kerberos
for some of the operators and it has support to refresh the
temporary kerberos tokens via airflow kerberos command.

This change adds support for the Kerberos side-car that connects
to the Kerberos Key Distribution Center and retrieves the
token using Keytab that should be deployed as Kubernetes Secret.

It uses shared volume to share the temporary token. The nice
thing about setting it up as a sidecar is that the Keytab
is never shared with the workers - the secret is only mounted
by the sidecar and the workers have only access to the temporary
token.

Depends on #11129


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@boring-cyborg boring-cyborg bot added the area:helm-chart Airflow Helm Chart label Sep 24, 2020
@potiuk potiuk force-pushed the kerberos-sidecar-support branch from 593990c to 336b1e4 Compare September 24, 2020 17:01
@potiuk
Copy link
Member Author

potiuk commented Sep 24, 2020

cc: @jaketf

@potiuk potiuk force-pushed the kerberos-sidecar-support branch from 336b1e4 to c789fbb Compare September 24, 2020 17:02
@potiuk potiuk changed the title Enables Kerberos sidecar support (#100) Enables Kerberos sidecar support Sep 24, 2020
@potiuk potiuk force-pushed the kerberos-sidecar-support branch from c789fbb to effeee9 Compare September 24, 2020 18:11
@mik-laj
Copy link
Member

mik-laj commented Sep 25, 2020

Can you add some docs to: https://github.com/apache/airflow/blob/master/chart/README.md ? You probably just need to write an additional 2-3 sentences and copy the description of this PR.

@mik-laj
Copy link
Member

mik-laj commented Sep 25, 2020

I also think it is worth adding a "Hardening container environment" section to Kerberos to describe good practices/recommendations. The excerpts from the security posture that we have written will be helpful for this. Not everyone who uses Kubernetes uses Helm. For example, I have heard about projects that only use Terraform.

@potiuk potiuk force-pushed the kerberos-sidecar-support branch from effeee9 to 5eeb154 Compare September 27, 2020 17:50
@potiuk
Copy link
Member Author

potiuk commented Sep 27, 2020

I also think it is worth adding a "Hardening container environment" section to Kerberos to describe good practices/recommendations. The excerpts from the security posture that we have written will be helpful for this. Not everyone who uses Kubernetes uses Helm. For example, I have heard about projects that only use Terraform.

I decided to only add a general concept description to the new production-deployment.rst where I think it belongs and will be much easier to discover. I think there will be a general overhaul of the chart documentation as currently, it's structure is a bit undefined, it contains a number of old references to Astronomer's helm repo and it's generally not yet well structured for end-user yet, and it will generally change, I guessm when we decide how we release the Chart. But I am afraid is not a priority now for anyone to fix it.

CC @dimberman -> for the far future when we get to release the Helm Chart we'd need to add much more documentation on the supported cases as the information there is rather a mixed-bag of different kinds of information. - some about installing, some about using, few features are described but many are not. Good to remember as a point that should be fulfilled when we release the chart.

@potiuk
Copy link
Member Author

potiuk commented Sep 27, 2020

Please re-review :). I made the test pass with it and added the documentation.

@mik-laj
Copy link
Member

mik-laj commented Sep 27, 2020

@potiuk I think it is also worth adding information about it on the page with the title "Kerberos". I imagine that a person who would like to start using Kerberos, eg @jaketf 2 months ago, will find this page, read it and will not be able to ensure security for Kerberos in container environment. He doesn't necessarily have to use the production image, but he may want to use any docker image. This concept is universal and independent of the Production Docker image and Helm Chart. This can be done using a Docker image from Astronomer, Puckel, or any other image. If I would like to start using Kerberos, I would like to have all the information on the "Kerberos" page or there should at least be a link on this page to get more information.

@mik-laj
Copy link
Member

mik-laj commented Sep 27, 2020

Or another example:
One of our key clients prepares the Docker image on their own. They already have it tested, but they want to start using Kerberos. How is they going to find out how to do it safely? I believe they will only read the Kerberos documentation. Probably after reading current documentation, they may come up with non-recommended solutions to this problem, eg. regular rotation of the kkeytab file to ensure security.

Some of the users of Airflow are using Kerberos to authenticate
their worker workflows. Airflow has a basic support for Kerberos
for some of the operators and it has support to refresh the
temporary kerberos tokens via `airflow kerberos` command.

This change adds support for the Kerberos side-car that connects
to the Kerberos Key Distribution Center and retrieves the
token using Keytab that should be deployed as Kubernetes Secret.

It uses shared volume to share the temporary token. The nice
thing about setting it up as a sidecar is that the Keytab
is never shared with the workers - the secret is only mounted
by the sidecar and the workers have only access to the temporary
token.

Depends on apache#11129
@potiuk potiuk force-pushed the kerberos-sidecar-support branch from 5eeb154 to 8941354 Compare September 27, 2020 20:50
@potiuk
Copy link
Member Author

potiuk commented Sep 27, 2020

Sure. Good idea @mik-laj I did not even know it existed. I think the best way will be to link from the Kerberos page to the "production-deployment.rst".

Unfortunately, I have no idea how to link to particular sections between the docs, but I am sure you can help with that. I looked at similar doc links and tried to make the similar link but I am not sure if it will work I had to fix some spelling mistakes, so I tried to add the link from the Kerberos document to the documentation I wrote.

Unfortunately, I have very little time to understand how sphinx details and links work, so I would be really happy if you can help in it, I know you are our local expert, so I'd appreciate if you can suggest any changes to the .rst document that could make the links more useful. I'd really appreciate if you can help with that since you have all the sphinx experience.

@mik-laj
Copy link
Member

mik-laj commented Sep 27, 2020

More information about ref: https://www.sphinx-doc.org/en/1.5/markup/inline.html#role-ref

@potiuk
Copy link
Member Author

potiuk commented Sep 27, 2020

Cool. Thanks. really helpful I just did not have time to read all the docs and find it. Really appreciate it.

@potiuk potiuk merged commit 4d2a787 into apache:master Sep 27, 2020
@potiuk potiuk deleted the kerberos-sidecar-support branch September 27, 2020 22:13
mik-laj pushed a commit that referenced this pull request Oct 12, 2020
* Adds missing schema for kerberos sidecar configuration

The kerberos support added in #11130 did not have schema added
to the values.yml. This PR fixes it.

Co-authored-by: Jacob Ferriero <[email protected]>

* Update chart/values.schema.json

Co-authored-by: Jacob Ferriero <[email protected]>
FloChehab pushed a commit to MeilleursAgents/airflow that referenced this pull request Oct 20, 2020
Follow up to apache#11130 : we shouldn't mount the `kerberos-keytab` secret
in the worker deployment if we are not using
kerberos in the first place.
(the previous behavior is breaking the chart)
FloChehab pushed a commit to MeilleursAgents/airflow that referenced this pull request Oct 30, 2020
Follow up to apache#11130 : we shouldn't mount the `kerberos-keytab` volume
in the worker deployment if we are not using
kerberos in the first place.
(the previous behavior is breaking the chart)
potiuk pushed a commit that referenced this pull request Oct 31, 2020
Follow up to #11130 : we shouldn't mount the `kerberos-keytab` volume
in the worker deployment if we are not using
kerberos in the first place.
(the previous behavior is breaking the chart)
szn pushed a commit to szn/airflow that referenced this pull request Nov 1, 2020
Follow up to apache#11130 : we shouldn't mount the `kerberos-keytab` volume
in the worker deployment if we are not using
kerberos in the first place.
(the previous behavior is breaking the chart)
potiuk added a commit that referenced this pull request Nov 15, 2020
Some of the users of Airflow are using Kerberos to authenticate
their worker workflows. Airflow has a basic support for Kerberos
for some of the operators and it has support to refresh the
temporary Kerberos tokens via `airflow kerberos` command.

This change adds support for the Kerberos side-car that connects
to the Kerberos Key Distribution Center and retrieves the
token using Keytab that should be deployed as Kubernetes Secret.

It uses shared volume to share the temporary token. The nice
thing about setting it up as a sidecar is that the Keytab
is never shared with the workers - the secret is only mounted
by the sidecar and the workers have only access to the temporary
token.

Depends on #11129

(cherry picked from commit 4d2a787)
potiuk added a commit that referenced this pull request Nov 15, 2020
* Adds missing schema for kerberos sidecar configuration

The kerberos support added in #11130 did not have schema added
to the values.yml. This PR fixes it.

Co-authored-by: Jacob Ferriero <[email protected]>

* Update chart/values.schema.json

Co-authored-by: Jacob Ferriero <[email protected]>
(cherry picked from commit 9142eed)
potiuk pushed a commit that referenced this pull request Nov 15, 2020
Follow up to #11130 : we shouldn't mount the `kerberos-keytab` volume
in the worker deployment if we are not using
kerberos in the first place.
(the previous behavior is breaking the chart)

(cherry picked from commit 4c54718)
@potiuk potiuk added this to the Airflow 1.10.13 milestone Nov 15, 2020
@potiuk potiuk added the type:improvement Changelog: Improvements label Nov 15, 2020
potiuk added a commit that referenced this pull request Nov 16, 2020
Some of the users of Airflow are using Kerberos to authenticate
their worker workflows. Airflow has a basic support for Kerberos
for some of the operators and it has support to refresh the
temporary Kerberos tokens via `airflow kerberos` command.

This change adds support for the Kerberos side-car that connects
to the Kerberos Key Distribution Center and retrieves the
token using Keytab that should be deployed as Kubernetes Secret.

It uses shared volume to share the temporary token. The nice
thing about setting it up as a sidecar is that the Keytab
is never shared with the workers - the secret is only mounted
by the sidecar and the workers have only access to the temporary
token.

Depends on #11129

(cherry picked from commit 4d2a787)
potiuk added a commit that referenced this pull request Nov 16, 2020
* Adds missing schema for kerberos sidecar configuration

The kerberos support added in #11130 did not have schema added
to the values.yml. This PR fixes it.

Co-authored-by: Jacob Ferriero <[email protected]>

* Update chart/values.schema.json

Co-authored-by: Jacob Ferriero <[email protected]>
(cherry picked from commit 9142eed)
potiuk pushed a commit that referenced this pull request Nov 16, 2020
Follow up to #11130 : we shouldn't mount the `kerberos-keytab` volume
in the worker deployment if we are not using
kerberos in the first place.
(the previous behavior is breaking the chart)

(cherry picked from commit 4c54718)
potiuk added a commit that referenced this pull request Nov 16, 2020
Some of the users of Airflow are using Kerberos to authenticate
their worker workflows. Airflow has a basic support for Kerberos
for some of the operators and it has support to refresh the
temporary Kerberos tokens via `airflow kerberos` command.

This change adds support for the Kerberos side-car that connects
to the Kerberos Key Distribution Center and retrieves the
token using Keytab that should be deployed as Kubernetes Secret.

It uses shared volume to share the temporary token. The nice
thing about setting it up as a sidecar is that the Keytab
is never shared with the workers - the secret is only mounted
by the sidecar and the workers have only access to the temporary
token.

Depends on #11129

(cherry picked from commit 4d2a787)
potiuk added a commit that referenced this pull request Nov 16, 2020
* Adds missing schema for kerberos sidecar configuration

The kerberos support added in #11130 did not have schema added
to the values.yml. This PR fixes it.

Co-authored-by: Jacob Ferriero <[email protected]>

* Update chart/values.schema.json

Co-authored-by: Jacob Ferriero <[email protected]>
(cherry picked from commit 9142eed)
potiuk pushed a commit that referenced this pull request Nov 16, 2020
Follow up to #11130 : we shouldn't mount the `kerberos-keytab` volume
in the worker deployment if we are not using
kerberos in the first place.
(the previous behavior is breaking the chart)

(cherry picked from commit 4c54718)
kaxil pushed a commit that referenced this pull request Nov 18, 2020
Some of the users of Airflow are using Kerberos to authenticate
their worker workflows. Airflow has a basic support for Kerberos
for some of the operators and it has support to refresh the
temporary Kerberos tokens via `airflow kerberos` command.

This change adds support for the Kerberos side-car that connects
to the Kerberos Key Distribution Center and retrieves the
token using Keytab that should be deployed as Kubernetes Secret.

It uses shared volume to share the temporary token. The nice
thing about setting it up as a sidecar is that the Keytab
is never shared with the workers - the secret is only mounted
by the sidecar and the workers have only access to the temporary
token.

Depends on #11129

(cherry picked from commit 4d2a787)
kaxil pushed a commit that referenced this pull request Nov 18, 2020
* Adds missing schema for kerberos sidecar configuration

The kerberos support added in #11130 did not have schema added
to the values.yml. This PR fixes it.

Co-authored-by: Jacob Ferriero <[email protected]>

* Update chart/values.schema.json

Co-authored-by: Jacob Ferriero <[email protected]>
(cherry picked from commit 9142eed)
kaxil pushed a commit that referenced this pull request Nov 18, 2020
Follow up to #11130 : we shouldn't mount the `kerberos-keytab` volume
in the worker deployment if we are not using
kerberos in the first place.
(the previous behavior is breaking the chart)

(cherry picked from commit 4c54718)
cfei18 pushed a commit to cfei18/incubator-airflow that referenced this pull request Mar 5, 2021
Some of the users of Airflow are using Kerberos to authenticate
their worker workflows. Airflow has a basic support for Kerberos
for some of the operators and it has support to refresh the
temporary Kerberos tokens via `airflow kerberos` command.

This change adds support for the Kerberos side-car that connects
to the Kerberos Key Distribution Center and retrieves the
token using Keytab that should be deployed as Kubernetes Secret.

It uses shared volume to share the temporary token. The nice
thing about setting it up as a sidecar is that the Keytab
is never shared with the workers - the secret is only mounted
by the sidecar and the workers have only access to the temporary
token.

Depends on apache#11129

(cherry picked from commit 4d2a787)
cfei18 pushed a commit to cfei18/incubator-airflow that referenced this pull request Mar 5, 2021
* Adds missing schema for kerberos sidecar configuration

The kerberos support added in apache#11130 did not have schema added
to the values.yml. This PR fixes it.

Co-authored-by: Jacob Ferriero <[email protected]>

* Update chart/values.schema.json

Co-authored-by: Jacob Ferriero <[email protected]>
(cherry picked from commit 9142eed)
cfei18 pushed a commit to cfei18/incubator-airflow that referenced this pull request Mar 5, 2021
Follow up to apache#11130 : we shouldn't mount the `kerberos-keytab` volume
in the worker deployment if we are not using
kerberos in the first place.
(the previous behavior is breaking the chart)

(cherry picked from commit 4c54718)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:helm-chart Airflow Helm Chart type:improvement Changelog: Improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants