diff --git a/applications/client/src/store/graphql/CommandModel.ts b/applications/client/src/store/graphql/CommandModel.ts index dd8002a6..d19c22e4 100644 --- a/applications/client/src/store/graphql/CommandModel.ts +++ b/applications/client/src/store/graphql/CommandModel.ts @@ -78,7 +78,7 @@ export class CommandModel extends ExtendedModel(CommandModelBase, {}) { const appStore = getRoot(this); const time = appStore.settings.momentTz(this?.input?.current?.dateTime); const operator = formatOperatorName(this?.operator?.current.name || 'unknown'); - const server = this?.beacon?.current?.host?.current?.server?.displayName; + const server = this?.beacon?.current?.host?.current?.server?.displayName; // BLDSTRIKE-598: servers? const host = this?.beacon?.current?.host?.current?.displayName; const beaconName = this?.beacon?.current?.displayName; const beaconUser = this?.beacon?.current?.meta?.[0]?.maybeCurrent?.username; diff --git a/applications/client/src/store/graphql/HostModel.ts b/applications/client/src/store/graphql/HostModel.ts index 659e0655..4e343e31 100644 --- a/applications/client/src/store/graphql/HostModel.ts +++ b/applications/client/src/store/graphql/HostModel.ts @@ -19,6 +19,7 @@ export { selectFromHost, hostModelPrimitives, HostModelSelector } from './HostMo */ @model('Host') export class HostModel extends ExtendedModel(HostModelBase, { + // BLDSTRIKE-598: should be this.serverIds plural serverId: prop().withSetter(), }) { protected onAttachedToRootStore(rootStore: any): (() => void) | void { @@ -39,6 +40,7 @@ export class HostModel extends ExtendedModel(HostModelBase, { @observable.ref maxTime: Moment | undefined; @computed get server(): ServerModel | undefined { + // BLDSTRIKE-598: should be this.servers plural const appStore = getRoot(this); return this.serverId ? appStore?.graphqlStore?.servers.get(this.serverId) : undefined; } diff --git a/applications/client/src/store/graphql/ServerModel.ts b/applications/client/src/store/graphql/ServerModel.ts index 88644467..4367e7ec 100644 --- a/applications/client/src/store/graphql/ServerModel.ts +++ b/applications/client/src/store/graphql/ServerModel.ts @@ -67,6 +67,7 @@ export class ServerModel extends ExtendedModel(ServerModelBase, { if (beacon?.host?.maybeCurrent) { getMinMaxTime(this, beacon.meta[0]?.maybeCurrent?.startTime); getMinMaxTime(this, beacon.meta[0]?.maybeCurrent?.endTime); + // BLDSTRIKE-598: add to Array/Set host.setServerIds, don't override last beacon.host?.maybeCurrent?.setServerId(this.id); this.hosts.set(beacon.host.id, hostCampaignRef(beacon.host?.maybeCurrent)); if (beacon.host?.maybeCurrent?.cobaltStrikeServer) cobaltStrikeHost = beacon.host.maybeCurrent; diff --git a/applications/client/src/views/Campaign/Explore/components/NavBreadcrumbs.tsx b/applications/client/src/views/Campaign/Explore/components/NavBreadcrumbs.tsx index 9c3d5fe7..d840fab7 100644 --- a/applications/client/src/views/Campaign/Explore/components/NavBreadcrumbs.tsx +++ b/applications/client/src/views/Campaign/Explore/components/NavBreadcrumbs.tsx @@ -107,29 +107,37 @@ export const NavBreadcrumbs = observer( : undefined, }); - if (store.campaign?.interactionState.selectedCommandType) + if (store.campaign?.interactionState.selectedCommandType) { crumbs.push({ text: 'Command', current: true, }); - else if (store.campaign?.interactionState.selectedOperator) + } else if (store.campaign?.interactionState.selectedOperator) { crumbs.push({ text: 'Operator', current: true, }); - else if (store.campaign?.interactionState.selectedServer) - crumbs.push({ - text: !store.campaign?.interactionState.selectedHost - ? 'Server' - : store.campaign?.interactionState.selectedServer?.current?.displayName, - current: !store.campaign?.interactionState.selectedHost, - onClick: store.campaign?.interactionState.selectedHost - ? (e) => { - onNavigate(e); - store.campaign?.interactionState.selectedServer?.current.searchSelect(); - } - : undefined, - }); + } else if (store.campaign?.interactionState.selectedServer) { + if (!store.campaign?.interactionState.selectedHost) { + crumbs.push({ + text: 'Server', + current: true, + }); + } else if (store.campaign?.interactionState.selectedBeacon) { + crumbs.push({ + text: store.campaign?.interactionState.selectedServer?.current?.displayName, + onClick: (e) => { + onNavigate(e); + store.campaign?.interactionState.selectedServer?.current.searchSelect(); + }, + }); + } /* else { BLDSTRIKE-598 + // const serverCount = store.campaign?.interactionState.selectedHost.current.servers.length + crumbs.push({ + text: '...', // serverCount, + }); + } */ + } if (store.campaign?.interactionState.selectedHost) crumbs.push({