CronJob
The Kubernetes object that creates a new Job on a repeating schedule written in cron format.
In more detail
concurrencyPolicy decides what happens if the previous run is still going: Allow, Forbid or Replace. History limits keep only a few finished Jobs so the namespace stays tidy. Test the first run and the time zone before trusting an overnight schedule.
Examples
kubectl get cj report-dailyAttackers create CronJobs, often in kube-system, to run their container again and again; ATT&CK tracks this as T1053.007.Related terms
- Kubernetes Job — The Kubernetes object that runs pods until a set number of them finish successfully, for work that has a clear end.
- cron — The Unix and Linux service that runs commands automatically on a schedule, such as every night at two in the morning.
- persistence — Anything an attacker sets up so their access survives reboots, logoffs and password changes, such as a scheduled task or a new key.
- Kubernetes audit log — The Kubernetes API server's record of every request made to it: who asked, for what, and whether it was allowed.
Taught in
- Container Images The Exam Way — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Choose The Right Workload Resource — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Jobs And CronJobs That Behave — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Design And Build: Timed Drill And Checkpoint — Certified Kubernetes Application Developer (CKAD) Exam Prep
- API Deprecations And Migrations — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Observability: Timed Drill And Checkpoint — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Custom Resources And Operators — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Mock Exam: Sixteen Tasks Against The Clock — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Same Name, Wrong Namespace: Objects, Namespaces And Labels — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Five Jobs, Five Workloads — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Fundamentals Sprint: Four Tickets Before The Doors Open — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- One Leaked Kubeconfig: How Far Does It Go? — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep
- What Outlives The Fix: Persistence And Privilege Escalation — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep
- Threat Model Sprint: Name It, Then Stop It — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep
- Forty Three Of Sixty: The Mock, And How To Read It — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep
- DaemonSets And Node Services — Kubernetes: Production-Grade Container Orchestration
- Jobs And CronJobs — Kubernetes: Production-Grade Container Orchestration
- Detecting Persistence: Tasks, Registry & Services — Security Operations & Threat Hunting (SOC)