Skip to content

feat: secret scrub multi write - #4944

Closed
dolanor wants to merge 10 commits into
dagger:mainfrom
dolanor:secret-scrub-multi-write
Closed

dolanor wants to merge 10 commits into
dagger:mainfrom
dolanor:secret-scrub-multi-write

Conversation

@dolanor

@dolanor dolanor commented Apr 12, 2023

Copy link
Copy Markdown
Contributor

We need to scrub even if the secret is written in multiple os.Stdout.Write().

Current state

After investigation, our system split big secrets into 32KB chunks.
And our secrets are limited to < 128000 bytes values.
Buildkit seems to handle bigger plaintext values, but we pass our secrets to the shim via os/exec.Cmd which limits the size of passed parameters. (I'll see how to improve that, maybe by passing the secrets as file to the shim command line)

@dolanor dolanor self-assigned this Apr 12, 2023
@dolanor
dolanor marked this pull request as draft April 12, 2023 17:23
@dolanor
dolanor force-pushed the secret-scrub-multi-write branch from b689094 to 2b4f4e7 Compare April 13, 2023 13:54
@dolanor

dolanor commented Apr 13, 2023

Copy link
Copy Markdown
Contributor Author

There was a weird behavior where the output wouldn't get correctly scrubbed.
It was because the secret lines that would get scrubbed could be a substring of a subsequent secret line.
Ordering the secret lines by size, big first fixed it.

@dolanor
dolanor force-pushed the secret-scrub-multi-write branch from 2b4f4e7 to f6e7fca Compare April 13, 2023 14:03
@dolanor dolanor linked an issue Apr 13, 2023 that may be closed by this pull request
@dolanor

dolanor commented Apr 14, 2023

Copy link
Copy Markdown
Contributor Author

There is some issue with the way the line buffer works. It holds the last line to be to check it with future secret.
So I finally have to implement some smarter way to do it.

I'm gonna switch to another secret improvement that should be faster to deliver in the meantime.

dolanor added 10 commits April 20, 2023 04:17
Signed-off-by: Tanguy ⧓ Herrmann <[email protected]>
Signed-off-by: Tanguy ⧓ Herrmann <[email protected]>
Signed-off-by: Tanguy ⧓ Herrmann <[email protected]>
when the scrubbing happens, it will try to scrub the
biggest first if a secret is a substring of a bigger one,
it will avoid partial leaks of the bigger secret

Signed-off-by: Tanguy ⧓ Herrmann <[email protected]>
Signed-off-by: Tanguy ⧓ Herrmann <[email protected]>
Signed-off-by: Tanguy ⧓ Herrmann <[email protected]>
Signed-off-by: Tanguy ⧓ Herrmann <[email protected]>
@dolanor
dolanor force-pushed the secret-scrub-multi-write branch from af5e946 to d1a9f7e Compare April 20, 2023 02:42
@github-actions

github-actions Bot commented May 5, 2023

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions

Copy link
Copy Markdown
Contributor

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions Bot closed this May 12, 2023
Ardaferad35 added a commit to Ardaferad35/CineVerse that referenced this pull request Aug 5, 2026
The project previously avoided the Hilt Gradle plugin entirely due to
a known AGP 9 incompatibility (dagger/dagger#4944), manually extending
generated Hilt_* base classes as a workaround. Root-caused it:

- Hilt 2.57.1 (in use) predates AGP 9 support. 2.58/2.59 added it but
  2.59 shipped with a runtime regression (dagger/dagger#5099,
  ComponentTreeDeps missing from the artifact). 2.60.1 fixes both.
- hilt-navigation-compose was pinned to 1.2.0 because 1.4.0 requires
  compileSdk 37 (project is on 36); 1.3.0 is the latest stable that
  doesn't require it.

With the real plugin applied and hiltJavaCompileDebug actually running
for the first time, it surfaced a real bug the pluginless setup had
been silently masking: Dagger does not support Kotlin constructor
default parameter values, and MovieRepository/TvRepository/
RecommendationRepository/UserListRepository relied on them as their
only injection path (e.g. `movieDao: MovieDao = AppGraph.movieDao`).

Fixed by dropping the defaults from the @Inject constructors (Hilt now
resolves every dependency from the existing DatabaseModule/
FirebaseModule/NetworkModule/ConnectivityModule bindings) and adding a
`default()` companion factory carrying the old default expressions,
for the ~15 call sites across screens/workers/other ViewModels that
still construct these repositories manually outside Hilt. Behavior is
unchanged; only how the instances get wired changed.

The wider inconsistency (AppGraph service locator + manual repository
construction alongside Hilt) is unchanged by this commit and remains
tracked as follow-up work.
Ardaferad35 added a commit to Ardaferad35/CineVerse that referenced this pull request Aug 13, 2026
The project previously avoided the Hilt Gradle plugin entirely due to
a known AGP 9 incompatibility (dagger/dagger#4944), manually extending
generated Hilt_* base classes as a workaround. Root-caused it:

- Hilt 2.57.1 (in use) predates AGP 9 support. 2.58/2.59 added it but
  2.59 shipped with a runtime regression (dagger/dagger#5099,
  ComponentTreeDeps missing from the artifact). 2.60.1 fixes both.
- hilt-navigation-compose was pinned to 1.2.0 because 1.4.0 requires
  compileSdk 37 (project is on 36); 1.3.0 is the latest stable that
  doesn't require it.

With the real plugin applied and hiltJavaCompileDebug actually running
for the first time, it surfaced a real bug the pluginless setup had
been silently masking: Dagger does not support Kotlin constructor
default parameter values, and MovieRepository/TvRepository/
RecommendationRepository/UserListRepository relied on them as their
only injection path (e.g. `movieDao: MovieDao = AppGraph.movieDao`).

Fixed by dropping the defaults from the @Inject constructors (Hilt now
resolves every dependency from the existing DatabaseModule/
FirebaseModule/NetworkModule/ConnectivityModule bindings) and adding a
`default()` companion factory carrying the old default expressions,
for the ~15 call sites across screens/workers/other ViewModels that
still construct these repositories manually outside Hilt. Behavior is
unchanged; only how the instances get wired changed.

The wider inconsistency (AppGraph service locator + manual repository
construction alongside Hilt) is unchanged by this commit and remains
tracked as follow-up work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scrub secrets when it is split in 2+ writes

1 participant