Skip to content

Commit

Permalink
Clean up "produces" field in the katalogus api: now show a list of mi…
Browse files Browse the repository at this point in the history
…me-types in Rocky for boefjes (#2033)

Co-authored-by: Jan Klopper <[email protected]>
  • Loading branch information
Donnype and underdarknl authored Nov 15, 2023
1 parent 634e202 commit 9c5fcb8
Show file tree
Hide file tree
Showing 49 changed files with 15 additions and 232 deletions.
3 changes: 1 addition & 2 deletions boefjes/boefjes/katalogus/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ class Boefje(Plugin):
type: Literal["boefje"] = "boefje"
scan_level: int = 1
consumes: Set[str] = Field(default_factory=set)
produces: List[str] = Field(default_factory=list)
mime_types: Set[str] = Field(default_factory=set)
produces: Set[str] = Field(default_factory=set)
options: Optional[List[str]]
runnable_hash: Optional[str]
oci_image: Optional[str]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
"consumes": [
"DNSZone"
],
"produces": [
"X509Certificate",
"Hostname"
],
"environment_keys": [],
"scan_level": 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"DNSZone"
],
"produces": [
"X509Certificate",
"Hostname"
"text/html"
],
"environment_keys": [],
"scan_level": 1
Expand Down
2 changes: 1 addition & 1 deletion boefjes/boefjes/katalogus/tests/test_plugin_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def test_get_plugins(self):
self.assertEqual("kat_test", kat_test.id)
self.assertEqual("Kat test name", kat_test.name)
self.assertEqual({"DNSZone"}, kat_test.consumes)
self.assertSetEqual({"Hostname", "X509Certificate"}, set(kat_test.produces))
self.assertSetEqual({"boefje/kat_test"}, set(kat_test.produces))

kat_test_norm = list(filter(lambda x: x.id == "kat_test_normalize", plugins)).pop()
self.assertIn("kat_test_normalize", kat_test_norm.id)
Expand Down
6 changes: 3 additions & 3 deletions boefjes/boefjes/katalogus/tests/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ def test_get_plugin(self):
# Simpler endpoint works as well, but due to the mock the default mime_types are not dynamically added
res = self.client.get("/v1/organisations/test-org/plugins/test-boefje-1")
self.assertEqual(200, res.status_code)
assert "mime_types" in res.json()
assert not res.json()["mime_types"]
assert "produces" in res.json()
assert res.json()["produces"] == ["text/html"]

