Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Restrict kubernetes pod kernel capabilities #690

Merged
merged 2 commits into from
Jul 26, 2018
Merged

Restrict kubernetes pod kernel capabilities #690

merged 2 commits into from
Jul 26, 2018

Conversation

OlafSzmidt
Copy link
Contributor

@OlafSzmidt OlafSzmidt commented Jul 25, 2018

Please read #689 before reviewing!

This PR will increase our pod security from kubesec rating 7 to 8. The next step would be to completely remove root access, but that was quite difficult to figure out as we don't assign and uID or gIDs right now.

A simple scan of existing game pods for example:

(aimmo-UXHtE3Rq) bash-3.2$ kubectl -n default plugin scan pod/game-1-zzn2n
scanning pod game-1-zzn2n
pod/game-1-zzn2n kubesec.io score 8

The advisory is now gone.


This change is Reviewable

@OlafSzmidt OlafSzmidt added this to the Sprint 66 Reactive Console milestone Jul 25, 2018
@OlafSzmidt OlafSzmidt self-assigned this Jul 25, 2018
Copy link
Contributor

@NiallEgan NiallEgan left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @OlafSzmidt)

Copy link
Contributor

@mossjacob mossjacob left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @OlafSzmidt)


aimmo-game-creator/game_manager.py, line 253 at r1 (raw file):

                                            ],
                                            "add": [
                                                "NET_BIND_SERVICE"

does this container bind to any port less than 1024? if not then this capability might be unnecessary


aimmo-game-creator/rc-aimmo-game-creator.yaml, line 32 at r1 (raw file):

        - name: GAME_MANAGER
          value: kubernetes
        securityContext:

why does this appear twice - in game_manager.py and here?

Copy link
Contributor Author

@OlafSzmidt OlafSzmidt left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @OlafSzmidt and @JCobbles)


aimmo-game-creator/game_manager.py, line 253 at r1 (raw file):

Previously, JCobbles (Jacob Moss) wrote…

does this container bind to any port less than 1024? if not then this capability might be unnecessary

This is creating the replication controller for the game, and the game starts flask so it's needed.


aimmo-game-creator/rc-aimmo-game-creator.yaml, line 32 at r1 (raw file):

Previously, JCobbles (Jacob Moss) wrote…

why does this appear twice - in game_manager.py and here?

Done.

Copy link
Contributor

@mossjacob mossjacob left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r1.
Reviewable status: 2 of 3 files reviewed, all discussions resolved (waiting on @JCobbles and @NiallEgan)

Copy link
Contributor

@mossjacob mossjacob left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@OlafSzmidt OlafSzmidt merged commit ebd999d into master Jul 26, 2018
@OlafSzmidt OlafSzmidt deleted the kubesecIO branch July 26, 2018 12:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants