Gitea / Forgejo log parser does not check API access

Open Beginner friendly
#1,851 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python
Domain
security

Research direction

Find the existing Gitea/Forgejo parser under the hub parsers (search for Gitea grok or router: completed). Add a pattern that matches 401 API authentication failures using the sample log and the suggested grok (timestamp, method, path, remote_ip, 401). Confirm the parser now extracts those failed API calls the same way successful ones are handled.

Written by the indexing model from the issue text.

Description

Currently the Gitea parser ignores failed API authentication. I don't have any experience with grok patterns, but according to https://www.javainuse.com/grok this should be enough:

^%{YEAR}/%{MONTHNUM}/%{MONTHDAY} %{TIME} .*?router: completed %{WORD:method} %{URIPATH:path} for %{IP:remote_ip}:%{NUMBER:remote_port}, 401 %{WORD} in

{YEAR}/%{MONTHNUM}/%{MONTHDAY} %{TIME} could probably be replaced with {GITEA_CUSTOMDATE:timestamp}

Sample log entry:
2026/07/22 19:40:17 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/v1/repos/flex/flexcore/hooks for 11.111.111.111:0, 401 Unauthorized in 1.8ms @ shared/middleware.go:60(shared.Middlewares.apiAuthentication)

Dominant language
Python
Stars
257
Forks
235
Avg merge
2d 10h
Merged PRs (30d)
26

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from crowdsecurity/hub

All issues in crowdsecurity/hub

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.