The Alloy API project is a restful api for Alloy functionality in the Crucible ecosystem. By default, alloy.api
is available at localhost:4402
, with the Swagger page at localhost:4402/swagger/index.html
.
From the Alloy.Api folder ... $ dotnet ef migrations add --project ..\Alloy.Api.Migrations.PostgreSQL\Alloy.Api.Migrations.PostgreSQL.csproj
Guid Id
Guid? ViewId
(Player, a view eventTemplate)Guid? DirectoryId
(Caster)Guid? ScenarioTemplateId
(Steamfitter)string Name
string Description
int DurationHours
Guid Id
Guid EventTemplateId
(Alloy)Guid UserId
Guid? ViewId
(Player)Guid? WorkspaceId
(Caster)Guid? RunId
(Caster)Guid? ScenarioId
(Steamfitter)string Name
string Description
EventStatus Status
DateTime? LaunchDate
DateTime? EndDate
DateTime? ExpirationDate
Alloy will deploy a lab/odx as a Caster workspace, including the workspace specific variables file. Variables include:
- Player View ID
- Player Team Names
Then, Alloy will:
- Create a run
- Create a plan
- Apply the plan
Caster will write the ViewId
and the TeamId
from Player to each VM's guest info variables.
Alloy will get all authorized view/directories from caster.api
.
Player.api
must have an idea of an View eventTemplate. Alloy will get all authorized View eventTemplates from the player.api
. Player.api
must have a CreateViewFromViewEventTemplate
endpoint.
Alloy will get all authorized scenarioTemplates from steamfitter.api
. Alloy will call the CreateScenarioFromScenarioTemplate
endpoint.
Determine if an event already exists that can be rejoined or if a new event needs to be created.
GET /eventTemplates/{eventTemplateId}/events/mine
- check for
active
status
If there is an active
event, then present option to rejoin and skip launch.
- Create a new event from the eventTemplate.
POST /eventTemplates/{eventTemplateId}/events
- Clone the Player view.
- Deploy a new Caster workspace in the Caster directory.
CreateWorkspaceFromDirectory
- Create a
Run
for the workspace - Wait for the
Run
to bePlanned
status - Apply the
Run
- Wait for the
Run
to beApplied
status
- Create a Steamfitter scenario from the scenarioTemplate.
- Set the Event status to
active
.
- Set Player view to
Inactive
. - End the Steamfitter scenario.
- Destroy the Caster workspace.
- Create an
isDestroy
Run
for the workspace - Wait for the
Run
to bePlanned
status - Apply the
Run
- Wait for the
Run
to beApplied
status
- Create an
- Set the Event status to
ended
orexpired
.
The entire Launch and End processes will be single background tasks that poll the Caster API for each status change, update the event database record appropriately, and then move on to the next step in the process.
Think you found a bug? Please report all Crucible bugs - including bugs for the individual Crucible apps - in the cmu-sei/crucible issue tracker.
Include as much detail as possible including steps to reproduce, specific app involved, and any error messages you may have received.
Have a good idea for a new feature? Submit all new feature requests through the cmu-sei/crucible issue tracker.
Include the reasons why you're requesting the new feature and how it might benefit other Crucible users.
Copyright 2021 Carnegie Mellon University. See the LICENSE.md files for details.