Skip to content

Add Netbox automation#32

Merged
scoopex merged 45 commits into
mainfrom
netbox
Nov 25, 2024
Merged

Add Netbox automation#32
scoopex merged 45 commits into
mainfrom
netbox

Conversation

@matofeder matofeder marked this pull request as draft July 30, 2024 06:46
@matofeder matofeder force-pushed the netbox branch 4 times, most recently from a745752 to 03520a4 Compare August 5, 2024 11:32
@matofeder matofeder force-pushed the netbox branch 13 times, most recently from c0bb68e to d61431f Compare August 14, 2024 13:07
@matofeder matofeder force-pushed the netbox branch 8 times, most recently from 3d37aca to 4045b3d Compare August 20, 2024 07:59
@matofeder matofeder force-pushed the netbox branch 3 times, most recently from 163f7bc to 74a2ca8 Compare August 22, 2024 13:34
matofeder and others added 23 commits November 18, 2024 14:30
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Signed-off-by: Marc Schöchlin <schoechlin@osb-alliance.com>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Signed-off-by: Marc Schöchlin <schoechlin@osb-alliance.com>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Signed-off-by: Marc Schöchlin <schoechlin@osb-alliance.com>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
* refactor group lookup
* add documentation
* add timeout and connections close

Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
- fix security groups problem
- add script execution

Signed-off-by: Marc Schöchlin <schoechlin@osb-alliance.com>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Co-authored-by: Marc Schöchlin <schoechlin@osb-alliance.com>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
* enhance quotas

Signed-off-by: Marc Schöchlin <schoechlin@osb-alliance.com>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Signed-off-by: Marc Schöchlin <schoechlin@osb-alliance.com>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Signed-off-by: Marc Schöchlin <schoechlin@osb-alliance.com>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
self.assign_role_to_user("manager")
LOGGER.info(
f"Created user {self.obj.name} / {self.obj.id} with password {self.obj.password} in {self.domain.name}")
f"Created user {self.obj.name} / {self.obj.id} with password {self.obj.password} in {domain_ident(self.domain.id)}")

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information

This expression logs [sensitive data (password)](1) as clear text.

Copilot Autofix

AI over 1 year ago

To fix the problem, we need to remove the logging of sensitive information, specifically the user password. Instead of logging the password, we can log a message that indicates the user was created without including the sensitive details. This change should be made in the create_and_get_user method of the SCSLandscapeTestUser class.

We will replace the line that logs the password with a line that logs a message indicating the user was created, without including the password. This change will ensure that sensitive information is not exposed in the logs.

Suggested changeset 1
misc/manage/lib/landscape.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/misc/manage/lib/landscape.py b/misc/manage/lib/landscape.py
--- a/misc/manage/lib/landscape.py
+++ b/misc/manage/lib/landscape.py
@@ -95,3 +95,3 @@
         LOGGER.info(
-            f"Created user {self.obj.name} / {self.obj.id} with password {self.obj.password} in {domain_ident(self.domain.id)}")
+            f"Created user {self.obj.name} / {self.obj.id} in {domain_ident(self.domain.id)}")
         return self.obj
EOF
@@ -95,3 +95,3 @@
LOGGER.info(
f"Created user {self.obj.name} / {self.obj.id} with password {self.obj.password} in {domain_ident(self.domain.id)}")
f"Created user {self.obj.name} / {self.obj.id} in {domain_ident(self.domain.id)}")
return self.obj
Copilot is powered by AI and may make mistakes. Always verify output.
matofeder and others added 4 commits November 18, 2024 14:31
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
Signed-off-by: Matej Feder <matej.feder@dnation.cloud>
@scoopex
Copy link
Copy Markdown
Contributor

scoopex commented Nov 25, 2024

To ensure that this documentation can be found or that this MVP can be continued at a later date, it would be good to link this documentation on the documentation page.

In @maxwolfs 's and my opinion, we add a ‘Concepts’ section below https://docs.scs.community/contributor-docs where we add this documentation as a menu item ‘Netbox SONiC Provisioning’.

See: SovereignCloudStack/docs#274

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automate deployment and management of SONiC switches in utilizing Netbox as source of truth

4 participants