forked from mtusi2026/mtusi2026lab7
Prepare verified laboratory 7 implementation and evidence
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
pid_file = "/tmp/bao-agent.pid"
|
||||
log_level = "error"
|
||||
vault {
|
||||
address = "https://openbao:8200"
|
||||
ca_cert = "/pki/ca.crt"
|
||||
}
|
||||
auto_auth {
|
||||
method "cert" {
|
||||
mount_path = "auth/cert"
|
||||
config = {
|
||||
name = "api"
|
||||
ca_cert = "/pki/ca.crt"
|
||||
client_cert = "/pki/cert.pem"
|
||||
client_key = "/pki/key.pem"
|
||||
reload = true
|
||||
}
|
||||
}
|
||||
}
|
||||
template_config {
|
||||
static_secret_render_interval = "5s"
|
||||
exit_on_retry_failure = false
|
||||
}
|
||||
template {
|
||||
destination = "/run/app/database_url"
|
||||
perms = "0600"
|
||||
backup = false
|
||||
error_on_missing_key = true
|
||||
contents = <<EOT
|
||||
{{ with secret "kv/data/api" }}{{ .Data.data.database_url }}{{ end }}
|
||||
EOT
|
||||
}
|
||||
template {
|
||||
destination = "/run/app/cache_url"
|
||||
perms = "0600"
|
||||
backup = false
|
||||
error_on_missing_key = true
|
||||
contents = <<EOT
|
||||
{{ with secret "kv/data/api" }}{{ .Data.data.cache_url }}{{ end }}
|
||||
EOT
|
||||
}
|
||||
template {
|
||||
destination = "/run/app/s3.json"
|
||||
perms = "0600"
|
||||
backup = false
|
||||
error_on_missing_key = true
|
||||
contents = <<EOT
|
||||
{{ with secret "kv/data/api" }}{{ .Data.data.s3_json }}{{ end }}
|
||||
EOT
|
||||
}
|
||||
template {
|
||||
destination = "/run/app/freshness"
|
||||
perms = "0600"
|
||||
backup = false
|
||||
error_on_missing_key = true
|
||||
contents = <<EOT
|
||||
{{ with secret "kv/data/api" }}{{ timestamp }}{{ end }}
|
||||
EOT
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
path "kv/data/api" { capabilities = ["read"] }
|
||||
path "auth/token/lookup-self" { capabilities = ["read"] }
|
||||
path "auth/token/renew-self" { capabilities = ["update"] }
|
||||
path "auth/token/revoke-self" { capabilities = ["update"] }
|
||||
@@ -0,0 +1,27 @@
|
||||
ui = false
|
||||
api_addr = "https://openbao:8200"
|
||||
default_lease_ttl = "60s"
|
||||
max_lease_ttl = "5m"
|
||||
log_level = "warn"
|
||||
storage "pebbledb" { path = "/bao/data/pebbledb" }
|
||||
audit "file" "file" {
|
||||
description = "Private HMAC-protected operator audit"
|
||||
options {
|
||||
file_path = "/bao/data/audit.log"
|
||||
log_raw = "false"
|
||||
mode = "0600"
|
||||
}
|
||||
}
|
||||
listener "tcp" {
|
||||
address = "0.0.0.0:8200"
|
||||
tls_cert_file = "/pki/cert.pem"
|
||||
tls_key_file = "/pki/key.pem"
|
||||
tls_client_ca_file = "/pki/ca.crt"
|
||||
tls_min_version = "tls12"
|
||||
tls_disable_client_certs = false
|
||||
tls_require_and_verify_client_cert = false
|
||||
max_request_size = 1048576
|
||||
http_read_header_timeout = "5s"
|
||||
http_read_timeout = "10s"
|
||||
http_write_timeout = "10s"
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
pid_file = "/tmp/bao-agent.pid"
|
||||
log_level = "error"
|
||||
vault {
|
||||
address = "https://openbao:8200"
|
||||
ca_cert = "/pki/ca.crt"
|
||||
}
|
||||
auto_auth {
|
||||
method "cert" {
|
||||
mount_path = "auth/cert"
|
||||
config = {
|
||||
name = "worker"
|
||||
ca_cert = "/pki/ca.crt"
|
||||
client_cert = "/pki/cert.pem"
|
||||
client_key = "/pki/key.pem"
|
||||
reload = true
|
||||
}
|
||||
}
|
||||
}
|
||||
template_config {
|
||||
static_secret_render_interval = "5s"
|
||||
exit_on_retry_failure = false
|
||||
}
|
||||
template {
|
||||
destination = "/run/app/database_url"
|
||||
perms = "0600"
|
||||
backup = false
|
||||
error_on_missing_key = true
|
||||
contents = <<EOT
|
||||
{{ with secret "kv/data/worker" }}{{ .Data.data.database_url }}{{ end }}
|
||||
EOT
|
||||
}
|
||||
template {
|
||||
destination = "/run/app/cache_url"
|
||||
perms = "0600"
|
||||
backup = false
|
||||
error_on_missing_key = true
|
||||
contents = <<EOT
|
||||
{{ with secret "kv/data/worker" }}{{ .Data.data.cache_url }}{{ end }}
|
||||
EOT
|
||||
}
|
||||
template {
|
||||
destination = "/run/app/s3.json"
|
||||
perms = "0600"
|
||||
backup = false
|
||||
error_on_missing_key = true
|
||||
contents = <<EOT
|
||||
{{ with secret "kv/data/worker" }}{{ .Data.data.s3_json }}{{ end }}
|
||||
EOT
|
||||
}
|
||||
template {
|
||||
destination = "/run/app/publisher_url"
|
||||
perms = "0600"
|
||||
backup = false
|
||||
error_on_missing_key = true
|
||||
contents = <<EOT
|
||||
{{ with secret "kv/data/worker" }}{{ .Data.data.publisher_url }}{{ end }}
|
||||
EOT
|
||||
}
|
||||
template {
|
||||
destination = "/run/app/freshness"
|
||||
perms = "0600"
|
||||
backup = false
|
||||
error_on_missing_key = true
|
||||
contents = <<EOT
|
||||
{{ with secret "kv/data/worker" }}{{ timestamp }}{{ end }}
|
||||
EOT
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
path "kv/data/worker" { capabilities = ["read"] }
|
||||
path "auth/token/lookup-self" { capabilities = ["read"] }
|
||||
path "auth/token/renew-self" { capabilities = ["update"] }
|
||||
path "auth/token/revoke-self" { capabilities = ["update"] }
|
||||
Reference in New Issue
Block a user