-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix(server): secrets inspectation for the config analyzer in client server mode #8418
fix(server): secrets inspectation for the config analyzer in client server mode #8418
Conversation
…e with redis backend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iamtraining Thanks for your work!
Looks good.
Left small comments
pkg/rpc/convert.go
Outdated
} | ||
} | ||
|
||
// ConvertFromRPCSecret converts fanal.Secret to common.Secret |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// ConvertFromRPCSecret converts fanal.Secret to common.Secret | |
// ConvertToRPCSecret converts fanal.Secret to common.Secret |
} | ||
|
||
// ConvertFromRPCSecret converts fanal.Secret to common.Secret | ||
func ConvertToRPCSecret(secret *ftypes.Secret) *common.Secret { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use this function in ConvertToRPCSecrets
:
Lines 149 to 152 in a280cbb
rpcSecrets = append(rpcSecrets, &common.Secret{ | |
Filepath: s.FilePath, | |
Findings: ConvertToRPCSecretFindings(s.Findings), | |
}) |
@@ -1015,3 +1017,25 @@ func ConvertFromDeleteBlobsRequest(deleteBlobsRequest *cache.DeleteBlobsRequest) | |||
} | |||
return deleteBlobsRequest.GetBlobIds() | |||
} | |||
|
|||
// ConvertFromRPCSecret converts common.Secret to fanal.Secret | |||
func ConvertFromRPCSecret(rpcSecret *common.Secret) *ftypes.Secret { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for ConvertFromRPCSecrets
rpc/cache/service.proto
Outdated
@@ -21,6 +21,7 @@ message ArtifactInfo { | |||
string docker_version = 4; | |||
string os = 5; | |||
repeated common.Package history_packages = 6; | |||
common.Secret secret = 7; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use mage fmt
fix secrets inspectation for the config analyzer in client server mode
Description
secrets that were found when inspecting the config in client/server mode are not saved in the remote cache
func (a Artifact) inspectConfig( ... )
the secret field for PutArtifact is not sent to the server so these secrets are lost
before
{ "SchemaVersion":1, "Architecture":"amd64", "Created":"2023-10-24T22:44:45Z", "DockerVersion":"", "OS":"linux" }
after this huge and massive fix
{"SchemaVersion":1,"Architecture":"amd64","Created":"2023-10-24T22:44:45Z","DockerVersion":"","OS":"linux","Secret":{"FilePath":"config.json","Findings":[{ ... }]}}
Related issues
Checklist