feat(types): new Port type

This commit is contained in:
dextmorgn
2025-11-18 12:54:04 +01:00
parent 775ac296cd
commit 7965a473fb
2 changed files with 22 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ from .message import Message
from .organization import Organization
from .phone import Phone
from .phrase import Phrase
from .port import Port
from .reputation_score import ReputationScore
from .risk_profile import RiskProfile
from .script import Script
@@ -67,6 +68,7 @@ __all__ = [
"Organization",
"Phone",
"Phrase",
"Port",
"ReputationScore",
"RiskProfile",
"Script",

View File

@@ -0,0 +1,20 @@
from pydantic import BaseModel, Field
from typing import Optional
class Port(BaseModel):
"""Represents an open network port related to an IP address."""
number: int = Field(..., description="Port number", title="Port Number")
protocol: Optional[str] = Field(
None, description="Protocol (TCP, UDP, etc.)", title="Protocol"
)
state: Optional[str] = Field(
None, description="Port state (open, closed, filtered, etc.)", title="State"
)
service: Optional[str] = Field(
None, description="Service running on the port", title="Service"
)
banner: Optional[str] = Field(
None, description="Service banner information", title="Banner"
)