Skip to content

Commit

Permalink
- Renamed the Foundation Core Python package.
Browse files Browse the repository at this point in the history
  - Renamed the Foundation Metadata Core (Python) package.
  - Renamed the Foundation Encryption Policy (Python) package.
  - Renamed the Extensions Encryption Vault Python package.
  - Renamed the Extensions Data Delivery Spark (Python) package.
  - Renamed all the child directories, classes, and methods.
  - Corrected all the imports inside of the velocity templates to ensure a successful build of the Foundation Core Python.
  - Baton migration scripts for automated migrations from legacy package names to the new aiSSEMBLE landscape.
  • Loading branch information
habibimoiz committed Jun 25, 2024
1 parent 74a1eeb commit 64a2336
Show file tree
Hide file tree
Showing 116 changed files with 840 additions and 196 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ USER 1001
RUN mkdir -p /deployments/krausening/
COPY target/dockerbuild/*.jar /deployments/

COPY ./src/main/resources/truststore/aiops-secure.jks /deployments/
COPY ./src/main/resources/krausening/base/aiops-security.properties /deployments/krausening/
COPY ./src/main/resources/truststore/aissemble-secure.jks /deployments/
COPY ./src/main/resources/krausening/base/aissemble-security.properties /deployments/krausening/
COPY ./src/main/resources/authorization/policies/test-policy.xml /deployments/
COPY ./src/main/resources/authorization/attributes/test-attributes.json /deployments/
COPY ./src/main/resources/authorization/pdp.xml /deployments/
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# This software package is licensed under the Booz Allen Public License. All Rights Reserved.
# #L%
###
token.issuer=aiops.authority
private.key.alias=aiopskey
keystore.file.location=/deployments/aiops-secure.jks
token.issuer=aissemble.authority
private.key.alias=aissemblekey
keystore.file.location=/deployments/aissemble-secure.jks
attribute.definition.location=/deployments/
pdp.configuration.location=/deployments/pdp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The following example illustrates how to perform encryption.
#### VaultRemoteEncryptionStrategy
```
# Uses remote Vault encryption
from aiops_encrypt.vault_remote_encryption_strategy import VaultRemoteEncryptionStrategy
from aissemble_encrypt.vault_remote_encryption_strategy import VaultRemoteEncryptionStrategy
vault_remote = VaultRemoteEncryptionStrategy()
Expand All @@ -39,7 +39,7 @@ The following example illustrates how to perform encryption.
#### VaultLocalEncryptionStrategy
```
# Uses an encryption key retrieved from the Vault server, but performs the encryption locally.
from aiops_encrypt.vault_local_encryption_strategy import VaultLocalEncryptionStrategy
from aissemble_encrypt.vault_local_encryption_strategy import VaultLocalEncryptionStrategy
vault_local = VaultLocalEncryptionStrategy()
Expand All @@ -53,7 +53,7 @@ The following example illustrates how to perform encryption.
#### AesCbcEncryptionStrategy
```
# Uses the AES CBC encryption
from aiops_encrypt.aes_cbc_encryption_strategy import AesCbcEncryptionStrategy
from aissemble_encrypt.aes_cbc_encryption_strategy import AesCbcEncryptionStrategy
aes_cbc = AesCbcEncryptionStrategy()
Expand All @@ -67,7 +67,7 @@ The following example illustrates how to perform encryption.
#### AesGcm96EncryptionStrategy
```
# AES GCM encryption with a 96 bit initialization vector (same algorithm as Vault)
from aiops_encrypt.aes_gcm_96_encryption_strategy import AesGcm96EncryptionStrategy
from aissemble_encrypt.aes_gcm_96_encryption_strategy import AesGcm96EncryptionStrategy
aes_gcm_96 = AesGcm96EncryptionStrategy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "Vault data encryption classes (python)"
authors = ["aiSSEMBLE Baseline Community <aissemble@bah.com>"]
readme = "README.md"
packages = [
{include = "aiops_encrypt", from="src"}
{include = "aissemble_encrypt", from="src"}
]

[tool.poetry.dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
###
from .strategy_base import StrategyBase
from krausening.logging import LogManager
from aiops_encrypt.aes_cbc_encrypt import AesCbcEncrypt
from aissemble_encrypt.aes_cbc_encrypt import AesCbcEncrypt


class AesCbcEncryptionStrategy(StrategyBase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
###
from .strategy_base import StrategyBase
from krausening.logging import LogManager
from aiops_encrypt.aes_gcm_96_encrypt import AesGcm96Encrypt
from aissemble_encrypt.aes_gcm_96_encrypt import AesGcm96Encrypt


class AesGcm96EncryptionStrategy(StrategyBase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import os
from krausening.logging import LogManager
import gc
from aiops_encrypt.vault_key_util import VaultKeyUtil
from aiops_encrypt.vault_config import VaultConfig
from aissemble_encrypt.vault_key_util import VaultKeyUtil
from aissemble_encrypt.vault_config import VaultConfig


class VaultEncrypt:
Expand Down Expand Up @@ -66,7 +66,7 @@ def encrypt(self, data: str):
Uses the Vault encryption service to encrypt data
"""
encrypt_data_response = self.__client.secrets.transit.encrypt_data(
name="aiopskey",
name="aissemblekey",
plaintext=self.base64_encode(data),
)

Expand Down Expand Up @@ -104,7 +104,7 @@ def decrypt(self, encrypted_data: str):
Uses the Vault service to decrypt data
"""
decrypt_data_response = self.__client.secrets.transit.decrypt_data(
name="aiopskey",
name="aissemblekey",
ciphertext=encrypted_data,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import base64
from krausening.logging import LogManager
import gc
from aiops_encrypt.vault_config import VaultConfig
from aissemble_encrypt.vault_config import VaultConfig


class VaultKeyUtil:
Expand Down Expand Up @@ -57,7 +57,7 @@ def __init__(self, key_version: str):

def __get_key_export(self, key_version="latest"):
export_key_response = self.__client.secrets.transit.export_key(
name="aiopskey",
name="aissemblekey",
key_type="encryption-key",
version=key_version,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
###
from .strategy_base import StrategyBase
from krausening.logging import LogManager
from aiops_encrypt.vault_encrypt import VaultEncrypt
from aissemble_encrypt.vault_encrypt import VaultEncrypt


class VaultLocalEncryptionStrategy(StrategyBase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
###
from .strategy_base import StrategyBase
from krausening.logging import LogManager
from aiops_encrypt.vault_encrypt import VaultEncrypt
from aissemble_encrypt.vault_encrypt import VaultEncrypt


class VaultRemoteEncryptionStrategy(StrategyBase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from krausening.logging import LogManager
from container.safe_docker_container import SafeDockerContainer
from testcontainers.core.waiting_utils import wait_for
from aiops_encrypt.vault_config import VaultConfig
from aissemble_encrypt.vault_config import VaultConfig
from importlib import metadata
import packaging.version
import platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@
use_step_matcher,
)
import nose.tools as nt
from aiops_encrypt.aes_cbc_encryption_strategy import AesCbcEncryptionStrategy
from aiops_encrypt.aes_gcm_96_encryption_strategy import AesGcm96EncryptionStrategy
from aiops_encrypt.vault_remote_encryption_strategy import VaultRemoteEncryptionStrategy
from aiops_encrypt.vault_local_encryption_strategy import VaultLocalEncryptionStrategy
from aiops_encrypt.vault_key_util import VaultKeyUtil
from aissemble_encrypt.aes_cbc_encryption_strategy import AesCbcEncryptionStrategy
from aissemble_encrypt.aes_gcm_96_encryption_strategy import AesGcm96EncryptionStrategy
from aissemble_encrypt.vault_remote_encryption_strategy import (
VaultRemoteEncryptionStrategy,
)
from aissemble_encrypt.vault_local_encryption_strategy import (
VaultLocalEncryptionStrategy,
)
from aissemble_encrypt.vault_key_util import VaultKeyUtil
from krausening.logging import LogManager
from json import dumps

Expand Down
10 changes: 5 additions & 5 deletions foundation/aissemble-foundation-core-python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ description = "Core classes for supporting concepts (alerting, metadata, etc) th
authors = ["aiSSEMBLE Baseline Community <aissemble@bah.com>"]
readme = "README.md"
packages = [
{include = "aiops_core_bom", from = "src"},
{include = "aiops_core_config", from = "src"},
{include = "aiops_core_filestore", from = "src"},
{include = "aiops_core_metadata", from = "src"},
{include = "aiopsauth", from = "src"},
{include = "aissemble_core_bom", from = "src"},
{include = "aissemble_core_config", from = "src"},
{include = "aissemble_core_filestore", from = "src"},
{include = "aissemble_core_metadata", from = "src"},
{include = "aissembleauth", from = "src"},
{include = "inference", from = "src"},
{include = "policy_manager", from = "src"}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# #%L
# AIOps Foundation::AIOps Core (Python)
# aiSSEMBLE Foundation::aiSSEMBLE Core (Python)
# %%
# Copyright (C) 2021 Booz Allen
# %%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# #%L
# AIOps Foundation::AIOps Core (Python)
# aiSSEMBLE Foundation::aiSSEMBLE Core (Python)
# %%
# Copyright (C) 2021 Booz Allen
# %%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# #%L
# AIOps Foundation::AIOps Core (Python)
# aiSSEMBLE Foundation::aiSSEMBLE Core (Python)
# %%
# Copyright (C) 2021 Booz Allen
# %%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# #%L
# AIOps Foundation::AIOps Core (Python)
# aiSSEMBLE Foundation::aiSSEMBLE Core (Python)
# %%
# Copyright (C) 2021 Booz Allen
# %%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# #%L
# AIOps Foundation::AIOps Core (Python)
# aiSSEMBLE Foundation::aiSSEMBLE Core (Python)
# %%
# Copyright (C) 2021 Booz Allen
# %%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# #%L
# AIOps Foundation::AIOps Core (Python)
# aiSSEMBLE Foundation::aiSSEMBLE Core (Python)
# %%
# Copyright (C) 2021 Booz Allen
# %%
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
###
# #%L
# aiSSEMBLE Foundation::aiSSEMBLE Core (Python)
# %%
# Copyright (C) 2021 Booz Allen
# %%
# This software package is licensed under the Booz Allen Public License. All Rights Reserved.
# #L%
###
from krausening.properties import PropertyManager


class SparkRDBMSConfig:
"""
Configurations for PySpark Relational Database Management System support.
"""

DEFAULT_JDBC_URL = "jdbc:postgresql://postgres:5432/db"
DEFAULT_JDBC_DRIVER = "org.postgresql.Driver"
DEFAULT_USER = "postgres"
DEFAULT_PASSWORD = "password"

def __init__(self):
self.properties = PropertyManager.get_instance().get_properties(
"spark-rdbms.properties"
)

def jdbc_url(self):
"""
The JDBC URL for the database connection.
"""
return self.properties.getProperty(
"jdbc.url", SparkRDBMSConfig.DEFAULT_JDBC_URL
)

def jdbc_driver(self):
"""
The JDBC driver class name.
"""
return self.properties.getProperty(
"jdbc.driver", SparkRDBMSConfig.DEFAULT_JDBC_DRIVER
)

def user(self):
"""
The RDBMS user.
"""
return self.properties.getProperty("jdbc.user", SparkRDBMSConfig.DEFAULT_USER)

def password(self):
"""
The password for the RDBMS user.
"""
return self.properties.getProperty(
"jdbc.password", SparkRDBMSConfig.DEFAULT_PASSWORD
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# #%L
# AIOps Foundation::AIOps Core (Python)
# aiSSEMBLE Foundation::aiSSEMBLE Core (Python)
# %%
# Copyright (C) 2021 Booz Allen
# %%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# #%L
# AIOps Foundation::AIOps Core (Python)
# aiSSEMBLE Foundation::aiSSEMBLE Core (Python)
# %%
# Copyright (C) 2021 Booz Allen
# %%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# #%L
# AIOps Foundation::AIOps Core (Python)
# aiSSEMBLE Foundation::aiSSEMBLE Core (Python)
# %%
# Copyright (C) 2021 Booz Allen
# %%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# #%L
# AIOps Foundation::AIOps Core (Python)
# aiSSEMBLE Foundation::aiSSEMBLE Core (Python)
# %%
# Copyright (C) 2021 Booz Allen
# %%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
###
# #%L
# AIOps Foundation::AIOps Core (Python)
# aiSSEMBLE Foundation::aiSSEMBLE Core (Python)
# %%
# Copyright (C) 2021 Booz Allen
# %%
# This software package is licensed under the Booz Allen Public License. All Rights Reserved.
# #L%
###
from krausening.logging import LogManager
from aiops_core_config import MessagingConfig
from aissemble_core_config import MessagingConfig
from .metadata_api import MetadataAPI
from .metadata_model import MetadataModel
from typing import Dict, List
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# #%L
# AIOps Foundation::AIOps Core (Python)
# aiSSEMBLE Foundation::aiSSEMBLE Core (Python)
# %%
# Copyright (C) 2021 Booz Allen
# %%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# #%L
# AIOps Foundation::AIOps Core (Python)
# aiSSEMBLE Foundation::aiSSEMBLE Core (Python)
# %%
# Copyright (C) 2021 Booz Allen
# %%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
###
# #%L
# AIOps Foundation::AIOps Core (Python)
# aiSSEMBLE Foundation::aiSSEMBLE Core (Python)
# %%
# Copyright (C) 2021 Booz Allen
# %%
# This software package is licensed under the Booz Allen Public License. All Rights Reserved.
# #L%
###
from pydantic import BaseModel
from pydantic.main import BaseModel
from datetime import datetime
from typing import Dict
from uuid import uuid4
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# #%L
# AIOps Foundation::AIOps Core (Python)
# aiSSEMBLE Foundation::aiSSEMBLE Core (Python)
# %%
# Copyright (C) 2021 Booz Allen
# %%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###
# #%L
# AIOps Foundation::AIOps Core (Python)
# aiSSEMBLE Foundation::aiSSEMBLE Core (Python)
# %%
# Copyright (C) 2021 Booz Allen
# %%
Expand Down
Loading

0 comments on commit 64a2336

Please sign in to comment.