# For boefjes that are pulled from the local repository, we actually get the default mime_types
assert set(self.client.get("/v1/organisations/test-org/plugins/kat_test").json()["mime_types"]) == set(
assert set(self.client.get("/v1/organisations/test-org/plugins/kat_test").json()["produces"]) == set(
["boefje/kat_test"]
)

Expand Down
3 changes: 0 additions & 3 deletions boefjes/boefjes/plugins/kat_adr_finding_types/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
"consumes": [
"ADRFindingType"
],
"produces": [
"ADRFindingType"
],
"scan_level": 0,
"enabled": true
}
4 changes: 0 additions & 4 deletions boefjes/boefjes/plugins/kat_adr_validator/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,5 @@
"consumes": [
"RESTAPI"
],
"produces": [
"ADRFindingType",
"Finding"
],
"scan_level": 1
}
10 changes: 0 additions & 10 deletions boefjes/boefjes/plugins/kat_binaryedge/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@
"IPAddressV4",
"IPAddressV6"
],
"produces": [
"KATFindingType",
"SoftwareInstance",
"Service",
"IPPort",
"Finding",
"Software",
"IPService",
"CVEFindingType"
],
"environment_keys": ["BINARYEDGE_API"],
"scan_level": 2
}
7 changes: 0 additions & 7 deletions boefjes/boefjes/plugins/kat_censys/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
"IPAddressV4",
"IPAddressV6"
],
"produces": [
"IPPort",
"X509Certificate",
"SoftwareInstance",
"ResolvedHostname",
"HTTPHeader"
],
"environment_keys": [
"CENSYS_API_ID",
"CENSYS_API_SECRET"
Expand Down
4 changes: 0 additions & 4 deletions boefjes/boefjes/plugins/kat_crt_sh/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,5 @@
"consumes": [
"DNSZone"
],
"produces": [
"Hostname",
"X509Certificate"
],
"scan_level": 1
}
4 changes: 0 additions & 4 deletions boefjes/boefjes/plugins/kat_cve_2023_34039/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,5 @@
"consumes": [
"IPService"
],
"produces": [
"Finding",
"CVEFindingType"
],
"scan_level": 4
}
4 changes: 0 additions & 4 deletions boefjes/boefjes/plugins/kat_cve_2023_35078/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,5 @@
"consumes": [
"Website"
],
"produces": [
"Finding",
"CVEFindingType"
],
"scan_level": 2
}
3 changes: 0 additions & 3 deletions boefjes/boefjes/plugins/kat_cve_finding_types/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
"consumes": [
"CVEFindingType"
],
"produces": [
"CVEFindingType"
],
"environment_keys": [
"CVEAPI_URL"
],
Expand Down
3 changes: 0 additions & 3 deletions boefjes/boefjes/plugins/kat_cwe_finding_types/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
"consumes": [
"CWEFindingType"
],
"produces": [
"CWEFindingType"
],
"scan_level": 0,
"enabled": true
}
7 changes: 0 additions & 7 deletions boefjes/boefjes/plugins/kat_dicom/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,5 @@
"IPAddressV4",
"IPAddressV6"
],
"produces": [
"KATFindingType",
"SoftwareInstance",
"IPPort",
"Finding",
"Software"
],
"scan_level": 2
}
15 changes: 0 additions & 15 deletions boefjes/boefjes/plugins/kat_dns/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,5 @@
"consumes": [
"Hostname"
],
"produces": [
"IPAddressV6",
"DNSARecord",
"DNSNSRecord",
"DNSTXTRecord",
"DNSSOARecord",
"NXDOMAIN",
"DNSCNAMERecord",
"DNSMXRecord",
"Hostname",
"Network",
"DNSAAAARecord",
"IPAddressV4",
"DNSZone"
],
"scan_level": 1
}
5 changes: 0 additions & 5 deletions boefjes/boefjes/plugins/kat_dns_zone/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,5 @@
"consumes": [
"DNSZone"
],
"produces": [
"Hostname",
"DNSZone",
"DNSSOARecord"
],
"scan_level": 1
}
4 changes: 0 additions & 4 deletions boefjes/boefjes/plugins/kat_dnssec/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,5 @@
"consumes": [
"Hostname"
],
"produces": [
"KATFindingType",
"Finding"
],
"scan_level": 1
}
7 changes: 0 additions & 7 deletions boefjes/boefjes/plugins/kat_external_db/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
"consumes": [
"Network"
],
"produces": [
"Hostname",
"IPAddressV4",
"IPV4NetBlock",
"IPAddressV6",
"IPV6NetBlock"
],
"environment_keys": [
"DB_URL",
"DB_ACCESS_TOKEN",
Expand Down
7 changes: 0 additions & 7 deletions boefjes/boefjes/plugins/kat_fierce/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,5 @@
"consumes": [
"Hostname"
],
"produces": [
"IPAddressV6",
"DNSARecord",
"Hostname",
"DNSAAAARecord",
"IPAddressV4"
],
"scan_level": 3
}
4 changes: 0 additions & 4 deletions boefjes/boefjes/plugins/kat_green_hosting/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,5 @@
"consumes": [
"Website"
],
"produces": [
"KATFindingType",
"Finding"
],
"scan_level": 1
}
3 changes: 0 additions & 3 deletions boefjes/boefjes/plugins/kat_kat_finding_types/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
"consumes": [
"KATFindingType"
],
"produces": [
"KATFindingType"
],
"scan_level": 0,
"enabled": true
}
10 changes: 0 additions & 10 deletions boefjes/boefjes/plugins/kat_leakix/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@
"IPAddressV6",
"Hostname"
],
"produces": [
"KATFindingType",
"SoftwareInstance",
"Service",
"IPPort",
"Finding",
"Software",
"IPService",
"CVEFindingType"
],
"environment_keys": ["LEAKIX_API"],
"scan_level": 1
}
4 changes: 0 additions & 4 deletions boefjes/boefjes/plugins/kat_log4shell/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
"consumes": [
"Hostname"
],
"produces": [
"Finding",
"CVEFindingType"
],
"environment_keys": [
"REPLY_FQDN"
],
Expand Down
4 changes: 0 additions & 4 deletions boefjes/boefjes/plugins/kat_manyportsopen/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,5 @@
"IPAddressV4",
"IPAddressV6"
],
"produces": [
"KATFindingType",
"Finding"
],
"scan_level": 1
}
4 changes: 0 additions & 4 deletions boefjes/boefjes/plugins/kat_masscan/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
"consumes": [
"IPV4NetBlock"
],
"produces": [
"IPAddressV4",
"IPPort"
],
"environment_keys": [
"PORTS",
"MAX_RATE"
Expand Down
7 changes: 0 additions & 7 deletions boefjes/boefjes/plugins/kat_nmap/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
"IPAddressV4",
"IPAddressV6"
],
"produces": [
"IPAddressV6",
"Service",
"IPPort",
"IPAddressV4",
"IPService"
],
"environment_keys": [
"TOP_PORTS",
"PROTOCOL"
Expand Down
7 changes: 0 additions & 7 deletions boefjes/boefjes/plugins/kat_nmap_ip_range/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
"IPV6NetBlock",
"IPV4NetBlock"
],
"produces": [
"IPAddressV6",
"Service",
"IPPort",
"IPAddressV4",
"IPService"
],
"environment_keys": [
"TOP_PORTS_TCP",
"TOP_PORTS_UDP"
Expand Down
7 changes: 0 additions & 7 deletions boefjes/boefjes/plugins/kat_nmap_ports/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
"IPAddressV4",
"IPAddressV6"
],
"produces": [
"IPAddressV6",
"Service",
"IPPort",
"IPAddressV4",
"IPService"
],
"environment_keys": [
"PORTS"
],
Expand Down
4 changes: 0 additions & 4 deletions boefjes/boefjes/plugins/kat_nuclei_cve/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,5 @@
"Hostname",
"HostnameHTTPURL"
],
"produces": [
"Finding",
"CVEFindingType"
],
"scan_level": 3
}
4 changes: 0 additions & 4 deletions boefjes/boefjes/plugins/kat_nuclei_exposed_panels/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,5 @@
"Hostname",
"HostnameHTTPURL"
],
"produces": [
"Finding",
"KATFindingType"
],
"scan_level": 3
}
4 changes: 0 additions & 4 deletions boefjes/boefjes/plugins/kat_nuclei_take_over/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,5 @@
"Hostname",
"HostnameHTTPURL"
],
"produces": [
"Finding",
"KATFindingType"
],
"scan_level": 3
}
3 changes: 0 additions & 3 deletions boefjes/boefjes/plugins/kat_rdns/boefje.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@
"IPAddressV4",
"IPAddressV6"
],
"produces": [
"DNSPTRRecord"
],
"scan_level": 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
"consumes": [
"RetireJSFindingType"
],
"produces": [
"RetireJSFindingType"
],
"scan_level": 0,
"enabled": true
}
Loading

0 comments on commit 9c5fcb8

Please sign in to comment.