Skip to content

[StepSecurity] Apply security best practices#4514

Open
stepsecurity-app[bot] wants to merge 5 commits into
devfrom
chore/GHA-180517-stepsecurity-remediation
Open

[StepSecurity] Apply security best practices#4514
stepsecurity-app[bot] wants to merge 5 commits into
devfrom
chore/GHA-180517-stepsecurity-remediation

Conversation

@stepsecurity-app

Copy link
Copy Markdown
Contributor

Summary

This pull request has been generated by StepSecurity as part of your enterprise subscription to ensure compliance with recommended security best practices. Please review and merge the pull request to apply these security enhancements.

Security Fixes

Keeping your actions up to date with Dependabot

With Dependabot version updates, when Dependabot identifies an outdated dependency, it raises a pull request to update the manifest to the latest version of the dependency. This is recommended by GitHub as well as The Open Source Security Foundation (OpenSSF).

Feedback

For bug reports, feature requests, and general feedback; please create an issue in step-security/secure-repo or contact us via our website.

roroghost17 and others added 5 commits June 17, 2026 18:14
## Summary

Fixes a bug where OTEL plugin headers were being overwritten with redacted placeholder values when saving a plugin configuration. After the multi-profile change, header values stored as plain strings inside the `profiles` array were not being restored from the database before saving, causing real credentials to be replaced with masked values like `****`.

## Changes

- Extracted `restoreRedactedValue` as a standalone recursive helper, replacing the inline logic in `restoreRedactedFromExisting`. This allows the restoration logic to descend into both nested maps and slices.
- Added slice traversal support (index-aligned) so that elements within arrays like the OTEL `profiles` array are individually checked and restored.
- Added plain-string redaction detection so that header values stored as raw strings (rather than `EnvVar` objects) are also restored from the existing DB config when they carry a redaction artifact. Empty strings are intentionally left as-is to allow clearing a value.
- Added `TestRestoreRedacted_OTELProfilesHeaders` to cover both failure modes: slice traversal and plain-string secret restoration. Also asserts that genuinely new (non-redacted) values pass through unchanged.

## Type of change

- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [x] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

```sh
go test ./transports/bifrost-http/handlers/...
```

Verify that saving an OTEL plugin configuration with multiple profiles, after a GET that returns redacted header values, does not overwrite the stored credentials in the database. Confirm that providing a genuinely new header value still persists correctly.

## Screenshots/Recordings

N/A

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

N/A

## Security considerations

This fix ensures that redacted credential placeholders returned to the client are never written back over real secrets stored in the database. The restoration logic only replaces values that are confirmed redaction artifacts; empty strings and non-redacted values are always passed through as-is, preserving the ability to clear a credential intentionally.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
@stepsecurity-app stepsecurity-app Bot requested a review from a team as a code owner June 18, 2026 05:17
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Single-line config addition to dependabot.yml with no effect on runtime behavior; safe to merge.

The change is a one-entry addition to a declarative Dependabot config file. The target directory exists with a valid go.mod, the weekly interval is consistent with all other entries in the same section of the file, and no open-pull-requests-limit is needed because the rest of the weekly-interval block omits it too. There is nothing here that could regress behavior.

No files require special attention.

Important Files Changed

Filename Overview
.github/dependabot.yml Adds a new gomod Dependabot entry for /scripts/litellm-to-bifrost on a weekly schedule; the directory exists with a go.mod file and the new entry is consistent with other weekly-interval entries in the file.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Dependabot Weekly Check] --> B{Go module in\n/scripts/litellm-to-bifrost}
    B -->|Outdated dependency found| C[Open PR with updated go.mod/go.sum]
    B -->|All up to date| D[No action]
    C --> E[Developer reviews & merges]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[Dependabot Weekly Check] --> B{Go module in\n/scripts/litellm-to-bifrost}
    B -->|Outdated dependency found| C[Open PR with updated go.mod/go.sum]
    B -->|All up to date| D[No action]
    C --> E[Developer reviews & merges]
Loading

Reviews (1): Last reviewed commit: "[StepSecurity] Apply security best pract..." | Re-trigger Greptile

@akshaydeo akshaydeo force-pushed the dev branch 2 times, most recently from 7f86f4e to 2f96e3a Compare June 19, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants