[+] lab7
Grade 3 secure application acceptance / secure (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
Xabenskie
2026-11-30 09:09:57 +03:00
parent 20afc2c790
commit 4eca49fe3d
149 changed files with 68317 additions and 58 deletions
+3
View File
@@ -0,0 +1,3 @@
FROM python:3.13.5-slim
RUN pip install --no-cache-dir pip-audit==2.9.0
ENTRYPOINT ["python", "-m", "pip_audit", "--cache-dir", "/tmp/pip-audit", "--disable-pip", "--no-deps", "-r", "/requirements.lock", "--format", "json", "--output", "/out/dependency-scan.json"]
+37
View File
@@ -0,0 +1,37 @@
[
{
"port": 6380,
"upstream_port": 6379,
"allowed_clients": [
"api",
"relay"
],
"protocol": "redis",
"redis_user": "producer",
"commands": [
"AUTH",
"PING",
"CLIENT",
"XADD"
]
},
{
"port": 6381,
"upstream_port": 6379,
"allowed_clients": [
"worker"
],
"protocol": "redis",
"redis_user": "consumer",
"commands": [
"AUTH",
"PING",
"CLIENT",
"XGROUP",
"XREADGROUP",
"XAUTOCLAIM",
"XACK",
"XDEL"
]
}
]
+8
View File
@@ -0,0 +1,8 @@
bind 127.0.0.1
port 6379
appendonly yes
appendfsync always
dir /data
aclfile /etc/redis/users.acl
maxmemory 96mb
maxmemory-policy noeviction
+7
View File
@@ -0,0 +1,7 @@
bind 127.0.0.1
port 6379
appendonly yes
dir /data
aclfile /etc/redis/users.acl
maxmemory 64mb
maxmemory-policy allkeys-lru
+40
View File
@@ -0,0 +1,40 @@
[
{
"port": 4319,
"upstream_port": 4318,
"allowed_clients": [
"api",
"worker",
"relay"
],
"protocol": "http"
},
{
"port": 9465,
"upstream_port": 9464,
"allowed_clients": [
"prometheus"
],
"protocol": "http",
"read_only_clients": [
"prometheus"
],
"read_prefixes": [
"/metrics"
]
},
{
"port": 8889,
"upstream_port": 8888,
"allowed_clients": [
"prometheus"
],
"protocol": "http",
"read_only_clients": [
"prometheus"
],
"read_prefixes": [
"/metrics"
]
}
]
+25
View File
@@ -0,0 +1,25 @@
[
{
"port": 9443,
"upstream_port": 3100,
"allowed_clients": [
"collector",
"grafana",
"operator"
],
"read_only_clients": [
"grafana",
"operator"
],
"protocol": "http",
"read_prefixes": [
"/ready",
"/loki/api/v1/query",
"/loki/api/v1/labels",
"/loki/api/v1/label/",
"/loki/api/v1/series",
"/loki/api/v1/index/",
"/loki/api/v1/volume"
]
}
]
+16
View File
@@ -0,0 +1,16 @@
ui = true
disable_mlock = true
api_addr = "https://openbao:8200"
cluster_addr = "https://127.0.0.1:8201"
listener "tcp" {
address = "0.0.0.0:8200"
cluster_address = "127.0.0.1:8201"
tls_cert_file = "/pki/tls.crt"
tls_key_file = "/pki/tls.key"
tls_client_ca_file = "/trust/ca.crt"
tls_require_and_verify_client_cert = true
tls_min_version = "tls12"
}
storage "file" {
path = "/openbao/file"
}
+5
View File
@@ -0,0 +1,5 @@
local all all trust
hostnossl all all 0.0.0.0/0 reject
hostnossl all all ::/0 reject
hostssl all all 0.0.0.0/0 scram-sha-256
hostssl all all ::/0 scram-sha-256
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
set -eu
cp /pki/tls.key /tmp/postgres-tls.key
chown postgres:postgres /tmp/postgres-tls.key
chmod 600 /tmp/postgres-tls.key
exec /usr/local/bin/docker-entrypoint.sh postgres -c hba_file=/config/pg_hba.conf -c ssl=on -c ssl_cert_file=/pki/tls.crt -c ssl_key_file=/tmp/postgres-tls.key -c ssl_min_protocol_version=TLSv1.2 -c log_parameter_max_length_on_error=0
+27
View File
@@ -0,0 +1,27 @@
[
{
"port": 9443,
"upstream_port": 9090,
"allowed_clients": [
"grafana",
"operator"
],
"read_only_clients": [
"grafana",
"operator"
],
"protocol": "http",
"read_prefixes": [
"/-/ready",
"/api/v1/query",
"/api/v1/labels",
"/api/v1/label/",
"/api/v1/series",
"/api/v1/metadata",
"/api/v1/status/",
"/api/v1/alerts",
"/api/v1/rules",
"/api/v1/targets"
]
}
]
+37
View File
@@ -0,0 +1,37 @@
[
{
"port": 6380,
"upstream_port": 6379,
"allowed_clients": [
"api"
],
"protocol": "redis",
"redis_user": "profile",
"commands": [
"AUTH",
"PING",
"CLIENT",
"GET",
"SET"
]
},
{
"port": 6382,
"upstream_port": 6379,
"allowed_clients": [
"operator"
],
"protocol": "redis",
"redis_user": "tester",
"commands": [
"AUTH",
"PING",
"CLIENT",
"GET",
"SET",
"FLUSHDB",
"DEL",
"TTL"
]
}
]
+33
View File
@@ -0,0 +1,33 @@
[
{
"port": 9443,
"upstream_port": 3200,
"allowed_clients": [
"grafana",
"operator"
],
"read_only_clients": [
"grafana",
"operator"
],
"protocol": "http",
"read_prefixes": [
"/ready",
"/api/traces/",
"/api/search",
"/api/v2/search",
"/api/echo",
"/api/status/"
]
},
{
"port": 4319,
"upstream_port": 4317,
"allowed_clients": [
"collector"
],
"alpn": [
"h2"
]
}
]