Repository: argoproj/argo-cd (go)

Issue:
Revision is not signed is misleading
**Describe the bug**

People are often confused that "Revision is not signed" is an error, but it's not. We should conditionally display this only if the project is enabled with signed commits.

**Screenshots**

![image](https://user-images.githubusercontent.com/12677113/97923680-3a9ec580-1d13-11eb-9a6d-213d45d2e76f.png)

**Version**

```shell
Paste the output from `argocd version` here.
```

**Logs**

```
Paste any relevant application logs here.
```


Pull request description:
fix: Only verify GPG signatures on metadata requests when verification is enforced
Fixes #4731

Change revision metadata request behaviour to only run signature verification when it's enforced by the application's parent project.

I was first considering to make this a simple UI only change. Since we need access to the parent project for making an informed choice about this status, and there might be cases where a user has read access to the application, but not to its parent project, I decided that making this change in the repo-server instead makes more sense - also, it reduces amounts of forks required when fetching revision meta data.

The downside to this is that meta data for the same revision might be loaded twice, in case two or more applications are pinned to the same revision, and one or more are enforcing signature verification but other's don't.

Signed-off-by: jannfis <jann@mistrust.net>

Checklist:

* [ ] Either (a) I've created an [enhancement proposal](https://github.com/argoproj/argo-cd/issues/new/choose) and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
* [ ] The title of the PR states what changed and the related issues number (used for the release note).
* [ ] I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
* [ ] Does this PR require documentation updates?
* [ ] I've updated documentation as required by this PR.
* [ ] Optional. My organization is added to USERS.md.
* [ ] I've signed the CLA and my build is green ([troubleshooting builds](https://argoproj.github.io/argo-cd/developer-guide/ci/)). 


Patch:
diff --git a/assets/swagger.json b/assets/swagger.json
index eeb740e99..6c81f4694 100644
--- a/assets/swagger.json
+++ b/assets/swagger.json
@@ -188,7 +188,7 @@
           "ApplicationService"
         ],
         "summary": "List returns list of applications",
