-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #397 from gthiemonge/fix_min_priv
Run Octavia pod components at minimum privilege escalation level
- Loading branch information
Showing
19 changed files
with
274 additions
and
228 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
config/samples/network-attachment-definition/kustomization.yaml
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,2 @@ | ||
resources: | ||
- octavia-nad.yaml |
24 changes: 24 additions & 0 deletions
24
config/samples/network-attachment-definition/octavia-nad.yaml
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,24 @@ | ||
apiVersion: k8s.cni.cncf.io/v1 | ||
kind: NetworkAttachmentDefinition | ||
metadata: | ||
name: octavia | ||
spec: | ||
config: | | ||
{ | ||
"cniVersion": "0.3.1", | ||
"name": "octavia", | ||
"type": "bridge", | ||
"bridge": "octbr", | ||
"ipam": { | ||
"type": "whereabouts", | ||
"range": "172.23.0.0/24", | ||
"range_start": "172.23.0.30", | ||
"range_end": "172.23.0.70", | ||
"routes": [ | ||
{ | ||
"dst": "172.24.0.0/16", | ||
"gw" : "172.23.0.150" | ||
} | ||
] | ||
} | ||
} |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package octavia | ||
|
||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
"k8s.io/utils/ptr" | ||
) | ||
|
||
const ( | ||
OctaviaUID int64 = 42437 | ||
OctaviaGID int64 = 42437 | ||
) | ||
|
||
func GetOctaviaSecurityContext() *corev1.SecurityContext { | ||
return &corev1.SecurityContext{ | ||
RunAsUser: ptr.To(OctaviaUID), | ||
RunAsGroup: ptr.To(OctaviaGID), | ||
RunAsNonRoot: ptr.To(true), | ||
} | ||
} |
Oops, something went wrong.