Skip to content

Commit

Permalink
[grizzly] Use a separate token for reducer tasks.
Browse files Browse the repository at this point in the history
These tasks required read/write access to FuzzManager.
  • Loading branch information
jschwartzentruber committed Jun 26, 2023
1 parent cdab72b commit 249bdba
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 10 deletions.
8 changes: 7 additions & 1 deletion services/grizzly-macos/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,14 @@ EOF
fluent-bit -c td-agent-bit.conf &

# Get fuzzmanager configuration from TC
if [ "$ADAPTER" = "reducer" ]
then
fmsecret=fuzzmanagerconf-rw
else
fmsecret=fuzzmanagerconf
fi
set +x
retry_curl "$TASKCLUSTER_PROXY_URL/secrets/v1/secret/project/fuzzing/fuzzmanagerconf" | python -c "import json,sys;open('.fuzzmanagerconf','w').write(json.load(sys.stdin)['secret']['key'])"
retry_curl "$TASKCLUSTER_PROXY_URL/secrets/v1/secret/project/fuzzing/$fmsecret" | python -c "import json,sys;open('.fuzzmanagerconf','w').write(json.load(sys.stdin)['secret']['key'])"
set -x
export FM_CONFIG_PATH="$PWD/.fuzzmanagerconf"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ def _list_objs(
)

while next_url:

resp_json = self.get(next_url, params=params).json()

if isinstance(resp_json, dict):
Expand Down Expand Up @@ -237,7 +236,7 @@ def ensure_credentials() -> None:
# get fuzzmanager config from taskcluster
conf_path = Path.home() / ".fuzzmanagerconf"
if not conf_path.is_file():
key = Taskcluster.load_secrets("project/fuzzing/fuzzmanagerconf")["key"]
key = Taskcluster.load_secrets("project/fuzzing/fuzzmanagerconf-rw")["key"]
conf_path.write_text(key)
conf_path.chmod(0o400)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def _fuzzmanager_get_crashes(
)

buckets_by_tool: Dict[str, List[str]] = {}
for (bucket, tool) in bucket_tools:
for bucket, tool in bucket_tools:
buckets_by_tool.setdefault(tool, [])
buckets_by_tool[tool].append(bucket)
for tool, bucket_filter in buckets_by_tool.items():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ scopes:
- "docker-worker:capability:privileged"
- "secrets:get:project/fuzzing/deploy-bearspray"
- "secrets:get:project/fuzzing/deploy-grizzly-private"
- "secrets:get:project/fuzzing/fuzzmanagerconf"
- "secrets:get:project/fuzzing/fuzzmanagerconf-rw"
- "secrets:get:project/fuzzing/google-logging-creds"
taskGroupId: "${task_group}"
workerType: "${worker}"
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ schedulerId: "${scheduler}"
scopes:
- "secrets:get:project/fuzzing/deploy-bearspray"
- "secrets:get:project/fuzzing/deploy-grizzly-private"
- "secrets:get:project/fuzzing/fuzzmanagerconf"
- "secrets:get:project/fuzzing/fuzzmanagerconf-rw"
- "secrets:get:project/fuzzing/google-logging-creds"
taskGroupId: "${task_group}"
workerType: "${worker}"
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ scopes:
- "generic-worker:run-as-administrator:${provisioner}/grizzly-reduce-worker-windows"
- "secrets:get:project/fuzzing/deploy-bearspray"
- "secrets:get:project/fuzzing/deploy-grizzly-private"
- "secrets:get:project/fuzzing/fuzzmanagerconf"
- "secrets:get:project/fuzzing/fuzzmanagerconf-rw"
- "secrets:get:project/fuzzing/google-logging-creds"
taskGroupId: "${task_group}"
workerType: "${worker}"
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ scopes:
- "docker-worker:capability:device:loopbackAudio"
- "secrets:get:project/fuzzing/deploy-bearspray"
- "secrets:get:project/fuzzing/deploy-grizzly-private"
- "secrets:get:project/fuzzing/fuzzmanagerconf"
- "secrets:get:project/fuzzing/fuzzmanagerconf-rw"
- "secrets:get:project/fuzzing/google-logging-creds"
taskGroupId: "${task_group}"
workerType: "${worker}"
8 changes: 7 additions & 1 deletion services/grizzly-win/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,14 @@ EOF
retry pip install git+https://github.com/MozillaSecurity/FuzzManager

# Get fuzzmanager configuration from TC
if [ "$ADAPTER" = "reducer" ]
then
fmsecret=fuzzmanagerconf-rw
else
fmsecret=fuzzmanagerconf
fi
set +x
retry_curl "$TASKCLUSTER_PROXY_URL/secrets/v1/secret/project/fuzzing/fuzzmanagerconf" | python -c "import json,sys;open('.fuzzmanagerconf','w').write(json.load(sys.stdin)['secret']['key'])"
retry_curl "$TASKCLUSTER_PROXY_URL/secrets/v1/secret/project/fuzzing/$fmsecret" | python -c "import json,sys;open('.fuzzmanagerconf','w').write(json.load(sys.stdin)['secret']['key'])"
set -x

# Update fuzzmanager config for this instance
Expand Down
6 changes: 5 additions & 1 deletion services/grizzly/launch-grizzly-worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ pushd /src/fuzzmanager >/dev/null
popd >/dev/null

# Get fuzzmanager configuration from TC
get-tc-secret fuzzmanagerconf .fuzzmanagerconf
if [[ "$ADAPTER" = "reducer" ]]; then
get-tc-secret fuzzmanagerconf-rw .fuzzmanagerconf
else
get-tc-secret fuzzmanagerconf .fuzzmanagerconf
fi

# Update fuzzmanager config for this instance
mkdir -p signatures
Expand Down

0 comments on commit 249bdba

Please sign in to comment.