wordpress-hardened

by Riotkit

Helm chartv6.1.1-3.0rc5App master

Lightweight Wordpress installation with additional security fixes

About this chart

wordpress-hardened

Hardened version of official WordPress container, with special support for Kubernetes.

Features:

  • Scheduled updates via wp-cli
  • NGINX instead of Apache
  • Supports NGINX-PROXY (VIRTUAL_HOST environment variable)
  • Hardened settings for WordPress: limiting access to code execution from wp-content directory, basic auth on wp-login.php
  • Basic Auth enabled by default to protect wp-login against bots (default user: riotkit, password: riotkit), can be changed using environment variables
  • Non-root container
  • Free from Supervisord, using lightweight multirun instead
  • Runtime NGINX and PHP configuration to adjust things like memory_limit, error_reporting or post_max_size
  • Pre-configuration of admin account, website name and list of installed plugins
  • Possible to upgrade Wordpress together with docker container
  • Built-in primitive rules to block common exploits targeting PHP

Kubernetes-only features:

  • Helm installer
  • Integration with Backup Repository (for Kubernetes-native backups)
  • Integration with Volume Syncing Controller (for WordPress volume synchronization between Pod and cloud filesystem)
  • Web Application Firewall and OWASP CRS support (experimental)

Check full documentation

Values

