Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Gatekeeper Policies
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IT Common Platform
platform-support
helm-charts
Gatekeeper Policies
Merge requests
!67
Revert "Merge branch 'bbooker-platform-2365' into 'master'"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Revert "Merge branch 'bbooker-platform-2365' into 'master'"
revert-737fad47
into
master
Overview
0
Commits
1
Pipelines
2
Changes
32
Merged
Morgan Hoffman
requested to merge
revert-737fad47
into
master
11 months ago
Overview
0
Commits
1
Pipelines
2
Changes
32
Expand
This reverts merge request
!66 (merged)
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
0e61fb40
1 commit,
11 months ago
32 files
+
5541
−
1
Expand all files
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
32
Search (e.g. *.vue) (Ctrl+P)
rego/pss_apparmor/policy.rego
0 → 100644
+
111
−
0
Options
package
pss_apparmor
apparmor_keys
[
containerName
]
=
key
{
containerName
:=
containers
[
_
].
name
key
:=
sprintf
(
"%s/%s"
,
[
"container.apparmor.security.beta.kubernetes.io"
,
containerName
])
}
custom_apparmor_containers
[
containerName
]
{
key
:=
apparmor_keys
[
containerName
]
annotation
:=
annotations
[
_
]
val
=
annotation
[
key
]
val
!
=
"runtime/default"
not
startswith
(
val
,
"localhost/"
)
}
violation
[
msg
]
{
failedContainer
:=
custom_apparmor_containers
[
_
]
msg
:=
format
(
sprintf
(
"Container '%s' of %s '%s' should specify an AppArmor profile"
,
[
failedContainer
,
kind
,
name
]))
}
################### LIBRARY ###################
default
is_gatekeeper
=
true
object
=
input
.
review
.
object
{
is_gatekeeper
}
format
(
msg
)
=
gatekeeper_format
{
is_gatekeeper
gatekeeper_format
=
{
"msg"
:
msg
}
}
name
=
object
.
metadata
.
name
kind
=
object
.
kind
is_pod
{
kind
=
"Pod"
}
is_cronjob
{
kind
=
"CronJob"
}
default
is_controller
=
false
is_controller
{
kind
=
"Deployment"
}
is_controller
{
kind
=
"StatefulSet"
}
is_controller
{
kind
=
"DaemonSet"
}
is_controller
{
kind
=
"ReplicaSet"
}
is_controller
{
kind
=
"ReplicationController"
}
is_controller
{
kind
=
"Job"
}
pod_containers
(
pod
)
=
all_containers
{
keys
=
{
"containers"
,
"initContainers"
}
all_containers
=
[
c
|
keys
[
k
];
c
=
pod
.
spec
[
k
][
_
]]
}
containers
[
container
]
{
pods
[
pod
]
all_containers
=
pod_containers
(
pod
)
container
=
all_containers
[
_
]
}
containers
[
container
]
{
all_containers
=
pod_containers
(
object
)
container
=
all_containers
[
_
]
}
annotations
[
annotation
]
{
pods
[
pod
]
annotation
=
pod
.
metadata
.
annotations
}
pods
[
pod
]
{
is_pod
pod
=
object
}
pods
[
pod
]
{
is_controller
pod
=
object
.
spec
.
template
}
pods
[
pod
]
{
is_cronjob
pod
=
object
.
spec
.
jobTemplate
.
spec
.
template
}
has_field
(
obj
,
field
)
{
obj
[
field
]
}