-        "operationId": "ListMixin9",
+        "operationId": "List",
         "parameters": [
           {
             "type": "string",
@@ -239,7 +239,7 @@
           "ApplicationService"
         ],
         "summary": "Create creates an application",
-        "operationId": "CreateMixin9",
+        "operationId": "Create",
         "parameters": [
           {
             "name": "body",
@@ -266,7 +266,7 @@
           "ApplicationService"
         ],
         "summary": "Update updates an application",
-        "operationId": "UpdateMixin9",
+        "operationId": "Update",
         "parameters": [
           {
             "type": "string",
@@ -400,7 +400,7 @@
           "ApplicationService"
         ],
         "summary": "Get returns an application by name",
-        "operationId": "GetMixin9",
+        "operationId": "GetMixin1",
         "parameters": [
           {
             "type": "string",
@@ -452,7 +452,7 @@
           "ApplicationService"
         ],
         "summary": "Delete deletes an application",
-        "operationId": "DeleteMixin9",
+        "operationId": "Delete",
         "parameters": [
           {
             "type": "string",
@@ -1162,7 +1162,7 @@
           "ClusterService"
         ],
         "summary": "List returns list of clusters",
-        "operationId": "List",
+        "operationId": "ListMixin5",
         "parameters": [
           {
             "type": "string",
@@ -1189,7 +1189,7 @@
           "ClusterService"
         ],
         "summary": "Create creates a cluster",
-        "operationId": "Create",
+        "operationId": "CreateMixin5",
         "parameters": [
           {
             "name": "body",
@@ -1216,7 +1216,7 @@
           "ClusterService"
         ],
         "summary": "Update updates a cluster",
-        "operationId": "Update",
+        "operationId": "UpdateMixin5",
         "parameters": [
           {
             "type": "string",
@@ -1250,7 +1250,7 @@
           "ClusterService"
         ],
         "summary": "Get returns a cluster by server address",
-        "operationId": "GetMixin2",
+        "operationId": "GetMixin5",
         "parameters": [
           {
             "type": "string",
@@ -1278,7 +1278,7 @@
           "ClusterService"
         ],
         "summary": "Delete deletes a cluster",
-        "operationId": "Delete",
+        "operationId": "DeleteMixin5",
         "parameters": [
           {
             "type": "string",
@@ -1358,7 +1358,7 @@
           "GPGKeyService"
         ],
         "summary": "List all available repository certificates",
-        "operationId": "ListMixin7",
+        "operationId": "ListMixin2",
         "parameters": [
           {
             "type": "string",
@@ -1381,7 +1381,7 @@
           "GPGKeyService"
         ],
         "summary": "Create one or more GPG public keys in the server's configuration",
-        "operationId": "CreateMixin7",
+        "operationId": "CreateMixin2",
         "parameters": [
           {
             "description": "Raw key data of the GPG key(s) to create",
@@ -1407,7 +1407,7 @@
           "GPGKeyService"
         ],
         "summary": "Delete specified GPG public key from the server's configuration",
-        "operationId": "DeleteMixin7",
+        "operationId": "DeleteMixin2",
         "parameters": [
           {
             "type": "string",
@@ -1432,7 +1432,7 @@
           "GPGKeyService"
         ],
         "summary": "Get information about specified GPG public key from the server",
-        "operationId": "GetMixin7",
+        "operationId": "GetMixin2",
         "parameters": [
           {
             "type": "string",
@@ -1948,7 +1948,7 @@
           "RepositoryService"
         ],
         "summary": "Get returns a repository or its credentials",
-        "operationId": "GetMixin3",
+        "operationId": "Get",
         "parameters": [
           {
             "type": "string",
@@ -2011,7 +2011,7 @@
         "tags": [
           "RepositoryService"
         ],
-        "summary": "ListApps returns list of apps in the repo",
+        "summary": "ListApps returns list of apps in the repe",
         "operationId": "ListApps",
         "parameters": [
           {
@@ -2235,7 +2235,7 @@
           "SettingsService"
         ],
         "summary": "Get returns Argo CD settings",
-        "operationId": "Get",
+        "operationId": "GetMixin8",
         "responses": {
           "200": {
             "description": "A successful response.",
diff --git a/reposerver/apiclient/repository.pb.go b/reposerver/apiclient/repository.pb.go
index 210daf73f..804d7d39f 100644
--- a/reposerver/apiclient/repository.pb.go
+++ b/reposerver/apiclient/repository.pb.go
@@ -628,7 +628,9 @@ type RepoServerRevisionMetadataRequest struct {
 	// the repo
 	Repo *v1alpha1.Repository `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"`
 	// the revision within the repo
-	Revision             string   `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"`
+	Revision string `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"`
+	// whether to check signature on revision
+	CheckSignature       bool     `protobuf:"varint,3,opt,name=checkSignature,proto3" json:"checkSignature,omitempty"`
 	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 	XXX_unrecognized     []byte   `json:"-"`
 	XXX_sizecache        int32    `json:"-"`
@@ -681,6 +683,13 @@ func (m *RepoServerRevisionMetadataRequest) GetRevision() string {
 	return ""
 }
 
+func (m *RepoServerRevisionMetadataRequest) GetCheckSignature() bool {
+	if m != nil {
+		return m.CheckSignature
+	}
+	return false
+}
+
 // KsonnetAppSpec contains Ksonnet app response
 // This roughly reflects: ksonnet/ksonnet/metadata/app/schema.go
 type KsonnetAppSpec struct {
@@ -1218,87 +1227,88 @@ func init() {
 }
 
 var fileDescriptor_dd8723cfcc820480 = []byte{
-	// 1280 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0x5b, 0x6f, 0x1b, 0xc5,
-	0x17, 0xcf, 0xda, 0xce, 0xc5, 0xc7, 0x6d, 0xe3, 0x4c, 0xfb, 0xef, 0x7f, 0x31, 0xa9, 0x15, 0x56,
-	0x80, 0x02, 0xa5, 0x36, 0x0d, 0x15, 0x54, 0xad, 0x54, 0x29, 0xf4, 0x8a, 0x92, 0xaa, 0xe9, 0x06,
-	0x2a, 0x71, 0x91, 0xaa, 0xc9, 0xfa, 0x64, 0x3d, 0x78, 0xbd, 0x3b, 0xec, 0x8c, 0x8d, 0xdc, 0x2f,
-	0x00, 0xef, 0x88, 0x17, 0xbe, 0x00, 0xef, 0x48, 0x3c, 0xf0, 0x8e, 0x10, 0x8f, 0x7c, 0x04, 0xd4,
-	0x4f, 0x82, 0x66, 0xf6, 0x36, 0x5e, 0x3b, 0x79, 0x71, 0x2f, 0x2f, 0xc9, 0xcc, 0x99, 0x73, 0x9b,
-	0x33, 0xbf, 0xf9, 0xcd, 0xf1, 0xc2, 0xbb, 0x31, 0xf2, 0x48, 0x60, 0x3c, 0xc6, 0xb8, 0xab, 0x87,
-	0x4c, 0x46, 0xf1, 0xc4, 0x18, 0x76, 0x78, 0x1c, 0xc9, 0x88, 0x40, 0x21, 0x69, 0x5d, 0xf0, 0x23,
-	0x3f, 0xd2, 0xe2, 0xae, 0x1a, 0x25, 0x1a, 0xad, 0x4d, 0x3f, 0x8a, 0xfc, 0x00, 0xbb, 0x94, 0xb3,
-	0x2e, 0x0d, 0xc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0xed, 0xf3, 0xd3,
-	0x5b, 0x7f, 0x3f, 0x6f, 0x5b, 0xff, 0x3c, 0x6f, 0x5b, 0xff, 0x3e, 0x6f, 0x5b, 0x5f, 0x7d, 0x78,
-	0xda, 0x97, 0x02, 0xe3, 0x8b, 0x06, 0xe5, 0xcc, 0x0b, 0x18, 0x86, 0xf2, 0x68, 0x45, 0x7f, 0x17,
-	0xf8, 0xe8, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x61, 0xb4, 0xe7, 0xb1, 0xf0, 0x10, 0x00, 0x00,
+	// 1292 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0x5b, 0x6f, 0x1b, 0x45,
+	0x14, 0xce, 0xda, 0xce, 0xc5, 0xc7, 0x6d, 0xe2, 0x4c, 0x4b, 0x59, 0x4c, 0x6a, 0x85, 0x15, 0x54,
+	0x81, 0x52, 0x9b, 0x86, 0x0a, 0xaa, 0x56, 0xaa, 0x14, 0x7a, 0x45, 0x49, 0xd5, 0x74, 0x03, 0x95,
+	0xb8, 0x48, 0xd5, 0x64, 0x7d, 0xb2, 0x1e, 0xbc, 0xde, 0x1d, 0x76, 0xc6, 0x46, 0xe9, 0x1f, 0x80,
+	0x77, 0xc4, 0x6f, 0xe0, 0x1d, 0x89, 0x07, 0x5e, 0x11, 0x42, 0x3c, 0xf2, 0x13, 0x50, 0x7f, 0x09,
+	0x9a, 0xd9, 0xdb, 0x78, 0xed, 0xe4, 0xc5, 0xbd, 0xbc, 0x24, 0x33, 0x67, 0xce, 0x6d, 0xce, 0x7c,
+	0xf3, 0xcd, 0xf1, 0xc2, 0xa5, 0x18, 0x79, 0x24, 0x30, 0x1e, 0x63, 0xdc, 0xd5, 0x43, 0x26, 0xa3,
+	0xf8, 0xd8, 0x18, 0x76, 0x78, 0x1c, 0xc9, 0x88, 0x40, 0x21, 0x69, 0x9d, 0xf7, 0x23, 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0xbf, 0x50, 0xe4, 0xca, 0xec, 0x20, 0x27, 0xbc,
+	0x64, 0xad, 0xdd, 0xb9, 0x50, 0x35, 0xe9, 0xd3, 0x59, 0x20, 0xfb, 0x7a, 0xcf, 0x05, 0x3a, 0xc8,
+	0xc5, 0x99, 0x30, 0xc8, 0x4b, 0xd7, 0x3e, 0x69, 0x39, 0xdb, 0xe7, 0x67, 0xb7, 0xfe, 0x79, 0xde,
+	0xb6, 0xfe, 0x7d, 0xde, 0xb6, 0xfe, 0x7b, 0xde, 0xb6, 0xbe, 0xfe, 0xe8, 0xb4, 0x2f, 0x0a, 0xc6,
+	0x97, 0x0f, 0xca, 0x99, 0x17, 0x30, 0x0c, 0xe5, 0xe1, 0x92, 0xfe, 0x7e, 0xf0, 0xf1, 0xff, 0x01,
+	0x00, 0x00, 0xff, 0xff, 0xaa, 0x90, 0xca, 0xf2, 0x18, 0x11, 0x00, 0x00,
 }
 
 // Reference imports to suppress errors if they are not otherwise used.
@@ -2160,6 +2170,16 @@ func (m *RepoServerRevisionMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (i
 		i -= len(m.XXX_unrecognized)
 		copy(dAtA[i:], m.XXX_unrecognized)
 	}
+	if m.CheckSignature {
+		i--
+		if m.CheckSignature {
+			dAtA[i] = 1
+		} else {
+			dAtA[i] = 0
+		}
+		i--
+		dAtA[i] = 0x18
+	}
 	if len(m.Revision) > 0 {
 		i -= len(m.Revision)
 		copy(dAtA[i:], m.Revision)
@@ -2887,6 +2907,9 @@ func (m *RepoServerRevisionMetadataRequest) Size() (n int) {
 	if l > 0 {
 		n += 1 + l + sovRepository(uint64(l))
 	}
+	if m.CheckSignature {
+		n += 2
+	}
 	if m.XXX_unrecognized != nil {
 		n += len(m.XXX_unrecognized)
 	}
@@ -4844,6 +4867,26 @@ func (m *RepoServerRevisionMetadataRequest) Unmarshal(dAtA []byte) error {
 			}
 			m.Revision = string(dAtA[iNdEx:postIndex])
 			iNdEx = postIndex
+		case 3:
+			if wireType != 0 {
+				return fmt.Errorf("proto: wrong wireType = %d for field CheckSignature", wireType)
+			}
+			var v int
+			for shift := uint(0); ; shift += 7 {
+				if shift >= 64 {
+					return ErrIntOverflowRepository
+				}
+				if iNdEx >= l {
+					return io.ErrUnexpectedEOF
+				}
+				b := dAtA[iNdEx]
+				iNdEx++
+				v |= int(b&0x7F) << shift
+				if b < 0x80 {
+					break
+				}
+			}
+			m.CheckSignature = bool(v != 0)
 		default:
 			iNdEx = preIndex
 			skippy, err := skipRepository(dAtA[iNdEx:])
diff --git a/reposerver/repository/repository.go b/reposerver/repository/repository.go
index 2c51afef0..10a08a773 100644
--- a/reposerver/repository/repository.go
+++ b/reposerver/repository/repository.go
@@ -1121,8 +1121,20 @@ func (s *Service) GetRevisionMetadata(ctx context.Context, q *apiclient.RepoServ
 	}
 	metadata, err := s.cache.GetRevisionMetadata(q.Repo.Repo, q.Revision)
 	if err == nil {
-		log.Infof("revision metadata cache hit: %s/%s", q.Repo.Repo, q.Revision)
-		return metadata, nil
+		// The logic here is that if a signature check on metadata is requested,
+		// but there is none in the cache, we handle as if we have a cache miss
+		// and re-generate the meta data. Otherwise, if there is signature info
+		// in the metadata, but none was requested, we remove it from the data
+		// that we return.
+		if q.CheckSignature && metadata.SignatureInfo == "" {
+			log.Infof("revision metadata cache hit, but need to regenerate due to missing signature info: %s/%s", q.Repo.Repo, q.Revision)
+		} else {
+			log.Infof("revision metadata cache hit: %s/%s", q.Repo.Repo, q.Revision)
+			if !q.CheckSignature {
+				metadata.SignatureInfo = ""
+			}
+			return metadata, nil
+		}
 	} else {
 		if err != reposervercache.ErrCacheMiss {
 			log.Warnf("revision metadata cache error %s/%s: %v", q.Repo.Repo, q.Revision, err)
@@ -1156,7 +1168,7 @@ func (s *Service) GetRevisionMetadata(ctx context.Context, q *apiclient.RepoServ
 
 	// Run gpg verify-commit on the revision
 	signatureInfo := ""
-	if gpg.IsGPGEnabled() {
+	if gpg.IsGPGEnabled() && q.CheckSignature {
 		cs, err := gitClient.VerifyCommitSignature(q.Revision)
 		if err != nil {
 			log.Debugf("Could not verify commit signature: %v", err)
diff --git a/reposerver/repository/repository.proto b/reposerver/repository/repository.proto
index 7802aab3d..986d14092 100644
--- a/reposerver/repository/repository.proto
+++ b/reposerver/repository/repository.proto
@@ -81,6 +81,8 @@ message RepoServerRevisionMetadataRequest {
     github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Repository repo = 1;
     // the revision within the repo
     string revision = 2;
+    // whether to check signature on revision
+    bool checkSignature = 3;
 }
 
 // KsonnetAppSpec contains Ksonnet app response
diff --git a/server/application/application.go b/server/application/application.go
index 1f5d22f80..b8ddab2db 100644
--- a/server/application/application.go
+++ b/server/application/application.go
@@ -982,12 +982,22 @@ func (s *Server) RevisionMetadata(ctx context.Context, q *application.RevisionMe
 	if err != nil {
 		return nil, err
 	}
+	// We need to get some information with the project associated to the app,
+	// so we'll know whether GPG signatures are enforced.
+	proj, err := argo.GetAppProject(&a.Spec, applisters.NewAppProjectLister(s.projInformer.GetIndexer()), a.Namespace, s.settingsMgr)
+	if err != nil {
+		return nil, err
+	}
 	conn, repoClient, err := s.repoClientset.NewRepoServerClient()
 	if err != nil {
 		return nil, err
 	}
 	defer io.Close(conn)
-	return repoClient.GetRevisionMetadata(ctx, &apiclient.RepoServerRevisionMetadataRequest{Repo: repo, Revision: q.GetRevision()})
+	return repoClient.GetRevisionMetadata(ctx, &apiclient.RepoServerRevisionMetadataRequest{
+		Repo:           repo,
+		Revision:       q.GetRevision(),
+		CheckSignature: len(proj.Spec.SignatureKeys) > 0,
+	})
 }
 
 func isMatchingResource(q *application.ResourcesQuery, key kube.ResourceKey) bool {


Test patch:
diff --git a/reposerver/repository/repository_test.go b/reposerver/repository/repository_test.go
index a2ac2ab0c..c74015b27 100644
--- a/reposerver/repository/repository_test.go
+++ b/reposerver/repository/repository_test.go
@@ -963,8 +963,9 @@ func TestGetRevisionMetadata(t *testing.T) {
 	}, nil)
 
 	res, err := service.GetRevisionMetadata(context.Background(), &apiclient.RepoServerRevisionMetadataRequest{
-		Repo:     &argoappv1.Repository{},
-		Revision: "c0b400fc458875d925171398f9ba9eabd5529923",
+		Repo:           &argoappv1.Repository{},
+		Revision:       "c0b400fc458875d925171398f9ba9eabd5529923",
+		CheckSignature: true,
 	})
 
 	assert.NoError(t, err)
@@ -972,7 +973,34 @@ func TestGetRevisionMetadata(t *testing.T) {
 	assert.Equal(t, now, res.Date.Time)
 	assert.Equal(t, "author", res.Author)
 	assert.EqualValues(t, []string{"tag1", "tag2"}, res.Tags)
+	assert.NotEmpty(t, res.SignatureInfo)
 
+	// Cache hit - signature info should not be in result
+	res, err = service.GetRevisionMetadata(context.Background(), &apiclient.RepoServerRevisionMetadataRequest{
+		Repo:           &argoappv1.Repository{},
+		Revision:       "c0b400fc458875d925171398f9ba9eabd5529923",
+		CheckSignature: false,
+	})
+	assert.NoError(t, err)
+	assert.Empty(t, res.SignatureInfo)
+
+	// Enforce cache miss - signature info should not be in result
+	res, err = service.GetRevisionMetadata(context.Background(), &apiclient.RepoServerRevisionMetadataRequest{
+		Repo:           &argoappv1.Repository{},
+		Revision:       "c0b400fc458875d925171398f9ba9eabd5529924",
+		CheckSignature: false,
+	})
+	assert.NoError(t, err)
+	assert.Empty(t, res.SignatureInfo)
+
+	// Cache hit on previous entry that did not have signature info
+	res, err = service.GetRevisionMetadata(context.Background(), &apiclient.RepoServerRevisionMetadataRequest{
+		Repo:           &argoappv1.Repository{},
+		Revision:       "c0b400fc458875d925171398f9ba9eabd5529924",
+		CheckSignature: true,
+	})
+	assert.NoError(t, err)
+	assert.NotEmpty(t, res.SignatureInfo)
 }
 
 func TestGetSignatureVerificationResult(t *testing.T) {