Skip to content

Commit

Permalink
Adding more comments and fixing alert type
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-buttner committed Sep 8, 2020
1 parent 04a588b commit c06ba93
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ describe('Generated documents', () => {
it('returns the right name for a registry event', () => {
const extensions = { registry: { key: `HKLM/Windows/Software/abc` } };
const event = generator.generateEvent({ eventCategory: 'registry', extensions });
// casting to ResolverEvent here because the `descriptiveName` function is used by the frontend is still relies
// on the unsafe ResolverEvent type. Once it's switched over to the safe version we can remove this cast.
expect(descriptiveName(event as ResolverEvent)).toEqual({
subject: `HKLM/Windows/Software/abc`,
});
Expand All @@ -28,6 +30,8 @@ describe('Generated documents', () => {
const randomIP = `${generator.randomIP()}`;
const extensions = { network: { direction: 'outbound', forwarded_ip: randomIP } };
const event = generator.generateEvent({ eventCategory: 'network', extensions });
// casting to ResolverEvent here because the `descriptiveName` function is used by the frontend is still relies
// on the unsafe ResolverEvent type. Once it's switched over to the safe version we can remove this cast.
expect(descriptiveName(event as ResolverEvent)).toEqual({
subject: `${randomIP}`,
descriptor: 'outbound',
Expand All @@ -37,6 +41,8 @@ describe('Generated documents', () => {
it('returns the right name for a file event', () => {
const extensions = { file: { path: 'C:\\My Documents\\business\\January\\processName' } };
const event = generator.generateEvent({ eventCategory: 'file', extensions });
// casting to ResolverEvent here because the `descriptiveName` function is used by the frontend is still relies
// on the unsafe ResolverEvent type. Once it's switched over to the safe version we can remove this cast.
expect(descriptiveName(event as ResolverEvent)).toEqual({
subject: 'C:\\My Documents\\business\\January\\processName',
});
Expand All @@ -45,6 +51,8 @@ describe('Generated documents', () => {
it('returns the right name for a dns event', () => {
const extensions = { dns: { question: { name: `${generator.randomIP()}` } } };
const event = generator.generateEvent({ eventCategory: 'dns', extensions });
// casting to ResolverEvent here because the `descriptiveName` function is used by the frontend is still relies
// on the unsafe ResolverEvent type. Once it's switched over to the safe version we can remove this cast.
expect(descriptiveName(event as ResolverEvent)).toEqual({
subject: extensions.dns.question.name,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,10 @@ export type AlertEvent = Partial<{
process: Partial<{
command_line: ECSField<string>;
ppid: ECSField<number>;
executable: ECSField<string>;
start: ECSField<number>;
// Using ECSField as the outer because the object is expected to be an array
thread: ECSField<ThreadFields>;
uptime: number;
uptime: ECSField<number>;
Ext: Partial<{
// Using ECSField as the outer because the object is expected to be an array
code_signature: ECSField<
Expand Down

0 comments on commit c06ba93

Please sign in to comment.