Add patch audit (#1416)

* Add auditing to patching commands

* Omit Patch Resource logs to prevent secret leaks
This commit is contained in:
dthomson25 2019-04-09 09:57:22 -06:00 committed by Alexander Matyushentsev
parent dea731a6b2
commit ad5d26f08a
2 changed files with 4 additions and 0 deletions

View file

@ -361,6 +361,8 @@ func (s *Server) Patch(ctx context.Context, q *ApplicationPatchRequest) (*appv1.
return nil, err
}
s.logEvent(app, ctx, argo.EventReasonResourceUpdated, fmt.Sprintf("patched application %s/%s",app.Namespace, app.Name))
err = json.Unmarshal(patchApp, &app)
if err != nil {
return nil, err
@ -616,6 +618,7 @@ func (s *Server) PatchResource(ctx context.Context, q *ApplicationResourcePatchR
if err != nil {
return nil, err
}
s.logEvent(a, ctx, argo.EventReasonResourceUpdated, fmt.Sprintf("patched resource %s/%s '%s'", q.Group, q.Kind, q.ResourceName))
return &ApplicationResourceResponse{
Manifest: string(data),
}, nil

View file

@ -377,6 +377,7 @@ func (a *ArgoCDServer) newGRPCServer() *grpc.Server {
"/account.AccountService/UpdatePassword": true,
"/repository.RepositoryService/Create": true,
"/repository.RepositoryService/Update": true,
"/application.ApplicationService/PatchResource": true,
}
// NOTE: notice we do not configure the gRPC server here with TLS (e.g. grpc.Creds(creds))
// This is because TLS handshaking occurs in cmux handling