-
Notifications
You must be signed in to change notification settings - Fork 0
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
818 rule str format #826
818 rule str format #826
Conversation
# Conflicts: # pkg/linter/linterExecute.go
direction: outbound, id: id:152, remote: 0.0.0.0/0, local: 0.0.0.0/0, conns: protocol: all | ||
network ACL acl2-ky allows connection with the following allow rules | ||
index: 2, direction: outbound , src: 10.240.20.0/24 , dst: 10.240.10.0/24, conn: all, action: allow | ||
direction: outbound, name: acl2-out-3, priority: 3, action: allow, source: 10.240.20.0/24 , destination: 10.240.10.0/24, conn: all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In SG we have conns: protocol: all
, while in NACL we have conn: all
.
Better be consistent (I prefer traffic: all
for both)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not related to this PR.
It has to do with the following workaround temp code from detailedConn.go
(which seems not to work in all cases)
Lets open a separate issue and handle it properly in connectionSet
// string adds * to non-responsive TCP components of the connection
// for cosmetic reasons remove the protocol word from cubes prints
func (d *detailedConn) string() string {
...
// todo: remove "protocol" from the original cube printing funcs
return strings.ReplaceAll(strings.Join(resStrSlice, "; "), "protocol: ", "")
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. @haim-kermany didn't you implement some shortened version of connection details for drawio?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not anything sophisticated:
func (data *templateData) SvgShortLabel(tn TreeNodeInterface) string {
// the connection label is created in another package,
// so, instead of creating a short version, we edit the long version here:
label := data.SvgLabel(tn)
label = strings.ReplaceAll(label, "protocol:", "")
if !strings.Contains(label, "src-ports:") {
label = strings.ReplaceAll(label, "dst-ports:", "")
}
if len(label) > maxConnLabelSize {
return label[0:maxConnLabelSize-len(threeDots)] + threeDots
}
return label
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of having ad-hoc code in multiple places as we do now, lets have the proper printing function in connectionSet
(My code is similar to Haim's and for some reason it does not work in all cases. I thing debugging this ad-hoc string oriented ad-hoc code is a waste of time -better fix it properly)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please open an issue in models repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you already did here
No description provided.