Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
Update runtime, build, and dev packages (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
GoldingAustin committed May 2, 2023
1 parent fa3b58a commit 15fb5ef
Show file tree
Hide file tree
Showing 39 changed files with 2,979 additions and 2,531 deletions.
4 changes: 2 additions & 2 deletions .moon/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $schema: 'https://moonrepo.dev/schemas/toolchain.json'
node:
# The version to use. Must be a semantic version that includes major, minor, and patch.
# We suggest using the latest active LTS version: https://nodejs.org/en/about/releases
version: '16.19.1'
version: '16.20.0'

# The package manager to use when managing dependencies.
# Accepts "npm" (default), "pnpm", or "yarn".
Expand Down Expand Up @@ -41,7 +41,7 @@ node:

# Sync `node.version` to a 3rd-party version manager's config file.
# Accepts "nodenv" (.node-version), "nvm" (.nvmrc), or none.
# syncVersionManagerConfig: 'nvm'
syncVersionManagerConfig: 'nvm'

# Configures how moon integrates with TypeScript.
typescript:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.13
v16.20.0
2 changes: 1 addition & 1 deletion applications/client/src/store/graphql/ImageModel.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { QueryBuilder } from 'mk-gql';
*/
export class ImageModelBase extends Model({
__typename: tProp('Image'),
fileType: prop<string | null>().withSetter(),
fileType: prop<string>().withSetter(),
id: prop<string>().withSetter(),
url: prop<string | null>().withSetter(),
}) {
Expand Down
2 changes: 1 addition & 1 deletion applications/client/src/store/graphql/LinkModel.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class LinkModelBase extends Model({
endTime: prop<any | null>().withSetter(),
id: prop<string>().withSetter(),
/** Was this Link manually created */
manual: prop<boolean | null>().withSetter(),
manual: prop<boolean>().withSetter(),
/** The display name of the link */
name: prop<string | null>().withSetter(),
origin: prop<Ref<BeaconModel> | null>().withSetter(),
Expand Down
19 changes: 2 additions & 17 deletions applications/client/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import react from '@vitejs/plugin-react-swc';
import checker from 'vite-plugin-checker';
import tsconfigPaths from 'vite-tsconfig-paths';

Expand All @@ -14,22 +14,7 @@ export default defineConfig(() => ({
plugins: [
react({
jsxImportSource: '@emotion/react',
babel: {
plugins: [
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-proposal-class-properties', { loose: true }],
[
'@emotion',
{
// sourceMap is on by default but source maps are dead code eliminated in production
sourceMap: true,
autoLabel: 'dev-only',
labelFormat: '[local]',
cssPropOptimization: true,
},
],
],
},
tsDecorators: true,
}),
tsconfigPaths({}),
checker({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ describe('Command counts', () => {
commandIds(beaconId: $beaconId, campaignId: $campaignId, commandIds: $commandIds, commandType: $commandType, hostId: $hostId, operatorId: $operatorId, sort: $sort)
}`;

const variables = `{"campaignId": "${returnedUrl}", "hostId": "${nameHost1}", "sort": { "sortBy": "time", "direction": "ASC"}}`;
const variables = {
campaignId: returnedUrl,
hostId: nameHost1,
sort: { sortBy: 'time', direction: 'ASC' },
};
graphqlRequest(query, variables).then((res) => {
// cy.log(res.body.data.commandIds);
expect(res.body.data.commandIds).length(countHost1);
Expand Down Expand Up @@ -120,7 +124,11 @@ describe('Command counts', () => {
commandIds(beaconId: $beaconId, campaignId: $campaignId, commandIds: $commandIds, commandType: $commandType, hostId: $hostId, operatorId: $operatorId, sort: $sort)
}`;

const variables = `{"campaignId": "${returnedUrl}", "hostId": "${nameHost2}", "sort": { "sortBy": "time", "direction": "ASC"}}`;
const variables = {
campaignId: returnedUrl,
hostId: nameHost2,
sort: { sortBy: 'time', direction: 'ASC' },
};
graphqlRequest(query, variables).then((res) => {
// cy.log(res.body.data.commandIds);
expect(res.body.data.commandIds).length(countHost2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Query Beacons', () => {
id
}
}`;
const variables = `{"campaignId": "${returnedUrl}"}`;
const variables = { campaignId: returnedUrl };
graphqlRequest(query, variables).then((res) => {
const comp = res.body.data.beacons;
expect(comp.length).to.eq(6);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Query CommandTypes', () => {
id
}
}`;
const variables = `{"campaignId": "${returnedUrl}"}`;
const variables = { campaignId: returnedUrl };
graphqlRequest(query, variables).then((res) => {
const comp = res.body.data.commandTypes;
//23 Unique Command Types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ describe('Query Commands & CommandsIds', () => {
const query = `query commandIds($beaconId: String, $campaignId: String!, $commandIds: [String!], $commandType: String, $hostId: String, $operatorId: String, $sort: SortType) {
commandIds(beaconId: $beaconId, campaignId: $campaignId, commandIds: $commandIds, commandType: $commandType, hostId: $hostId, operatorId: $operatorId, sort: $sort)
}`;
const variables = `{"campaignId": "${returnedUrl}", "commandType": "elevate", "sort": { "sortBy": "time", "direction": "ASC"}}`;
const variables = { campaignId: returnedUrl, commandType: 'elevate', sort: { sortBy: 'time', direction: 'ASC' } };
graphqlRequest(query, variables).then((res) => {
let cmdId = res.body.data.commandIds.toString();
cy.log(cmdId);

const query1 = `query commands($beaconId: String, $campaignId: String!, $commandIds: [String!], $commandType: String, $hostId: String, $operatorId: String, $sort: SortType) {
commands(beaconId: $beaconId, campaignId: $campaignId, commandIds: $commandIds, commandType: $commandType, hostId: $hostId, operatorId: $operatorId, sort: $sort)
}`;
const variables1 = `{"campaignId": "${returnedUrl}", "commandIds": ["a1117439-359c-4b28-a634-1a43912d0d6a"] "}`;
const variables1 = { campaignId: returnedUrl, commandIds: ['a1117439-359c-4b28-a634-1a43912d0d6a'] };
graphqlRequest(query1, variables1).then((res1) => {
cy.log(res1.body);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('Delete Campaign', () => {
mutation deleteCampaign($campaignId: String!) {
deleteCampaign(campaignId: $campaignId)
}`;
const variables = `{"campaignId": "${campToDelete}"}`;
const variables = { campaignId: campToDelete };
mutRequest(mutation, variables).then((res) => {
cy.log(res);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Query Global Operators', () => {
name
}
}`;
const variables = `{"password": "937038570"}`;
const variables = { password: '937038570' };
graphqlRequest(query, variables).then((response) => {
const res = response.body.data.globalOperators;
const match = Cypress._.find(res, { id: 'cypress' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Query Hosts', () => {
id
}
}`;
const variables = `{"campaignId": "${returnedUrl}"}`;
const variables = { campaignId: returnedUrl };
graphqlRequest(query, variables).then((res) => {
const comp = res.body.data.hosts;
expect(comp.length).to.eq(3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Get All Links', () => {
id
}
}`;
const variables = `{"campaignId": "${returnedUrl}"}`;
const variables = { campaignId: returnedUrl };
graphqlRequest(query, variables).then((res) => {
const search = res.body.data.links;
cy.log(search);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('Query Operators', () => {
}
}`;

const variables = `{"campaignId": "${returnedUrl}" }`;
const variables = { campaignId: returnedUrl };
graphqlRequest(query, variables).then((res) => {
const resp = res.body.data.operators[0];
cy.log(resp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Query Presentation Items', () => {
id
}
}`;
const variables = `{"campaignId": "${returnedUrl}"}`;
const variables = { campaignId: returnedUrl };
graphqlRequest(query, variables).then((res) => {
const comp = res.body.data.presentationItems;
cy.log(comp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('Search Request', () => {
inputText
}
}`;
const variables = `{"campaignId": "${returnedUrl}", "searchQuery": "exit"}`;
const variables = { campaignId: returnedUrl, searchQuery: 'exit' };
graphqlRequest(query, variables).then((res) => {
const search = res.body.data.searchCommands;
cy.log(search);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('Query Servers', () => {
}
}`;

const variables = `{"campaignId": "${returnedUrl}", "username": "seb" }`;
const variables = { campaignId: returnedUrl, username: 'seb' };
graphqlRequest(query, variables).then((res) => {
expect(res.body.data.servers.length).to.eq(1);
});
Expand Down
2 changes: 1 addition & 1 deletion applications/redeye-e2e/src/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ Cypress.Commands.add('deleteCampaignGraphQL', (name) => {
mutation deleteCampaign($campaignId: String!) {
deleteCampaign(campaignId: $campaignId)
}`;
const variables = `{"campaignId": "${campToDelete}"}`;
const variables = { campaignId: campToDelete };
mutRequest(mutation, variables).then((res) => {
cy.log(res);
});
Expand Down
6 changes: 3 additions & 3 deletions applications/redeye-e2e/src/support/graphqlCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Cypress.Commands.add('uploadLogs', (creatorName, folderName) => {
}
}`;

const variables = `{"creatorName": "${creatorName}", "name": "${folderName}"}`;
const variables = { creatorName: creatorName, name: folderName };
mutRequest(mutation, variables).then((res) => {
let camp = res.body.data.createCampaign.id;

Expand All @@ -24,7 +24,7 @@ Cypress.Commands.add('uploadLogs', (creatorName, folderName) => {
}
}`;
cy.task('getPath', { dirPath: path.join(__dirname, '..', 'fixtures', 'smalldata') }).then((logPath) => {
const variables1 = `{"campaignId": "${camp}", "name": "200817", "path": "${logPath}"}`;
const variables1 = { campaignId: camp, name: '200817', path: logPath };
mutRequest(mutation2, variables1).then((res) => {
cy.log(res);
});
Expand All @@ -42,7 +42,7 @@ Cypress.Commands.add('uploadLogs', (creatorName, folderName) => {
serversParse(campaignId: $campaignId)
}`;

const variables = `{"campaignId": "${camp}"}`;
const variables = { campaignId: camp };
mutRequest(mutation1, variables).then((res) => {
cy.log(res);
});
Expand Down
13 changes: 4 additions & 9 deletions applications/server/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,7 @@ type File {
md5: String
}

"""
Designates if this is an upload or download
UPLOAD: File was put on or replace on a target host
DOWNLOAD: File was taken from a target host
"""
"Designates if this is an upload or download\n UPLOAD: File was put on or replace on a target host\n DOWNLOAD: File was taken from a target host\n "
enum FileFlag {
DOWNLOAD
UPLOAD
Expand Down Expand Up @@ -195,7 +190,7 @@ type HostMeta {
}

type Image {
fileType: String
fileType: String!
id: String!
url: String
}
Expand All @@ -207,7 +202,7 @@ type Link {
id: String!

"""Was this Link manually created"""
manual: Boolean
manual: Boolean!

"""The display name of the link"""
name: String
Expand Down Expand Up @@ -638,4 +633,4 @@ type TimelineCommandCountTuple {

"""The number of commands run during this time interval"""
commandCount: Float!
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,37 @@ import { anonymizeService } from './anonymize.service';

@InputType()
class FindReplaceInput {
@Field(() => String, { defaultValue: '' })
@Field(() => String, { defaultValue: '', nullable: true })
find: string = '';

@Field(() => String, { defaultValue: '' })
@Field(() => String, { defaultValue: '', nullable: true })
replace: string = '';
}

@InputType()
export class AnonymizationInput {
@Field(() => Boolean, { defaultValue: false })
@Field(() => Boolean, { defaultValue: false, nullable: true })
removePasswordsHashes: boolean = false;

@Field(() => Boolean, { defaultValue: false })
@Field(() => Boolean, { defaultValue: false, nullable: true })
removeHidden: boolean = false;

@Field(() => Boolean, { defaultValue: false })
@Field(() => Boolean, { defaultValue: false, nullable: true })
removeKeystrokes: boolean = false;

@Field(() => Boolean, { defaultValue: false })
@Field(() => Boolean, { defaultValue: false, nullable: true })
removeScreenshots: boolean = false;

@Field(() => Boolean, { defaultValue: false })
@Field(() => Boolean, { defaultValue: false, nullable: true })
replaceUsernames: boolean = false;

@Field(() => Boolean, { defaultValue: false })
@Field(() => Boolean, { defaultValue: false, nullable: true })
replaceHostnames: boolean = false;

@Field(() => Boolean, { defaultValue: false })
@Field(() => Boolean, { defaultValue: false, nullable: true })
replaceDomainsAndIps: boolean = false;

@Field(() => [FindReplaceInput])
@Field(() => [FindReplaceInput], { nullable: true })
findReplace: FindReplaceInput[] = [];
}

Expand Down
Loading

0 comments on commit 15fb5ef

Please sign in to comment.