Log processors: in-process hub update
Maintainers usually reply within 4 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reading the existing cron/systemd hub update flow and the configuration and reload paths. The issue identifies exprhelpers globals, appsec configuration parsing, atomic reload, and the update mechanism as separate work areas, but does not name files or tests. Done means updates run in process, validate before swapping configuration, and publish the two specified metrics.
Written by the indexing model from the issue text.
Description
Automated hub updates are currently handled by a cron/systemd timer that invokes cscli hub update / cscli hub upgrade then reloads crowdsec.
This works fine for deployment in VMs/bare metal, but cannot work for container/k8s/deployment (and windows currently has no support at all for hub auto updates).
We should replace the cron with an-in process update that has no external dependancies.
A new config key would be introduced:
crowdsec_service:
hub_auto_update:
enabled: true
interval: 24h
This would default to enabled (the cron would be removed in the 1st release shipping this).
When crowdsec performs an update, the new configuration would be tested then swapped with the current one (the current cron cannot handle a rollback during a config upgrade, so we will also address this).
Because this require some important internal changes, we should split the work:
- Stop relying on package level globals for exprhelpers (datafiles, geoip, ...) so that they can be swapped at runtime
- Decouple appsec configuration parsing from the datasource itself to allow for testing before loading the configuration (this would have the side effect of being able to test them with
crowdsec -t) - Implement the atomic configuration swap on reload (probably LP only at first ?): this would make crowdsec behaves more like nginx during a reload (a reload can fail, but the current version stays up), where currently we simply refuse the new config and exit.
- Implement the actual update mechanism
A successfull auto-update would kill all existing buckets (like the current reload does)
New metrics would be published:
cs_autoupdate_last_timestamp: timestamp of the last successful autoupdatecs_autoupdate_total: counter that tracks how many autoupdates with changes were performed
- Dominant language
- Go
- Stars
- 15.1k
- Forks
- 726
- Avg merge
- 4d 23h
- Merged PRs (30d)
- 27
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from crowdsecurity/crowdsec
-
needs/kind needs/triage
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
crowdsecurity/crowdsec#4849 · 2 comments ·
Maintainers usually reply within 4 days
-
kind/bug needs/triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
crowdsecurity/crowdsec#4847 · 3 comments ·
Maintainers usually reply within 4 days
-
kind/bug needs/triage os/linux
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
crowdsecurity/crowdsec#4836 · 1 comment ·
Maintainers usually reply within 4 days
-
victorialogs datasource passes the trailing newline of a message to the parsers (traefik-logs 1.6 fails on every line)Possibly taken @IlayWolfson claimed this 6 days ago. Openkind/bug needs/triage os/linux version/1.8.2
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
crowdsecurity/crowdsec#4820 · 1 comment ·
Maintainers usually reply within 4 days
-
[email protected]Openneeds/kind needs/triage
Difficulty 5/5 Over a week Newbie friendliness 10/100
crowdsecurity/crowdsec#4842 · 3 comments ·
Maintainers usually reply within 4 days
All issues in crowdsecurity/crowdsec
Similar issues
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 62/100
DaoCloud/DaoCloud-docs#7839 ·
Maintainers usually reply within 1 day
-
Type: Enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
projectdiscovery/urlfinder#167 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
peterstace/simplefeatures#726 ·
-
area: import bug go good first issue priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
fukubie/StockLlama#69 ·
-
enhancement help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
cloverworks-hq/rumpty-cli#95 ·
Maintainers usually reply within 1 day