Remove security level from profile
This commit is contained in:
@@ -30,7 +30,6 @@ func MergeProfiles(name string, primary *Profile, secondaries ...*Profile) (newP
|
||||
Description: primary.Description,
|
||||
Homepage: primary.Homepage,
|
||||
UsePresentationPath: false, // Disable presentation path.
|
||||
SecurityLevel: primary.SecurityLevel,
|
||||
Config: primary.Config,
|
||||
Created: nowUnix,
|
||||
}
|
||||
|
||||
@@ -135,8 +135,6 @@ func NewLayeredProfile(localProfile *Profile) *LayeredProfile {
|
||||
|
||||
// TODO: Load additional profiles.
|
||||
|
||||
lp.updateCaches()
|
||||
|
||||
lp.CreateMeta()
|
||||
lp.SetKey(runtime.DefaultRegistry.DatabaseName() + ":" + revisionProviderPrefix + localProfile.ScopedID())
|
||||
|
||||
@@ -292,9 +290,6 @@ func (lp *LayeredProfile) Update(md MatchingData, createProfileCallback func() *
|
||||
// get global config validity flag
|
||||
lp.globalValidityFlag.Refresh()
|
||||
|
||||
// update cached data fields
|
||||
lp.updateCaches()
|
||||
|
||||
// bump revision counter
|
||||
lp.increaseRevisionCounter(false)
|
||||
}
|
||||
@@ -302,17 +297,6 @@ func (lp *LayeredProfile) Update(md MatchingData, createProfileCallback func() *
|
||||
return lp.RevisionCounter
|
||||
}
|
||||
|
||||
func (lp *LayeredProfile) updateCaches() {
|
||||
// update security level
|
||||
var newLevel uint8
|
||||
for _, layer := range lp.layers {
|
||||
if newLevel < layer.SecurityLevel {
|
||||
newLevel = layer.SecurityLevel
|
||||
}
|
||||
}
|
||||
atomic.StoreUint32(lp.securityLevel, uint32(newLevel))
|
||||
}
|
||||
|
||||
// SecurityLevel returns the highest security level of all layered profiles. This function is atomic and does not require any locking.
|
||||
func (lp *LayeredProfile) SecurityLevel() uint8 {
|
||||
return uint8(atomic.LoadUint32(lp.securityLevel))
|
||||
|
||||
@@ -87,12 +87,6 @@ type Profile struct { //nolint:maligned // not worth the effort
|
||||
UsePresentationPath bool
|
||||
// Fingerprints holds process matching information.
|
||||
Fingerprints []Fingerprint
|
||||
// SecurityLevel is the mininum security level to apply to
|
||||
// connections made with this profile.
|
||||
// Note(ppacher): we may deprecate this one as it can easily
|
||||
// be "simulated" by adjusting the settings
|
||||
// directly.
|
||||
SecurityLevel uint8
|
||||
// Config holds profile specific setttings. It's a nested
|
||||
// object with keys defining the settings database path. All keys
|
||||
// until the actual settings value (which is everything that is not
|
||||
|
||||
Reference in New Issue
Block a user