Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

### Bug Fixes

- Disable HTTP directory listing for RPM repository to improve security
(PR[#4651](https://github.com/scality/metalk8s/pull/4651))

- Fix a Bug where NodeSystemSaturation alert triggers too early after only 15 minutes of high load
(PR[#4641](https://github.com/scality/metalk8s/pull/4641))

Expand Down
1 change: 1 addition & 0 deletions salt/metalk8s/repo/configured.sls
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Generate repositories nginx configuration:
- defaults:
listening_address: {{ grains.metalk8s.control_plane_ip }}
listening_port: {{ repo.port }}
archives: {{ archives }}

Deploy common container registry nginx configuration:
file.managed:
Expand Down
17 changes: 16 additions & 1 deletion salt/metalk8s/repo/files/nginx.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,24 @@ server {
listen {{ listening_address }}:{{ listening_port }};
server_name localhost;

# Return 200 OK for root path health checks
location = / {
return 200 '';
add_header Content-Type text/plain;
}

# Return 200 OK for saltenv path health checks
{%- for env in archives.keys() %}
location = /{{ env }}/ {
return 200 '';
add_header Content-Type text/plain;
}
{%- endfor %}

location / {
root /var/www/repositories;
autoindex on;
# Security fix: Disable directory listing to prevent exposing repository structure
autoindex off;
}

include conf.d/*.inc;
Expand Down
1 change: 1 addition & 0 deletions salt/tests/unit/formulas/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,7 @@ metalk8s:
extra_context:
listening_address: "10.0.0.1"
listening_port: 8080
archives: *example_archives

repositories-manifest.yaml.j2:
_cases:
Expand Down
Loading