Compare commits
4 Commits
f2d3e58948
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
83cf48b2a9
|
|||
|
fc9f34939b
|
|||
|
c80024972c
|
|||
|
eed5b44916
|
@@ -6,9 +6,23 @@ group "default" {
|
||||
}
|
||||
|
||||
target "docker-metadata-action" {}
|
||||
target "cache" {
|
||||
cache-from = [
|
||||
{
|
||||
type = "gha",
|
||||
}
|
||||
]
|
||||
|
||||
cache-to = [
|
||||
{
|
||||
type = "gha",
|
||||
mode = "max"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
target "authelia-controller" {
|
||||
inherits = ["docker-metadata-action"]
|
||||
inherits = ["docker-metadata-action", "cache"]
|
||||
context = "./"
|
||||
dockerfile = "Dockerfile"
|
||||
tags = [for tag in target.docker-metadata-action.tags : "${TAG_BASE}:${tag}"]
|
||||
@@ -16,6 +30,7 @@ target "authelia-controller" {
|
||||
}
|
||||
|
||||
target "manifests" {
|
||||
inherits = ["cache"]
|
||||
context = "./"
|
||||
dockerfile = "Dockerfile"
|
||||
target = "manifests"
|
||||
|
||||
@@ -2,9 +2,11 @@ kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: authelia-controller
|
||||
namespace: authelia
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: authelia-controller
|
||||
namespace: authelia
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: authelia-controller
|
||||
|
||||
@@ -2,6 +2,7 @@ kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: authelia-controller
|
||||
namespace: authelia
|
||||
rules:
|
||||
- apiGroups:
|
||||
- authelia.huizinga.dev
|
||||
|
||||
@@ -2,6 +2,7 @@ apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: authelia-controller
|
||||
namespace: authelia
|
||||
labels:
|
||||
app: authelia-controller
|
||||
app.kubernetes.io/name: authelia-controller
|
||||
@@ -18,12 +19,17 @@ spec:
|
||||
kubectl.kubernetes.io/default-container: authelia-controller
|
||||
spec:
|
||||
serviceAccountName: authelia-controller
|
||||
securityContext: {}
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
fsGroup: 1000
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
containers:
|
||||
- name: authelia-controller
|
||||
image: '{{ index .images "authelia-controller" }}'
|
||||
imagePullPolicy: IfNotPresent
|
||||
securityContext: {}
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
@@ -34,3 +40,9 @@ spec:
|
||||
env:
|
||||
- name: RUST_LOG
|
||||
value: info,authelia_controller=debug
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
runAsNonRoot: true
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
namespace: authelia
|
||||
resources:
|
||||
- ./crds.yaml
|
||||
- ./service-account.yaml
|
||||
- ./cluster-role.yaml
|
||||
- ./cluster-role-binding.yaml
|
||||
- ./deployment.yaml
|
||||
- namespace.yaml
|
||||
- crds.yaml
|
||||
- service-account.yaml
|
||||
- cluster-role.yaml
|
||||
- cluster-role-binding.yaml
|
||||
- deployment.yaml
|
||||
|
||||
4
manifests/namespace.yaml
Normal file
4
manifests/namespace.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: authelia
|
||||
@@ -2,6 +2,7 @@ apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: authelia-controller
|
||||
namespace: authelia
|
||||
labels:
|
||||
app: authelia-controller
|
||||
app.kubernetes.io/name: authelia-controller
|
||||
|
||||
@@ -45,6 +45,7 @@ pub struct AccessControlRuleSpec {
|
||||
#[derive(Serialize, Deserialize, Clone, Debug, Hash)]
|
||||
struct AccessControl {
|
||||
rules: Vec<AccessControlRuleSpec>,
|
||||
default_policy: AccessPolicy,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone, Debug, Hash)]
|
||||
@@ -60,14 +61,22 @@ impl AccessControlRule {
|
||||
debug!("Updating acl");
|
||||
rules.sort_by_cached_key(|rule| rule.name_any());
|
||||
|
||||
let rules = rules
|
||||
let rules: Vec<_> = rules
|
||||
.iter()
|
||||
.inspect(|rule| trace!(name = rule.name_any(), "Rule found"))
|
||||
.map(|rule| rule.spec.clone())
|
||||
.collect();
|
||||
|
||||
let top = TopLevel {
|
||||
access_control: AccessControl { rules },
|
||||
access_control: AccessControl {
|
||||
// TODO: Make sure configurable?
|
||||
default_policy: if rules.is_empty() {
|
||||
AccessPolicy::OneFactor
|
||||
} else {
|
||||
AccessPolicy::Deny
|
||||
},
|
||||
rules,
|
||||
},
|
||||
};
|
||||
|
||||
let contents = BTreeMap::from([(
|
||||
|
||||
Reference in New Issue
Block a user