Skip to content

Add api security headers#7138

Merged
davidjiglesias merged 2 commits into4.0.4from
4.0.4-api-security-headers
Jan 11, 2021
Merged

Add api security headers#7138
davidjiglesias merged 2 commits into4.0.4from
4.0.4-api-security-headers

Conversation

@AdriiiPRodri
Copy link
Copy Markdown
Contributor

@AdriiiPRodri AdriiiPRodri commented Jan 11, 2021

Related issue
#7024

Description

Hi team,

As we stated in issue #7024, we did not follow the recommended security standard regarding the headers of the API responses. This PR closes #7024. In this PR he have added missing secure headers for API responses.

adriiiprodri@wazuh curl -k -u wazuh:wazuh -D- https://localhost:55040/security/user/authenticate
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Server: Wazuh
Strict-Transport-Security: max-age=63072000; includeSubdomains
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Security-Policy: none
Referrer-Policy: no-referrer, strict-origin-when-cross-origin
Pragma: no-cache
Expires: 0
Cache-control: no-cache, no-store, must-revalidate, max-age=0
Content-Length: 300
Date: Thu, 24 Dec 2020 10:01:02 GMT

{"data": {"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNjA4ODA0MDYyLCJleHAiOjE2MDg4MDc2NjIsInN1YiI6IndhenVoIiwicnVuX2FzIjpmYWxzZSwicmJhY19yb2xlcyI6WzFdLCJyYmFjX21vZGUiOiJ3aGl0ZSJ9.ffBh2wmdPEIGjNWTxPIRFIJ1gI_zaqgoqffQwjsUH4o"}, "error": 0}

Tests

adriiiprodri@wazuh python3 run_tests.py -k security -rbac no
Collected tests [4]:
test_security_DELETE_endpoints.tavern.yaml, test_security_GET_endpoints.tavern.yaml, test_security_POST_endpoints.tavern.yaml, test_security_PUT_endpoints.tavern.yaml


test_security_DELETE_endpoints.tavern.yaml 
         15 passed, 17 warnings

test_security_GET_endpoints.tavern.yaml 
         18 passed, 20 warnings

test_security_POST_endpoints.tavern.yaml 
         6 passed, 8 warnings

test_security_PUT_endpoints.tavern.yaml 
         8 passed, 10 warnings

@davidjiglesias davidjiglesias changed the title 4.0.4 api security headers Add api security headers Jan 11, 2021
@davidjiglesias davidjiglesias marked this pull request as ready for review January 11, 2021 13:08
@davidjiglesias davidjiglesias added this to the Sprint 123 - Framework milestone Jan 11, 2021
@davidjiglesias davidjiglesias merged commit f4f0786 into 4.0.4 Jan 11, 2021
@davidjiglesias davidjiglesias deleted the 4.0.4-api-security-headers branch January 11, 2021 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants