-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve infrastructure security (#75)
* ci: update paths-filter action * ci: sign container images * chore: add Kyverno policy * chore: add user in backend Dockerfile * chore: add security context to deployments * chore: add resource limits to deployments * feat(kube): add network policies * ci: don't sign the image if not pushing
- Loading branch information
Showing
15 changed files
with
175 additions
and
5 deletions.
There are no files selected for viewing
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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- op: add | ||
path: /spec/template/spec/containers/0/resources | ||
value: | ||
requests: | ||
memory: "1Gi" | ||
cpu: "0.5" | ||
limits: | ||
memory: "2Gi" | ||
cpu: "1" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
apiVersion: kyverno.io/v1 | ||
kind: ClusterPolicy | ||
metadata: | ||
name: check-linkedout-image-signature | ||
spec: | ||
validationFailureAction: Enforce | ||
background: false | ||
webhookTimeoutSeconds: 30 | ||
failurePolicy: Fail | ||
rules: | ||
- name: check-image | ||
match: | ||
any: | ||
- resources: | ||
kinds: | ||
- Pod | ||
verifyImages: | ||
- imageReferences: | ||
- "ghcr.io/thomas-mauran/linkedout/*" | ||
attestors: | ||
- count: 1 | ||
entries: | ||
- keys: | ||
publicKeys: |- | ||
-----BEGIN PUBLIC KEY----- | ||
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEaFU86MNnoiHTLXkBrgnPO18R5gpo | ||
cMic199RKzUa6YftDcDCEovrR0nyzfGp3pKcr4nhjwi3qNRQRHPz76EaWg== | ||
-----END PUBLIC KEY----- |
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,47 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: NetworkPolicy | ||
metadata: | ||
name: microservices | ||
spec: | ||
podSelector: | ||
matchLabels: | ||
network-group: microservices | ||
policyTypes: | ||
- Ingress | ||
- Egress | ||
egress: | ||
- to: | ||
- podSelector: | ||
matchLabels: | ||
app.kubernetes.io/name: nats | ||
- podSelector: | ||
matchLabels: | ||
app.kubernetes.io/name: postgresql | ||
- podSelector: | ||
matchLabels: | ||
helm.neo4j.com/neo4j.name: linkedout | ||
- podSelector: | ||
matchLabels: | ||
app.kubernetes.io/name: minio | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: NetworkPolicy | ||
metadata: | ||
name: coredns-egress | ||
spec: | ||
podSelector: | ||
matchLabels: | ||
network-group: microservices | ||
policyTypes: | ||
- Egress | ||
egress: | ||
- to: | ||
- namespaceSelector: | ||
matchLabels: | ||
kubernetes.io/metadata.name: kube-system | ||
podSelector: | ||
matchLabels: | ||
k8s-app: kube-dns | ||
ports: | ||
- protocol: UDP | ||
port: 53 |