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

Html out #531

Closed
wants to merge 223 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
223 commits
Select commit Hold shift + click to select a range
74ec605
Initial implementation of the optimized TcpLikeProperties (and HyperC…
tanyaveksler Nov 15, 2022
c279de6
Extended testcase3 to produce connectivity_map
tanyaveksler Nov 15, 2022
1b1ebbe
Fixed a problem in HyperCubeSet (wrongly changing self in _and_aux.
tanyaveksler Nov 20, 2022
09cfad1
Small fix
tanyaveksler Nov 21, 2022
94fb117
Further fix of the hyper cube set
tanyaveksler Nov 22, 2022
520377a
Further fix of the hyper cube set
tanyaveksler Nov 22, 2022
af37b10
Merge remote-tracking branch 'origin/Optimized_HC_set' into Optimized…
tanyaveksler Nov 22, 2022
0339215
Avoiding redundant and heavy copy of layers.
tanyaveksler Nov 22, 2022
564d667
Merge branch 'master' into Optimized_HC_set
tanyaveksler Nov 22, 2022
b9810b3
General changes from the Optimized_HC_set branch.
tanyaveksler Nov 22, 2022
e82ac99
General changes from the Optimized_HC_set branch.
tanyaveksler Nov 22, 2022
6b3b364
Avoiding lint warnings
tanyaveksler Nov 22, 2022
cfb5ee7
Avoiding lint warnings
tanyaveksler Nov 22, 2022
01a9d40
Merge branch 'Small-fixes-for-master' into Optimized_HC_set
tanyaveksler Nov 22, 2022
28e211b
Added support of IpBlocks in optimized hyper cube set implementation.
tanyaveksler Nov 27, 2022
d5d97a6
More accurate update of base_peer_set.
tanyaveksler Nov 27, 2022
0a2cb45
Added dedundant fw_rules creation for testing (to be further removed).
tanyaveksler Nov 29, 2022
0800959
Initial implementation of Calico optimized connections handling.
tanyaveksler Dec 4, 2022
05a496c
Fixed the construction of connectivity graph (when some of src_peer o…
tanyaveksler Dec 6, 2022
bb6842c
Multiple fixes:
tanyaveksler Dec 11, 2022
0d4bd28
Properly handling 'False' represented by TcpLikeProperties.
tanyaveksler Dec 18, 2022
47d5bd0
Added support to ICMP data in optimized HC set (handled in TCPLikePro…
tanyaveksler Jan 1, 2023
0a8d53f
Added command line flag optimized_run, having 3 possibilities:
tanyaveksler Jan 3, 2023
183eaeb
Small fixes;
tanyaveksler Jan 8, 2023
8e34573
Small fixes;
tanyaveksler Jan 8, 2023
9957228
Fixed building tcp_like_properties form connectivity graph
tanyaveksler Jan 8, 2023
004742b
Optimized the comparison between original and optimized connections (…
tanyaveksler Jan 8, 2023
a27899d
Implemented optimized Istio policy handling.
tanyaveksler Jan 15, 2023
ebae572
Added Ingress policy support in the optimized solution.
tanyaveksler Jan 15, 2023
25118de
Added Istio Ingress policy support in the optimized solution.
tanyaveksler Jan 15, 2023
9218096
Merge with master.
tanyaveksler Jan 15, 2023
7780876
Further optimization: converting HC set directly to fw rules.
tanyaveksler Jan 24, 2023
8998470
Small bug fix
tanyaveksler Jan 24, 2023
1281b2c
Fixed printing peer sets in FWRules.
tanyaveksler Jan 24, 2023
278b921
More released comparison between original and optimized fw-rules (all…
tanyaveksler Jan 29, 2023
6320d95
Merge with master.
tanyaveksler Jan 29, 2023
c408b49
Splitting istio opt properties to tcp and non-tcp properties.
tanyaveksler Feb 5, 2023
4a187f2
Fixed creation TcpLikeProperties with empty methods or protocols.
tanyaveksler Feb 5, 2023
74234ab
Optimizing sidecar priorities handling by refinement of sidecar.selec…
tanyaveksler Feb 12, 2023
1216778
Merge with master.
tanyaveksler Feb 12, 2023
2c4b1af
Adding newline at the end of connectivity test expected results.
tanyaveksler Feb 14, 2023
9ff9d25
Handling exclude_ipv6 print in optimized calculation.
tanyaveksler Feb 14, 2023
eb763fb
Fixing initialization of MethodSet in HTTPRoute (None means no method…
tanyaveksler Feb 21, 2023
dabbd17
Changed output format of ICMP data.
tanyaveksler Feb 21, 2023
1388a4c
Making default the original (not optimized) implementation in run_all…
tanyaveksler Feb 21, 2023
e45a007
1. Merge with master
tanyaveksler Feb 21, 2023
3882e85
1. Merge with master
tanyaveksler Feb 26, 2023
6350ebd
Simplifying and improving make_tcp_like_properties function.
tanyaveksler Feb 28, 2023
54a1708
Fixing lint errors.
tanyaveksler Feb 28, 2023
a30fc04
Fixing lint errors.
tanyaveksler Feb 28, 2023
ab7dc47
Removed unised classes ConnectivityGraphPrototype and ConnectivityGra…
tanyaveksler Feb 28, 2023
e49ddfb
Avoid using creation of TcpLikeProperties directly with init; using m…
tanyaveksler Feb 28, 2023
254412a
Fixing lint errors.
tanyaveksler Feb 28, 2023
8ec0717
Fixing lint errors.
tanyaveksler Feb 28, 2023
95971c4
Fixing ConnectionSet.__str__ to be accurate, since it is used in sort…
tanyaveksler Mar 5, 2023
b343603
Merge with master.
tanyaveksler Mar 5, 2023
2bba713
Fixed excluding unused ipv6 blocks in the optimized solution.
tanyaveksler Mar 5, 2023
a346c25
Renamed TcpLikeProperties to ConnectivityProperties.
tanyaveksler Mar 5, 2023
0d2661b
Fixing lint errors.
tanyaveksler Mar 5, 2023
64daeed
Fixing lint errors.
tanyaveksler Mar 5, 2023
51b38d5
track expl data
shmfr Mar 6, 2023
464f004
explain connectivity
shmfr Mar 7, 2023
b5c6586
explain connectivity
shmfr Mar 7, 2023
f8243de
Simplified and cleaned interfaces.
tanyaveksler Mar 7, 2023
d77050d
Fixed lint errors.
tanyaveksler Mar 7, 2023
8977f43
Fixed lint errors.
tanyaveksler Mar 7, 2023
dae1bb1
Added a new class ConnectivityCube that manages forth and back transl…
tanyaveksler Mar 14, 2023
ad299fb
Added set_dims method to set multiple dimensions at once.
tanyaveksler Mar 14, 2023
a1c5654
Added get_protocol_set_with_single_protocol function to ProtocolSet.
tanyaveksler Mar 14, 2023
ca0cab9
Fixing lint errors.
tanyaveksler Mar 19, 2023
85ae2ea
Fixed connectivity properties unit tests to match the new API.
tanyaveksler Mar 19, 2023
e72081f
Aligned get_cube_dict to return str for all dimensions.
tanyaveksler Mar 19, 2023
458c373
Removed unused ICMPDAtaSet class and its unit tests.
tanyaveksler Mar 19, 2023
4fdeed5
Cleaner code using the new ConnectivityCube API.
tanyaveksler Mar 19, 2023
13fcaff
Added missing copy() in ConnectionSet.
tanyaveksler Mar 19, 2023
d58118c
Added missing copy() in ConnectionSet.
tanyaveksler Mar 19, 2023
61bcee2
Merge branch 'Optimized_HC_set' of https://github.com/IBM/network-con…
tanyaveksler Mar 19, 2023
52b3ec9
When running with -opt=debug, printing the original results of Connec…
tanyaveksler Mar 19, 2023
e38aff1
Made cleaner interface of ConectivityCube class, using __setitem__, _…
tanyaveksler Mar 21, 2023
f5f579e
explain connectivity
shmfr Mar 21, 2023
5013659
Made cleaner interface of ConectivityCube class, using __setitem__, _…
tanyaveksler Mar 21, 2023
90bbcee
explain connectivity
shmfr Mar 21, 2023
4119c29
Fixed lint error.
tanyaveksler Mar 21, 2023
9fef3ce
Small fix
tanyaveksler Mar 21, 2023
072701d
merge with HC branch
shmfr Mar 21, 2023
e59169f
Added documentation and small code beautifications.
tanyaveksler Mar 21, 2023
26904f8
Improved documentation.
tanyaveksler Mar 21, 2023
3aa9f52
Small fix.
tanyaveksler Mar 21, 2023
4797f3c
Moved empty dimension values to DimensionsManager.
tanyaveksler Mar 21, 2023
484bf2a
Moved empty dimension values to DimensionsManager.
tanyaveksler Mar 21, 2023
c221c3b
Update nca/CoreDS/ConnectivityProperties.py
tanyaveksler Mar 21, 2023
2cdb462
Update nca/CoreDS/ConnectivityProperties.py
tanyaveksler Mar 21, 2023
a6d62ff
Update nca/CoreDS/ConnectivityProperties.py
tanyaveksler Mar 21, 2023
c6ec427
Update nca/CoreDS/ConnectivityProperties.py
tanyaveksler Mar 21, 2023
495ac1e
Update nca/CoreDS/ConnectivityProperties.py
tanyaveksler Mar 21, 2023
1d952db
Update nca/CoreDS/ConnectivityProperties.py
tanyaveksler Mar 21, 2023
6e956bb
Fixed small errors.
tanyaveksler Mar 21, 2023
80613a8
Update nca/CoreDS/ConnectivityProperties.py
tanyaveksler Mar 21, 2023
df3afe1
Update nca/CoreDS/ConnectivityProperties.py
tanyaveksler Mar 21, 2023
380d379
Update nca/CoreDS/ConnectivityProperties.py
tanyaveksler Mar 21, 2023
70f1280
Update nca/CoreDS/ConnectivityProperties.py
tanyaveksler Mar 21, 2023
62bc9b9
Update nca/CoreDS/ConnectivityProperties.py
tanyaveksler Mar 21, 2023
ce3cbda
Update nca/Parsers/CalicoPolicyYamlParser.py
tanyaveksler Mar 21, 2023
66fecd8
Fixed lint errors.
tanyaveksler Mar 21, 2023
7d6a08c
Removed base_peer_set from ConnectivityProperties and ConnectivityCub…
tanyaveksler Mar 26, 2023
0aa712d
Merge branch 'master' into Optimized_HC_set
tanyaveksler Mar 26, 2023
c2ccbfa
Removed base_peer_set from ConnectivityProperties and ConnectivityCub…
tanyaveksler Mar 26, 2023
7e2e571
Added check to BasePeerSet.get_peer_interval_of that all peers are tr…
tanyaveksler Mar 26, 2023
cbcba8e
updates after merge with HC branch
shmfr Mar 27, 2023
ead46b3
updates after merge with HC branch
shmfr Mar 27, 2023
9420f5b
after second merge with HC branch
shmfr Mar 27, 2023
760e1da
removed unused function
shmfr Mar 27, 2023
4cc8de2
added some function descriptions
shmfr Mar 27, 2023
7fbc5ca
txt_no_fe_rules format added
shmfr Mar 28, 2023
75846e3
Added OptimizedPolicyConnections class to hold allowed, denied and pa…
tanyaveksler Apr 2, 2023
dca13d5
Fixed lint errors.
tanyaveksler Apr 2, 2023
17a5fe6
Merge branch 'master' into Optimized_HC_set
tanyaveksler Apr 2, 2023
51d8927
The BasePeerSet singleton should be reset in the main (for the cases …
tanyaveksler Apr 2, 2023
835fa33
Added support to calico PASS rules in optimized solution.
tanyaveksler Apr 2, 2023
ebe4006
Added support to calico PASS rules in optimized solution.
tanyaveksler Apr 2, 2023
10bceb8
Simplified calico parsing method to avoid lint error.
tanyaveksler Apr 2, 2023
5dc62e9
handling ipBlocks and base ip range
shmfr Apr 4, 2023
e200ebd
after merge with HC optimization branch
shmfr Apr 4, 2023
2d4f3c0
Merge with master
tanyaveksler Apr 16, 2023
49a4046
Generalized ServiceEntry implementation for optimized solution.
tanyaveksler Apr 16, 2023
736ea07
Fixing lint errors.
tanyaveksler Apr 16, 2023
9db0f91
xml support for explain_all and default-policy fix
shmfr Apr 18, 2023
fc01aa1
merge with HC branch
shmfr Apr 18, 2023
31ff805
Removed unused functions.
tanyaveksler Apr 18, 2023
2604eb6
Separated ConnectivityCube class to its own file.
tanyaveksler Apr 18, 2023
368bb78
Update nca/NetworkConfig/NetworkConfig.py
tanyaveksler Apr 18, 2023
c39f53f
Update nca/Resources/NetworkPolicy.py
tanyaveksler Apr 18, 2023
f5d1581
Added assertions avoiding incorrect comparisons of "src_peers" and "d…
tanyaveksler Apr 18, 2023
ec12351
Update nca/CoreDS/Peer.py
tanyaveksler Apr 18, 2023
9c8ffca
Update nca/CoreDS/ConnectionSet.py
tanyaveksler Apr 18, 2023
310a81d
Update nca/CoreDS/ConnectionSet.py
tanyaveksler Apr 18, 2023
bbee710
merge with HC branch
shmfr Apr 20, 2023
93a8ffc
Added shortcut function ConnectivityProperties.make_conn_props_from_d…
tanyaveksler Apr 23, 2023
e87c432
Merge branch 'master' into Optimized_HC_set
tanyaveksler Apr 23, 2023
e9edad9
Merge remote-tracking branch 'origin/Optimized_HC_set' into Optimized…
tanyaveksler Apr 23, 2023
0cbee6c
Fixed lint errors.
tanyaveksler Apr 23, 2023
2e70105
Code reuse optimization.
tanyaveksler Apr 23, 2023
1a84d7e
Update nca/NetworkConfig/NetworkLayer.py
tanyaveksler Apr 23, 2023
6d92ca7
Update nca/NetworkConfig/NetworkLayer.py
tanyaveksler Apr 23, 2023
21984e1
Update nca/NetworkConfig/NetworkLayer.py
tanyaveksler Apr 23, 2023
fd7bc60
Update nca/NetworkConfig/NetworkLayer.py
tanyaveksler Apr 23, 2023
64e5684
Removed unused functions and imports.
tanyaveksler Apr 23, 2023
f64b019
Merge remote-tracking branch 'origin/Optimized_HC_set' into Optimized…
tanyaveksler Apr 23, 2023
f3eeeba
Making more accurate default all properties, according to all peers i…
tanyaveksler Apr 23, 2023
2a2606b
output_endpoints support.
shmfr Apr 24, 2023
780f0ab
merge with HC
shmfr Apr 24, 2023
99a6b73
support ep modes
shmfr Apr 25, 2023
4f9c0c2
Documentation added
shmfr Apr 25, 2023
8b0e3ac
minor fix
shmfr Apr 25, 2023
802b3fc
use Expl' functions only when activated by user
shmfr Apr 27, 2023
0587e83
some lintings
shmfr Apr 27, 2023
e2d059f
adding html config params
shmfr Apr 30, 2023
7a178b3
merging with upstream
shmfr Apr 30, 2023
8159fb0
integrating SVG, expl and JS code
shmfr May 2, 2023
4e291e5
implemented subgraph with expl into the html generation
shmfr May 4, 2023
98c8bb0
some small fine tunning
shmfr May 4, 2023
230c2f3
some small fine tunning
shmfr May 8, 2023
ee4d341
supporting scheme files
shmfr May 9, 2023
7011930
support only text output formats and '[',']' in peer names
shmfr May 9, 2023
65763bf
merged with master
shmfr May 9, 2023
ea226af
linting
shmfr May 9, 2023
697e8ff
small fixes
shmfr May 11, 2023
70458d7
small fixes
shmfr May 12, 2023
6ba1d4f
adding beautifulsoup4 to requirements
shmfr May 14, 2023
429e653
Merge branch 'master' into explainability_with_HCS
shmfr May 14, 2023
42a7588
small fix
shmfr May 16, 2023
3716922
Merge branch 'explainability_with_HCS' of github.com:IBM/network-conf…
shmfr May 16, 2023
41982ec
use TCP conns when istio layer is present
shmfr May 16, 2023
47389c4
after merge with origin branch
shmfr May 18, 2023
3fa41b6
1. src and dst in different colors - also in expl text. 2. selected i…
shmfr May 23, 2023
ba0a0c4
graph explanations placed in the headline
shmfr May 23, 2023
8504efb
some fixes and improvements.
shmfr May 28, 2023
b39146e
extra line
shmfr May 29, 2023
70a9892
Merge remote-tracking branch 'origin/master' into explainability_with…
shmfr May 29, 2023
f0d1b37
adding test
shmfr May 30, 2023
10f0737
adding test
shmfr May 30, 2023
53e0180
changed 'run_all_tests' so opt parameter can be override by tests
shmfr May 30, 2023
f2c3a22
added expected results
shmfr May 30, 2023
c41fdb3
parsing xml without the need of lxml
shmfr Jun 1, 2023
2c0ac6c
parsing xml without the need of lxml
shmfr Jun 1, 2023
b876100
update expected results (for new xml parser)
shmfr Jun 1, 2023
c0f63da
update expected results and make it deterministic
shmfr Jun 1, 2023
793d935
Merge branch 'master' into explainability_with_HCS
shmfr Jun 4, 2023
a35a860
some fixes and new tests
shmfr Jun 6, 2023
857f9fe
Merge branch 'master' into explainability_with_HCS
shmfr Jun 6, 2023
6941aed
temp support in setting peers from the peer container, till fix will …
shmfr Jun 7, 2023
f3212bf
new expected results
shmfr Jun 7, 2023
53a2963
new expected results
shmfr Jun 7, 2023
89789d9
manually adding tests
shmfr Jun 7, 2023
c0b32de
manually updating test times
shmfr Jun 8, 2023
cd9d28f
fixed some testing env agnostic issues
shmfr Jun 8, 2023
92ce374
better handling of ipblocks and some small fixes.
shmfr Jun 8, 2023
f9d4099
after merge - working html, using xml parser
shmfr Jun 13, 2023
bc96432
lxml added to requirements.txt and setup.cfg
shmfr Jun 14, 2023
1a85599
update expected results due to new xml parser
shmfr Jun 14, 2023
5436aba
some linting fixes
shmfr Jun 14, 2023
d8e0812
dot header fix
shmfr Jun 15, 2023
c402d73
removing explanation for ipblocks
shmfr Jun 20, 2023
d835df7
adding policies in one place
shmfr Jun 20, 2023
b7ceb53
adding some documentations and test
shmfr Jun 20, 2023
895d75d
after merge with master
shmfr Jun 20, 2023
dea4134
updated expected results
shmfr Jun 21, 2023
c4761fc
fixed run_all_tests path problem
shmfr Jun 22, 2023
fd40627
duplicate line removed
shmfr Jun 22, 2023
cef2195
Merge remote-tracking branch 'origin/explainability_with_HCS' into ht…
shmfr Jun 22, 2023
cdaa329
updated testes and some docs.
shmfr Jun 26, 2023
658811e
little better explanation
shmfr Jun 27, 2023
7c6ac51
some small fixes
shmfr Jun 27, 2023
a468689
base_name added
shmfr Jul 3, 2023
224e43b
better documentation for using IP-blocks
shmfr Jul 3, 2023
cae6397
added a ip-block test
shmfr Jul 4, 2023
7dcfc67
base_name check
shmfr Jul 4, 2023
c33d88a
base_name check
shmfr Jul 4, 2023
43f494b
Merge remote-tracking branch 'origin/master' into explainability_with…
shmfr Jul 4, 2023
2a6e68f
base_name and sync
shmfr Jul 4, 2023
f4f7394
after merge with expl branch
shmfr Jul 6, 2023
0f6cec8
empty merge
haim-kermany Dec 5, 2023
e0b70dd
from master
haim-kermany Dec 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@fdcae64e1484d349b3366718cdfef3d404390e85
uses: github/codeql-action/init@6c089f53dd51dc3fc7e599c3cb5356453a52ca9e
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -44,4 +44,4 @@ jobs:
# queries: ./path/to/local/query, your-org/your-repo/queries@main

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@fdcae64e1484d349b3366718cdfef3d404390e85
uses: github/codeql-action/analyze@6c089f53dd51dc3fc7e599c3cb5356453a52ca9e
8 changes: 4 additions & 4 deletions .github/workflows/make-github-and-docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
packages: write
steps:
- name: Check out the repo
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab

- name: Setup NCA environment
uses: ./.github/actions/setup-nca-env
Expand All @@ -31,21 +31,21 @@ jobs:
echo "version=$VERSION" >> $GITHUB_ENV

- name: Log in to Docker Hub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
uses: docker/build-push-action@44ea916f6c540f9302d50c2b1e5a8dc071f15cdf
with:
context: .
push: true
tags: ghcr.io/ibm/nca:${{ env.version }}

- name: Build and push ubi-based Docker image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
uses: docker/build-push-action@44ea916f6c540f9302d50c2b1e5a8dc071f15cdf
with:
context: .
file: Dockerfile.ubi
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/reset-tests-expected-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- uses: ./.github/actions/setup-nca-env
- uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
- uses: dawidd6/action-download-artifact@7132ab516fba5f602fafae6fdd4822afa10db76f
with:
workflow: test-push.yml
workflow_conclusion: completed
name: k8s-log
path: tests/
- uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
- uses: dawidd6/action-download-artifact@7132ab516fba5f602fafae6fdd4822afa10db76f
with:
workflow: test-push.yml
workflow_conclusion: completed
name: calico-log
path: tests/
- uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
- uses: dawidd6/action-download-artifact@7132ab516fba5f602fafae6fdd4822afa10db76f
with:
workflow: test-push.yml
workflow_conclusion: completed
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:

steps:
- name: "Checkout code"
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@483ef80eb98fb506c348f7d62e28055e49fe2398 # v2.3.0
uses: ossf/scorecard-action@80e868c13c90f172d68d1f4501dee99e2479f7af # v2.1.3
with:
results_file: results.sarif
results_format: sarif
Expand All @@ -47,6 +47,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@fdcae64e1484d349b3366718cdfef3d404390e85
uses: github/codeql-action/upload-sarif@6c089f53dd51dc3fc7e599c3cb5356453a52ca9e # v2.1.27
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/update-tests-expected-output.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- uses: ./.github/actions/setup-nca-env
- name: update or add expected output files
run: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/update-tests-expected-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
outputs:
changed_tests: ${{ steps.changes.outputs.changed_tests}}
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
with:
fetch-depth: 0
- uses: ./.github/actions/setup-nca-env
Expand All @@ -28,21 +28,21 @@ jobs:
needs: changed-tests
if: ${{needs.changed-tests.outputs.changed_tests}}
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- uses: ./.github/actions/setup-nca-env
- uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
- uses: dawidd6/action-download-artifact@7132ab516fba5f602fafae6fdd4822afa10db76f
with:
workflow: test-push.yml
workflow_conclusion: completed
name: k8s-log
path: tests/
- uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
- uses: dawidd6/action-download-artifact@7132ab516fba5f602fafae6fdd4822afa10db76f
with:
workflow: test-push.yml
workflow_conclusion: completed
name: calico-log
path: tests/
- uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
- uses: dawidd6/action-download-artifact@7132ab516fba5f602fafae6fdd4822afa10db76f
with:
workflow: test-push.yml
workflow_conclusion: completed
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#

# Using python:3.9-slim
FROM python@sha256:7476637ee33fae24822294643449e7fe9158708c976ea379037960d3007590a4
FROM python@sha256:1fc44d17b4ca49a8715af80786f21fa5ed8cfd257a1e14e24f4a79b4ec329388

COPY requirements.txt /nca/
RUN python -m pip install -U pip wheel setuptools && pip install -r /nca/requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.ubi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache2.0
#

FROM registry.access.redhat.com/ubi8/ubi-minimal@sha256:8d43664c250c72d35af8498c7ff76a9f0d42f16b9b3b29f0caa747121778de0e
FROM registry.access.redhat.com/ubi8/ubi-minimal@sha256:6910799b75ad41f00891978575a0d955be2f800c51b955af73926e7ab59a41c3

USER 0

Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ It takes such resources as input, in addition to a list of relevant endpoints, a
- What are the endpoints that are not covered by any policy?
- Are my policies implemented efficiently?

## Installation (requires Python 3.9 or above)
## Installation (requires Python 3.8 or above)
For command-line use, NCA is installed with:
```shell
pip install network-config-analyzer
Expand Down Expand Up @@ -95,8 +95,6 @@ The arguments to `--resource_list` and to `--base_resource_list` should be one o
*shorthand* `-f`
- `--expected_output <file name>`\
A file path to the expected query output (for connectivity or semantic_diff queries).\
- `--simplify_graph`\
simplify the connectivity graph, (relevant only when output_format is dot or jpg)
- `--pr_url <URL>`\
Write output as GitHub PR comment. URL points to the relevant `comments` resource in the GitHub API.\
e.g., https://api.github.com/repos/shift-left-netconfig/online-boutique/issues/1/comments
Expand Down
1 change: 0 additions & 1 deletion docs/SchemeFileFormat.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ The supported entries in the outputConfiguration object are as follows:
|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|
| outputFormat | Output format specification. | string [ txt / yaml / csv / md / dot / jpg/ txt_no_fw_rules] |
| outputPath | A file path to redirect output into. | string |
| simplifyGraph | Choose if to simplify the connectivity graph. | bool [default: False] |
| outputEndpoints | Choose endpoints type in output. | string [ pods / deployments ] |
| subset | A dict object with the defined subset elements to display in the output | [subset](#subset) object |
| fullExplanation | Choose if to print all counterexamples causing the query result in the output | bool |
Expand Down
15 changes: 6 additions & 9 deletions nca/CoreDS/CanonicalHyperCubeSet.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,23 +541,20 @@ def _contained_in_aux(self, other, all_active_dims): # noqa: C901
common_part = current_layer_0 & other_layer
has_common_part = bool(common_part)
if has_common_part:
# if it's not last dim for both self and other, determine containment recursively
if not self._is_last_dimension() and not other._is_last_dimension() and \
not (self.layers[layer])._contained_in_aux(other_sub_elem, all_active_dims[1:]):
return False
# if it's last dim for self but not for other: the remaining of other should be entire cube
if self._is_last_dimension() and not other._is_last_dimension() and \
not other_sub_elem._is_sub_elem_entire_sub_space():
return False
# if it's the last dim for other but not for self -> containment is satisfied on this part
# at this point, sub-object from common_part is contained
remaining = current_layer_0 - common_part
if remaining:
# continue exploring other's cubes for containment of the remaining part from self
current_layer_0 = remaining
else:
# count current cube (from current_layer_0) as contained in other
is_subset_count += 1
if self._is_last_dimension() and not other._is_last_dimension():
# if it's last dim for self but not for other: the remaining of other should be entire cube
if other_sub_elem._is_sub_elem_entire_sub_space():
is_subset_count += 1
else:
is_subset_count += 1
break
return is_subset_count == len(self.layers)

Expand Down
17 changes: 3 additions & 14 deletions nca/CoreDS/ConnectionSet.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,12 +528,8 @@ def print_diff(self, other, self_name, other_name):
return other_name + ' allows all connections while ' + self_name + ' does not.'
for protocol, properties in self.allowed_protocols.items():
if protocol not in other.allowed_protocols:
res = self_name + ' allows communication using protocol ' + \
ProtocolNameResolver.get_protocol_name(protocol)
if not isinstance(properties, bool) and not properties.is_all():
res += ' on ' + properties._get_first_item_str()
res += ' while ' + other_name + ' does not.'
return res
return self_name + ' allows communication using protocol ' + ProtocolNameResolver.get_protocol_name(protocol) \
+ ' while ' + other_name + ' does not.'
other_properties = other.allowed_protocols[protocol]
if properties != other_properties:
return ProtocolNameResolver.get_protocol_name(protocol) + ' protocol - ' + \
Expand Down Expand Up @@ -585,9 +581,8 @@ def get_non_tcp_connections():
# get rid of ConnectionSet and move the code below to ConnectivityProperties.py

@staticmethod
def get_connection_set_and_peers_from_cube(the_cube, peer_container,
def get_connection_set_and_peers_from_cube(conn_cube, peer_container,
relevant_protocols=ProtocolSet(True)):
conn_cube = the_cube.copy()
src_peers = conn_cube["src_peers"] or peer_container.get_all_peers_group(True)
conn_cube.unset_dim("src_peers")
dst_peers = conn_cube["dst_peers"] or peer_container.get_all_peers_group(True)
Expand Down Expand Up @@ -662,10 +657,6 @@ def split_peer_set_to_fw_rule_elements(peer_set, cluster_info):
res.append(FWRule.IPBlockElement(peer))
peer_set_copy.remove(peer)
continue
elif isinstance(peer, FWRule.DNSEntry):
res.append(FWRule.DNSElement(peer))
peer_set_copy.remove(peer)
continue
ns_peers = PeerSet(cluster_info.ns_dict[peer.namespace])
if ns_peers.issubset(peer_set_copy):
ns_set.add(peer.namespace)
Expand All @@ -689,8 +680,6 @@ def fw_rules_to_conn_props(fw_rules, peer_container):
:return: the resulting ConnectivityProperties.
"""
res = ConnectivityProperties.make_empty_props()
if fw_rules.fw_rules_map is None:
return res
for fw_rules_list in fw_rules.fw_rules_map.values():
for fw_rule in fw_rules_list:
conn_props = fw_rule.conn.convert_to_connectivity_properties(peer_container)
Expand Down
13 changes: 1 addition & 12 deletions nca/CoreDS/ConnectivityProperties.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def get_cube_dict(self, cube, is_txt=False):
values_list = str(dim_values)
elif dim in ["src_peers", "dst_peers"]:
peers_set = BasePeerSet().get_peer_set_by_indices(dim_values)
peers_str_list = sorted([str(peer.full_name()) for peer in peers_set])
peers_str_list = [str(peer.full_name()) for peer in peers_set]
values_list = ','.join(peers_str_list) if is_txt else peers_str_list
elif dim_type == DimensionsManager.DimensionType.IntervalSet:
values_list = dim_values.get_interval_set_list_numbers_and_ranges()
Expand Down Expand Up @@ -491,14 +491,3 @@ def are_auto_conns(self):
if cube[src_peers_index] != cube[dst_peers_index] or not cube[src_peers_index].is_single_value():
return False
return True

def props_without_auto_conns(self):
"""
Return the properties after removing all connections from peer to itself
"""
peers = self.project_on_one_dimension("src_peers") | self.project_on_one_dimension("dst_peers")
auto_conns = ConnectivityProperties()
for peer in peers:
auto_conns |= ConnectivityProperties.make_conn_props_from_dict({"src_peers": PeerSet({peer}),
"dst_peers": PeerSet({peer})})
return self - auto_conns
6 changes: 2 additions & 4 deletions nca/CoreDS/Peer.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,17 +662,15 @@ def get_ip_block_canonical_form(self):
res |= elem
return res

def filter_ip_blocks_by_mask(self, ip_blocks_mask):
def filter_ipv6_blocks(self, ip_blocks_mask):
"""
Update ip blocks in the peer set by keeping only parts overlapping with the given mask.
:param IpBlock ip_blocks_mask: the mask according to which ip blocks should be updated
:param ip_blocks_mask: the mask according to which ip blocks should be updated
"""
peers_to_remove = []
peers_to_add = []
for peer in self:
if isinstance(peer, IpBlock):
if peer.contained_in(ip_blocks_mask):
continue # optimization - avoid removing and adding the same peer
peers_to_remove.append(peer)
if peer.overlaps(ip_blocks_mask):
new_peer = peer.copy()
Expand Down
Loading
Loading