-
Notifications
You must be signed in to change notification settings - Fork 768
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update version to 3.4.5.1. * Update fleetspeak binary dependency. * Adding more logging to proto deserialization. * Add tests for title in Netstat results. * Fleetspeak server wrapper: remove obsolete config initialization. * Config updater: add support for rotating fleetspeak certificate. * Use material table for displaying Netstat results. * Format NetworkConnectionFamily and NetworkConnectionType in Netstat Results table. * MSI: MSI templates can't be bulk signed. * Increasing min time between stop checks to 30 seconds.
- Loading branch information
Showing
20 changed files
with
412 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...er/grr_response_server/gui/ui/components/flow_details/helpers/network_connection_pipes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import {Pipe, PipeTransform} from '@angular/core'; | ||
|
||
import {NetworkConnectionFamily, NetworkConnectionType} from '../../../lib/api/api_interfaces'; | ||
|
||
const NETWORK_CONNECTION_FAMILY_MAP: | ||
ReadonlyMap<NetworkConnectionFamily, string> = new Map([ | ||
[NetworkConnectionFamily.INET, 'IPv4'], | ||
[NetworkConnectionFamily.INET6, 'IPv6'], | ||
[NetworkConnectionFamily.INET6_WIN, 'IPv6'], | ||
[NetworkConnectionFamily.INET6_OSX, 'IPv6'], | ||
]); | ||
|
||
const NETWORK_CONNECTION_TYPE_MAP: ReadonlyMap<NetworkConnectionType, string> = | ||
new Map([ | ||
[NetworkConnectionType.UNKNOWN_SOCKET, '?'], | ||
[NetworkConnectionType.SOCK_STREAM, 'TCP'], | ||
[NetworkConnectionType.SOCK_DGRAM, 'UDP'], | ||
]); | ||
|
||
/** | ||
* Converts a given NetworkConnectionFamily (IP Version) enum to a more | ||
* human readable format. | ||
*/ | ||
@Pipe({name: 'networkConnectionFamily'}) | ||
export class NetworkConnectionFamilyPipe implements PipeTransform { | ||
transform(family: NetworkConnectionFamily|undefined): string { | ||
if (family === undefined) { | ||
return '-'; | ||
} | ||
return NETWORK_CONNECTION_FAMILY_MAP.get(family) ?? '-'; | ||
} | ||
} | ||
|
||
/** | ||
* Converts a given NetworkConnectionType (IP Version) enum to a more | ||
* human readable format. | ||
*/ | ||
@Pipe({name: 'networkConnectionType'}) | ||
export class NetworkConnectionTypePipe implements PipeTransform { | ||
transform(type: NetworkConnectionType|undefined): string { | ||
if (type === undefined) { | ||
return '-'; | ||
} | ||
return NETWORK_CONNECTION_TYPE_MAP.get(type) ?? '-'; | ||
} | ||
} |
81 changes: 81 additions & 0 deletions
81
...r_response_server/gui/ui/components/flow_details/helpers/network_connection_pipes_test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import {Component, Type} from '@angular/core'; | ||
import {TestBed, waitForAsync} from '@angular/core/testing'; | ||
import {initTestEnvironment} from '@app/testing'; | ||
|
||
import {HelpersModule} from './module'; | ||
|
||
|
||
|
||
@Component({template: '{{ value | networkConnectionFamily }}'}) | ||
class TestFamilyComponent { | ||
value: string|undefined; | ||
} | ||
|
||
@Component({template: '{{ value | networkConnectionType }}'}) | ||
class TestTypeComponent { | ||
value: string|undefined; | ||
} | ||
|
||
initTestEnvironment(); | ||
|
||
describe('Network Connection Pipes', () => { | ||
beforeEach(waitForAsync(() => { | ||
TestBed | ||
.configureTestingModule({ | ||
imports: [ | ||
HelpersModule, | ||
], | ||
declarations: [ | ||
TestFamilyComponent, | ||
TestTypeComponent, | ||
], | ||
|
||
providers: [] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
function render( | ||
component: Type<TestFamilyComponent|TestTypeComponent>, value?: string) { | ||
const fixture = TestBed.createComponent(component); | ||
fixture.componentInstance.value = value; | ||
fixture.detectChanges(); | ||
return fixture.nativeElement.innerText.trim(); | ||
} | ||
|
||
it('Family - undefined', () => { | ||
expect(render(TestFamilyComponent, undefined)).toBe('-'); | ||
}); | ||
|
||
it('Family - INET', () => { | ||
expect(render(TestFamilyComponent, 'INET')).toBe('IPv4'); | ||
}); | ||
|
||
it('Family - INET6', () => { | ||
expect(render(TestFamilyComponent, 'INET6')).toBe('IPv6'); | ||
}); | ||
|
||
it('Family - INET6_WIN', () => { | ||
expect(render(TestFamilyComponent, 'INET6_WIN')).toBe('IPv6'); | ||
}); | ||
|
||
it('Family - INET6_OSX', () => { | ||
expect(render(TestFamilyComponent, 'INET6_OSX')).toBe('IPv6'); | ||
}); | ||
|
||
it('Type - undefined', () => { | ||
expect(render(TestTypeComponent, undefined)).toBe('-'); | ||
}); | ||
|
||
it('Type - UNKNOWN_SOCKET', () => { | ||
expect(render(TestTypeComponent, 'UNKNOWN_SOCKET')).toBe('?'); | ||
}); | ||
|
||
it('Type - SOCK_STREAM', () => { | ||
expect(render(TestTypeComponent, 'SOCK_STREAM')).toBe('TCP'); | ||
}); | ||
|
||
it('Type - SOCK_DGRAM', () => { | ||
expect(render(TestTypeComponent, 'SOCK_DGRAM')).toBe('UDP'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.