Skip to content

Commit 442d023

Browse files
authored
Syncing recent changes - Release GRR version 4.0.0 (#1149)
1 parent 1ccdba0 commit 442d023

File tree

2,739 files changed

+130365
-220345
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,739 files changed

+130365
-220345
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,3 @@ installers/
3333
GRRlog.txt
3434
grr/server/grr_response_server/gui/static/third-party/
3535
grr/server/grr_response_server/gui/ui/.angular/
36-
docker_config_files/*.pem
37-
compose.watch.yaml
38-
Dockerfile.client

CHANGELOG.md

Lines changed: 94 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,84 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### Changed
1313

14+
## [4.0.0.0] - 2025-12-15
15+
16+
### Added
17+
18+
* API Changes:
19+
* Added a new endpoint to `ApiListAllFlowOutputPluginLogs`.
20+
* Server-side support for the new agent ([RRG](https://github.com/google/rrg))
21+
written in Rust. Both agents, the Python one and the Rust one, are currently
22+
supported. Actions are scheduled on either of the two agents, depending on
23+
their availability and the supported features.
24+
25+
### Removed
26+
27+
* Legacy UI code completely removed, along with reflection API endpoints used in
28+
it.
29+
* The Podman based dev environment was removed, `docker compose watch` can be
30+
used instead.
31+
32+
### Changed
33+
34+
* API Changes:
35+
* Legacy HTTP API removed (v1 - `/api/...`), in favor of v2 (`/api/v2/...`).
36+
The `v2` API is 100% protocol buffers-based, and the json format is not the
37+
same as the legacy RDF-based version.
38+
* All API Routers and Handlers now 100% protocol-buffer based. If you have
39+
custom router implementations, you'll need to update them. You can use the
40+
current implementations as guides.
41+
* Added argument to configure `ListGRRBinaries` API method. Only if
42+
`include_metadata` is set to true metadata (binary size, valid_signature and
43+
timestamp) is included in the API response.
44+
* ListFlows API method (`/api/clients/<client_id>/flows`) now also contains
45+
progress data when `top_flows_only` is set to false.
46+
* Stopped supporting outdated artifact types
47+
* Removed stats/reports API Handlers (used only in the legacy UI).
48+
49+
* New UI changes:
50+
* Upgraded Angular and Material libraries to version 19.
51+
* New layout/design.
52+
* Improved loading speed of several API endpoints and improved overall
53+
performace by preloading and caching data.
54+
* Dark mode.
55+
* Display of nested flows.
56+
* Added debugging information for flows: logs, additional flow information.
57+
* Added debugging information for fleet collections: logs, additional fleet
58+
collection information.
59+
* Added missing flows, details about client startups, fleet collection
60+
configuration, more compact representation, and much more!
61+
62+
* Flows:
63+
* Refactored to use protocol buffers in the child classes. If you have your
64+
own custom flow implementations, you'll need to adapt and can use the
65+
existing classes as a guide. Further refactorings will come in new
66+
releases.
67+
* Flow `state`s refactored to be protocol-buffer based `store`s.
68+
* Flow `progress` refactored to be protocol-buffer based.
69+
* Refactored to use RRG agent when available.
70+
* Return type of the Interrogate flow changed from `ClientSummary` to
71+
`ClientSnapshot`. `ClientSnapshot` contains a superset of the information
72+
contained in `ClientSummary`.
73+
* Removed `GetFile` flow.
74+
75+
* Fleet collections (fka Hunts):
76+
* Variable hunts no longer supported.
77+
78+
* Other:
79+
* `ExportConverters` are now protocol-buffer based, and no longer
80+
automatically convert values automatically if the data was never seen before
81+
or there's no exported definition. We now provide well-defined protocol buffer
82+
messages for all the results we have from our flows. If you have custom ones,
83+
you'll need to implement converters for them and provide a well defined type
84+
for the output.
85+
* `OutputPlugin`s - most implementations are removed, except the
86+
`EmailOutputPlugin`. This is part of an ongoing migration out of RDF-values
87+
and towards protocol buffers. The new interface `OutputPluginProto` no
88+
longer has a state. If you rely on the previously provided `OutputPlugin`s,
89+
you'll need to add an equivalent `OutputPluginProto` implementation - we're
90+
happy to receive contributions!
91+
1492
## [3.4.9.0] - 2025-02-27
1593

1694
### Added
@@ -69,17 +147,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
69147
repository (ForensicArtifacts/artifacts#275).
70148
* **GRR server Debian package**. We stopped providing the GRR server Debian
71149
package as the main way of distributing GRR server and client binaries.
72-
Instead we make GRR Docker image a preferred way for running GRR in a
73-
demo or production environment. See the documentation [here](https://grr-doc.readthedocs.io/en/latest/installing-and-running-grr/via-docker-compose.html).
150+
Instead we make GRR Docker image a preferred way for running GRR in a
151+
demo or production environment. See the documentation
152+
[here](https://grr-doc.readthedocs.io/en/latest/installing-and-running-grr/via-docker-compose.html).
74153
* **Artifact parsers**. ArtifactCollector flow supported parsing collected files
75154
and output of executed commands. Its parsers were not properly maintained,
76155
were often outdated and fragile. We're converted selected parsers
77-
into standalone flows (`CollectDistroInfo`, `CollectInstalledSoftware`, `CollectHardwareInfo`) and removed the artifact parsing subsystem.
156+
into standalone flows (`CollectDistroInfo`, `CollectInstalledSoftware`,
157+
`CollectHardwareInfo`) and removed the artifact parsing subsystem.
78158
The ArtifactCollector now works as if "apply_parsers" arguments
79159
attribute is set to False. At some point the "apply_parsers" attribute will be
80160
deprecated completely.
81161

82162
### Added
163+
83164
* GRR docker image which contains all grr server components and client
84165
templates. It is available for every new GRR version for download at
85166
https://github.com/google/grr/pkgs/container/grr
@@ -91,7 +172,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
91172

92173
### Fixed
93174

94-
* YARA memory scanning improvements (matching context options, consuming less bandwidth).
175+
* YARA memory scanning improvements (matching context options, consuming less
176+
bandwidth).
95177

96178
### API removed
97179

@@ -150,20 +232,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
150232

151233
* Fully removed deprecated use_tsk flag.
152234
* Removed deprecated plugin_args field from OutputPluginDescriptor.
153-
* Removed deprecated flows: FingerprintFile, KeepAlive, FingerprintFile, FindFiles, SendFile, Uninstall,
235+
* Removed deprecated flows: FingerprintFile, KeepAlive, FingerprintFile,
236+
FindFiles, SendFile, Uninstall,
154237
UpdateClient, CollectEfiHashes, DumpEfiImage.
155238
* Deprecated GetFile flow in favor of MultiGetFile.
156239
* Made FileFinder an alias to ClientFileFinder, using ClientFileFinder
157240
by default everywhere. Legacy FileFinder is still available as
158241
LegacyFileFinder. Fixed several inconsistencies in ClientFileFinder
159242
client action. Same for RegistryFinder.
160-
* Removed deprecated client actions: EficheckCollectHashes, EficheckDumpImage, Uninstall, SendFile.
243+
* Removed deprecated client actions: EficheckCollectHashes, EficheckDumpImage,
244+
Uninstall, SendFile.
161245
* Removed "Checks" functionality.
162246

163247
### API removed
164248

165249
* Deprecated no-op "keep_client_alive" attribute in ApiCreateClientApprovalArgs.
166-
* Deprecated ListClientActionRequests API call (was no-op after Fleetspeak migration).
250+
* Deprecated ListClientActionRequests API call (was no-op after Fleetspeak
251+
migration).
167252

168253
## [3.4.6.7] - 2023-03-22
169254

@@ -176,12 +261,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
176261
### Added
177262

178263
* Introduced Server.grr_binaries_readonly configuration option (set to False
179-
by default). When set to True, binaries and python hacks can't be overriden
264+
by default). When set to True, binaries and python hacks can't be overridden
180265
or deleted.
181266
* Added configuration option Monitoring.http_address to specify server address
182267
of stats server. Default value will remain 127.0.0.1.
183268

184-
185269
### Changed
186270

187271
* Updates elasticsearch output plugin post request to _bulk in the
@@ -349,6 +433,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
349433
* Removed default "age" attribute from the legacy HTTP API JSON. Every value
350434
rendered in legacy API responses will be dictionary of {value: ..., type:
351435
...} instead of {value: ..., type: ..., age: ...}.
352-
* GetClientVersions API call(/api/clients/<client_id>/versions) does not
436+
* GetClientVersions API call(/api/clients/\<client_id\>/versions) does not
353437
include metadata (last ping, last clock, last boot time, last crash time)
354438
anymore.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ ENV PATH=${VIRTUAL_ENV}/bin:${PATH}
8686

8787
RUN ${VIRTUAL_ENV}/bin/python -m pip install wheel nodeenv grpcio-tools==1.60
8888

89-
RUN ${VIRTUAL_ENV}/bin/nodeenv -p --prebuilt --node=16.13.0
89+
RUN ${VIRTUAL_ENV}/bin/nodeenv -p --prebuilt --node=22.14.0
9090

9191
RUN mkdir -p ${GRR_SOURCE}
9292
ADD . ${GRR_SOURCE}

api_client/python/grr_api_client/api.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
#!/usr/bin/env python
22
"""Main file of GRR API client library."""
33

4-
from typing import Any
5-
from typing import Dict
6-
from typing import Optional
7-
from typing import Tuple
4+
from typing import Any, Optional
85

96
from google.protobuf import message
107
from grr_api_client import artifact
@@ -120,16 +117,16 @@ def UploadYaraSignature(self, signature: str) -> bytes:
120117
def username(self) -> str:
121118
return self._context.username
122119

123-
def GetOpenApiDescription(self) -> Dict[str, Any]:
120+
def GetOpenApiDescription(self) -> dict[str, Any]:
124121
"""Returns the OpenAPI description of the GRR API as a dictionary."""
125122
return metadata.GetOpenApiDescription(context=self._context)
126123

127124

128125
def InitHttp(
129126
api_endpoint: str,
130127
page_size: Optional[int] = None,
131-
auth: Optional[Tuple[str, str]] = None,
132-
proxies: Optional[Dict[str, str]] = None,
128+
auth: Optional[tuple[str, str]] = None,
129+
proxies: Optional[dict[str, str]] = None,
133130
verify: Optional[bool] = None,
134131
cert: Optional[bytes] = None,
135132
trust_env: Optional[bool] = None,

api_client/python/grr_api_client/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"""Clients-related part of GRR API client library."""
33

44
from collections import abc
5+
from collections.abc import Sequence
56
import time
6-
from typing import Sequence
77

88
from grr_api_client import flow
99
from grr_api_client import utils

api_client/python/grr_api_client/connectors/http.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,10 @@ def _FetchRoutingMap(self):
204204
self.api_methods = {}
205205
for method in proto.items:
206206
if not method.http_route.startswith("/api/v2/"):
207-
method.http_route = method.http_route.replace("/api/", "/api/v2/", 1)
207+
raise ValueError(
208+
f"Method {method.name} has an unexpected HTTP route:"
209+
f" {method.http_route}"
210+
)
208211

209212
self.api_methods[method.name] = method
210213
routing_rules.append(
@@ -266,7 +269,7 @@ def _CoerceValueToQueryStringType(
266269
if isinstance(value, bool):
267270
value = int(value)
268271
elif field.enum_type:
269-
value = field.enum_type.values_by_number[value].name.lower()
272+
value = field.enum_type.values_by_number[value].name
270273

271274
return value
272275

@@ -406,9 +409,8 @@ def SendRequest(
406409
content = response.content
407410
json_str = content[len(self.JSON_PREFIX):]
408411

409-
if method_descriptor.result_type_descriptor.name:
410-
default_value = method_descriptor.result_type_descriptor.default
411-
result = utils.TypeUrlToMessage(default_value.type_url)
412+
if method_descriptor.result_type_url:
413+
result = utils.TypeUrlToMessage(method_descriptor.result_type_url)
412414
json_format.Parse(json_str, result, ignore_unknown_fields=True)
413415
return result
414416

api_client/python/grr_api_client/context.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/usr/bin/env python
22
"""API context definition. Context defines request/response behavior."""
33

4+
from collections.abc import Iterator
45
import itertools
5-
from typing import Any
6-
from typing import Iterator
7-
from typing import Optional
6+
from typing import Any, Optional
87

98
from google.protobuf import message
109
from grr_api_client import connectors

api_client/python/grr_api_client/errors.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#!/usr/bin/env python
22
"""API errors definitions."""
33

4-
from typing import Tuple
5-
6-
VersionTuple = Tuple[int, int, int, int]
4+
VersionTuple = tuple[int, int, int, int]
75

86

97
class Error(RuntimeError):

api_client/python/grr_api_client/hunt.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#!/usr/bin/env python
22
"""Hunts-related part of GRR API client library."""
33

4-
from typing import Optional
5-
from typing import Sequence
6-
from typing import Union
4+
from collections.abc import Sequence
5+
from typing import Optional, Union
76

87
from google.protobuf import message
98
from grr_api_client import client

api_client/python/grr_api_client/metadata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
"""Metadata-related part of GRR API client library."""
33

44
import json
5-
from typing import Any, Dict, Optional
5+
from typing import Any, Optional
66

77
from grr_api_client import context as api_context
88
from grr_response_proto.api import metadata_pb2
99

1010

1111
def GetOpenApiDescription(
1212
context: Optional[api_context.GrrApiContext] = None,
13-
) -> Dict[str, Any]:
13+
) -> dict[str, Any]:
1414
"""Returns the OpenAPI description of the GRR API as a dictionary."""
1515
if not context:
1616
raise ValueError("context can't be empty")

0 commit comments

Comments
 (0)