Compare commits
60 commits
vbridier-r
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eff7baf3fe | ||
|
|
c8b18faba8 | ||
|
|
89a315f217 | ||
|
|
e1da57be4c | ||
|
|
aa0b17f15b | ||
|
|
9cc9b34c6f | ||
|
|
87b04fc03c | ||
|
|
39780fa0fa | ||
|
|
bb373952bb | ||
|
|
e15d74e233 | ||
|
|
4ce0256307 | ||
|
|
f3346b2be7 | ||
|
|
7852a7dbf5 | ||
|
|
cd4a14403f | ||
|
|
4f303ce92e | ||
|
|
eeea16bf53 | ||
|
|
ce910ea49d | ||
|
|
53296907b0 | ||
|
|
d15ec10689 | ||
|
|
59dc7b3f3e | ||
|
|
057fb8d192 | ||
|
|
2fa0fba3af | ||
|
|
edba2e40bb | ||
|
|
34d7392b89 | ||
|
|
9d07a14801 | ||
|
|
ced2987809 | ||
|
|
62f7615039 | ||
|
|
62cbd2ef1e | ||
|
|
c3b21c920d | ||
|
|
1e9b068752 | ||
|
|
3db0442fef | ||
|
|
c1ab98f496 | ||
|
|
25da33d21a | ||
|
|
2bb7681e7f | ||
|
|
06ac38eb37 | ||
|
|
293f76533a | ||
|
|
2155d7427a | ||
|
|
756ae32b69 | ||
|
|
1e12270193 | ||
|
|
ee306a824b | ||
|
|
e8271b5f14 | ||
|
|
a5605eb316 | ||
|
|
1f6610f27b | ||
|
|
7073a20383 | ||
|
|
0ff24fb82d | ||
|
|
cd0540f33f | ||
|
|
41cf295e54 | ||
|
|
03e69a4522 | ||
|
|
7a9c997c3e | ||
|
|
014172bece | ||
|
|
d838122f2d | ||
|
|
bb6abdab00 | ||
|
|
03a4cdebc4 | ||
|
|
0ebd62f297 | ||
|
|
ce58e39527 | ||
|
|
6b79e9b97d | ||
|
|
00562f5325 | ||
|
|
68d20611ee | ||
|
|
8c7d268737 | ||
|
|
db7012d742 |
11 changed files with 251 additions and 9 deletions
|
|
@ -2,6 +2,7 @@ ci_access:
|
|||
projects:
|
||||
- id: ldc-web/projets/agis
|
||||
- id: ldc-web/projets/auguste-lambert
|
||||
- id: ldc-web/projets/bien-etre-animal
|
||||
- id: ldc-web/projets/boutique-cnc-sable
|
||||
- id: ldc-web/projets/boutique-jeusselin
|
||||
- id: ldc-web/projets/cailles-robin
|
||||
|
|
@ -12,8 +13,10 @@ ci_access:
|
|||
- id: ldc-web/projets/doux
|
||||
- id: ldc-web/projets/espri-restauration
|
||||
- id: ldc-web/projets/galina
|
||||
- id: ldc-web/projets/gen-game-web-instances/auguste-lambert
|
||||
- id: ldc-web/projets/gen-game-web-instances/janze
|
||||
- id: ldc-web/projets/gen-game-web-instances/l-orleanais-jeu
|
||||
- id: ldc-web/projets/gen-game-web-instances/le-gaulois-eveillez-vos-papilles
|
||||
- id: ldc-web/projets/gen-game-web-instances/le-gaulois-tdf-2024
|
||||
- id: ldc-web/projets/gen-game-web-instances/le-gaulois-chequier-40-2025
|
||||
- id: ldc-web/projets/gen-game-web-instances/le-gaulois-op-brasserie-2025
|
||||
|
|
@ -27,6 +30,7 @@ ci_access:
|
|||
- id: ldc-web/projets/gen-game-web-prize-draw
|
||||
- id: ldc-web/projets/id-halal
|
||||
- id: ldc-web/projets/jeusselin
|
||||
- id: ldc-web/projets/ker-chant
|
||||
- id: ldc-web/projets/l-hours
|
||||
- id: ldc-web/projets/la-boutique-du-canard
|
||||
- id: ldc-web/projets/la-toque-angevine
|
||||
|
|
@ -55,6 +59,7 @@ ci_access:
|
|||
- id: ldc-web/projets/parc-auto
|
||||
- id: ldc-web/projets/poule-et-toque
|
||||
- id: ldc-web/projets/prims
|
||||
- id: ldc-web/projets/qualimaine
|
||||
- id: ldc-web/projets/qrcollector/qrcollector-back
|
||||
- id: ldc-web/projets/regalette
|
||||
- id: ldc-web/projets/reghalal
|
||||
|
|
|
|||
32
flux/kustomizations/crowdsec.yaml
Normal file
32
flux/kustomizations/crowdsec.yaml
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||
kind: Kustomization
|
||||
metadata:
|
||||
name: crowdsec
|
||||
namespace: flux-system
|
||||
spec:
|
||||
interval: 1m0s
|
||||
path: ./infrastructure/crowdsec
|
||||
prune: false
|
||||
healthChecks:
|
||||
- apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: HelmRepository
|
||||
name: crowdsec
|
||||
namespace: common-services
|
||||
- apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
name: crowdsec
|
||||
namespace: common-services
|
||||
- apiVersion: v1
|
||||
kind: Pod
|
||||
name: vault-0
|
||||
namespace: common-services
|
||||
dependsOn:
|
||||
- name: namespaces
|
||||
namespace: flux-system
|
||||
- name: external-secrets-resources
|
||||
namespace: flux-system
|
||||
sourceRef:
|
||||
kind: GitRepository
|
||||
name: flux-system
|
||||
timeout: 5m
|
||||
|
|
@ -14,3 +14,4 @@ resources:
|
|||
- traefik.yaml
|
||||
- quickchart.yaml
|
||||
- netdata.yaml
|
||||
- crowdsec.yaml
|
||||
|
|
|
|||
92
infrastructure/crowdsec/helm-release.yaml
Normal file
92
infrastructure/crowdsec/helm-release.yaml
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: crowdsec
|
||||
namespace: common-services
|
||||
spec:
|
||||
interval: 5m
|
||||
chart:
|
||||
spec:
|
||||
chart: crowdsec
|
||||
version: 0.24.0
|
||||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: crowdsec
|
||||
namespace: common-services
|
||||
values:
|
||||
container_runtime: containerd
|
||||
|
||||
image:
|
||||
tag: v1.7.8
|
||||
|
||||
agent:
|
||||
acquisition:
|
||||
- namespace: common-services
|
||||
podName: traefik-*
|
||||
program: traefik
|
||||
env:
|
||||
- name: COLLECTIONS
|
||||
value: "crowdsecurity/traefik"
|
||||
|
||||
secrets:
|
||||
externalSecret:
|
||||
name: crowdsec-lapi-secret
|
||||
csLapiSecretKey: "CS_LAPI_SECRET"
|
||||
registrationTokenKey: "REGISTRATION_TOKEN"
|
||||
|
||||
lapi:
|
||||
replicas: 2
|
||||
storeCAPICredentialsInSecret: true
|
||||
storeLAPICscliCredentialsInSecret: true
|
||||
persistentVolume:
|
||||
data:
|
||||
enabled: false
|
||||
config:
|
||||
enabled: false
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: crowdsec-lapi-secret
|
||||
|
||||
config:
|
||||
config.yaml.local: |
|
||||
api:
|
||||
client:
|
||||
# the log processor will remove delete itself from LAPI when stopping.
|
||||
unregister_on_exit: true
|
||||
server:
|
||||
auto_registration: # Activate if not using TLS for authentication
|
||||
enabled: true
|
||||
token: "${CROWDSEC_REGISTRATION_TOKEN}" # /!\ Do not modify this variable (Cluster K8S gitlab var)
|
||||
allowed_ranges: # /!\ Make sure to adapt to the pod IP ranges used by your cluster
|
||||
- "127.0.0.1/32"
|
||||
- "192.168.0.0/16"
|
||||
- "10.0.0.0/8"
|
||||
- "172.16.0.0/12"
|
||||
db_config:
|
||||
type: mysql
|
||||
user: ${CROWDSEC_DB_USER}
|
||||
password: ${CROWDSEC_DB_PWD}
|
||||
db_name: ${CROWDSEC_DB_NAME}
|
||||
host: ${DB_HOST}
|
||||
port: ${DB_PORT}
|
||||
flush:
|
||||
bouncers_autodelete:
|
||||
api_key: 1h
|
||||
agents_autodelete:
|
||||
login_password: 6h
|
||||
cert: 6h
|
||||
|
||||
appsec:
|
||||
enabled: true
|
||||
acquisitions:
|
||||
- source: appsec
|
||||
listen_addr: "0.0.0.0:7422"
|
||||
path: /
|
||||
appsec_configs:
|
||||
- crowdsecurity/appsec-default
|
||||
- crowdsecurity/crs
|
||||
labels:
|
||||
type: appsec
|
||||
env:
|
||||
- name: COLLECTIONS
|
||||
value: "crowdsecurity/appsec-virtual-patching crowdsecurity/appsec-crs crowdsecurity/appsec-generic-rules"
|
||||
8
infrastructure/crowdsec/helm-repository.yaml
Normal file
8
infrastructure/crowdsec/helm-repository.yaml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: HelmRepository
|
||||
metadata:
|
||||
name: crowdsec
|
||||
namespace: common-services
|
||||
spec:
|
||||
interval: 1h0m0s
|
||||
url: https://crowdsecurity.github.io/helm-charts
|
||||
5
infrastructure/crowdsec/kustomization.yaml
Normal file
5
infrastructure/crowdsec/kustomization.yaml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- helm-repository.yaml
|
||||
- helm-release.yaml
|
||||
|
|
@ -9,7 +9,7 @@ spec:
|
|||
chart:
|
||||
spec:
|
||||
chart: gitlab-agent
|
||||
version: 2.20.1
|
||||
version: 2.29.0
|
||||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: gitlab-agent
|
||||
|
|
@ -17,7 +17,7 @@ spec:
|
|||
values:
|
||||
|
||||
image:
|
||||
tag: v18.5.2
|
||||
tag: v19.2.0
|
||||
|
||||
config:
|
||||
kasAddress: "wss://lab.s-web.fr/-/kubernetes-agent/"
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ spec:
|
|||
chart:
|
||||
spec:
|
||||
chart: gitlab-runner
|
||||
version: 0.82.0
|
||||
version: 0.91.2
|
||||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: gitlab-runner
|
||||
|
|
@ -17,7 +17,7 @@ spec:
|
|||
values:
|
||||
|
||||
image:
|
||||
tag: alpine-v18.5.0
|
||||
tag: alpine-v19.2.2
|
||||
|
||||
gitlabUrl: https://lab.s-web.fr
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
apiVersion: external-secrets.io/v1beta1
|
||||
kind: ExternalSecret
|
||||
metadata:
|
||||
name: crowdsec-lapi-secret
|
||||
namespace: common-services
|
||||
spec:
|
||||
refreshInterval: 15s
|
||||
secretStoreRef:
|
||||
name: vault-secret-store
|
||||
kind: ClusterSecretStore
|
||||
target:
|
||||
name: crowdsec-lapi-secret
|
||||
creationPolicy: Owner
|
||||
data:
|
||||
- secretKey: CS_LAPI_SECRET
|
||||
remoteRef:
|
||||
key: secret/data/crowdsec/lapi
|
||||
property: CS_LAPI_SECRET
|
||||
- secretKey: REGISTRATION_TOKEN
|
||||
remoteRef:
|
||||
key: secret/data/crowdsec/lapi
|
||||
property: REGISTRATION_TOKEN
|
||||
- secretKey: ENROLL_KEY
|
||||
remoteRef:
|
||||
key: secret/data/crowdsec/lapi
|
||||
property: ENROLL_KEY
|
||||
- secretKey: ENROLL_INSTANCE_NAME
|
||||
remoteRef:
|
||||
key: secret/data/crowdsec/lapi
|
||||
property: ENROLL_INSTANCE_NAME
|
||||
- secretKey: ENROLL_TAGS
|
||||
remoteRef:
|
||||
key: secret/data/crowdsec/lapi
|
||||
property: ENROLL_TAGS
|
||||
- secretKey: BOUNCER_KEY_traefik
|
||||
remoteRef:
|
||||
key: secret/data/crowdsec/lapi
|
||||
property: BOUNCER_KEY_traefik
|
||||
|
|
@ -12,4 +12,5 @@ resources:
|
|||
- staging.yaml
|
||||
- production.yaml
|
||||
- rabbitmq.yaml
|
||||
- netdata.yaml
|
||||
- netdata.yaml
|
||||
- crowdsec.yaml
|
||||
|
|
|
|||
|
|
@ -33,7 +33,9 @@ spec:
|
|||
- "--entryPoints.websecure.forwardedHeaders.trustedIPs=${OVH_LOAD_BALANCER_EGRESS_IP}/32"
|
||||
|
||||
additionalArguments:
|
||||
- "--log.level=DEBUG"
|
||||
#- "--log.level=DEBUG"
|
||||
- "--entrypoints.web.http.middlewares=common-services-crowdsec-bouncer@kubernetescrd"
|
||||
- "--entrypoints.websecure.http.middlewares=common-services-crowdsec-bouncer@kubernetescrd"
|
||||
|
||||
deployment:
|
||||
replicas: 2
|
||||
|
|
@ -83,13 +85,28 @@ spec:
|
|||
kubernetesIngress:
|
||||
enabled: true
|
||||
|
||||
experimental:
|
||||
plugins:
|
||||
bouncer:
|
||||
moduleName: github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin
|
||||
version: v1.4.5
|
||||
|
||||
volumes:
|
||||
- name: crowdsec-lapi-secret
|
||||
mountPath: /etc/traefik/crowdsec
|
||||
type: secret
|
||||
secretName: crowdsec-lapi-secret
|
||||
|
||||
service:
|
||||
enabled: true
|
||||
type: LoadBalancer
|
||||
annotations:
|
||||
service.beta.kubernetes.io/ovh-loadbalancer-proxy-protocol: v2
|
||||
loadbalancer.ovhcloud.com/class: "octavia"
|
||||
loadbalancer.openstack.org/proxy-protocol: "v2"
|
||||
loadbalancer.openstack.org/keep-floatingip: "true"
|
||||
# Protection Flux : empêche la suppression accidentelle
|
||||
kustomize.toolkit.fluxcd.io/prune: disabled
|
||||
spec:
|
||||
loadBalancerIP: "${TRAEFIK_LOAD_BALANCER_IP}"
|
||||
externalTrafficPolicy: Local
|
||||
|
||||
ingressRoute:
|
||||
|
|
@ -97,6 +114,28 @@ spec:
|
|||
enabled: true
|
||||
|
||||
extraObjects:
|
||||
- apiVersion: traefik.io/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: crowdsec-bouncer
|
||||
namespace: common-services
|
||||
spec:
|
||||
plugin:
|
||||
bouncer:
|
||||
forwardedHeadersTrustedIps: "${OVH_LOAD_BALANCER_EGRESS_IP}/32"
|
||||
enabled: true
|
||||
crowdsecMode: stream
|
||||
crowdsecLapiScheme: http
|
||||
crowdsecLapiHost: crowdsec-service.common-services.svc.cluster.local:8080
|
||||
crowdsecLapiPath: /
|
||||
crowdsecLapiKeyFile: /etc/traefik/crowdsec/BOUNCER_KEY_traefik
|
||||
crowdsecAppsecEnabled: true
|
||||
crowdsecAppsecHost: crowdsec-appsec-service.common-services.svc.cluster.local:7422
|
||||
crowdsecAppsecPath: /
|
||||
crowdsecAppsecFailureBlock: true
|
||||
crowdsecAppsecUnreachableBlock: true
|
||||
crowdsecAppsecBodyLimit: 10485760
|
||||
|
||||
- apiVersion: traefik.io/v1alpha1 # Redirect www URLs to their no-www equivalent
|
||||
kind: Middleware
|
||||
metadata:
|
||||
|
|
@ -328,6 +367,9 @@ spec:
|
|||
- 168.119.123.75 # UptimeRobot
|
||||
- 78.46.215.1 # UptimeRobot
|
||||
- 91.99.101.207 # UptimeRobot
|
||||
- 46.224.188.186 # BugSmash
|
||||
- 178.156.178.124 # BugSmash
|
||||
- 5.161.29.18 # BugSmash
|
||||
|
||||
# AJOUT : Service Octavia en parallèle
|
||||
- apiVersion: v1
|
||||
|
|
@ -393,7 +435,25 @@ spec:
|
|||
routes:
|
||||
- kind: Rule
|
||||
match: >-
|
||||
ClientIP(`45.88.138.45/32`)
|
||||
ClientIP(`45.88.138.45/32`) ||
|
||||
ClientIP(`8.34.210.32/32`) ||
|
||||
ClientIP(`8.34.210.37/32`) ||
|
||||
ClientIP(`8.34.210.42/32`) ||
|
||||
ClientIP(`8.34.210.43/32`) ||
|
||||
ClientIP(`8.34.210.45/32`) ||
|
||||
ClientIP(`34.68.34.65/32`) ||
|
||||
ClientIP(`34.68.34.66/32`) ||
|
||||
ClientIP(`34.68.34.67/32`) ||
|
||||
ClientIP(`34.68.34.69/32`) ||
|
||||
ClientIP(`34.68.34.71/32`) ||
|
||||
ClientIP(`34.68.34.72/32`) ||
|
||||
ClientIP(`34.68.34.77/32`) ||
|
||||
ClientIP(`34.68.34.79/32`) ||
|
||||
ClientIP(`34.68.34.81/32`) ||
|
||||
ClientIP(`34.68.34.84/32`) ||
|
||||
ClientIP(`94.74.106.96/32`) ||
|
||||
ClientIP(`20.220.225.223/32`) ||
|
||||
ClientIP(`52.182.173.140/32`)
|
||||
priority: 100000
|
||||
middlewares:
|
||||
- name: deny-ip-blocklist
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue