diff --git a/docs/proto/proto.md b/docs/proto/proto.md index 3d77c745e..f7d371709 100644 --- a/docs/proto/proto.md +++ b/docs/proto/proto.md @@ -1276,6 +1276,7 @@ Represents App Protect WAF details | health | [AppProtectWAFHealth](#f5-nginx-agent-sdk-AppProtectWAFHealth) | | App Protect Health details (This is being deprecated and will be removed in a future release) | | waf_location | [string](#string) | | Location of WAF metadata file | | precompiled_publication | [bool](#bool) | | Determines whether the publication of NGINX App Protect pre-compiled content from an external source is supported | +| waf_release | [string](#string) | | WAF release | diff --git a/sdk/proto/nap.pb.go b/sdk/proto/nap.pb.go index 01467bf06..b2c9c5831 100644 --- a/sdk/proto/nap.pb.go +++ b/sdk/proto/nap.pb.go @@ -68,10 +68,12 @@ type AppProtectWAFDetails struct { // Location of WAF metadata file WafLocation string `protobuf:"bytes,5,opt,name=waf_location,json=wafLocation,proto3" json:"waf_location"` // Determines whether the publication of NGINX App Protect pre-compiled content from an external source is supported - PrecompiledPublication bool `protobuf:"varint,6,opt,name=precompiled_publication,json=precompiledPublication,proto3" json:"precompiled_publication"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + PrecompiledPublication bool `protobuf:"varint,6,opt,name=precompiled_publication,json=precompiledPublication,proto3" json:"precompiled_publication"` + // WAF release + WafRelease string `protobuf:"bytes,7,opt,name=waf_release,json=wafRelease,proto3" json:"waf_release"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *AppProtectWAFDetails) Reset() { *m = AppProtectWAFDetails{} } @@ -149,6 +151,13 @@ func (m *AppProtectWAFDetails) GetPrecompiledPublication() bool { return false } +func (m *AppProtectWAFDetails) GetWafRelease() string { + if m != nil { + return m.WafRelease + } + return "" +} + // Represents the health of App Protect WAF type AppProtectWAFHealth struct { // System ID @@ -225,39 +234,40 @@ func init() { func init() { proto.RegisterFile("nap.proto", fileDescriptor_f34234efeae954d9) } var fileDescriptor_f34234efeae954d9 = []byte{ - // 504 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x41, 0x6f, 0x12, 0x41, - 0x14, 0x76, 0xa9, 0x22, 0x3c, 0x6a, 0x4b, 0x06, 0x43, 0xb1, 0x2a, 0x4b, 0xb8, 0x88, 0x1e, 0x16, - 0x43, 0x63, 0x3c, 0xb4, 0x17, 0x28, 0xa8, 0x4d, 0x0d, 0x36, 0xd3, 0x4a, 0xa3, 0x97, 0xcd, 0x63, - 0x77, 0x58, 0x36, 0xc0, 0xee, 0x64, 0x67, 0x68, 0xf5, 0x3f, 0xf8, 0xc3, 0x3c, 0x78, 0x30, 0xf1, - 0xbe, 0x31, 0x1c, 0xf7, 0x57, 0x18, 0x66, 0x17, 0x28, 0x55, 0x12, 0x2f, 0x3b, 0x33, 0xdf, 0xf7, - 0xbe, 0x2f, 0xef, 0x7d, 0x2f, 0x0b, 0x59, 0x0f, 0xb9, 0xc1, 0x03, 0x5f, 0xfa, 0x84, 0x0c, 0x5e, - 0x19, 0x9e, 0xe3, 0x7a, 0x5f, 0x0c, 0x74, 0x98, 0x27, 0x0d, 0x61, 0x8f, 0xf6, 0xc1, 0xf1, 0x1d, - 0x3f, 0xe6, 0xab, 0xbf, 0xb6, 0xe0, 0x61, 0x93, 0xf3, 0xb3, 0xc0, 0x97, 0xcc, 0x92, 0x97, 0xcd, - 0x37, 0x6d, 0x26, 0xd1, 0x1d, 0x0b, 0xf2, 0x12, 0x72, 0xd7, 0x38, 0x30, 0xaf, 0x58, 0x20, 0x5c, - 0xdf, 0x2b, 0x69, 0x15, 0xad, 0x96, 0x6d, 0xed, 0x46, 0xa1, 0x7e, 0x13, 0xa6, 0x70, 0x8d, 0x83, - 0x5e, 0x7c, 0x27, 0x9f, 0xe0, 0x11, 0x4a, 0x89, 0xd6, 0xc8, 0x14, 0xae, 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- 0x3e, 0x83, 0x90, 0x28, 0xa7, 0x42, 0x2d, 0x73, 0xa7, 0x71, 0xf8, 0x9f, 0x61, 0xad, 0x63, 0xe7, - 0xca, 0xa2, 0xb5, 0x1f, 0x85, 0xfa, 0x06, 0x7b, 0x5a, 0xc0, 0x95, 0x00, 0x07, 0xb1, 0x80, 0x1c, - 0xc1, 0xae, 0xcd, 0x9c, 0x00, 0x6d, 0x66, 0x9b, 0x01, 0x43, 0xb1, 0xdc, 0x7c, 0x21, 0x0a, 0xf5, - 0xdb, 0x14, 0xdd, 0x59, 0x00, 0x54, 0xbd, 0xab, 0x47, 0xb7, 0xf2, 0x48, 0x4c, 0x73, 0x70, 0xff, - 0x63, 0xf7, 0xb4, 0xfb, 0xe1, 0xb2, 0x9b, 0xbf, 0x43, 0x00, 0xd2, 0xcd, 0xe3, 0x8b, 0x93, 0x5e, - 0x27, 0xaf, 0x91, 0x6d, 0xc8, 0xb4, 0x3b, 0x6f, 0x69, 0xb3, 0xdd, 0x69, 0xe7, 0x53, 0xad, 0xd7, - 0xdf, 0x67, 0x65, 0xed, 0xe7, 0xac, 0xac, 0xfd, 0x9e, 0x95, 0xb5, 0xcf, 0xcf, 0x1d, 0x57, 0x0e, - 0xa7, 0x7d, 0xc3, 0xf2, 0x27, 0x75, 0x35, 0x7e, 0x5d, 0x8d, 0x5f, 0x17, 0xf6, 0xa8, 0x7e, 0xd5, - 0xa8, 0xab, 0xff, 0xea, 0x50, 0x7d, 0xfb, 0x69, 0x75, 0x1c, 0xfc, 0x09, 0x00, 0x00, 0xff, 0xff, - 0x25, 0xf1, 0x11, 0xa4, 0x91, 0x03, 0x00, 0x00, + // 525 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x41, 0x73, 0xd2, 0x4c, + 0x18, 0xfe, 0xc2, 0x57, 0x29, 0x2c, 0xb5, 0x65, 0x16, 0x87, 0x62, 0x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a4, 0x6e, 0xb0, 0x27, 0x15, 0x58, 0x09, + 0x60, 0x94, 0x08, 0xf0, 0x31, 0xda, 0xb3, 0xa9, 0x13, 0x82, 0x4d, 0x6d, 0x33, 0xa4, 0xc0, 0x97, + 0x6f, 0xa5, 0x12, 0x47, 0xea, 0x5d, 0x8a, 0xec, 0x66, 0x00, 0x91, 0xe7, 0xe6, 0xf1, 0x9d, 0x3c, + 0x52, 0xd3, 0x12, 0xda, 0xfe, 0xd0, 0x3f, 0xeb, 0xbf, 0xbf, 0xea, 0x97, 0xff, 0xc3, 0x08, 0xe5, + 0x3b, 0x27, 0x97, 0xa7, 0x83, 0x5e, 0x59, 0xc1, 0x3b, 0xa8, 0xd0, 0xed, 0xbd, 0x21, 0x9d, 0x6e, + 0xaf, 0x5b, 0xce, 0x19, 0xaf, 0xbe, 0xcf, 0xeb, 0xca, 0xcf, 0x79, 0x5d, 0xf9, 0x35, 0xaf, 0x2b, + 0x9f, 0x9e, 0x39, 0xae, 0x18, 0xcf, 0x86, 0x9a, 0x15, 0x4c, 0x75, 0xd9, 0xbe, 0x2e, 0xdb, 0xd7, + 0xb9, 0x3d, 0xd1, 0xaf, 0xdb, 0xba, 0xfc, 0x12, 0x8f, 0xe4, 0xef, 0x30, 0x2f, 0x97, 0xc3, 0xdf, + 0x01, 0x00, 0x00, 0xff, 0xff, 0xde, 0x38, 0x05, 0x13, 0xc3, 0x03, 0x00, 0x00, } func (m *AppProtectWAFDetails) Marshal() (dAtA []byte, err error) { @@ -284,6 +294,13 @@ func (m *AppProtectWAFDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.WafRelease) > 0 { + i -= len(m.WafRelease) + copy(dAtA[i:], m.WafRelease) + i = encodeVarintNap(dAtA, i, uint64(len(m.WafRelease))) + i-- + dAtA[i] = 0x3a + } if m.PrecompiledPublication { i-- if m.PrecompiledPublication { @@ -423,6 +440,10 @@ func (m *AppProtectWAFDetails) Size() (n int) { if m.PrecompiledPublication { n += 2 } + l = len(m.WafRelease) + if l > 0 { + n += 1 + l + sovNap(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -671,6 +692,38 @@ func (m *AppProtectWAFDetails) Unmarshal(dAtA []byte) error { } } m.PrecompiledPublication = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WafRelease", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNap + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNap + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNap + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WafRelease = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipNap(dAtA[iNdEx:]) diff --git a/sdk/proto/nap.proto b/sdk/proto/nap.proto index 76218aae9..a53135e3b 100644 --- a/sdk/proto/nap.proto +++ b/sdk/proto/nap.proto @@ -19,6 +19,8 @@ message AppProtectWAFDetails { string waf_location = 5 [(gogoproto.jsontag) = "waf_location"]; // Determines whether the publication of NGINX App Protect pre-compiled content from an external source is supported bool precompiled_publication = 6 [(gogoproto.jsontag) = "precompiled_publication"]; + // WAF release + string waf_release = 7 [(gogoproto.jsontag) = "waf_release"]; } // Represents the health of App Protect WAF diff --git a/src/extensions/nginx-app-protect/nap/const.go b/src/extensions/nginx-app-protect/nap/const.go index 1b23668dd..a3e158074 100644 --- a/src/extensions/nginx-app-protect/nap/const.go +++ b/src/extensions/nginx-app-protect/nap/const.go @@ -9,7 +9,7 @@ package nap const ( NAP_VERSION_FILE = "/opt/app_protect/VERSION" - BD_SOCKET_PLUGIN_PATH = "/usr/share/ts/bin/bd-socket-plugin" + NAP_RELEASE_FILE = "/opt/app_protect/RELEASE" BD_SOCKET_PLUGIN_PROCESS = "bd-socket-plugin" // TODO: Rather than using the update yaml files for attack signatures and threat diff --git a/src/extensions/nginx-app-protect/nap/nap.go b/src/extensions/nginx-app-protect/nap/nap.go index 9d87c8fa9..2043859d7 100644 --- a/src/extensions/nginx-app-protect/nap/nap.go +++ b/src/extensions/nginx-app-protect/nap/nap.go @@ -28,7 +28,7 @@ const ( ) var ( - requiredNAPFiles = []string{BD_SOCKET_PLUGIN_PATH, NAP_VERSION_FILE} + requiredNAPFiles = []string{NAP_VERSION_FILE, NAP_RELEASE_FILE} requireNAPProcesses = []string{BD_SOCKET_PLUGIN_PROCESS} processCheckFunc = core.CheckForProcesses ) @@ -56,7 +56,7 @@ func NewNginxAppProtect(optDirPath, symLinkDir string) (*NginxAppProtect, error) // Get the release version of NAP on the system if NAP is installed var napRelease *NAPRelease if status != MISSING { - napRelease, err = installedNAPRelease(NAP_VERSION_FILE) + napRelease, err = installedNAPRelease(NAP_VERSION_FILE, NAP_RELEASE_FILE) if err != nil { return nil, err } @@ -107,7 +107,7 @@ func (nap *NginxAppProtect) Monitor(pollInterval time.Duration) chan NAPReportBu func (nap *NginxAppProtect) monitor(msgChannel chan NAPReportBundle, pollInterval time.Duration) { // Initial symlink sync if nap.Release.VersioningDetails.NAPRelease != "" { - err := nap.syncSymLink("", nap.Release.VersioningDetails.NAPRelease) + err := nap.syncSymLink("", nap.Release.VersioningDetails.NAPBuild) if err != nil { log.Errorf("Error occurred while performing initial sync for NAP symlink - %v", err) } @@ -137,7 +137,7 @@ func (nap *NginxAppProtect) monitor(msgChannel chan NAPReportBundle, pollInterva previousReport := nap.GenerateNAPReport() log.Infof("Change in NAP detected... \nPrevious: %+v\nUpdated: %+v\n", previousReport, newNAPReport) - err = nap.syncSymLink(nap.Release.VersioningDetails.NAPRelease, newNAPReport.NAPVersion) + err = nap.syncSymLink(nap.Release.VersioningDetails.NAPBuild, newNAPReport.NAPVersion) if err != nil { log.Errorf("Got the following error syncing NAP symlink - %v", err) break @@ -237,7 +237,8 @@ func (nap *NginxAppProtect) removeNAPSymlinks(symlinkPatternToIgnore string) err // to be in sync with the current system NAP values. func (nap *NginxAppProtect) GenerateNAPReport() NAPReport { return NAPReport{ - NAPVersion: nap.Release.VersioningDetails.NAPRelease, + NAPVersion: nap.Release.VersioningDetails.NAPBuild, + NAPRelease: nap.Release.VersioningDetails.NAPRelease, Status: nap.Status, AttackSignaturesVersion: nap.AttackSignaturesVersion, ThreatCampaignsVersion: nap.ThreatCampaignsVersion, diff --git a/src/extensions/nginx-app-protect/nap/nap_metadata.go b/src/extensions/nginx-app-protect/nap/nap_metadata.go index 582d93bf9..0b38e5bd2 100644 --- a/src/extensions/nginx-app-protect/nap/nap_metadata.go +++ b/src/extensions/nginx-app-protect/nap/nap_metadata.go @@ -73,6 +73,7 @@ func UpdateMetadata( metadata := &Metadata{ NapVersion: appProtectWAFDetails.GetWafVersion(), + NapRelease: appProtectWAFDetails.GetWafRelease(), PrecompiledPublication: appProtectWAFDetails.GetPrecompiledPublication(), AttackSignatureRevisionTimestamp: appProtectWAFDetails.GetAttackSignaturesVersion(), ThreatCampaignRevisionTimestamp: appProtectWAFDetails.GetThreatCampaignsVersion(), diff --git a/src/extensions/nginx-app-protect/nap/nap_metadata_test.go b/src/extensions/nginx-app-protect/nap/nap_metadata_test.go index 7be283f2d..1cc8c63df 100644 --- a/src/extensions/nginx-app-protect/nap/nap_metadata_test.go +++ b/src/extensions/nginx-app-protect/nap/nap_metadata_test.go @@ -27,7 +27,8 @@ const ( nginxID = "1" systemID = "2" - wafVersion = "4.2.0" + wafVersion = "4.815.0" + wafRelease = "4.8.1" wafAttackSignaturesVersion = "2023.01.01" wafThreatCampaignsVersion = "2023.01.02" ) @@ -57,7 +58,8 @@ var ( }` metadata1 = `{ - "napVersion": "4.2.0", + "napVersion": "4.815.0", + "napRelease": "4.8.1", "precompiledPublication": false, "attackSignatureRevisionTimestamp": "2023.01.09", "threatCampaignRevisionTimestamp": "2023.01.04", @@ -77,7 +79,8 @@ var ( }` metadata2 = `{ - "napVersion":"4.2.0", + "napVersion":"4.815.0", + "napRelease":"4.8.1", "precompiledPublication": true, "attackSignatureRevisionTimestamp": "2023.01.09", "threatCampaignRevisionTimestamp": "2023.01.04", @@ -96,9 +99,9 @@ var ( ] }` - expectedFalse = `{"napVersion":"4.2.0","precompiledPublication":false,"attackSignatureRevisionTimestamp":"2023.01.01","threatCampaignRevisionTimestamp":"2023.01.02","policyMetadata":[{"name":"my-nap-policy.json"}],"logProfileMetadata":[{"name":"log-all.json"}]}` + expectedFalse = `{"napVersion":"4.815.0","napRelease":"4.8.1","precompiledPublication":false,"attackSignatureRevisionTimestamp":"2023.01.01","threatCampaignRevisionTimestamp":"2023.01.02","policyMetadata":[{"name":"my-nap-policy.json"}],"logProfileMetadata":[{"name":"log-all.json"}]}` - expectedTrue = `{"napVersion":"4.2.0","precompiledPublication":true,"attackSignatureRevisionTimestamp":"2023.01.01","threatCampaignRevisionTimestamp":"2023.01.02","policyMetadata":[{"name":"my-nap-policy.json"}],"logProfileMetadata":[{"name":"log-all.json"}]}` + expectedTrue = `{"napVersion":"4.815.0","napRelease":"4.8.1","precompiledPublication":true,"attackSignatureRevisionTimestamp":"2023.01.01","threatCampaignRevisionTimestamp":"2023.01.02","policyMetadata":[{"name":"my-nap-policy.json"}],"logProfileMetadata":[{"name":"log-all.json"}]}` ) func TestUpdateNapMetadata(t *testing.T) { @@ -166,6 +169,7 @@ func TestUpdateNapMetadata(t *testing.T) { appProtectWAFDetails := &proto.AppProtectWAFDetails{ WafVersion: wafVersion, + WafRelease: wafRelease, AttackSignaturesVersion: wafAttackSignaturesVersion, ThreatCampaignsVersion: wafThreatCampaignsVersion, WafLocation: metadataFile, diff --git a/src/extensions/nginx-app-protect/nap/nap_release.go b/src/extensions/nginx-app-protect/nap/nap_release.go index 60998d380..7d6a78f74 100644 --- a/src/extensions/nginx-app-protect/nap/nap_release.go +++ b/src/extensions/nginx-app-protect/nap/nap_release.go @@ -17,36 +17,40 @@ import ( // installedNAPRelease gets the NAP release version based off the Nginx App Protect installed // on the system. -func installedNAPRelease(versionFile string) (*NAPRelease, error) { - // Get build version of NAP, so we can determine the release details - napBuildVersion, err := installedNAPBuildVersion(versionFile) +func installedNAPRelease(versionFile, releaseFile string) (*NAPRelease, error) { + // Get build version of NAP, so we can determine the release details + napBuildVersion, err := installedNAP(versionFile) + if err != nil { + return nil, err + } + napRelease, err := installedNAP(releaseFile) if err != nil { return nil, err } - unmappedRelease := ReleaseUnmappedBuild(napBuildVersion) + unmappedRelease := ReleaseUnmappedBuild(napBuildVersion, napRelease) return &unmappedRelease, nil } -// installedNAPBuildVersion gets the NAP build version based off the Nginx App Protect installed +// installedNAP gets the NAP version or release based off the Nginx App Protect installed // on the system. -func installedNAPBuildVersion(versionFile string) (string, error) { +func installedNAP(file string) (string, error) { // Check if nap version file exists - exists, err := core.FileExists(versionFile) + exists, err := core.FileExists(file) if !exists && err == nil { - return "", fmt.Errorf(FILE_NOT_FOUND, versionFile) + return "", fmt.Errorf(FILE_NOT_FOUND, file) } else if err != nil { return "", err } - versionBytes, err := os.ReadFile(versionFile) + bytes, err := os.ReadFile(file) if err != nil { return "", err } - // Remove the trailing '\n' from the version string since it was read + // Remove the trailing '\n' from the string since it was read // from a file - version := strings.Split(string(versionBytes), "\n")[0] + napNumber := strings.Split(string(bytes), "\n")[0] - return version, nil + return napNumber, nil } diff --git a/src/extensions/nginx-app-protect/nap/nap_release_test.go b/src/extensions/nginx-app-protect/nap/nap_release_test.go index 8130b6286..11bda1e80 100644 --- a/src/extensions/nginx-app-protect/nap/nap_release_test.go +++ b/src/extensions/nginx-app-protect/nap/nap_release_test.go @@ -16,30 +16,36 @@ import ( ) const ( - testNAPVersionFile = "/tmp/test-nap-version" - testNAPVersion = "3.780.1" // This is the actual build number for NAP 3.9 - testUnsupportedVersion = "0.1.2" + testNAPVersionFile = "/tmp/test-nap-version" + testNAPReleaseFile = "/tmp/test-nap-release" + testNoFile = "/tmp/no-file" + testNAPVersion = "4.815.0" // This is the actual build number for NAP 4.8.1 + testNAPRelease = "4.8.1" + testUnsupported = "0.1.2" ) -var testUnmappedBuildRelease = ReleaseUnmappedBuild(testUnsupportedVersion) +var testUnmappedBuildRelease = ReleaseUnmappedBuild(testNAPVersion, testUnsupported) func TestInstalledNAPBuildVersion(t *testing.T) { testCases := []struct { testName string versionFile string version string + releaseFile string + release string expBuildVersion string + expRelease string expError error }{ { testName: "NAPVersionFileMissing", - versionFile: NAP_VERSION_FILE, + versionFile: testNoFile, version: "", expBuildVersion: "", - expError: fmt.Errorf(FILE_NOT_FOUND, NAP_VERSION_FILE), + expError: fmt.Errorf(FILE_NOT_FOUND, testNoFile), }, { - testName: "SuccessfullyGetNAPBuildVersion", + testName: "SuccessfullyGetNAPVersion", versionFile: testNAPVersionFile, version: testNAPVersion, expBuildVersion: testNAPVersion, @@ -61,7 +67,7 @@ func TestInstalledNAPBuildVersion(t *testing.T) { } // Get build version - buildVersion, err := installedNAPBuildVersion(tc.versionFile) + buildVersion, err := installedNAP(tc.versionFile) // Validate returned build version assert.Equal(t, err, tc.expError) @@ -70,61 +76,65 @@ func TestInstalledNAPBuildVersion(t *testing.T) { } } -func buildFromPTR(v string) *NAPRelease { - version := ReleaseUnmappedBuild(v) +func buildFromPTR(v, r string) *NAPRelease { + version := ReleaseUnmappedBuild(v, r) return &version } func TestInstalledNAPRelease(t *testing.T) { testCases := []struct { - testName string - versionFile string - version string - expReleaseVersion *NAPRelease - expError error + testName string + releaseFile string + release string + expRelease *NAPRelease + expError error }{ { - testName: "NAPVersionFileMissing", - versionFile: NAP_VERSION_FILE, - version: "", - expReleaseVersion: nil, - expError: fmt.Errorf(FILE_NOT_FOUND, NAP_VERSION_FILE), + testName: "NAPReleaseFileMissing", + releaseFile: testNoFile, + release: "", + expRelease: nil, + expError: fmt.Errorf(FILE_NOT_FOUND, testNAPVersionFile), }, { - testName: "SuccessfullyGetNAPReleaseVersion", - versionFile: testNAPVersionFile, - version: testNAPVersion, - expReleaseVersion: buildFromPTR(testNAPVersion), - expError: nil, + testName: "SuccessfullyGetNAPReleaseVersion", + releaseFile: testNAPReleaseFile, + release: testNAPRelease, + expRelease: buildFromPTR(testNAPVersion, testNAPRelease), + expError: nil, }, { - testName: "UnmappedBuildForSupportedReleases", - versionFile: testNAPVersionFile, - version: testUnsupportedVersion, - expReleaseVersion: &testUnmappedBuildRelease, - expError: nil, + testName: "UnmappedBuildForSupportedReleases", + releaseFile: testNAPReleaseFile, + release: testUnsupported, + expRelease: &testUnmappedBuildRelease, + expError: nil, }, } for _, tc := range testCases { t.Run(tc.testName, func(t *testing.T) { // Create a fake version file if required by test - if tc.version != "" { - err := os.WriteFile(tc.versionFile, []byte(tc.version), 0o644) + if tc.release != "" { + err := os.WriteFile(tc.releaseFile, []byte(tc.release), 0o644) + assert.Nil(t, err) + err = os.WriteFile(testNAPVersionFile, []byte(testNAPVersion), 0o644) assert.Nil(t, err) defer func() { - err := os.Remove(tc.versionFile) + err := os.Remove(tc.releaseFile) + assert.Nil(t, err) + err = os.Remove(testNAPVersionFile) assert.Nil(t, err) }() } - // Get build version - releaseVersion, err := installedNAPRelease(tc.versionFile) + // Get release + release, err := installedNAPRelease(testNAPVersionFile, tc.releaseFile) - // Validate returned build version + // Validate returned release assert.Equal(t, err, tc.expError) - assert.Equal(t, tc.expReleaseVersion, releaseVersion) + assert.Equal(t, tc.expRelease, release) }) } } diff --git a/src/extensions/nginx-app-protect/nap/nap_test.go b/src/extensions/nginx-app-protect/nap/nap_test.go index ff0212134..76b38ac80 100644 --- a/src/extensions/nginx-app-protect/nap/nap_test.go +++ b/src/extensions/nginx-app-protect/nap/nap_test.go @@ -22,6 +22,8 @@ const ( testNAPFile = "/tmp/test-nap" ) +var testRelease = ReleaseUnmappedBuild(testNAPVersion, testNAPRelease) + func TestNewNginxAppProtect(t *testing.T) { // TODO: Add a test case where NAP is installed testCases := []struct { @@ -65,13 +67,14 @@ func TestGenerateNAPReport(t *testing.T) { testName: "NAPInstalled", nap: NginxAppProtect{ Status: INSTALLED.String(), - Release: testUnmappedBuildRelease, + Release: testRelease, AttackSignaturesVersion: "2022.02.24", ThreatCampaignsVersion: "2022.03.01", }, expNAPReport: NAPReport{ Status: INSTALLED.String(), - NAPVersion: testUnmappedBuildRelease.VersioningDetails.NAPRelease, + NAPRelease: testNAPRelease, + NAPVersion: testNAPVersion, AttackSignaturesVersion: "2022.02.24", ThreatCampaignsVersion: "2022.03.01", }, diff --git a/src/extensions/nginx-app-protect/nap/releases.go b/src/extensions/nginx-app-protect/nap/releases.go index f9c4c737c..b1a0b21c3 100644 --- a/src/extensions/nginx-app-protect/nap/releases.go +++ b/src/extensions/nginx-app-protect/nap/releases.go @@ -7,7 +7,7 @@ package nap -func ReleaseUnmappedBuild(buildVersion string) NAPRelease { +func ReleaseUnmappedBuild(version, release string) NAPRelease { return NAPRelease{ NAPPackages: NAPReleasePackages{}, NAPCompilerPackages: NAPReleasePackages{}, @@ -15,8 +15,8 @@ func ReleaseUnmappedBuild(buildVersion string) NAPRelease { NAPPluginPackages: NAPReleasePackages{}, NAPPlusModulePackages: NAPReleasePackages{}, VersioningDetails: NAPVersioningDetails{ - NAPBuild: buildVersion, - NAPRelease: buildVersion, + NAPBuild: version, + NAPRelease: release, }, } } diff --git a/src/extensions/nginx-app-protect/nap/types.go b/src/extensions/nginx-app-protect/nap/types.go index 2bbd94368..d7a648b1a 100644 --- a/src/extensions/nginx-app-protect/nap/types.go +++ b/src/extensions/nginx-app-protect/nap/types.go @@ -25,6 +25,7 @@ type NginxAppProtect struct { type NAPReport struct { Status string NAPVersion string + NAPRelease string AttackSignaturesVersion string ThreatCampaignsVersion string } @@ -71,6 +72,7 @@ type NAPVersioningDetails struct { NAPPlusModule string `json:"nap-plus-module,omitempty"` NAPRelease string `json:"nap-release"` NginxPlus string `json:"nginx-plus,omitempty"` + NAPVersion string `json:"nap-version"` } // NAPReleaseMap is a mapping object meant to capture a specific NAP Release version as @@ -90,6 +92,7 @@ type napRevisionDateTime struct { type Metadata struct { NapVersion string `json:"napVersion"` + NapRelease string `json:"napRelease"` PrecompiledPublication bool `json:"precompiledPublication"` GlobalStateFileName string `json:"globalStateFileName,omitempty"` GlobalStateFileUID string `json:"globalStateFileUID,omitempty"` diff --git a/src/extensions/nginx_app_protect.go b/src/extensions/nginx_app_protect.go index 198685ec6..62c7e0328 100644 --- a/src/extensions/nginx_app_protect.go +++ b/src/extensions/nginx_app_protect.go @@ -178,6 +178,7 @@ func (n *NginxAppProtect) generateNAPDetailsProtoCommand() *proto.DataplaneSoftw AppProtectWafDetails: &proto.AppProtectWAFDetails{ WafLocation: nap.APP_PROTECT_METADATA_FILE_PATH, WafVersion: napReport.NAPVersion, + WafRelease: napReport.NAPRelease, AttackSignaturesVersion: napReport.AttackSignaturesVersion, ThreatCampaignsVersion: napReport.ThreatCampaignsVersion, PrecompiledPublication: n.precompiledPublication, diff --git a/src/extensions/nginx_app_protect_test.go b/src/extensions/nginx_app_protect_test.go index 34825e532..843d3eb4e 100644 --- a/src/extensions/nginx_app_protect_test.go +++ b/src/extensions/nginx_app_protect_test.go @@ -26,6 +26,7 @@ const ( testSigDate1 = "2022.02.14" testCampaignDate1 = "2022.02.07" testWAFVersion = "3.780.1" + testWAFRelease = "3.9.0" ) var ( @@ -33,6 +34,7 @@ var ( AppProtectWafDetails: &proto.AppProtectWAFDetails{ WafLocation: nap.APP_PROTECT_METADATA_FILE_PATH, WafVersion: testWAFVersion, + WafRelease: testWAFRelease, AttackSignaturesVersion: testSigDate1, ThreatCampaignsVersion: testCampaignDate1, Health: &proto.AppProtectWAFHealth{ @@ -56,6 +58,7 @@ var ( AppProtectWafDetails: &proto.AppProtectWAFDetails{ WafLocation: nap.APP_PROTECT_METADATA_FILE_PATH, WafVersion: testWAFVersion, + WafRelease: testWAFRelease, AttackSignaturesVersion: testSigDate1, ThreatCampaignsVersion: testCampaignDate1, Health: &proto.AppProtectWAFHealth{ @@ -90,7 +93,7 @@ func TestNginxAppProtect(t *testing.T) { Status: nap.RUNNING.String(), AttackSignaturesVersion: testSigDate1, ThreatCampaignsVersion: testCampaignDate1, - Release: nap.ReleaseUnmappedBuild("3.780.1"), + Release: nap.ReleaseUnmappedBuild("3.780.1", "3.9.0"), } currentNAPPluginDetails = napPlugin.generateNAPDetailsProtoCommand() assert.Equal(t, testNAPDetailsActive, currentNAPPluginDetails) @@ -100,7 +103,7 @@ func TestNginxAppProtect(t *testing.T) { Status: nap.INSTALLED.String(), AttackSignaturesVersion: testSigDate1, ThreatCampaignsVersion: testCampaignDate1, - Release: nap.ReleaseUnmappedBuild("3.780.1"), + Release: nap.ReleaseUnmappedBuild("3.780.1", "3.9.0"), } currentNAPPluginDetails = napPlugin.generateNAPDetailsProtoCommand() assert.Equal(t, testNAPDetailsDegraded, currentNAPPluginDetails) diff --git a/src/plugins/nginx_test.go b/src/plugins/nginx_test.go index e0768646d..858057275 100644 --- a/src/plugins/nginx_test.go +++ b/src/plugins/nginx_test.go @@ -102,6 +102,7 @@ var ( }`) wafMetaData1 = []byte(`{ "napVersion": "3.1088.2", + "napRelease": "3.12.2", "globalStateFileName": "", "globalStateFileUID": "", "attackSignatureRevisionTimestamp ": "2021.04.04", @@ -142,6 +143,7 @@ func TestNginxConfigApply(t *testing.T) { config *proto.NginxConfig msgTopics []string wafVersion string + wafRelease string }{ { config: &proto.NginxConfig{ @@ -175,6 +177,7 @@ func TestNginxConfigApply(t *testing.T) { core.NginxConfigApplySucceeded, }, wafVersion: "", + wafRelease: "", }, { config: &proto.NginxConfig{ @@ -208,6 +211,7 @@ func TestNginxConfigApply(t *testing.T) { core.NginxConfigApplySucceeded, }, wafVersion: "", + wafRelease: "", }, { config: &proto.NginxConfig{ @@ -241,6 +245,7 @@ func TestNginxConfigApply(t *testing.T) { core.NginxConfigApplySucceeded, }, wafVersion: "", + wafRelease: "", }, { config: &proto.NginxConfig{ @@ -294,6 +299,7 @@ func TestNginxConfigApply(t *testing.T) { core.NginxConfigApplySucceeded, }, wafVersion: "3.1088.2", + wafRelease: "3.12.2", }, { config: &proto.NginxConfig{ @@ -331,6 +337,7 @@ func TestNginxConfigApply(t *testing.T) { core.NginxConfigApplySucceeded, }, wafVersion: "", + wafRelease: "", }, { config: &proto.NginxConfig{ @@ -364,6 +371,7 @@ func TestNginxConfigApply(t *testing.T) { core.NginxConfigApplySucceeded, }, wafVersion: "", + wafRelease: "", }, { config: &proto.NginxConfig{ @@ -418,6 +426,7 @@ func TestNginxConfigApply(t *testing.T) { }, // mismatch, test should still pass because of the NginxConfigAction_FORCE wafVersion: "3.1088.1", + wafRelease: "3.12.1", }, { config: &proto.NginxConfig{ @@ -467,6 +476,7 @@ func TestNginxConfigApply(t *testing.T) { }, // mismatch, should fail on preflight because of the NginxConfigAction_APPLY wafVersion: "3.1088.1", + wafRelease: "3.12.1", }, } @@ -558,6 +568,7 @@ func TestNginxConfigApply(t *testing.T) { PrecompiledPublication: true, WafLocation: auxPath, WafVersion: test.wafVersion, + WafRelease: test.wafRelease, } } diff --git a/test/integration/vendor/github.com/nginx/agent/sdk/v2/proto/nap.pb.go b/test/integration/vendor/github.com/nginx/agent/sdk/v2/proto/nap.pb.go index 01467bf06..b2c9c5831 100644 --- a/test/integration/vendor/github.com/nginx/agent/sdk/v2/proto/nap.pb.go +++ b/test/integration/vendor/github.com/nginx/agent/sdk/v2/proto/nap.pb.go @@ -68,10 +68,12 @@ type AppProtectWAFDetails struct { // Location of WAF metadata file WafLocation string `protobuf:"bytes,5,opt,name=waf_location,json=wafLocation,proto3" json:"waf_location"` // Determines whether the publication of NGINX App Protect pre-compiled content from an external source is supported - PrecompiledPublication bool `protobuf:"varint,6,opt,name=precompiled_publication,json=precompiledPublication,proto3" json:"precompiled_publication"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + PrecompiledPublication bool `protobuf:"varint,6,opt,name=precompiled_publication,json=precompiledPublication,proto3" json:"precompiled_publication"` + // WAF release + WafRelease string `protobuf:"bytes,7,opt,name=waf_release,json=wafRelease,proto3" json:"waf_release"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *AppProtectWAFDetails) Reset() { *m = AppProtectWAFDetails{} } @@ -149,6 +151,13 @@ func (m *AppProtectWAFDetails) GetPrecompiledPublication() bool { return false } +func (m *AppProtectWAFDetails) GetWafRelease() string { + if m != nil { + return m.WafRelease + } + return "" +} + // Represents the health of App Protect WAF type AppProtectWAFHealth struct { // System ID @@ -225,39 +234,40 @@ func init() { func init() { proto.RegisterFile("nap.proto", fileDescriptor_f34234efeae954d9) } var fileDescriptor_f34234efeae954d9 = []byte{ - // 504 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x41, 0x6f, 0x12, 0x41, - 0x14, 0x76, 0xa9, 0x22, 0x3c, 0x6a, 0x4b, 0x06, 0x43, 0xb1, 0x2a, 0x4b, 0xb8, 0x88, 0x1e, 0x16, - 0x43, 0x63, 0x3c, 0xb4, 0x17, 0x28, 0xa8, 0x4d, 0x0d, 0x36, 0xd3, 0x4a, 0xa3, 0x97, 0xcd, 0x63, - 0x77, 0x58, 0x36, 0xc0, 0xee, 0x64, 0x67, 0x68, 0xf5, 0x3f, 0xf8, 0xc3, 0x3c, 0x78, 0x30, 0xf1, - 0xbe, 0x31, 0x1c, 0xf7, 0x57, 0x18, 0x66, 0x17, 0x28, 0x55, 0x12, 0x2f, 0x3b, 0x33, 0xdf, 0xf7, - 0xbe, 0x2f, 0xef, 0x7d, 0x2f, 0x0b, 0x59, 0x0f, 0xb9, 0xc1, 0x03, 0x5f, 0xfa, 0x84, 0x0c, 0x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x95, 0xb5, 0xcf, 0xcf, 0x1d, 0x57, 0x0e, - 0xa7, 0x7d, 0xc3, 0xf2, 0x27, 0x75, 0x35, 0x7e, 0x5d, 0x8d, 0x5f, 0x17, 0xf6, 0xa8, 0x7e, 0xd5, - 0xa8, 0xab, 0xff, 0xea, 0x50, 0x7d, 0xfb, 0x69, 0x75, 0x1c, 0xfc, 0x09, 0x00, 0x00, 0xff, 0xff, - 0x25, 0xf1, 0x11, 0xa4, 0x91, 0x03, 0x00, 0x00, + // 525 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x41, 0x73, 0xd2, 0x4c, + 0x18, 0xfe, 0xc2, 0x57, 0x29, 0x2c, 0xb5, 0x65, 0x16, 0x87, 0x62, 0x55, 0xc2, 0x70, 0x11, 0x3d, + 0x24, 0x0e, 0x1d, 0xc7, 0x43, 0x7b, 0x21, 0x05, 0xb5, 0x53, 0x07, 0x3b, 0xdb, 0x4a, 0x47, 0x2f, + 0x99, 0x97, 0x64, 0x09, 0x19, 0x42, 0xb2, 0x93, 0x5d, 0x5a, 0xfd, 0x01, 0xde, 0xfc, 0x61, 0x1e, + 0x3c, 0xf8, 0x0b, 0x32, 0x0e, 0xc7, 0xfc, 0x0a, 0x87, 0x4d, 0x02, 0xa5, 0xca, 0x8c, 0x17, 0x76, + 0xf7, 0x79, 0xde, 0xe7, 0x61, 0xdf, 0xe7, 0xdd, 0xa0, 0xa2, 0x0f, 0x4c, 0x63, 0x61, 0x20, 0x02, + 0x8c, 0x47, 0x2f, 0x35, 0xdf, 0x71, 0xfd, 0xcf, 0x1a, 0x38, 0xd4, 0x17, 0x1a, 0xb7, 0x27, 0x07, + 0xc8, 0x09, 0x9c, 0x20, 0xe1, 0x9b, 0x5f, 0xb7, 0xd0, 0x83, 0x0e, 0x63, 0xe7, 0x61, 0x20, 0xa8, + 0x25, 0xae, 0x3a, 0xaf, 0xbb,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xd1, 0xaf, 0xdb, 0xba, 0xfc, 0x12, 0x8f, 0xe4, 0xef, 0x30, 0x2f, 0x97, 0xc3, 0xdf, + 0x01, 0x00, 0x00, 0xff, 0xff, 0xde, 0x38, 0x05, 0x13, 0xc3, 0x03, 0x00, 0x00, } func (m *AppProtectWAFDetails) Marshal() (dAtA []byte, err error) { @@ -284,6 +294,13 @@ func (m *AppProtectWAFDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.WafRelease) > 0 { + i -= len(m.WafRelease) + copy(dAtA[i:], m.WafRelease) + i = encodeVarintNap(dAtA, i, uint64(len(m.WafRelease))) + i-- + dAtA[i] = 0x3a + } if m.PrecompiledPublication { i-- if m.PrecompiledPublication { @@ -423,6 +440,10 @@ func (m *AppProtectWAFDetails) Size() (n int) { if m.PrecompiledPublication { n += 2 } + l = len(m.WafRelease) + if l > 0 { + n += 1 + l + sovNap(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -671,6 +692,38 @@ func (m *AppProtectWAFDetails) Unmarshal(dAtA []byte) error { } } m.PrecompiledPublication = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WafRelease", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNap + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNap + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNap + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WafRelease = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipNap(dAtA[iNdEx:]) diff --git a/test/integration/vendor/github.com/nginx/agent/sdk/v2/proto/nap.proto b/test/integration/vendor/github.com/nginx/agent/sdk/v2/proto/nap.proto index 76218aae9..a53135e3b 100644 --- a/test/integration/vendor/github.com/nginx/agent/sdk/v2/proto/nap.proto +++ b/test/integration/vendor/github.com/nginx/agent/sdk/v2/proto/nap.proto @@ -19,6 +19,8 @@ message AppProtectWAFDetails { string waf_location = 5 [(gogoproto.jsontag) = "waf_location"]; // Determines whether the publication of NGINX App Protect pre-compiled content from an external source is supported bool precompiled_publication = 6 [(gogoproto.jsontag) = "precompiled_publication"]; + // WAF release + string waf_release = 7 [(gogoproto.jsontag) = "waf_release"]; } // Represents the health of App Protect WAF diff --git a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/nap.pb.go b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/nap.pb.go index 01467bf06..b2c9c5831 100644 --- a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/nap.pb.go +++ b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/nap.pb.go @@ -68,10 +68,12 @@ type AppProtectWAFDetails struct { // Location of WAF metadata file WafLocation string `protobuf:"bytes,5,opt,name=waf_location,json=wafLocation,proto3" json:"waf_location"` // Determines whether the publication of NGINX App Protect pre-compiled content from an external source is supported - PrecompiledPublication bool `protobuf:"varint,6,opt,name=precompiled_publication,json=precompiledPublication,proto3" json:"precompiled_publication"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + PrecompiledPublication bool `protobuf:"varint,6,opt,name=precompiled_publication,json=precompiledPublication,proto3" json:"precompiled_publication"` + // WAF release + WafRelease string `protobuf:"bytes,7,opt,name=waf_release,json=wafRelease,proto3" json:"waf_release"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *AppProtectWAFDetails) Reset() { *m = AppProtectWAFDetails{} } @@ -149,6 +151,13 @@ func (m *AppProtectWAFDetails) GetPrecompiledPublication() bool { return false } +func (m *AppProtectWAFDetails) GetWafRelease() string { + if m != nil { + return m.WafRelease + } + return "" +} + // Represents the health of App Protect WAF type AppProtectWAFHealth struct { // System ID @@ -225,39 +234,40 @@ func init() { func init() { proto.RegisterFile("nap.proto", fileDescriptor_f34234efeae954d9) } var fileDescriptor_f34234efeae954d9 = []byte{ - // 504 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x41, 0x6f, 0x12, 0x41, - 0x14, 0x76, 0xa9, 0x22, 0x3c, 0x6a, 0x4b, 0x06, 0x43, 0xb1, 0x2a, 0x4b, 0xb8, 0x88, 0x1e, 0x16, - 0x43, 0x63, 0x3c, 0xb4, 0x17, 0x28, 0xa8, 0x4d, 0x0d, 0x36, 0xd3, 0x4a, 0xa3, 0x97, 0xcd, 0x63, - 0x77, 0x58, 0x36, 0xc0, 0xee, 0x64, 0x67, 0x68, 0xf5, 0x3f, 0xf8, 0xc3, 0x3c, 0x78, 0x30, 0xf1, - 0xbe, 0x31, 0x1c, 0xf7, 0x57, 0x18, 0x66, 0x17, 0x28, 0x55, 0x12, 0x2f, 0x3b, 0x33, 0xdf, 0xf7, - 0xbe, 0x2f, 0xef, 0x7d, 0x2f, 0x0b, 0x59, 0x0f, 0xb9, 0xc1, 0x03, 0x5f, 0xfa, 0x84, 0x0c, 0x5e, - 0x19, 0x9e, 0xe3, 0x7a, 0x5f, 0x0c, 0x74, 0x98, 0x27, 0x0d, 0x61, 0x8f, 0xf6, 0xc1, 0xf1, 0x1d, - 0x3f, 0xe6, 0xab, 0xbf, 0xb6, 0xe0, 0x61, 0x93, 0xf3, 0xb3, 0xc0, 0x97, 0xcc, 0x92, 0x97, 0xcd, - 0x37, 0x6d, 0x26, 0xd1, 0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, 0xff, - 0x25, 0xf1, 0x11, 0xa4, 0x91, 0x03, 0x00, 0x00, + // 525 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x41, 0x73, 0xd2, 0x4c, + 0x18, 0xfe, 0xc2, 0x57, 0x29, 0x2c, 0xb5, 0x65, 0x16, 0x87, 0x62, 0x55, 0xc2, 0x70, 0x11, 0x3d, + 0x24, 0x0e, 0x1d, 0xc7, 0x43, 0x7b, 0x21, 0x05, 0xb5, 0x53, 0x07, 0x3b, 0xdb, 0x4a, 0x47, 0x2f, + 0x99, 0x97, 0x64, 0x09, 0x19, 0x42, 0xb2, 0x93, 0x5d, 0x5a, 0xfd, 0x01, 0xde, 0xfc, 0x61, 0x1e, + 0x3c, 0xf8, 0x0b, 0x32, 0x0e, 0xc7, 0xfc, 0x0a, 0x87, 0x4d, 0x02, 0xa5, 0xca, 0x8c, 0x17, 0x76, + 0xf7, 0x79, 0xde, 0xe7, 0x61, 0xdf, 0xe7, 0xdd, 0xa0, 0xa2, 0x0f, 0x4c, 0x63, 0x61, 0x20, 0x02, + 0x8c, 0x47, 0x2f, 0x35, 0xdf, 0x71, 0xfd, 0xcf, 0x1a, 0x38, 0xd4, 0x17, 0x1a, 0xb7, 0x27, 0x07, + 0xc8, 0x09, 0x9c, 0x20, 0xe1, 0x9b, 0x5f, 0xb7, 0xd0, 0x83, 0x0e, 0x63, 0xe7, 0x61, 0x20, 0xa8, + 0x25, 0xae, 0x3a, 0xaf, 0xbb, 0x54, 0x80, 0xeb, 0x71, 0xfc, 0x02, 0x95, 0x6e, 0x60, 0x64, 0x5e, + 0xd3, 0x90, 0xbb, 0x81, 0x5f, 0x53, 0x1a, 0x4a, 0xab, 0x68, 0xec, 0xc5, 0x91, 0x7a, 0x1b, 0x26, + 0xe8, 0x06, 0x46, 0x83, 0x64, 0x8f, 0x3f, 0xa2, 0x87, 0x20, 0x04, 0x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, 0x8e, 0xd4, 0x15, 0x48, 0x0a, 0xc9, 0xf6, 0xd4, 0xc6, 0xdf, 0x14, 0x54, 0x05, 0xc6, + 0x4c, 0x96, 0x98, 0x98, 0x8b, 0xff, 0xe2, 0x02, 0xc4, 0x8c, 0xcb, 0xf1, 0xef, 0xb6, 0x8f, 0xfe, + 0x31, 0xde, 0x75, 0xec, 0x42, 0x5a, 0x18, 0x07, 0x71, 0xa4, 0x6e, 0xb0, 0x27, 0x15, 0x58, 0x09, + 0x60, 0x94, 0x08, 0xf0, 0x31, 0xda, 0xb3, 0xa9, 0x13, 0x82, 0x4d, 0x6d, 0x33, 0xa4, 0xc0, 0x97, + 0x6f, 0xa5, 0x12, 0x47, 0xea, 0x5d, 0x8a, 0xec, 0x66, 0x00, 0x91, 0xe7, 0xe6, 0xf1, 0x9d, 0x3c, + 0x52, 0xd3, 0x12, 0xda, 0xfe, 0xd0, 0x3f, 0xeb, 0xbf, 0xbf, 0xea, 0x97, 0xff, 0xc3, 0x08, 0xe5, + 0x3b, 0x27, 0x97, 0xa7, 0x83, 0x5e, 0x59, 0xc1, 0x3b, 0xa8, 0xd0, 0xed, 0xbd, 0x21, 0x9d, 0x6e, + 0xaf, 0x5b, 0xce, 0x19, 0xaf, 0xbe, 0xcf, 0xeb, 0xca, 0xcf, 0x79, 0x5d, 0xf9, 0x35, 0xaf, 0x2b, + 0x9f, 0x9e, 0x39, 0xae, 0x18, 0xcf, 0x86, 0x9a, 0x15, 0x4c, 0x75, 0xd9, 0xbe, 0x2e, 0xdb, 0xd7, + 0xb9, 0x3d, 0xd1, 0xaf, 0xdb, 0xba, 0xfc, 0x12, 0x8f, 0xe4, 0xef, 0x30, 0x2f, 0x97, 0xc3, 0xdf, + 0x01, 0x00, 0x00, 0xff, 0xff, 0xde, 0x38, 0x05, 0x13, 0xc3, 0x03, 0x00, 0x00, } func (m *AppProtectWAFDetails) Marshal() (dAtA []byte, err error) { @@ -284,6 +294,13 @@ func (m *AppProtectWAFDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.WafRelease) > 0 { + i -= len(m.WafRelease) + copy(dAtA[i:], m.WafRelease) + i = encodeVarintNap(dAtA, i, uint64(len(m.WafRelease))) + i-- + dAtA[i] = 0x3a + } if m.PrecompiledPublication { i-- if m.PrecompiledPublication { @@ -423,6 +440,10 @@ func (m *AppProtectWAFDetails) Size() (n int) { if m.PrecompiledPublication { n += 2 } + l = len(m.WafRelease) + if l > 0 { + n += 1 + l + sovNap(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -671,6 +692,38 @@ func (m *AppProtectWAFDetails) Unmarshal(dAtA []byte) error { } } m.PrecompiledPublication = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WafRelease", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNap + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNap + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNap + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WafRelease = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipNap(dAtA[iNdEx:]) diff --git a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/nap.proto b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/nap.proto index 76218aae9..a53135e3b 100644 --- a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/nap.proto +++ b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/nap.proto @@ -19,6 +19,8 @@ message AppProtectWAFDetails { string waf_location = 5 [(gogoproto.jsontag) = "waf_location"]; // Determines whether the publication of NGINX App Protect pre-compiled content from an external source is supported bool precompiled_publication = 6 [(gogoproto.jsontag) = "precompiled_publication"]; + // WAF release + string waf_release = 7 [(gogoproto.jsontag) = "waf_release"]; } // Represents the health of App Protect WAF diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/const.go b/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/const.go index 1b23668dd..a3e158074 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/const.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/const.go @@ -9,7 +9,7 @@ package nap const ( NAP_VERSION_FILE = "/opt/app_protect/VERSION" - BD_SOCKET_PLUGIN_PATH = "/usr/share/ts/bin/bd-socket-plugin" + NAP_RELEASE_FILE = "/opt/app_protect/RELEASE" BD_SOCKET_PLUGIN_PROCESS = "bd-socket-plugin" // TODO: Rather than using the update yaml files for attack signatures and threat diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/nap.go b/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/nap.go index 9d87c8fa9..2043859d7 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/nap.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/nap.go @@ -28,7 +28,7 @@ const ( ) var ( - requiredNAPFiles = []string{BD_SOCKET_PLUGIN_PATH, NAP_VERSION_FILE} + requiredNAPFiles = []string{NAP_VERSION_FILE, NAP_RELEASE_FILE} requireNAPProcesses = []string{BD_SOCKET_PLUGIN_PROCESS} processCheckFunc = core.CheckForProcesses ) @@ -56,7 +56,7 @@ func NewNginxAppProtect(optDirPath, symLinkDir string) (*NginxAppProtect, error) // Get the release version of NAP on the system if NAP is installed var napRelease *NAPRelease if status != MISSING { - napRelease, err = installedNAPRelease(NAP_VERSION_FILE) + napRelease, err = installedNAPRelease(NAP_VERSION_FILE, NAP_RELEASE_FILE) if err != nil { return nil, err } @@ -107,7 +107,7 @@ func (nap *NginxAppProtect) Monitor(pollInterval time.Duration) chan NAPReportBu func (nap *NginxAppProtect) monitor(msgChannel chan NAPReportBundle, pollInterval time.Duration) { // Initial symlink sync if nap.Release.VersioningDetails.NAPRelease != "" { - err := nap.syncSymLink("", nap.Release.VersioningDetails.NAPRelease) + err := nap.syncSymLink("", nap.Release.VersioningDetails.NAPBuild) if err != nil { log.Errorf("Error occurred while performing initial sync for NAP symlink - %v", err) } @@ -137,7 +137,7 @@ func (nap *NginxAppProtect) monitor(msgChannel chan NAPReportBundle, pollInterva previousReport := nap.GenerateNAPReport() log.Infof("Change in NAP detected... \nPrevious: %+v\nUpdated: %+v\n", previousReport, newNAPReport) - err = nap.syncSymLink(nap.Release.VersioningDetails.NAPRelease, newNAPReport.NAPVersion) + err = nap.syncSymLink(nap.Release.VersioningDetails.NAPBuild, newNAPReport.NAPVersion) if err != nil { log.Errorf("Got the following error syncing NAP symlink - %v", err) break @@ -237,7 +237,8 @@ func (nap *NginxAppProtect) removeNAPSymlinks(symlinkPatternToIgnore string) err // to be in sync with the current system NAP values. func (nap *NginxAppProtect) GenerateNAPReport() NAPReport { return NAPReport{ - NAPVersion: nap.Release.VersioningDetails.NAPRelease, + NAPVersion: nap.Release.VersioningDetails.NAPBuild, + NAPRelease: nap.Release.VersioningDetails.NAPRelease, Status: nap.Status, AttackSignaturesVersion: nap.AttackSignaturesVersion, ThreatCampaignsVersion: nap.ThreatCampaignsVersion, diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/nap_metadata.go b/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/nap_metadata.go index 582d93bf9..0b38e5bd2 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/nap_metadata.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/nap_metadata.go @@ -73,6 +73,7 @@ func UpdateMetadata( metadata := &Metadata{ NapVersion: appProtectWAFDetails.GetWafVersion(), + NapRelease: appProtectWAFDetails.GetWafRelease(), PrecompiledPublication: appProtectWAFDetails.GetPrecompiledPublication(), AttackSignatureRevisionTimestamp: appProtectWAFDetails.GetAttackSignaturesVersion(), ThreatCampaignRevisionTimestamp: appProtectWAFDetails.GetThreatCampaignsVersion(), diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/nap_release.go b/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/nap_release.go index 60998d380..7d6a78f74 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/nap_release.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/nap_release.go @@ -17,36 +17,40 @@ import ( // installedNAPRelease gets the NAP release version based off the Nginx App Protect installed // on the system. -func installedNAPRelease(versionFile string) (*NAPRelease, error) { - // Get build version of NAP, so we can determine the release details - napBuildVersion, err := installedNAPBuildVersion(versionFile) +func installedNAPRelease(versionFile, releaseFile string) (*NAPRelease, error) { + // Get build version of NAP, so we can determine the release details + napBuildVersion, err := installedNAP(versionFile) + if err != nil { + return nil, err + } + napRelease, err := installedNAP(releaseFile) if err != nil { return nil, err } - unmappedRelease := ReleaseUnmappedBuild(napBuildVersion) + unmappedRelease := ReleaseUnmappedBuild(napBuildVersion, napRelease) return &unmappedRelease, nil } -// installedNAPBuildVersion gets the NAP build version based off the Nginx App Protect installed +// installedNAP gets the NAP version or release based off the Nginx App Protect installed // on the system. -func installedNAPBuildVersion(versionFile string) (string, error) { +func installedNAP(file string) (string, error) { // Check if nap version file exists - exists, err := core.FileExists(versionFile) + exists, err := core.FileExists(file) if !exists && err == nil { - return "", fmt.Errorf(FILE_NOT_FOUND, versionFile) + return "", fmt.Errorf(FILE_NOT_FOUND, file) } else if err != nil { return "", err } - versionBytes, err := os.ReadFile(versionFile) + bytes, err := os.ReadFile(file) if err != nil { return "", err } - // Remove the trailing '\n' from the version string since it was read + // Remove the trailing '\n' from the string since it was read // from a file - version := strings.Split(string(versionBytes), "\n")[0] + napNumber := strings.Split(string(bytes), "\n")[0] - return version, nil + return napNumber, nil } diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/releases.go b/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/releases.go index f9c4c737c..b1a0b21c3 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/releases.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/releases.go @@ -7,7 +7,7 @@ package nap -func ReleaseUnmappedBuild(buildVersion string) NAPRelease { +func ReleaseUnmappedBuild(version, release string) NAPRelease { return NAPRelease{ NAPPackages: NAPReleasePackages{}, NAPCompilerPackages: NAPReleasePackages{}, @@ -15,8 +15,8 @@ func ReleaseUnmappedBuild(buildVersion string) NAPRelease { NAPPluginPackages: NAPReleasePackages{}, NAPPlusModulePackages: NAPReleasePackages{}, VersioningDetails: NAPVersioningDetails{ - NAPBuild: buildVersion, - NAPRelease: buildVersion, + NAPBuild: version, + NAPRelease: release, }, } } diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/types.go b/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/types.go index 2bbd94368..d7a648b1a 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/types.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/types.go @@ -25,6 +25,7 @@ type NginxAppProtect struct { type NAPReport struct { Status string NAPVersion string + NAPRelease string AttackSignaturesVersion string ThreatCampaignsVersion string } @@ -71,6 +72,7 @@ type NAPVersioningDetails struct { NAPPlusModule string `json:"nap-plus-module,omitempty"` NAPRelease string `json:"nap-release"` NginxPlus string `json:"nginx-plus,omitempty"` + NAPVersion string `json:"nap-version"` } // NAPReleaseMap is a mapping object meant to capture a specific NAP Release version as @@ -90,6 +92,7 @@ type napRevisionDateTime struct { type Metadata struct { NapVersion string `json:"napVersion"` + NapRelease string `json:"napRelease"` PrecompiledPublication bool `json:"precompiledPublication"` GlobalStateFileName string `json:"globalStateFileName,omitempty"` GlobalStateFileUID string `json:"globalStateFileUID,omitempty"` diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx_app_protect.go b/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx_app_protect.go index 198685ec6..62c7e0328 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx_app_protect.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx_app_protect.go @@ -178,6 +178,7 @@ func (n *NginxAppProtect) generateNAPDetailsProtoCommand() *proto.DataplaneSoftw AppProtectWafDetails: &proto.AppProtectWAFDetails{ WafLocation: nap.APP_PROTECT_METADATA_FILE_PATH, WafVersion: napReport.NAPVersion, + WafRelease: napReport.NAPRelease, AttackSignaturesVersion: napReport.AttackSignaturesVersion, ThreatCampaignsVersion: napReport.ThreatCampaignsVersion, PrecompiledPublication: n.precompiledPublication, diff --git a/vendor/github.com/nginx/agent/sdk/v2/proto/nap.pb.go b/vendor/github.com/nginx/agent/sdk/v2/proto/nap.pb.go index 01467bf06..b2c9c5831 100644 --- a/vendor/github.com/nginx/agent/sdk/v2/proto/nap.pb.go +++ b/vendor/github.com/nginx/agent/sdk/v2/proto/nap.pb.go @@ -68,10 +68,12 @@ type AppProtectWAFDetails struct { // Location of WAF metadata file WafLocation string `protobuf:"bytes,5,opt,name=waf_location,json=wafLocation,proto3" json:"waf_location"` // Determines whether the publication of NGINX App Protect pre-compiled content from an external source is supported - PrecompiledPublication bool `protobuf:"varint,6,opt,name=precompiled_publication,json=precompiledPublication,proto3" json:"precompiled_publication"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + PrecompiledPublication bool `protobuf:"varint,6,opt,name=precompiled_publication,json=precompiledPublication,proto3" json:"precompiled_publication"` + // WAF release + WafRelease string `protobuf:"bytes,7,opt,name=waf_release,json=wafRelease,proto3" json:"waf_release"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *AppProtectWAFDetails) Reset() { *m = AppProtectWAFDetails{} } @@ -149,6 +151,13 @@ func (m *AppProtectWAFDetails) GetPrecompiledPublication() bool { return false } +func (m *AppProtectWAFDetails) GetWafRelease() string { + if m != nil { + return m.WafRelease + } + return "" +} + // Represents the health of App Protect WAF type AppProtectWAFHealth struct { // System ID @@ -225,39 +234,40 @@ func init() { func init() { proto.RegisterFile("nap.proto", fileDescriptor_f34234efeae954d9) } var fileDescriptor_f34234efeae954d9 = []byte{ - // 504 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x41, 0x6f, 0x12, 0x41, - 0x14, 0x76, 0xa9, 0x22, 0x3c, 0x6a, 0x4b, 0x06, 0x43, 0xb1, 0x2a, 0x4b, 0xb8, 0x88, 0x1e, 0x16, - 0x43, 0x63, 0x3c, 0xb4, 0x17, 0x28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, - 0xdb, 0x14, 0xdd, 0x59, 0x00, 0x54, 0xbd, 0xab, 0x47, 0xb7, 0xf2, 0x48, 0x4c, 0x73, 0x70, 0xff, - 0x63, 0xf7, 0xb4, 0xfb, 0xe1, 0xb2, 0x9b, 0xbf, 0x43, 0x00, 0xd2, 0xcd, 0xe3, 0x8b, 0x93, 0x5e, - 0x27, 0xaf, 0x91, 0x6d, 0xc8, 0xb4, 0x3b, 0x6f, 0x69, 0xb3, 0xdd, 0x69, 0xe7, 0x53, 0xad, 0xd7, - 0xdf, 0x67, 0x65, 0xed, 0xe7, 0xac, 0xac, 0xfd, 0x9e, 0x95, 0xb5, 0xcf, 0xcf, 0x1d, 0x57, 0x0e, - 0xa7, 0x7d, 0xc3, 0xf2, 0x27, 0x75, 0x35, 0x7e, 0x5d, 0x8d, 0x5f, 0x17, 0xf6, 0xa8, 0x7e, 0xd5, - 0xa8, 0xab, 0xff, 0xea, 0x50, 0x7d, 0xfb, 0x69, 0x75, 0x1c, 0xfc, 0x09, 0x00, 0x00, 0xff, 0xff, - 0x25, 0xf1, 0x11, 0xa4, 0x91, 0x03, 0x00, 0x00, + // 525 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x41, 0x73, 0xd2, 0x4c, + 0x18, 0xfe, 0xc2, 0x57, 0x29, 0x2c, 0xb5, 0x65, 0x16, 0x87, 0x62, 0x55, 0xc2, 0x70, 0x11, 0x3d, + 0x24, 0x0e, 0x1d, 0xc7, 0x43, 0x7b, 0x21, 0x05, 0xb5, 0x53, 0x07, 0x3b, 0xdb, 0x4a, 0x47, 0x2f, + 0x99, 0x97, 0x64, 0x09, 0x19, 0x42, 0xb2, 0x93, 0x5d, 0x5a, 0xfd, 0x01, 0xde, 0xfc, 0x61, 0x1e, + 0x3c, 0xf8, 0x0b, 0x32, 0x0e, 0xc7, 0xfc, 0x0a, 0x87, 0x4d, 0x02, 0x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bf, 0xea, 0x97, 0xff, 0xc3, 0x08, 0xe5, + 0x3b, 0x27, 0x97, 0xa7, 0x83, 0x5e, 0x59, 0xc1, 0x3b, 0xa8, 0xd0, 0xed, 0xbd, 0x21, 0x9d, 0x6e, + 0xaf, 0x5b, 0xce, 0x19, 0xaf, 0xbe, 0xcf, 0xeb, 0xca, 0xcf, 0x79, 0x5d, 0xf9, 0x35, 0xaf, 0x2b, + 0x9f, 0x9e, 0x39, 0xae, 0x18, 0xcf, 0x86, 0x9a, 0x15, 0x4c, 0x75, 0xd9, 0xbe, 0x2e, 0xdb, 0xd7, + 0xb9, 0x3d, 0xd1, 0xaf, 0xdb, 0xba, 0xfc, 0x12, 0x8f, 0xe4, 0xef, 0x30, 0x2f, 0x97, 0xc3, 0xdf, + 0x01, 0x00, 0x00, 0xff, 0xff, 0xde, 0x38, 0x05, 0x13, 0xc3, 0x03, 0x00, 0x00, } func (m *AppProtectWAFDetails) Marshal() (dAtA []byte, err error) { @@ -284,6 +294,13 @@ func (m *AppProtectWAFDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.WafRelease) > 0 { + i -= len(m.WafRelease) + copy(dAtA[i:], m.WafRelease) + i = encodeVarintNap(dAtA, i, uint64(len(m.WafRelease))) + i-- + dAtA[i] = 0x3a + } if m.PrecompiledPublication { i-- if m.PrecompiledPublication { @@ -423,6 +440,10 @@ func (m *AppProtectWAFDetails) Size() (n int) { if m.PrecompiledPublication { n += 2 } + l = len(m.WafRelease) + if l > 0 { + n += 1 + l + sovNap(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -671,6 +692,38 @@ func (m *AppProtectWAFDetails) Unmarshal(dAtA []byte) error { } } m.PrecompiledPublication = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WafRelease", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNap + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNap + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNap + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WafRelease = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipNap(dAtA[iNdEx:]) diff --git a/vendor/github.com/nginx/agent/sdk/v2/proto/nap.proto b/vendor/github.com/nginx/agent/sdk/v2/proto/nap.proto index 76218aae9..a53135e3b 100644 --- a/vendor/github.com/nginx/agent/sdk/v2/proto/nap.proto +++ b/vendor/github.com/nginx/agent/sdk/v2/proto/nap.proto @@ -19,6 +19,8 @@ message AppProtectWAFDetails { string waf_location = 5 [(gogoproto.jsontag) = "waf_location"]; // Determines whether the publication of NGINX App Protect pre-compiled content from an external source is supported bool precompiled_publication = 6 [(gogoproto.jsontag) = "precompiled_publication"]; + // WAF release + string waf_release = 7 [(gogoproto.jsontag) = "waf_release"]; } // Represents the health of App Protect WAF