Commit Graph

43 Commits

Author SHA1 Message Date
Kevin Fenzi
e5d26fea60 proxies: allow POST for forge
Some folks were getting posts failing against forge.
See https://forge.fedoraproject.org/forge/forge/issues/401

So, lets just explicitly allow POSTs through anubis as
this should be fine for normal people and should not be something
that scrapers normally do.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2026-02-12 16:57:26 -08:00
Kevin Fenzi
5615d1b036 anubis: allow .zck files universally
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2026-02-10 07:52:53 -08:00
Kevin Fenzi
4e9729d938 anubis: fix ports for el vs non el versions
I mistakenly changed the port in the fedora/non el one, that was
correct.

Need to add the port in the el one for selinux to allow httpd to work.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2026-01-22 10:44:20 -08:00
Kevin Fenzi
6ceb3ea68b download: enable/finish anubis for other download servers
Fixed up a few things missed and caught in testing on dl01:
* need to setup subuid/subgid files for podman
* need to allow the right port for httpd to listen in selinux
* need httpd network connect to allow it to connect to anubis
* adjust worker values, we were not using prefork for a long time
so the values were just default up them a bunch.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2026-01-22 10:16:22 -08:00
Tomáš Hrčka
f836929e43 Update roles/anubis/templates/policies.yaml.j2
Add attlasian to the allow list in anubis
2026-01-14 00:06:10 +00:00
Jiri Kyjovsky
88102722cb copr-anubis: allow copr-related user agents to pass without challenge 2026-01-12 09:00:32 +00:00
Jiri Kyjovsky
02d6781cc9 copr-anubis: allow comps.xml endpoint for Copr backend
The backend uses urlretrieve() to download comps.xml from the frontend
at /coprs/<user>/<project>/chroot/<chroot>/comps/. Since this path is
under /coprs/ which is protected by Anubis, the backend receives the
JavaScript challenge page instead of the actual comps data.

This HTML then gets saved as comps.xml and included in the repository
metadata, causing users to download Anubis challenge HTML instead of
the actual comps.xml.gz file.
2026-01-08 17:06:03 +01:00
Jiri Kyjovsky
3595436104 copr-anubis: loosen policies (go through defaults), allow essentials 2026-01-08 16:40:34 +01:00
Jiri Kyjovsky
d79d6ca487 copr/anubis: fix configuration on frontend to protect only /coprs (same for distgit)
Anubis was accidentally enabled for all traffic (/) instead of just
the /coprs/ web UI. This caused unnecessary bot challenges for API
clients, dnf/yum, and other automated tools.

Use Anubis BASE_PREFIX to cleanly protect only specific endpoints:
- Frontend: /coprs/ (web UI)
- Dist-git: /{{ cgit_uri }}/ (package browser)

https://anubis.techaro.lol/docs/admin/installation#using-base-prefix
2026-01-07 13:58:11 +01:00
Jiri Kyjovsky
b7f3eff5f0 copr-anubis: allow webhooks 2025-12-19 19:45:53 +01:00
Jiri Kyjovsky
79f8839285 anubis copr: allow path for build status badges 2025-12-15 18:25:08 +01:00
Kevin Fenzi
af685201f8 anubis: disable open graph passthrough for now until we can sit down and make it work
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-12-12 15:45:48 -08:00
Pavel Raiskup
87a0161df3 copr-fe: anubis: pass through to all /repo/ routes 2025-12-11 08:12:49 +01:00
Pavel Raiskup
14d3be6b93 copr-fe: anubis: do not protect .repo routes
This was breaking testing farm.
2025-12-10 19:54:40 +01:00
Pavel Raiskup
50223282e7 copr-fe: deploy anubis
Relates: https://pagure.io/fedora-infrastructure/issue/12971
Fixes: https://github.com/fedora-copr/copr/issues/4064

Co-authored-by: Jiri Kyjovsky <j1.kyjovsky@gmail.com>
2025-12-10 16:01:04 +01:00
Kevin Fenzi
a7402ebf5f anubis: allowlist productmd
The python productmd library hits kojipkgs to find recent
composes/compose information. It's not easy for it to adjust on the
client end, but it does send a user-agent header like "productmd/1.49"
So, lets just allowlist it for now.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-12-05 10:09:49 -08:00
Maxwell G
51ab1dc9e6 anubis: allow checking for dead.package files
Checking for the presence of dead.package by trying to download the
dead.package file and checking for an HTTP 404 or 200 is an easy way to
check if a package is retied in distgit.
This practice is used in the wild in tools like fedora-misc-package-utilities.
2025-12-03 20:15:35 -06:00
Kevin Fenzi
f7e4a1bdd7 anubis: 30 is too high, down to 20
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-12-03 16:08:52 -08:00
Kevin Fenzi
4822e9cd13 anubis: revert challenging all /forks/
This was an attempt to block the scrapers, but sadly it breaks humans.
We cannot challenge everything under forks because people need to push
pr's and those get blocked.