KeyTypeDefaultDescription
backups.collectionIdstring""Server side collection id (a backup slot/directory)
backups.emailstring"[email protected]"Used for GPG encryption. Recommended: Set the same as in user account in Backup Repository
backups.enabledboolfalse
backups.schedulestring"16 1 * * *"Crontab-like syntax, will be used in a kind: CronJob object
backups.secrets.gpgKeysobject{"createIfNotExists":true,"secretName":"backups-gpg"}GPG key pair - public & private key used for backup encryption. Will generate automatically if not present (make sure to back up created kind: Secret)
backups.secrets.loginTokenobject{"secretKey":"backup-login-token","secretName":""}Login token is a JWT token generated by logging in to Backup Repository (see: https://github.com/riotkit-org/backup-repository/blob/767707ada71781a59b583f3e35f22618cf7c1e44/docs/api/users/README.md#post-apistableauthlogin)
backups.templateNamestring"wordpress-mariadb-10.10"Use MariaDB template version matching your server's version for best compatibility
backups.templateTypestring"internal"
backups.urlstring"https://my-backup-repository-instance.org"Backup Repository instance URL
chownInitContainerobject{"enabled":true,"image":"busybox:1.36.0-musl"}Use PRIVILEGED init container to correct permissions of your volumes
db.administrativeJobsobject{}
db.hoststring"mariadb.db.svc.cluster.local"
db.namestring"riotkit"
db.password.secretKeystring"password"
db.password.secretNamestring"db-credentials"
db.portint3306
db.userstring"riotkit"
envobject{}
extraConfigMapslist[]
health.allowedSubnetsstring"10.0.0.0/8"
health.liveness.attributes.failureThresholdint2
health.liveness.attributes.periodSecondsint60
health.liveness.enabledbooltrue
health.readiness.attributes.failureThresholdint2
health.readiness.attributes.periodSecondsint60
health.readiness.enabledbooltrue
image.repositorystring"ghcr.io/riotkit-org/wordpress-hardened"
image.tagstring""
ingresses[0].annotations."cert-manager.io/cluster-issuer"string"letsencrypt-staging"
ingresses[0].classNamestring"nginx"
ingresses[0].hosts[0].paths[0].pathstring"/"
ingresses[0].hosts[0].paths[0].pathTypestring"ImplementationSpecific"
ingresses[0].tls[0].hostslist[]
permissionsobject{"gid":65161,"uid":65161}If .Values.podSecurityContext is not specified, then this section will set securityContext. Those values also applies to the chown init container
podDisruptionBudget.enabledboolfalse
podDisruptionBudget.spec.maxUnavailableint0
podDisruptionBudget.spec.minAvailableint1
podLabelsobject{}
podSecurityContextobject{}
pv.extraVolumeMountslist[]
pv.extraVolumeslist[]
pv.wpobject{"claimName":"wp","create":true,"enabled":true,"size":"256Mi"}Disable whole root directory volume to have WordPress version managed by the container. Enable it to use updater from the web - in this case the image version would only matter for PHP, NGINX versions, but the WordPress version would be bumped by WordPress by his own
pv.wp_content.claimNamestring"wp-content"
pv.wp_content.createbooltrue
pv.wp_content.enabledbooltrue
pv.wp_content.sizestring"1Gi"
replicasint1
resources.limits.cpuint1
resources.limits.memorystring"128Mi"
resources.requests.cpuint0
resources.requests.memorystring"16Mi"
revisionHistoryLimitint1
rollingUpdate.enabledbooltrue
rollingUpdate.spec.maxSurgeint1
rollingUpdate.spec.maxUnavailableint0
secretsobject{"apiVersion":"bitnami.com/v1alpha1","content":"encryptedData:\n ...\n","create":false,"enabled":false,"kind":"SealedSecret","name":"wordpress-secrets"}Allows to embed kind: Secret, kind: SealedSecret, kind: ExternalSecret or any other secret. Use it for example with Bitnami's Sealed Secret
service.portint8080
service.typestring"ClusterIP"
terminationGracePeriodSecondsint20
volumeSyncing.automaticEncryption.enabledbooltrue
volumeSyncing.automaticEncryption.secretNamestring"sync-encryption"
volumeSyncing.enabledboolfalse
volumeSyncing.env.REMOTE_ACLstring"private"
volumeSyncing.env.REMOTE_ENDPOINTstring"http://minio.storage.svc.cluster.local:9000"
volumeSyncing.env.REMOTE_PROVIDERstring"Minio"
volumeSyncing.env.REMOTE_TYPEstring"s3"Remote storage configuration
volumeSyncing.secret.namestring""
volumeSyncing.syncOptions.allowedDirections.fromRemotebooltrue
volumeSyncing.syncOptions.allowedDirections.toRemotebooltrue
volumeSyncing.syncOptions.cleanUp.forceLocalboolfalse
volumeSyncing.syncOptions.cleanUp.forceRemoteboolfalse
volumeSyncing.syncOptions.cleanUp.localboolfalse
volumeSyncing.syncOptions.cleanUp.remotebooltrue
volumeSyncing.syncOptions.restoreRemoteOnFirstRunboolfalse
volumeSyncing.syncOptions.schedulestring"@every 8h"
waf.directivesstring"#SecDefaultAction \"phase:4,allow,log\"\n#SecAction \"id:1,pass,log\"\n#SecAuditLog /dev/stdout\n#SecDebugLog /dev/stdout\n#SecDebugLogLevel 5\n"
waf.enabledboolfalse
waf.env.ENABLE_CORAZA_WAFboolfalse
waf.env.ENABLE_CRSbooltrue
waf.env.ENABLE_RATE_LIMITERbooltrue
waf.env.ENABLE_RULE_WORDPRESSbooltrue
waf.env.RATE_LIMIT_EVENTSstring"30"
waf.env.RATE_LIMIT_WINDOWstring"5s"
waf.health.liveness.attributes.failureThresholdint2
waf.health.liveness.attributes.periodSecondsint60
waf.health.liveness.enabledbooltrue
waf.image.repositorystring"ghcr.io/riotkit-org/waf-proxy"
waf.image.tagstring"snapshot"
wordpress.autoUpdatebooltrueShould the WordPress automatically update itself periodically? NOTICE! Use with .pv.wp.enabled = true
wordpress.domainstring"example.org"Ingress domain name
wordpress.httpsstring"on"HTTP/HTTPS
wordpress.publicPortstring"443"Ingress port

Deploy wordpress-hardened with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has wordpress-hardened on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartwordpress-hardened is pinned at v6.1.1-3.0rc5 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply