Skip to content

Commit

Permalink
Merge pull request #39 from aliaksei-ivanou/efs-encryption-at-rest
Browse files Browse the repository at this point in the history
Efs encryption at rest
  • Loading branch information
shapirov103 authored Mar 22, 2023
2 parents 2e08d0b + 8a0a170 commit 83d87da
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
2 changes: 2 additions & 0 deletions security/envs/dev/templates/team-platform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ spec:
helm:
values: |
spec:
efsKmsKey: {{ index .Values.spec "efsKmsKey" }}
efsFileSystemId: {{ index .Values.spec "efsFileSystemId" }}
ebsKmsKey: {{ index .Values.spec "ebsKmsKey" }}
syncPolicy:
automated:
Expand Down
29 changes: 29 additions & 0 deletions teams/team-data/dev/templates/efs-ecncrypted-storage-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: efs-encrypted-claim
spec:
accessModes:
- ReadWriteMany
storageClassName: efs-encrypted
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: Pod
metadata:
name: efs-encryption-app
spec:
containers:
- name: app
image: centos
command: ["/bin/sh"]
args: ["-c", "while true; do echo $(date -u) >> /example/out.txt; sleep 5; done"]
volumeMounts:
- name: persistent-storage
mountPath: /example
volumes:
- name: persistent-storage
persistentVolumeClaim:
claimName: efs-encrypted-claim
18 changes: 18 additions & 0 deletions teams/team-platform/dev/templates/efs-encrypted-storage-class.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: efs-encrypted
annotations:
storageclass.kubernetes.io/is-default-class: "true"
provisioner: efs.csi.aws.com
mountOptions:
- tls
parameters:
fileSystemId: {{ .Values.spec.efsFileSystemId }}
provisioningMode: efs-ap
directoryPerms: "700"
gidRangeStart: "1000" # optional
gidRangeEnd: "2000" # optional
{{ if .Values.spec.efsKmsKey }}
kmsKeyId: {{ .Values.spec.efsKmsKey }}
{{ end }}

0 comments on commit 83d87da

Please sign in to comment.