1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 18:15:42 +01:00

Break overly long lines. Use defined constants for TLP levels.

This commit is contained in:
Sascha L. Teichmann 2023-06-23 11:40:09 +02:00
parent a02d9c36a7
commit 65536f51a4
2 changed files with 10 additions and 4 deletions

View file

@ -715,10 +715,15 @@ func (p *processor) integrity(
"Extracting 'tlp level' from %s failed: %v", u, err) "Extracting 'tlp level' from %s failed: %v", u, err)
} else { } else {
tlpe := extractTLP(tlpa) tlpe := extractTLP(tlpa)
// If the client has no authorization it shouldn't be able to access TLP:AMBER or TLP:RED advisories // If the client has no authorization it shouldn't be able
if !p.opts.protectedAccess() && (tlpe == "AMBER" || tlpe == "RED") { // to access TLP:AMBER or TLP:RED advisories
if !p.opts.protectedAccess() &&
(tlpe == csaf.TLPLabelAmber || tlpe == csaf.TLPLabelRed) {
p.badAmberRedPermissions.use() p.badAmberRedPermissions.use()
p.badAmberRedPermissions.error("Advisory %s of TLP level %v is not access protected.", u, tlpe) p.badAmberRedPermissions.error(
"Advisory %s of TLP level %v is not access protected.",
u, tlpe)
} }
// check if current feed has correct or all of their tlp levels entries. // check if current feed has correct or all of their tlp levels entries.
if p.labelChecker != nil { if p.labelChecker != nil {

View file

@ -125,7 +125,8 @@ func (ca *rolieLabelChecker) check(
"Unexpected Error %v when trying to fetch: %s", err, advisory) "Unexpected Error %v when trying to fetch: %s", err, advisory)
} else if res.StatusCode == http.StatusOK { } else if res.StatusCode == http.StatusOK {
p.badAmberRedPermissions.error( p.badAmberRedPermissions.error(
"Advisory %s of TLP level %v is not properly access protected.", advisory, advisoryLabel) "Advisory %s of TLP level %v is not properly access protected.",
advisory, advisoryLabel)
} }
} }