Skip to content
Open
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
73 changes: 0 additions & 73 deletions tests/relay_integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,79 +80,6 @@ def test_csp(self) -> None:
event = self.post_and_retrieve_security_report(event_data)
assert event.message == "Blocked 'default-src' from 'evilhackerscripts.com'"

def test_hpkp(self) -> None:
event_data = {
"date-time": "2014-04-06T13:00:50Z",
"hostname": "www.example.com",
"port": 443,
"effective-expiration-date": "2014-05-01T12:40:50Z",
"include-subdomains": False,
"served-certificate-chain": [
"-----BEGIN CERTIFICATE-----\n MIIEBDCCAuygBQUAMEIxCzAJBgNVBAYTAlVT\n -----END CERTIFICATE-----"
],
"validated-certificate-chain": [
"-----BEGIN CERTIFICATE-----\n MIIEBDCCAuygAwIBAgIDCzAJBgNVBAYTAlVT\n -----END CERTIFICATE-----"
],
"known-pins": [
'pin-sha256="d6qzRu9zOECb90Uez27xWltNsj0e1Md7GkYYkVoZWmM="',
'pin-sha256="E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g="',
],
}

event = self.post_and_retrieve_security_report(event_data)
assert event.message == "Public key pinning validation failed for 'www.example.com'"
assert event.group.title == "Public key pinning validation failed for 'www.example.com'"

def test_expect_ct(self) -> None:
event_data = {
"expect-ct-report": {
"date-time": "2014-04-06T13:00:50Z",
"hostname": "www.example.com",
"port": 443,
"effective-expiration-date": "2014-05-01T12:40:50Z",
"served-certificate-chain": [
"-----BEGIN CERTIFICATE-----\nABC\n-----END CERTIFICATE-----"
],
"validated-certificate-chain": [
"-----BEGIN CERTIFICATE-----\nCDE\n-----END CERTIFICATE-----"
],
"scts": [
{
"version": 1,
"status": "invalid",
"source": "embedded",
"serialized_sct": "ABCD==",
}
],
}
}

event = self.post_and_retrieve_security_report(event_data)
assert event.message == "Expect-CT failed for 'www.example.com'"
assert event.group.title == "Expect-CT failed for 'www.example.com'"

def test_expect_staple(self) -> None:
event_data = {
"expect-staple-report": {
"date-time": "2014-04-06T13:00:50Z",
"hostname": "www.example.com",
"port": 443,
"response-status": "ERROR_RESPONSE",
"cert-status": "REVOKED",
"effective-expiration-date": "2014-05-01T12:40:50Z",
"served-certificate-chain": [
"-----BEGIN CERTIFICATE-----\nABC\n-----END CERTIFICATE-----"
],
"validated-certificate-chain": [
"-----BEGIN CERTIFICATE-----\nCDE\n-----END CERTIFICATE-----"
],
}
}

event = self.post_and_retrieve_security_report(event_data)
assert event.message == "Expect-Staple failed for 'www.example.com'"
assert event.group.title == "Expect-Staple failed for 'www.example.com'"

def test_standalone_attachment(self) -> None:
event_id = uuid4().hex
retention_days = 66
Expand Down
Loading