1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 18:15:42 +01:00

Merge pull request #624 from gocsaf/add-acao-header

feat: add access-control-allow-origin header
This commit is contained in:
JanHoefelmeyer 2025-03-14 17:38:59 +01:00 committed by GitHub
commit e916f19ee4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 1 deletions

View file

@ -78,6 +78,9 @@ server {
# directory listings # directory listings
autoindex on; autoindex on;
# allow others web applications to get the static information
add_header Access-Control-Allow-Origin "*";
} }
# enable CGI # enable CGI
@ -155,7 +158,7 @@ Again replacing `{clientCert.crt}` and `{clientKey.pem}` accordingly.
To let nginx resolves the DNS record `csaf.data.security.domain.tld` to fulfill the [Requirement 10](https://docs.oasis-open.org/csaf/csaf/v2.0/cs01/csaf-v2.0-cs01.html#7110-requirement-10-dns-path) configure a new server block (virtual host) in a separated file under `/etc/nginx/available-sites/{DNSNAME}` like following: To let nginx resolves the DNS record `csaf.data.security.domain.tld` to fulfill the [Requirement 10](https://docs.oasis-open.org/csaf/csaf/v2.0/cs01/csaf-v2.0-cs01.html#7110-requirement-10-dns-path) configure a new server block (virtual host) in a separated file under `/etc/nginx/available-sites/{DNSNAME}` like following:
<!-- MARKDOWN-AUTO-DOCS:START (CODE:src=../docs/scripts/DNSConfigForItest.sh&lines=18-35) --> <!-- MARKDOWN-AUTO-DOCS:START (CODE:src=../docs/scripts/DNSConfigForItest.sh&lines=18-37) -->
<!-- The below code snippet is automatically added from ../docs/scripts/DNSConfigForItest.sh --> <!-- The below code snippet is automatically added from ../docs/scripts/DNSConfigForItest.sh -->
```sh ```sh
server { server {

View file

@ -28,6 +28,8 @@ echo "
location = / { location = / {
try_files /.well-known/csaf/provider-metadata.json =404; try_files /.well-known/csaf/provider-metadata.json =404;
# allow others web applications to get the static information
add_header Access-Control-Allow-Origin "*";
} }
access_log /var/log/nginx/dns-domain_access.log; access_log /var/log/nginx/dns-domain_access.log;

View file

@ -61,6 +61,9 @@ echo "
# directory listings # directory listings
autoindex on; autoindex on;
# allow others web applications to get the static information
add_header Access-Control-Allow-Origin "*";
" > locationConfig.txt " > locationConfig.txt
sudo sed -i "/^\s*location \/ {/r locationConfig.txt" $NGINX_CONFIG_PATH # Insert config inside location{} sudo sed -i "/^\s*location \/ {/r locationConfig.txt" $NGINX_CONFIG_PATH # Insert config inside location{}
./DNSConfigForItest.sh ./DNSConfigForItest.sh