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

Add authorize Monitor connection elements. #1333

Conversation

anastasia-malysheva
Copy link
Contributor

@anastasia-malysheva anastasia-malysheva commented Jul 27, 2022

…Server chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain.

Signed-off-by: anastasia.malysheva anastasia.malysheva@xored.com

Description

Issue link

#46

How Has This Been Tested?

  • Added unit testing to cover
  • Tested manually
  • Tested by integration testing
  • Have not tested

Types of changes

  • Bug fix
  • New functionallity
  • Documentation
  • Refactoring
  • CI

…Server chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain.

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>
@@ -117,6 +119,16 @@ func WithAuthorizeServer(authorizeServer networkservice.NetworkServiceServer) Op
}
}

// WithAuthorizeMonitorServer sets authorization MonitorConnectionServer chain element
func WithAuthorizeMonitorServer(authorizeMonitorServer networkservice.MonitorConnectionServer) Option {
Copy link
Member

Choose a reason for hiding this comment

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

Please apply for other places

Suggested change
func WithAuthorizeMonitorServer(authorizeMonitorServer networkservice.MonitorConnectionServer) Option {
func WithAuthorizeMonitorConnectionServer(authorizeMonitorServer networkservice.MonitorConnectionServer) Option {

Comment on lines 75 to 77
for _, v := range in.PathSegments {
seg = append(seg, v.GetId())
}
Copy link
Member

Choose a reason for hiding this comment

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

Please check only previous segment.

Comment on lines 22 to 26
conn_ids := [y | y = input.spiffe_id_connection_map[input.service_spiffe_id][_]]
count(input.path_segments) > 0
count(conn_ids) > 0
conn_ids == input.path_segments
}
Copy link
Member

Choose a reason for hiding this comment

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

Please note: the client is always previous segment. Please check only previous id.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>
@@ -55,7 +54,8 @@ func pemEncodingX509Cert(cert *x509.Certificate) string {
return string(certpem)
}

func parseX509Cert(authInfo credentials.AuthInfo) *x509.Certificate {
// ParseX509Cert - parses x509 certificate from the passed credentials.AuthInfo
func ParseX509Cert(authInfo credentials.AuthInfo) *x509.Certificate {
Copy link
Member

Choose a reason for hiding this comment

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

Can be private

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I use this method in other package.

ids = &spire.ConnectionIDSet{}
}
var placer struct{}
ids.Store(connID, placer)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ids.Store(connID, placer)
ids.Store(connID, struct{}{})

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixes

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>
@@ -0,0 +1,36 @@
// Copyright (c) 2022 Cisco and/or its affiliates.
Copy link
Member

Choose a reason for hiding this comment

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

this file can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>
@denis-tingaikin denis-tingaikin merged commit 990b341 into networkservicemesh:main Jul 28, 2022
nsmbot pushed a commit to networkservicemesh/sdk-kernel that referenced this pull request Jul 28, 2022
…k@main

PR link: networkservicemesh/sdk#1333

Commit: 990b341
Author: anastasia-malysheva
Date: 2022-07-28 19:53:47 +0700
Message:
  - Add authorize Monitor connection elements.  (#1333)
* Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain.

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* rename options

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-ipam-vl3 that referenced this pull request Jul 28, 2022
…k@main

PR link: networkservicemesh/sdk#1333

Commit: 990b341
Author: anastasia-malysheva
Date: 2022-07-28 19:53:47 +0700
Message:
  - Add authorize Monitor connection elements.  (#1333)
* Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain.

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* rename options

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-registry-memory that referenced this pull request Jul 28, 2022
…k@main

PR link: networkservicemesh/sdk#1333

Commit: 990b341
Author: anastasia-malysheva
Date: 2022-07-28 19:53:47 +0700
Message:
  - Add authorize Monitor connection elements.  (#1333)
* Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain.

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* rename options

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsc-init that referenced this pull request Jul 28, 2022
…k@main

PR link: networkservicemesh/sdk#1333

Commit: 990b341
Author: anastasia-malysheva
Date: 2022-07-28 19:53:47 +0700
Message:
  - Add authorize Monitor connection elements.  (#1333)
* Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain.

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* rename options

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nse-remote-vlan that referenced this pull request Jul 28, 2022
…k@main

PR link: networkservicemesh/sdk#1333

Commit: 990b341
Author: anastasia-malysheva
Date: 2022-07-28 19:53:47 +0700
Message:
  - Add authorize Monitor connection elements.  (#1333)
* Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain.

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* rename options

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-map-ip-k8s that referenced this pull request Jul 28, 2022
…k@main

PR link: networkservicemesh/sdk#1333

Commit: 990b341
Author: anastasia-malysheva
Date: 2022-07-28 19:53:47 +0700
Message:
  - Add authorize Monitor connection elements.  (#1333)
* Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain.

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* rename options

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-cluster-info-k8s that referenced this pull request Jul 28, 2022
…k@main

PR link: networkservicemesh/sdk#1333

Commit: 990b341
Author: anastasia-malysheva
Date: 2022-07-28 19:53:47 +0700
Message:
  - Add authorize Monitor connection elements.  (#1333)
* Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain.

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* rename options

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-registry-proxy-dns that referenced this pull request Jul 28, 2022
…k@main

PR link: networkservicemesh/sdk#1333

Commit: 990b341
Author: anastasia-malysheva
Date: 2022-07-28 19:53:47 +0700
Message:
  - Add authorize Monitor connection elements.  (#1333)
* Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain.

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* rename options

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr that referenced this pull request Jul 28, 2022
…k@main

PR link: networkservicemesh/sdk#1333

Commit: 990b341
Author: anastasia-malysheva
Date: 2022-07-28 19:53:47 +0700
Message:
  - Add authorize Monitor connection elements.  (#1333)
* Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain.

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* rename options

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr-proxy that referenced this pull request Jul 28, 2022
…k@main

PR link: networkservicemesh/sdk#1333

Commit: 990b341
Author: anastasia-malysheva
Date: 2022-07-28 19:53:47 +0700
Message:
  - Add authorize Monitor connection elements.  (#1333)
* Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain.

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* rename options

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nse-vfio that referenced this pull request Jul 28, 2022
…k@main

PR link: networkservicemesh/sdk#1333

Commit: 990b341
Author: anastasia-malysheva
Date: 2022-07-28 19:53:47 +0700
Message:
  - Add authorize Monitor connection elements.  (#1333)
* Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain.

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* rename options

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/sdk-k8s that referenced this pull request Jul 28, 2022
…k@main

PR link: networkservicemesh/sdk#1333

Commit: 990b341
Author: anastasia-malysheva
Date: 2022-07-28 19:53:47 +0700
Message:
  - Add authorize Monitor connection elements.  (#1333)
* Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain.

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* rename options

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-admission-webhook-k8s that referenced this pull request Jul 28, 2022
…k@main

PR link: networkservicemesh/sdk#1333

Commit: 990b341
Author: anastasia-malysheva
Date: 2022-07-28 19:53:47 +0700
Message:
  - Add authorize Monitor connection elements.  (#1333)
* Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain.

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* rename options

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-registry-proxy-dns that referenced this pull request Jul 29, 2022
…k@main

PR link: networkservicemesh/sdk#1333

Commit: 990b341
Author: anastasia-malysheva
Date: 2022-07-28 19:53:47 +0700
Message:
  - Add authorize Monitor connection elements.  (#1333)
* Add authorize Monitor connection elements. Add next monitorConnectionServer chain element. Add options to enable mointor authorize element. Add unit tests. Turn off authorize monitor by default in the network service chain.

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* rename options

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: anastasia.malysheva <anastasia.malysheva@xored.com>

* update auth monitor police

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
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.

None yet

2 participants