Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update slosilo to resolve thread-safety bug #2718

Merged
merged 2 commits into from
Feb 10, 2023
Merged

Update slosilo to resolve thread-safety bug #2718

merged 2 commits into from
Feb 10, 2023

Conversation

micahlee
Copy link
Contributor

@micahlee micahlee commented Feb 10, 2023

Desired Outcome

The desired outcome of this PR is to resolve a thread-safety defect with decrypting secret values fixed upstream in cyberark/slosilo#31.

Implemented Changes

This PR updates Slosilo to version 3.0.1 to include the defect fix. It also includes a second commit to fix an uninitialized constant error I also observed while working on this change.

Connected Issue/Story

CyberArk internal issue ID: CNJR-479

Definition of Done

At least 1 todo must be completed in the sections below for the PR to be
merged.

Changelog

  • The CHANGELOG has been updated, or
  • This PR does not include user-facing changes and doesn't require a
    CHANGELOG update

Test coverage

  • This PR includes new unit and integration tests to go with the code
    changes, or
  • The changes in this PR do not require tests (this is tested in slosilo)

Documentation

  • Docs (e.g. READMEs) were updated in this PR
  • A follow-up issue to update official docs has been filed here: [insert issue ID]
  • This PR does not require updating any documentation

Behavior

  • This PR changes product behavior and has been reviewed by a PO, or
  • These changes are part of a larger initiative that will be reviewed later, or
  • No behavior was changed with this PR

Security

  • Security architect has reviewed the changes in this PR,
  • These changes are part of a larger initiative with a separate security review, or
  • There are no security aspects to these changes

It's not clear what the origin of this is.
However, the Sequel gem docs clearly document
that if a record doesn't exist, this will return
`nil` rather than raise an exception.

Original error from logs:

```
NameError (uninitialized constant FindResource::NotFound):
app/controllers/concerns/find_resource.rb:23:in `rescue in resource_exists?'
app/controllers/concerns/find_resource.rb:20:in `resource_exists?'
app/controllers/secrets_controller.rb:119:in `error_info'
app/controllers/secrets_controller.rb:23:in `ensure in create'
app/controllers/secrets_controller.rb:30:in `create'
app/controllers/application_controller.rb:83:in `run_with_transaction'
lib/rack/remove_request_parameters.rb:26:in `call'
lib/rack/default_content_type.rb:78:in `call'
```
@micahlee micahlee marked this pull request as ready for review February 10, 2023 20:45
@micahlee micahlee requested a review from a team as a code owner February 10, 2023 20:45
Copy link
Contributor

@imheresamir imheresamir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -18,6 +18,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
detects that either the directory or file do not exist.
[cyberark/conjur#2715](https://github.com/cyberark/conjur/pull/2715)

### Fixed
- Fixed a thread-safety bug in secret retrieval when multiple threads attempt
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lists should be surrounded by blank lines

@codeclimate
Copy link

codeclimate bot commented Feb 10, 2023

Code Climate has analyzed commit bad6f8e and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Style 1

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 90.1% (-1.5% change).

View more on Code Climate.

@micahlee micahlee merged commit 6b38be2 into master Feb 10, 2023
@micahlee micahlee deleted the update-slosilo branch February 10, 2023 21:08
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.

2 participants