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

print abstract policy to log #209

Merged
merged 13 commits into from
Feb 10, 2025
Merged

print abstract policy to log #209

merged 13 commits into from
Feb 10, 2025

Conversation

ShiriMoran
Copy link
Contributor

No description provided.

@ShiriMoran ShiriMoran marked this pull request as draft February 9, 2025 10:02
@ShiriMoran ShiriMoran linked an issue Feb 9, 2025 that may be closed by this pull request
@ShiriMoran ShiriMoran marked this pull request as ready for review February 9, 2025 11:05
Copy link
Contributor

@adisos adisos left a comment

Choose a reason for hiding this comment

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

looks good.

maybe for a separate issue, ran with pkg/collector/data/json/Example1.json and got log messages that are not clear:

 INFO        Expression must not be nil and must be of size at least 1

the abstract model is printed this way:

INFO        abstract model
~~~~~~~~~~~~~~
category: Application
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
symbolic inbound rules:
        0. action: allow paths: src: (group = frontend) dst: (group = backend) conn: TCP dst-ports: 445
        1. action: deny paths: src: (*) dst: (*) conn: All Connections
symbolic outbound rules:
        0. action: allow paths: src: (group = frontend) dst: (group = backend) conn: TCP dst-ports: 445
        1. action: deny paths: src: (*) dst: (*) conn: All Connections

another comment, maybe for a separate issue - consider printing in table format (similar to connectivity output, input rules of DFW, etc... there is a func in common pkg to use that - GenerateTableString).

pkg/synthesis/synthesis.go Outdated Show resolved Hide resolved
@ShiriMoran
Copy link
Contributor Author

stract model

please op

looks good.

maybe for a separate issue, ran with pkg/collector/data/json/Example1.json and got log messages that are not clear:

 INFO        Expression must not be nil and must be of size at least 1

the abstract model is printed this way:

INFO        abstract model
~~~~~~~~~~~~~~
category: Application
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
symbolic inbound rules:
        0. action: allow paths: src: (group = frontend) dst: (group = backend) conn: TCP dst-ports: 445
        1. action: deny paths: src: (*) dst: (*) conn: All Connections
symbolic outbound rules:
        0. action: allow paths: src: (group = frontend) dst: (group = backend) conn: TCP dst-ports: 445
        1. action: deny paths: src: (*) dst: (*) conn: All Connections

another comment, maybe for a separate issue - consider printing in table format (similar to connectivity output, input rules of DFW, etc... there is a func in common pkg to use that - GenerateTableString).

Please open a separate issue for the table

@adisos
Copy link
Contributor

adisos commented Feb 9, 2025

Please open a separate issue for the table

do you want to fix the issue about the unclear log message in this PR? (already opened an issue about other unclear log messages).

@pull-request-size pull-request-size bot added size/S and removed size/XS labels Feb 9, 2025
@ShiriMoran
Copy link
Contributor Author

ShiriMoran commented Feb 9, 2025

Please open a separate issue for the table

do you want to fix the issue about the unclear log message in this PR? (already opened an issue about other unclear log messages).

fixed (" INFO Expression must not be nil and must be of size at least 1" rewritten)

pkg/symbolicexpr/tagTerm.go Outdated Show resolved Hide resolved
pkg/symbolicexpr/tagTerm.go Outdated Show resolved Hide resolved
@adisos
Copy link
Contributor

adisos commented Feb 9, 2025

Please open a separate issue for the table

do you want to fix the issue about the unclear log message in this PR? (already opened an issue about other unclear log messages).

fixed (" INFO Expression must not be nil and must be of size at least 1" rewritten)

getting many duplications of this warning in the log:

2025/02/09 15:10:19 INFO        Illegal or nil expression attached to group frontend. Thus using the group for synthesis and ignoring the expression
2025/02/09 15:10:19 INFO        Illegal or nil expression attached to group backend. Thus using the group for synthesis and ignoring the expression
2025/02/09 15:10:19 INFO        Illegal or nil expression attached to group backend. Thus using the group for synthesis and ignoring the expression
2025/02/09 15:10:19 INFO        Illegal or nil expression attached to group frontend. Thus using the group for synthesis and ignoring the expression
2025/02/09 15:10:19 INFO        Illegal or nil expression attached to group backend. Thus using the group for synthesis and ignoring the expression
2025/02/09 15:10:19 INFO        Illegal or nil expression attached to group frontend. Thus using the group for synthesis and ignoring the expression
2025/02/09 15:10:19 INFO        Illegal or nil expression attached to group frontend. Thus using the group for synthesis and ignoring the expression
2025/02/09 15:10:19 INFO        Illegal or nil expression attached to group backend. Thus using the group for synthesis and ignoring the expression
2025/02/09 15:10:19 INFO        Illegal or nil expression attached to group backend. Thus using the group for synthesis and ignoring the expression
2025/02/09 15:10:19 INFO        Illegal or nil expression attached to group frontend. Thus using the group for synthesis and ignoring the expression
2025/02/09 15:10:19 INFO        Illegal or nil expression attached to group backend. Thus using the group for synthesis and ignoring the expression
2025/02/09 15:10:19 INFO        Illegal or nil expression attached to group frontend. Thus using the group for synthesis and ignoring the expression
2

can fix here or open a separate issue to avoid these duplications.

I'm having problem in reproducing it; Lets open another issue.

ShiriMoran and others added 2 commits February 9, 2025 15:14
Co-authored-by: Adi Sosnovich <82078442+adisos@users.noreply.github.com>
@ShiriMoran ShiriMoran merged commit f60ac71 into main Feb 10, 2025
5 checks passed
@ShiriMoran ShiriMoran deleted the 207_abstract_rules_to_log branch February 10, 2025 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add abstract model rules' list to log
2 participants