-
Notifications
You must be signed in to change notification settings - Fork 21
feat(importer): add generic firewall import #4923
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
Open
Y4nnikH
wants to merge
7
commits into
CactuseSecurity:develop
Choose a base branch
from
Y4nnikH:feat/generic-firewall-import
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9d0b8b4
feat(importer): add generic firewall import
Y4nnikH c892e06
feat: version as v9.1.18
Y4nnikH 60b924f
fix(db): wrong ids in upgrade script
Y4nnikH 343fb38
fix(importer): generic fw import issues
Y4nnikH 5d7573f
Merge branch 'develop' into feat/generic-firewall-import
Y4nnikH cf009d5
update version
Y4nnikH a486110
docs: update revision history
Y4nnikH File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| INSERT INTO stm_dev_typ (dev_typ_id,dev_typ_name,dev_typ_version,dev_typ_manufacturer,dev_typ_predef_svc,dev_typ_is_multi_mgmt,dev_typ_is_mgmt,is_pure_routing_device) | ||
| VALUES | ||
| (30, 'Generic Firewall Management', '1.0', null, '', false, true, false), | ||
| (31, 'Generic Firewall Gateway', '1.0', null, '', false, false, false) | ||
| ON CONFLICT (dev_typ_id) DO NOTHING; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
23 changes: 23 additions & 0 deletions
23
roles/importer/files/importer/fw_modules/generic/fwcommon.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| from fwo_log import FWOLogger | ||
| from model_controllers.fwconfigmanagerlist_controller import FwConfigManagerListController | ||
| from model_controllers.import_state_controller import ImportStateController | ||
| from models.fw_common import FwCommon | ||
|
|
||
|
|
||
| class GenericFirewallCommon(FwCommon): | ||
| def get_config( | ||
| self, config_in: FwConfigManagerListController, import_state: ImportStateController | ||
| ) -> tuple[int, FwConfigManagerListController]: | ||
|
|
||
| return get_config(config_in, import_state) | ||
|
|
||
|
|
||
| def get_config( | ||
| config_in: FwConfigManagerListController, _import_state: ImportStateController | ||
| ) -> tuple[int, FwConfigManagerListController]: | ||
| FWOLogger.debug("starting generic/get_config") | ||
|
|
||
| if config_in.has_empty_config() or config_in.contains_only_native(): | ||
| raise ValueError("Generic firewall import requires a normalized config as input.") | ||
|
|
||
| return 0, config_in |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.