Skip to content

Commit

Permalink
Merge pull request #132 from janssensjelle/feature/CAPE-certification
Browse files Browse the repository at this point in the history
[FEATURE] - Added validation for CAPE cert
  • Loading branch information
makelarisjr authored Dec 19, 2024
2 parents 46b2e0a + d0a28ff commit 7088d37
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions .test.env
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ ROLE_ACADEMY_CBBH=7168215511011276950
ROLE_ACADEMY_CPTS=1795774641027354363
ROLE_ACADEMY_CDSA=1157697238949167235
ROLE_ACADEMY_CWEE=1257697240949167235
ROLE_ACADEMY_CAPE=1318971191586979861

ROLE_UNICTF2022=6148613121047893215

Expand Down
4 changes: 4 additions & 0 deletions src/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class AcademyCertificates(BaseSettings):
CERTIFIED_PENETRATION_TESTING_SPECIALIST = 3
CERTIFIED_DEFENSIVE_SECURITY_ANALYST = 4
CERTIFIED_WEB_EXPLOITATION_EXPERT = 5
CERTIFIED_ACTIVEDIRECTORY_PENTESTING_EXPERT = 6


class Roles(BaseSettings):
Expand Down Expand Up @@ -133,6 +134,7 @@ class Roles(BaseSettings):
ACADEMY_CPTS: int
ACADEMY_CDSA: int
ACADEMY_CWEE: int
ACADEMY_CAPE: int
# Joinable roles
UNICTF2022: int
BIZCTF2022: int
Expand Down Expand Up @@ -225,6 +227,7 @@ def get_academy_cert_role(self, certificate: int) -> int:
self.academy_certificates.CERTIFIED_PENETRATION_TESTING_SPECIALIST: self.roles.ACADEMY_CPTS,
self.academy_certificates.CERTIFIED_DEFENSIVE_SECURITY_ANALYST: self.roles.ACADEMY_CDSA,
self.academy_certificates.CERTIFIED_WEB_EXPLOITATION_EXPERT: self.roles.ACADEMY_CWEE,
self.academy_certificates.CERTIFIED_ACTIVEDIRECTORY_PENTESTING_EXPERT: self.roles.ACADEMY_CAPE
}.get(certificate)

def get_post_or_rank(self, what: str) -> Optional[int]:
Expand Down Expand Up @@ -259,6 +262,7 @@ def get_cert(self, what: str):
"CBBH": self.roles.ACADEMY_CBBH,
"CDSA": self.roles.ACADEMY_CDSA,
"CWEE": self.roles.ACADEMY_CWEE,
"CAPE": self.roles.ACADEMY_CAPE
}.get(what)

class Config:
Expand Down
4 changes: 4 additions & 0 deletions src/helpers/verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ async def _check_for_ban(uid: str) -> Optional[Dict]:

return ban_details


async def process_certification(certid: str, name: str):
"""Process certifications."""
cert_api_url = f"{settings.API_V4_URL}/certificate/lookup"
params = {'id': certid, 'name': name}
async with aiohttp.ClientSession() as session:
Expand All @@ -98,6 +100,8 @@ async def process_certification(certid: str, name: str):
cert = "CDSA"
elif certRawName == "HTB Certified Web Exploitation Expert":
cert = "CWEE"
elif certRawName == "HTB Certified Active Directory Pentesting Expert":
cert = "CAPE"
else:
cert = False
return cert
Expand Down

0 comments on commit 7088d37

Please sign in to comment.