Skip to content

Commit 64f8e02

Browse files
authored
Merge pull request #112 from PDOK/read-only_base_volume_mapserver
For security set base volume to readOnly in mapserver deployment
2 parents 1e622e0 + 2aa6527 commit 64f8e02

File tree

15 files changed

+16
-14
lines changed

15 files changed

+16
-14
lines changed

internal/controller/blobdownload/blob_download.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func GetBlobDownloadInitContainer[O pdoknlv3.WMSWFS](obj O, images types.Images)
6363
},
6464
Command: []string{"/bin/sh", "-c"},
6565
VolumeMounts: []corev1.VolumeMount{
66-
utils.GetBaseVolumeMount(),
66+
utils.GetBaseVolumeMount(false),
6767
utils.GetDataVolumeMount(),
6868
},
6969
}

internal/controller/featureinfogenerator/featureinfo_generator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func GetFeatureinfoGeneratorInitContainer(images types.Images) (*corev1.Containe
2727
"feature-info",
2828
},
2929
VolumeMounts: []corev1.VolumeMount{
30-
utils.GetBaseVolumeMount(),
30+
utils.GetBaseVolumeMount(false),
3131
utils.GetConfigVolumeMount(constants.ConfigMapFeatureinfoGeneratorVolumeName),
3232
},
3333
}

internal/controller/legendgenerator/legend_generator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ exit $exit_code;
4040
`,
4141
},
4242
VolumeMounts: []corev1.VolumeMount{
43-
utils.GetBaseVolumeMount(),
43+
utils.GetBaseVolumeMount(false),
4444
utils.GetDataVolumeMount(),
4545
{Name: constants.MapserverName, MountPath: "/srv/mapserver/config/default_mapserver.conf", SubPath: "default_mapserver.conf"},
4646
},

internal/controller/mapfilegenerator/mapfile_generator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func GetMapfileGeneratorInitContainer[O pdoknlv3.WMSWFS](obj O, images types.Ima
2828
"/srv/data/config/mapfile",
2929
},
3030
VolumeMounts: []corev1.VolumeMount{
31-
utils.GetBaseVolumeMount(),
31+
utils.GetBaseVolumeMount(false),
3232
utils.GetConfigVolumeMount(constants.ConfigMapMapfileGeneratorVolumeName),
3333
},
3434
}

internal/controller/mapserver/deployment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func GetMapserverContainer[O pdoknlv3.WMSWFS](obj O, images types.Images) (*core
6363

6464
func getVolumeMounts(customMapfile bool) []corev1.VolumeMount {
6565
volumeMounts := []corev1.VolumeMount{
66-
utils.GetBaseVolumeMount(),
66+
utils.GetBaseVolumeMount(true),
6767
utils.GetDataVolumeMount(),
6868
}
6969

internal/controller/mapserver/test_data/expected_volumemounts.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
volumeMounts:
22
- mountPath: /srv/data
33
name: base
4+
readOnly: true
45
- mountPath: /var/www
56
name: data
67
- mountPath: /srv/mapserver/config/include.conf

internal/controller/test_data/wfs/complete/expected/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ spec:
126126
volumeMounts:
127127
- mountPath: /srv/data
128128
name: base
129-
readOnly: false
129+
readOnly: true
130130
- mountPath: /var/www
131131
name: data
132132
readOnly: false

internal/controller/test_data/wfs/minimal/expected/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ spec:
122122
volumeMounts:
123123
- mountPath: /srv/data
124124
name: base
125-
readOnly: false
125+
readOnly: true
126126
- mountPath: /var/www
127127
name: data
128128
readOnly: false

internal/controller/test_data/wfs/noprefetch/expected/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ spec:
122122
volumeMounts:
123123
- mountPath: /srv/data
124124
name: base
125-
readOnly: false
125+
readOnly: true
126126
- mountPath: /var/www
127127
name: data
128128
readOnly: false

internal/controller/test_data/wms/complete/expected/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ spec:
128128
volumeMounts:
129129
- mountPath: /srv/data
130130
name: base
131-
readOnly: false
131+
readOnly: true
132132
- mountPath: /var/www
133133
name: data
134134
readOnly: false

0 commit comments

Comments
 (0)