Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 8 additions & 2 deletions src/exploit_iq_commons/data_models/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,14 @@ class ScanInfoInput(HashableModel):
"""
id: str = Field(default_factory=lambda: str(uuid4()))
type: str | None = None
started_at: str | None = None
completed_at: str | None = None
started_at: str | None = Field(
default=None,
description="Scan start time as ISO-8601 with UTC offset (e.g. ...+00:00).",
)
completed_at: str | None = Field(
default=None,
description="Scan completion time as ISO-8601 with UTC offset (e.g. ...+00:00).",
)

vulns: typing.Annotated[list[VulnInfo], Field(min_length=1)]

Expand Down
6 changes: 3 additions & 3 deletions src/vuln_analysis/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from datetime import datetime
from datetime import datetime, timezone
from io import TextIOWrapper

from aiq.builder.builder import Builder
Expand Down Expand Up @@ -104,7 +104,7 @@ async def cve_agent_workflow(config: CVEAgentWorkflowConfig, builder: Builder):
@catch_pipeline_errors_async
async def add_start_time_node(state: AgentMorpheusInput) -> AgentMorpheusInput:
"""Adds the start time to the input"""
state.scan.started_at = datetime.now().isoformat()
state.scan.started_at = datetime.now(timezone.utc).isoformat()
return state

@catch_pipeline_errors_async
Expand Down Expand Up @@ -175,7 +175,7 @@ async def generate_cvss_node(state: AgentMorpheusEngineState) -> AgentMorpheusEn
@catch_pipeline_errors_async
async def add_completed_time_node(state: AgentMorpheusOutput) -> AgentMorpheusOutput:
"""Adds the completed time to the output"""
state.input.scan.completed_at = datetime.now().isoformat()
state.input.scan.completed_at = datetime.now(timezone.utc).isoformat()
return state

@catch_pipeline_errors_async
Expand Down