So, go back to just weighting those higher...

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-12-03 15:52:57 -08:00
Kevin Fenzi
2c29dbef64 anubis: allowlist src/extras
These are some smallish json files that are used by various scripts.
Lets just allowlist them.

See https://pagure.io/fedora-infrastructure/issue/12946

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-12-03 11:46:29 -08:00
Kevin Fenzi
4ae493f195 anubis: reduce forks, was impossible at the former level
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-12-02 12:19:38 -08:00
Kevin Fenzi
708c0fdaa2 anubis: adjust forks on src to slow challenge
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-12-02 11:05:15 -08:00
Kevin Fenzi
00c612bd6a anubis: allow packit user-agent
Per https://pagure.io/fedora-infrastructure/issue/12923
just allowlist the packit user agent at least for now.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-12-02 10:22:27 -08:00
Kevin Fenzi
7fbb35c25b anubis: drop libreoffice rules
We had this in place when scrapers were hitting libreoffice really hard.
They don't seem to be anymore, so drop it for now.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-11-30 14:03:22 -08:00
Kevin Fenzi
05dbcb3812 anubis: grant up challenge difficulty for libreoffice for now as it is being hit hard
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-11-22 20:30:46 -08:00
Kevin Fenzi
e1396032ca anubis: enable open graph passthrough
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-11-20 10:10:56 -08:00
Kevin Fenzi
8d5fabd4ca anubis: also allow compose/iot
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-11-19 07:42:11 -08:00
Kevin Fenzi
ec612e869a anubis: simplify and allow more
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-11-18 16:32:37 -08:00
Kevin Fenzi
0fc8720190 anubis: also enable rules on the proxies
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-11-18 16:30:13 -08:00
Kevin Fenzi
fb1594c31d anubis: use correct default policy link
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-11-18 16:20:38 -08:00
Kevin Fenzi
40549293ac anubis: actually add the default policy file
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-11-18 16:15:16 -08:00
Kevin Fenzi
b1f3b68e09 anubis: allow flatpak delta-indexes
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-11-18 16:03:30 -08:00
Kevin Fenzi
ceb9a4f94b anubis: crank up challenges on /fork
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-11-18 15:56:56 -08:00
Kevin Fenzi
29978f3192 anubis: try and allow ostree/iot summary and refs through
This was causing problems when we last upgraded anubis because
the refs/summary were getting challenges from anubis for ostree users.
So, lets try and just allow those. They are all small files, so
it shouldn't be much in the way of load.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-11-18 15:16:52 -08:00
Greg Sutcliffe
0a4a78bf9a Zabbix: Add HAProxy monitoring template
Signed-off-by: Greg Sutcliffe <fedora@emeraldreverie.org>
2025-11-03 15:54:57 +00:00
Greg Sutcliffe
162852fef5 Zabbix: Add Anubis template and role changes to apply it
Includes an SELinux module, and an attempt at alering via
anomaly detection rather than hard thresholds.

Uses the newly-created SELinux compile tasks to deploy the
new module too.

Signed-off-by: Greg Sutcliffe <fedora@emeraldreverie.org>
2025-10-31 12:38:40 +00:00
Kevin Fenzi
f75f2c51c1 anubis: try and allow bodhi and badges rss feeds
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-09-25 16:09:27 -07:00
Kevin Fenzi
5fa264e63e anubis: allow httpd to bind to port 8345
Tell selinux that httpd can use port 8345 in enforcing mode.
It needs to do this to listen for post anubis requests coming in on
localhost.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-09-18 16:29:17 -07:00
Kevin Fenzi
fd4ebff347 anubis: add group/user
Normally the fedora anubis package uses systemd's DynamicUser, which is
fine, but we need to setup a env file only readable by anubis because it
contains a private key.

So, just add group/user here and the unit will use those instead.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-09-18 15:43:23 -07:00
Kevin Fenzi
7f37ed4a54 anubis: add missing line
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-09-18 14:16:01 -07:00
Kevin Fenzi
f9be91f9c1 anubis: split out these config loops
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-09-18 14:12:27 -07:00
Kevin Fenzi
818be6364d anubis: fix typo
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-09-18 13:47:18 -07:00
Kevin Fenzi
e7c16d7fe0 anubis: move to top level role, add some more items
This copies the excellect copr/anubis role to a more generic top level
one. It allows for using a different env per ipa_host_group (but we
could also just add more cases in there) or a default one if that isn't
found.

It moves the defaults and policies to template so we can include a
static key from ansible-private if we like.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-09-18 13:31:42 -07:00