From 69e7970effd33a5230cf5e6b6c3e47e65272c42e Mon Sep 17 00:00:00 2001 From: Seth Hollandsworth Date: Wed, 29 Mar 2023 11:23:18 -0400 Subject: [PATCH] changing version number naming scheme and bugfix for 32bit python --- src/confcom/.gitignore | 4 +- src/confcom/HISTORY.rst | 5 + src/confcom/azext_confcom/README.md | 4 +- src/confcom/azext_confcom/config.py | 4 + .../data/customer_rego_policy.txt | 4 +- .../azext_confcom/data/internal_config.json | 4 +- .../data/sidecar_rego_policy.txt | 5 +- src/confcom/azext_confcom/rootfs_proxy.py | 8 +- src/confcom/azext_confcom/security_policy.py | 6 +- src/confcom/azext_confcom/template_util.py | 1 + .../azext_confcom/tests/latest/README.md | 1 + .../tests/latest/test_confcom_arm.py | 10 +- .../tests/latest/test_confcom_image.py | 4 +- .../tests/latest/test_confcom_scenario.py | 21 +- .../tests/latest/test_confcom_tar.py | 32 +-- src/confcom/samples/sample-policy-output.rego | 222 +++++++++--------- .../samples/sample-template-output.json | 2 +- src/confcom/setup.py | 49 +++- 18 files changed, 228 insertions(+), 158 deletions(-) diff --git a/src/confcom/.gitignore b/src/confcom/.gitignore index d60f4d0f18a..9c952235ed4 100644 --- a/src/confcom/.gitignore +++ b/src/confcom/.gitignore @@ -29,4 +29,6 @@ azext_confcom/bin/* **/dmverity-vhd # metadata file for coverage reports **/.coverage -**/htmlcov \ No newline at end of file +**/htmlcov +# temporary files for version numbers +**/svn_api \ No newline at end of file diff --git a/src/confcom/HISTORY.rst b/src/confcom/HISTORY.rst index 770f05f1382..f9a73ca86a7 100644 --- a/src/confcom/HISTORY.rst +++ b/src/confcom/HISTORY.rst @@ -2,6 +2,11 @@ Release History =============== +0.2.14 +* changing the name of api_svn and framework_svn to api_version and framework_version +* changing fragment versions to an integer instead of semver +* bugfix for allowing 32bit python on a 64bit OS + 0.2.13 * fixing bug where you could not pull by sha value if a tag was not specified * fixing error message when attempting to use sha value with tar files diff --git a/src/confcom/azext_confcom/README.md b/src/confcom/azext_confcom/README.md index c0399d99173..c4ee55482d5 100644 --- a/src/confcom/azext_confcom/README.md +++ b/src/confcom/azext_confcom/README.md @@ -225,8 +225,8 @@ Below is an example rego policy: import future.keywords.every import future.keywords.in - api_svn := "0.10.0" - framework_svn := "0.1.0" + api_version := "0.10.0" + framework_version := "0.1.0" fragments := [...] diff --git a/src/confcom/azext_confcom/config.py b/src/confcom/azext_confcom/config.py index c6a1b8be4d1..854f7176748 100644 --- a/src/confcom/azext_confcom/config.py +++ b/src/confcom/azext_confcom/config.py @@ -132,5 +132,9 @@ SIDECAR_REGO_FILE = "./data/sidecar_rego_policy.txt" SIDECAR_REGO_FILE_PATH = f"{script_directory}/{SIDECAR_REGO_FILE}" SIDECAR_REGO_POLICY = os_util.load_str_from_file(SIDECAR_REGO_FILE_PATH) +# api svn file +SVN_API_FILE = "./data/svn_api" +SVN_API_PATH = f"{script_directory}/{SVN_API_FILE}" +SVN_API_VERSION = os_util.load_str_from_file(SVN_API_PATH) # default containers to be added to all container groups DEFAULT_CONTAINERS = _config["default_containers"] diff --git a/src/confcom/azext_confcom/data/customer_rego_policy.txt b/src/confcom/azext_confcom/data/customer_rego_policy.txt index 0268a8ea999..c8dcc4b8962 100644 --- a/src/confcom/azext_confcom/data/customer_rego_policy.txt +++ b/src/confcom/azext_confcom/data/customer_rego_policy.txt @@ -3,8 +3,8 @@ package policy import future.keywords.every import future.keywords.in -api_svn := "0.10.0" -framework_svn := "0.1.0" +api_version := %s +framework_version := "0.2.3" fragments := %s diff --git a/src/confcom/azext_confcom/data/internal_config.json b/src/confcom/azext_confcom/data/internal_config.json index 5c29558af2f..b949cfa107c 100644 --- a/src/confcom/azext_confcom/data/internal_config.json +++ b/src/confcom/azext_confcom/data/internal_config.json @@ -1,5 +1,5 @@ { - "version": "0.2.13", + "version": "0.2.14", "hcsshim_config": { "maxVersion": "1.0.0", "minVersion": "0.0.1" @@ -173,7 +173,7 @@ { "issuer": "did:x509:0:sha256:I__iuL25oXEVFdTP_aBLx_eT1RPHbCQ_ECBQfYZpt9s::eku:1.3.6.1.4.1.311.76.59.1.3", "feed": "mcr.microsoft.com/aci/aci-cc-infra-fragment", - "minimum_svn": "1.0.0", + "minimum_svn": "1", "includes": [ "containers" ] diff --git a/src/confcom/azext_confcom/data/sidecar_rego_policy.txt b/src/confcom/azext_confcom/data/sidecar_rego_policy.txt index fe79034b5da..be39ded50b2 100644 --- a/src/confcom/azext_confcom/data/sidecar_rego_policy.txt +++ b/src/confcom/azext_confcom/data/sidecar_rego_policy.txt @@ -1,7 +1,6 @@ package microsoftcontainerinstance -svn := "1.0.0" -api_svn := "0.10.0" -framework_svn := "0.1.0" +api_version := %s +framework_version := "0.2.3" containers := %s \ No newline at end of file diff --git a/src/confcom/azext_confcom/rootfs_proxy.py b/src/confcom/azext_confcom/rootfs_proxy.py index 88ab6025303..56951b25cc4 100644 --- a/src/confcom/azext_confcom/rootfs_proxy.py +++ b/src/confcom/azext_confcom/rootfs_proxy.py @@ -13,7 +13,7 @@ host_os = platform.system() -arch = platform.architecture()[0] +machine = platform.machine() class SecurityPolicyProxy: # pylint: disable=too-few-public-methods @@ -27,11 +27,11 @@ def __init__(self): if host_os == "Linux": pass elif host_os == "Windows": - if arch == "64bit": + if machine.endswith("64"): DEFAULT_LIB += ".exe" else: - raise NotImplementedError( - f"The current architecture {arch} for windows is not supported." + eprint( + "32-bit Windows is not supported." ) elif host_os == "Darwin": eprint("The extension for MacOS has not been implemented.") diff --git a/src/confcom/azext_confcom/security_policy.py b/src/confcom/azext_confcom/security_policy.py index f928382ac71..18d2d780eb4 100644 --- a/src/confcom/azext_confcom/security_policy.py +++ b/src/confcom/azext_confcom/security_policy.py @@ -51,7 +51,7 @@ class AciPolicy: # pylint: disable=too-many-instance-attributes def __init__( self, deserialized_config: Any, - rego_fragments: Any = config.DEFAULT_REGO_FRAGMENTS, + rego_fragments: Any = copy.deepcopy(config.DEFAULT_REGO_FRAGMENTS), existing_rego_fragments: Any = None, debug_mode: bool = False, disable_stdio: bool = False, @@ -63,6 +63,7 @@ def __init__( self._disable_stdio = disable_stdio self._fragments = rego_fragments self._existing_fragments = existing_rego_fragments + self._api_version = config.SVN_API_VERSION if debug_mode: self._allow_properties_access = config.DEBUG_MODE_SETTINGS.get( "allowPropertiesAccess" @@ -175,8 +176,9 @@ def _add_rego_boilerplate(self, output: str) -> str: # determine if we're outputting for a sidecar or not if self._images[0].get_id() and is_sidecar(self._images[0].get_id()): - return config.SIDECAR_REGO_POLICY % (output) + return config.SIDECAR_REGO_POLICY % (pretty_print_func(self._api_version), output) return config.CUSTOMER_REGO_POLICY % ( + pretty_print_func(self._api_version), pretty_print_func(self._fragments), output, pretty_print_func(self._allow_properties_access), diff --git a/src/confcom/azext_confcom/template_util.py b/src/confcom/azext_confcom/template_util.py index 275c0d982d0..665953812bf 100644 --- a/src/confcom/azext_confcom/template_util.py +++ b/src/confcom/azext_confcom/template_util.py @@ -355,6 +355,7 @@ def compare_containers(container1, container2) -> Dict[str, Any]: diff = deepdiff.DeepDiff( container1, container2, + ignore_order=True, ) # cast to json using built-in function in deepdiff so there's safe translation # e.g. a type will successfully cast to string diff --git a/src/confcom/azext_confcom/tests/latest/README.md b/src/confcom/azext_confcom/tests/latest/README.md index 41ea57a2208..27a7bd518f1 100644 --- a/src/confcom/azext_confcom/tests/latest/README.md +++ b/src/confcom/azext_confcom/tests/latest/README.md @@ -60,6 +60,7 @@ test_allow_elevated | python:3.6.14-slim-buster | Using allow_elevated in contai test_image_layers_python | python:3.6.14-slim-buster | Make sure image layers are as expected test_image_layers_rust | rust:1.52.1 | Make sure image layers are as expected with different image test_docker_pull | rust:1.52.1 | Test pulling an image from docker client +test_infrastructure_svn | rust:1.52.1 | make sure the correct infrastructure_svn is present in the policy test_stdio_access_default | python:3.6.14-slim-buster | Checking the default value for std I/O access test_stdio_access_updated | python:3.6.14-slim-buster | Checking the value for std I/O when it's set test_environment_variables_parsing | mcr.microsoft.com/azuredocs/aci-dataprocessing-cc:v1 | Make sure env vars are output in the right format diff --git a/src/confcom/azext_confcom/tests/latest/test_confcom_arm.py b/src/confcom/azext_confcom/tests/latest/test_confcom_arm.py index bc54a58f5cd..8cae3eaaeb6 100644 --- a/src/confcom/azext_confcom/tests/latest/test_confcom_arm.py +++ b/src/confcom/azext_confcom/tests/latest/test_confcom_arm.py @@ -1816,17 +1816,17 @@ class PolicyGeneratingArmInfrastructureSvn(unittest.TestCase): @classmethod def setUpClass(cls): cls.aci_arm_policy = load_policy_from_arm_template_str( - cls.custom_arm_json, "", infrastructure_svn="2.0.0" + cls.custom_arm_json, "", infrastructure_svn="2" )[0] cls.aci_arm_policy.populate_policy_content_for_all_images() def test_update_infrastructure_svn(self): - expected_policy = "cGFja2FnZSBwb2xpY3kKCmltcG9ydCBmdXR1cmUua2V5d29yZHMuZXZlcnkKaW1wb3J0IGZ1dHVyZS5rZXl3b3Jkcy5pbgoKYXBpX3N2biA6PSAiMC4xMC4wIgpmcmFtZXdvcmtfc3ZuIDo9ICIwLjEuMCIKCmZyYWdtZW50cyA6PSBbCiAgewogICAgImZlZWQiOiAibWNyLm1pY3Jvc29mdC5jb20vYWNpL2FjaS1jYy1pbmZyYS1mcmFnbWVudCIsCiAgICAiaW5jbHVkZXMiOiBbCiAgICAgICJjb250YWluZXJzIgogICAgXSwKICAgICJpc3N1ZXIiOiAiZGlkOng1MDk6MDpzaGEyNTY6SV9faXVMMjVvWEVWRmRUUF9hQkx4X2VUMVJQSGJDUV9FQ0JRZllacHQ5czo6ZWt1OjEuMy42LjEuNC4xLjMxMS43Ni41OS4xLjMiLAogICAgIm1pbmltdW1fc3ZuIjogIjIuMC4wIgogIH0KXQoKY29udGFpbmVycyA6PSBbeyJhbGxvd19lbGV2YXRlZCI6dHJ1ZSwiYWxsb3dfc3RkaW9fYWNjZXNzIjp0cnVlLCJjb21tYW5kIjpbInB5dGhvbjMiXSwiZW52X3J1bGVzIjpbeyJwYXR0ZXJuIjoiUEFUSD0vdXNyL2xvY2FsL2JpbjovdXNyL2xvY2FsL3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XkKdW5tb3VudF9vdmVybGF5IDo9IGRhdGEuZnJhbWV3b3JrLnVubW91bnRfb3ZlcmxheQpjcmVhdGVfY29udGFpbmVyIDo9IGRhdGEuZnJhbWV3b3JrLmNyZWF0ZV9jb250YWluZXIKZXhlY19pbl9jb250YWluZXIgOj0gZGF0YS5mcmFtZXdvcmsuZXhlY19pbl9jb250YWluZXIKZXhlY19leHRlcm5hbCA6PSBkYXRhLmZyYW1ld29yay5leGVjX2V4dGVybmFsCnNodXRkb3duX2NvbnRhaW5lciA6PSBkYXRhLmZyYW1ld29yay5zaHV0ZG93bl9jb250YWluZXIKc2lnbmFsX2NvbnRhaW5lcl9wcm9jZXNzIDo9IGRhdGEuZnJhbWV3b3JrLnNpZ25hbF9jb250YWluZXJfcHJvY2VzcwpwbGFuOV9tb3VudCA6PSBkYXRhLmZyYW1ld29yay5wbGFuOV9tb3VudApwbGFuOV91bm1vdW50IDo9IGRhdGEuZnJhbWV3b3JrLnBsYW45X3VubW91bnQKZ2V0X3Byb3BlcnRpZXMgOj0gZGF0YS5mcmFtZXdvcmsuZ2V0X3Byb3BlcnRpZXMKZHVtcF9zdGFja3MgOj0gZGF0YS5mcmFtZXdvcmsuZHVtcF9zdGFja3MKcnVudGltZV9sb2dnaW5nIDo9IGRhdGEuZnJhbWV3b3JrLnJ1bnRpbWVfbG9nZ2luZwpsb2FkX2ZyYWdtZW50IDo9IGRhdGEuZnJhbWV3b3JrLmxvYWRfZnJhZ21lbnQKc2NyYXRjaF9tb3VudCA6PSBkYXRhLmZyYW1ld29yay5zY3JhdGNoX21vdW50CnNjcmF0Y2hfdW5tb3VudCA6PSBkYXRhLmZyYW1ld29yay5zY3JhdGNoX3VubW91bnQKCnJlYXNvbiA6PSB7ImVycm9ycyI6IGRhdGEuZnJhbWV3b3JrLmVycm9yc30=" self.assertEqual(expected_policy, self.aci_arm_policy.get_serialized_output()) self.assertEqual( - "2.0.0", + "2", self.aci_arm_policy._fragments[0][ config.POLICY_FIELD_CONTAINERS_ELEMENTS_REGO_FRAGMENTS_MINIMUM_SVN ], @@ -2006,8 +2006,8 @@ def test_multiple_policies(self): output2 = self.aci_policy2.get_serialized_output() self.assertTrue(output1 != output2) - expected_output1 = "cGFja2FnZSBwb2xpY3kKCmltcG9ydCBmdXR1cmUua2V5d29yZHMuZXZlcnkKaW1wb3J0IGZ1dHVyZS5rZXl3b3Jkcy5pbgoKYXBpX3N2biA6PSAiMC4xMC4wIgpmcmFtZXdvcmtfc3ZuIDo9ICIwLjEuMCIKCmZyYWdtZW50cyA6PSBbCiAgewogICAgImZlZWQiOiAibWNyLm1pY3Jvc29mdC5jb20vYWNpL2FjaS1jYy1pbmZyYS1mcmFnbWVudCIsCiAgICAiaW5jbHVkZXMiOiBbCiAgICAgICJjb250YWluZXJzIgogICAgXSwKICAgICJpc3N1ZXIiOiAiZGlkOng1MDk6MDpzaGEyNTY6SV9faXVMMjVvWEVWRmRUUF9hQkx4X2VUMVJQSGJDUV9FQ0JRZllacHQ5czo6ZWt1OjEuMy42LjEuNC4xLjMxMS43Ni41OS4xLjMiLAogICAgIm1pbmltdW1fc3ZuIjogIjEuMC4wIgogIH0KXQoKY29udGFpbmVycyA6PSBbeyJhbGxvd19lbGV2YXRlZCI6dHJ1ZSwiYWxsb3dfc3RkaW9fYWNjZXNzIjp0cnVlLCJjb21tYW5kIjpbImJhc2giXSwiZW52X3J1bGVzIjpbeyJwYXR0ZXJuIjoiUEFUSD0vY3VzdG9taXplZC9wYXRoL3ZhbHVlIiwicmVxdWlyZWQiOmZhbHNlLCJzdHJhdGVneSI6InN0cmluZyJ9LHsicGF0dGVybiI6IlRFU1RfUkVHRVhQX0VOVj10ZXN0X3JlZ2V4cF9lbnYiLCJyZXF1aXJlZCI6ZmFsc2UsInN0cmF0ZWd5Ijoic3RyaW5nIn0seyJwYXR0ZXJuIjoiUlVTVFVQX0hPTUU9L3Vzci9sb2NhbC9ydXN0dXAiLCJyZXF1aXJlZCI6ZmFsc2UsInN0cmF0ZWd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mZyYW1ld29yay5leGVjX2luX2NvbnRhaW5lcgpleGVjX2V4dGVybmFsIDo9IGRhdGEuZnJhbWV3b3JrLmV4ZWNfZXh0ZXJuYWwKc2h1dGRvd25fY29udGFpbmVyIDo9IGRhdGEuZnJhbWV3b3JrLnNodXRkb3duX2NvbnRhaW5lcgpzaWduYWxfY29udGFpbmVyX3Byb2Nlc3MgOj0gZGF0YS5mcmFtZXdvcmsuc2lnbmFsX2NvbnRhaW5lcl9wcm9jZXNzCnBsYW45X21vdW50IDo9IGRhdGEuZnJhbWV3b3JrLnBsYW45X21vdW50CnBsYW45X3VubW91bnQgOj0gZGF0YS5mcmFtZXdvcmsucGxhbjlfdW5tb3VudApnZXRfcHJvcGVydGllcyA6PSBkYXRhLmZyYW1ld29yay5nZXRfcHJvcGVydGllcwpkdW1wX3N0YWNrcyA6PSBkYXRhLmZyYW1ld29yay5kdW1wX3N0YWNrcwpydW50aW1lX2xvZ2dpbmcgOj0gZGF0YS5mcmFtZXdvcmsucnVudGltZV9sb2dnaW5nCmxvYWRfZnJhZ21lbnQgOj0gZGF0YS5mcmFtZXdvcmsubG9hZF9mcmFnbWVudApzY3JhdGNoX21vdW50IDo9IGRhdGEuZnJhbWV3b3JrLnNjcmF0Y2hfbW91bnQKc2NyYXRjaF91bm1vdW50IDo9IGRhdGEuZnJhbWV3b3JrLnNjcmF0Y2hfdW5tb3VudAoKcmVhc29uIDo9IHsiZXJyb3JzIjogZGF0YS5mcmFtZXdvcmsuZXJyb3JzfQ==" self.assertEqual(output1, expected_output1) self.assertEqual(output2, expected_output2) diff --git a/src/confcom/azext_confcom/tests/latest/test_confcom_image.py b/src/confcom/azext_confcom/tests/latest/test_confcom_image.py index b1ae7646402..9fe463227d1 100644 --- a/src/confcom/azext_confcom/tests/latest/test_confcom_image.py +++ b/src/confcom/azext_confcom/tests/latest/test_confcom_image.py @@ -29,7 +29,7 @@ def setUpClass(cls): cls.aci_policy = aci_policy def test_image_policy(self): - expected_policy = "cGFja2Fn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tZXdvcmsubW91bnRfb3ZlcmxheQp1bm1vdW50X292ZXJsYXkgOj0gZGF0YS5mcmFtZXdvcmsudW5tb3VudF9vdmVybGF5CmNyZWF0ZV9jb250YWluZXIgOj0gZGF0YS5mcmFtZXdvcmsuY3JlYXRlX2NvbnRhaW5lcgpleGVjX2luX2NvbnRhaW5lciA6PSBkYXRhLmZyYW1ld29yay5leGVjX2luX2NvbnRhaW5lcgpleGVjX2V4dGVybmFsIDo9IGRhdGEuZnJhbWV3b3JrLmV4ZWNfZXh0ZXJuYWwKc2h1dGRvd25fY29udGFpbmVyIDo9IGRhdGEuZnJhbWV3b3JrLnNodXRkb3duX2NvbnRhaW5lcgpzaWduYWxfY29udGFpbmVyX3Byb2Nlc3MgOj0gZGF0YS5mcmFtZXdvcmsuc2lnbmFsX2NvbnRhaW5lcl9wcm9jZXNzCnBsYW45X21vdW50IDo9IGRhdGEuZnJhbWV3b3JrLnBsYW45X21vdW50CnBsYW45X3VubW91bnQgOj0gZGF0YS5mcmFtZXdvcmsucGxhbjlfdW5tb3VudApnZXRfcHJvcGVydGllcyA6PSBkYXRhLmZyYW1ld29yay5nZXRfcHJvcGVydGllcwpkdW1wX3N0YWNrcyA6PSBkYXRhLmZyYW1ld29yay5kdW1wX3N0YWNrcwpydW50aW1lX2xvZ2dpbmcgOj0gZGF0YS5mcmFtZXdvcmsucnVudGltZV9sb2dnaW5nCmxvYWRfZnJhZ21lbnQgOj0gZGF0YS5mcmFtZXdvcmsubG9hZF9mcmFnbWVudApzY3JhdGNoX21vdW50IDo9IGRhdGEuZnJhbWV3b3JrLnNjcmF0Y2hfbW91bnQKc2NyYXRjaF91bm1vdW50IDo9IGRhdGEuZnJhbWV3b3JrLnNjcmF0Y2hfdW5tb3VudAoKcmVhc29uIDo9IHsiZXJyb3JzIjogZGF0YS5mcmFtZXdvcmsuZXJyb3JzfQ==" # deep diff the output policies from the regular policy.json and the ARM template aci_policy_str = self.aci_policy.get_serialized_output() @@ -49,7 +49,7 @@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kMTRkMmUzZTc5MTlhMDY0YjBjODI1NTNjMDhiMzU0MjJmNWQxZjA3YzM0MzViNDYyIiwiNTgyZmUzOWJkMzU5MDliYWY2YzQwMzY3MzRlMjBmNzY2MzkxYmE4MzcyN2ZiMWQ2ODNiZTA0NWZlNDUzYjVhZiIsImFhYzlmYjQwNDI1OGMwNjlhZTg1MzgyMzY0ZjVkMmJhMWQ0MDUxOGM2YjFmNTZhZGU2YmMyMmYzMDI4ZWFmZjAiXSwibW91bnRzIjpbXSwic2lnbmFscyI6W10sIndvcmtpbmdfZGlyIjoiLyJ9XQ==" aci_policy_str = self.aci_policy.get_serialized_output() self.assertEqual(aci_policy_str, expected_policy) diff --git a/src/confcom/azext_confcom/tests/latest/test_confcom_scenario.py b/src/confcom/azext_confcom/tests/latest/test_confcom_scenario.py index d2fd2c292f7..9713cdfbcd2 100644 --- a/src/confcom/azext_confcom/tests/latest/test_confcom_scenario.py +++ b/src/confcom/azext_confcom/tests/latest/test_confcom_scenario.py @@ -276,7 +276,7 @@ def test_injected_sidecar_container_msi(self): image = self.aci_policy.get_images()[0] self.assertEqual(image.base, "mcr.microsoft.com/aci/msi-atlas-adapter") self.assertIsNotNone(image) - + self.maxDiff = None expected_workingdir = "/root/" self.assertEqual(image._workingDir, expected_workingdir) @@ -568,6 +568,25 @@ def test_docker_pull(self): "sha256:83ac22b6cf50c51a1d11b3220316be73271e59d30a65f33f4391dc4cfabdc856", ) + def test_infrastructure_svn(self): + custom_json = """ + { + "version": "1.0", + "containers": [ + { + "containerImage": "rust:1.52.1", + "environmentVariables": [], + "command": ["echo", "hello"] + } + ] + } + """ + with load_policy_from_str(custom_json) as aci_policy: + aci_policy.populate_policy_content_for_all_images() + output = aci_policy.get_serialized_output(OutputType.PRETTY_PRINT) + + self.assertTrue('"0.2.3"' in output) + def test_environment_variables_parsing(self): custom_json = """ { diff --git a/src/confcom/azext_confcom/tests/latest/test_confcom_tar.py b/src/confcom/azext_confcom/tests/latest/test_confcom_tar.py index af75d819790..263438c4171 100644 --- a/src/confcom/azext_confcom/tests/latest/test_confcom_tar.py +++ b/src/confcom/azext_confcom/tests/latest/test_confcom_tar.py @@ -29,10 +29,8 @@ def setUpClass(cls) -> None: path = os.path.dirname(__file__) image_path = os.path.join(path, "./nginx.tar") - tar_mapping_file = {"nginx:1.22": image_path} - cls.path = path - cls.tar_mapping_file = tar_mapping_file + cls.image_path = image_path def test_arm_template_with_parameter_file_clean_room_tar(self): @@ -173,17 +171,17 @@ def test_arm_template_with_parameter_file_clean_room_tar(self): # save the tar file for the image in the testing directory client = docker.from_env() image = client.images.get("nginx:1.22") - + tar_mapping_file = {"nginx:1.22": self.image_path} # Note: Class setup and teardown shouldn't have side effects, and reading from the tar file fails when all the tests are running in parallel, so we want to save and delete this tar file as a part of the test. Not as a part of the testing class. f = open(self.image_path, "wb") for chunk in image.save(named=True): f.write(chunk) f.close() client.close() - + tar_mapping_file = {"nginx:1.22": self.image_path} try: clean_room_image.populate_policy_content_for_all_images( - tar_mapping=self.tar_mapping_file + tar_mapping=tar_mapping_file ) except: raise AccContainerError("Could not get image from tar file") @@ -392,22 +390,22 @@ def test_arm_template_mixed_mode_tar(self): # save the tar file for the image in the testing directory client = docker.from_env() image = client.images.get("nginx:1.22") - + image_path = self.image_path + "2" # Note: Class setup and teardown shouldn't have side effects, and reading from the tar file fails when all the tests are running in parallel, so we want to save and delete this tar file as a part of the test. Not as a part of the testing class. - f = open(self.image_path, "wb") + f = open(image_path, "wb") for chunk in image.save(named=True): f.write(chunk) f.close() client.close() - + tar_mapping_file = {"nginx:1.22": image_path} try: clean_room_image.populate_policy_content_for_all_images( - tar_mapping=self.tar_mapping_file + tar_mapping=tar_mapping_file ) finally: # delete the tar file - if os.path.isfile(self.image_path): - os.remove(self.image_path) + if os.path.isfile(image_path): + os.remove(image_path) regular_image_json = json.loads( regular_image.get_serialized_output(output_type=OutputType.RAW, use_json=True) @@ -571,7 +569,9 @@ def test_arm_template_with_parameter_file_clean_room_tar_invalid(self): image = client.images.get("nginx:1.23") # Note: Class setup and teardown shouldn't have side effects, and reading from the tar file fails when all the tests are running in parallel, so we want to save and delete this tar file as a part of the test. Not as a part of the testing class. - f = open(self.image_path, "wb") + image_path = self.image_path + "3" + tar_mapping_file = {"nginx:1.22": image_path} + f = open(image_path, "wb") for chunk in image.save(named=True): f.write(chunk) f.close() @@ -579,15 +579,15 @@ def test_arm_template_with_parameter_file_clean_room_tar_invalid(self): try: clean_room_image.populate_policy_content_for_all_images( - tar_mapping=self.tar_mapping_file + tar_mapping=tar_mapping_file ) raise AccContainerError("getting image should fail") except: pass finally: # delete the tar file - if os.path.isfile(self.image_path): - os.remove(self.image_path) + if os.path.isfile(image_path): + os.remove(image_path) def test_clean_room_fake_tar_invalid(self): custom_arm_json_default_value = """ diff --git a/src/confcom/samples/sample-policy-output.rego b/src/confcom/samples/sample-policy-output.rego index a4ab429abef..dc4d4717cde 100644 --- a/src/confcom/samples/sample-policy-output.rego +++ b/src/confcom/samples/sample-policy-output.rego @@ -3,190 +3,200 @@ package policy import future.keywords.every import future.keywords.in -api_svn := "0.10.0" -framework_svn := "0.1.0" - -fragments := [ - { - "feed": "mcr.microsoft.com/aci/aci-cc-infra-fragment", - "includes": [ - "containers" - ], - "issuer": "did:x509:0:sha256:I__iuL25oXEVFdTP_aBLx_eT1RPHbCQ_ECBQfYZpt9s::eku:1.3.6.1.4.1.311.76.59.1.3", - "minimum_svn": "1.0.0" - } -] +api_version := "0.10.0" + +framework_version := "0.2.3" + +fragments := [{ + "feed": "mcr.microsoft.com/aci/aci-cc-infra-fragment", + "includes": ["containers"], + "issuer": "did:x509:0:sha256:I__iuL25oXEVFdTP_aBLx_eT1RPHbCQ_ECBQfYZpt9s::eku:1.3.6.1.4.1.311.76.59.1.3", + "minimum_svn": 1, +}] containers := [ { - "allow_elevated":true, - "allow_stdio_access":true, - "command":[ - "bash" - ], - "env_rules":[ + "allow_elevated": true, + "allow_stdio_access": true, + "command": ["bash"], + "env_rules": [ { - "pattern":"PATH=/customized/path/value", - "required":false, - "strategy":"string" + "pattern": "PATH=/customized/path/value", + "required": false, + "strategy": "string", }, { - "pattern":"TEST_REGEXP_ENV=test_regexp_env", - "required":false, - "strategy":"string" + "pattern": "TEST_REGEXP_ENV=test_regexp_env", + "required": false, + "strategy": "string", }, { - "pattern":"RUSTUP_HOME=/usr/local/rustup", - "required":false, - "strategy":"string" + "pattern": "RUSTUP_HOME=/usr/local/rustup", + "required": false, + "strategy": "string", }, { - "pattern":"CARGO_HOME=/usr/local/cargo", - "required":false, - "strategy":"string" + "pattern": "CARGO_HOME=/usr/local/cargo", + "required": false, + "strategy": "string", }, { - "pattern":"RUST_VERSION=1.52.1", - "required":false, - "strategy":"string" + "pattern": "RUST_VERSION=1.52.1", + "required": false, + "strategy": "string", }, { - "pattern":"TERM=xterm", - "required":false, - "strategy":"string" + "pattern": "TERM=xterm", + "required": false, + "strategy": "string", }, { - "pattern":"((?i)FABRIC)_.+=.+", - "required":false, - "strategy":"re2" + "pattern": "((?i)FABRIC)_.+=.+", + "required": false, + "strategy": "re2", }, { - "pattern":"HOSTNAME=.+", - "required":false, - "strategy":"re2" + "pattern": "HOSTNAME=.+", + "required": false, + "strategy": "re2", }, { - "pattern":"T(E)?MP=.+", - "required":false, - "strategy":"re2" + "pattern": "T(E)?MP=.+", + "required": false, + "strategy": "re2", }, { - "pattern":"FabricPackageFileName=.+", - "required":false, - "strategy":"re2" + "pattern": "FabricPackageFileName=.+", + "required": false, + "strategy": "re2", }, { - "pattern":"HostedServiceName=.+", - "required":false, - "strategy":"re2" + "pattern": "HostedServiceName=.+", + "required": false, + "strategy": "re2", }, { - "pattern":"IDENTITY_API_VERSION=.+", - "required":false, - "strategy":"re2" + "pattern": "IDENTITY_API_VERSION=.+", + "required": false, + "strategy": "re2", }, { - "pattern":"IDENTITY_HEADER=.+", - "required":false, - "strategy":"re2" + "pattern": "IDENTITY_HEADER=.+", + "required": false, + "strategy": "re2", }, { - "pattern":"IDENTITY_SERVER_THUMBPRINT=.+", - "required":false, - "strategy":"re2" + "pattern": "IDENTITY_SERVER_THUMBPRINT=.+", + "required": false, + "strategy": "re2", }, { - "pattern":"azurecontainerinstance_restarted_by=.+", - "required":false, - "strategy":"re2" - } + "pattern": "azurecontainerinstance_restarted_by=.+", + "required": false, + "strategy": "re2", + }, ], - "exec_processes":[], - "id":"rust:1.52.1", - "layers":[ + "exec_processes": [], + "id": "rust:1.52.1", + "layers": [ "fe84c9d5bfddd07a2624d00333cf13c1a9c941f3a261f13ead44fc6a93bc0e7a", "4dedae42847c704da891a28c25d32201a1ae440bce2aecccfa8e6f03b97a6a6c", "41d64cdeb347bf236b4c13b7403b633ff11f1cf94dbc7cf881a44d6da88c5156", "eb36921e1f82af46dfe248ef8f1b3afb6a5230a64181d960d10237a08cd73c79", "e769d7487cc314d3ee748a4440805317c19262c7acd2fdbdb0d47d2e4613a15c", - "1b80f120dbd88e4355d6241b519c3e25290215c469516b49dece9cf07175a766" + "1b80f120dbd88e4355d6241b519c3e25290215c469516b49dece9cf07175a766", ], - "mounts":[ + "mounts": [ { - "destination":"/mount/azurefile", - "options":[ + "destination": "/mount/azurefile", + "options": [ "rbind", "rshared", - "rw" + "rw", ], - "source":"sandbox:///tmp/atlas/azureFileVolume/.+", - "type":"bind" + "source": "sandbox:///tmp/atlas/azureFileVolume/.+", + "type": "bind", }, { - "destination":"/etc/resolv.conf", - "options":[ + "destination": "/etc/resolv.conf", + "options": [ "rbind", "rshared", - "rw" + "rw", ], - "source":"sandbox:///tmp/atlas/resolvconf/.+", - "type":"bind" - } + "source": "sandbox:///tmp/atlas/resolvconf/.+", + "type": "bind", + }, ], - "signals":[], - "working_dir":"/" + "signals": [], + "working_dir": "/", }, { - "allow_elevated":false, - "allow_stdio_access":true, - "command":[ - "/pause" - ], - "env_rules":[ + "allow_elevated": false, + "allow_stdio_access": true, + "command": ["/pause"], + "env_rules": [ { - "pattern":"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", - "required":true, - "strategy":"string" + "pattern": "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "required": true, + "strategy": "string", }, { - "pattern":"TERM=xterm", - "required":false, - "strategy":"string" - } - ], - "exec_processes":[], - "layers":[ - "16b514057a06ad665f92c02863aca074fd5976c755d26bff16365299169e8415" + "pattern": "TERM=xterm", + "required": false, + "strategy": "string", + }, ], - "mounts":[], - "signals":[], - "working_dir":"/" - } + "exec_processes": [], + "layers": ["16b514057a06ad665f92c02863aca074fd5976c755d26bff16365299169e8415"], + "mounts": [], + "signals": [], + "working_dir": "/", + }, ] allow_properties_access := false + allow_dump_stacks := false + allow_runtime_logging := false -allow_environment_variable_dropping := true -allow_unencrypted_scratch := false +allow_environment_variable_dropping := true +allow_unencrypted_scratch := false mount_device := data.framework.mount_device + unmount_device := data.framework.unmount_device + mount_overlay := data.framework.mount_overlay + unmount_overlay := data.framework.unmount_overlay + create_container := data.framework.create_container + exec_in_container := data.framework.exec_in_container + exec_external := data.framework.exec_external + shutdown_container := data.framework.shutdown_container + signal_container_process := data.framework.signal_container_process + plan9_mount := data.framework.plan9_mount + plan9_unmount := data.framework.plan9_unmount + get_properties := data.framework.get_properties + dump_stacks := data.framework.dump_stacks + runtime_logging := data.framework.runtime_logging + load_fragment := data.framework.load_fragment + scratch_mount := data.framework.scratch_mount + scratch_unmount := data.framework.scratch_unmount + reason := {"errors": data.framework.errors} diff --git a/src/confcom/samples/sample-template-output.json b/src/confcom/samples/sample-template-output.json index 4473d563fef..0200a99875f 100644 --- a/src/confcom/samples/sample-template-output.json +++ b/src/confcom/samples/sample-template-output.json @@ -13,7 +13,7 @@ "location": "[resourceGroup().location]", "properties": { "confidentialComputeProperties": { - "ccePolicy": "cGFja2FnZSBwb2xpY3kKCmltcG9ydCBmdXR1cmUua2V5d29yZHMuZXZlcnkKaW1wb3J0IGZ1dHVyZS5rZXl3b3Jkcy5pbgoKYXBpX3N2biA6PSAiMC4xMC4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dvcmsuZ2V0X3Byb3BlcnRpZXMKZHVtcF9zdGFja3MgOj0gZGF0YS5mcmFtZXdvcmsuZHVtcF9zdGFja3MKcnVudGltZV9sb2dnaW5nIDo9IGRhdGEuZnJhbWV3b3JrLnJ1bnRpbWVfbG9nZ2luZwpsb2FkX2ZyYWdtZW50IDo9IGRhdGEuZnJhbWV3b3JrLmxvYWRfZnJhZ21lbnQKc2NyYXRjaF9tb3VudCA6PSBkYXRhLmZyYW1ld29yay5zY3JhdGNoX21vdW50CnNjcmF0Y2hfdW5tb3VudCA6PSBkYXRhLmZyYW1ld29yay5zY3JhdGNoX3VubW91bnQKCnJlYXNvbiA6PSB7ImVycm9ycyI6IGRhdGEuZnJhbWV3b3JrLmVycm9yc30=" }, "containers": [ { diff --git a/src/confcom/setup.py b/src/confcom/setup.py index 364ebd90b65..4e5663c168e 100644 --- a/src/confcom/setup.py +++ b/src/confcom/setup.py @@ -21,7 +21,7 @@ # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = "0.2.13" +VERSION = "0.2.14" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers @@ -47,17 +47,44 @@ if not os.path.exists(bin_folder): os.makedirs(bin_folder) -exe_path = dir_path + "/bin/dmverity-vhd.exe" -if not os.path.exists(exe_path): - r = requests.get("https://github.com/microsoft/hcsshim/releases/download/v0.10.0-rc.6/dmverity-vhd.exe") - with open(exe_path, "wb") as f: - f.write(r.content) +data_folder = dir_path + "/data/" +if not os.path.exists(data_folder): + os.makedirs(data_folder) -bin_path = dir_path + "/bin/dmverity-vhd" -if not os.path.exists(bin_path): - r = requests.get("https://github.com/microsoft/hcsshim/releases/download/v0.10.0-rc.6/dmverity-vhd") - with open(bin_path, "wb") as f: - f.write(r.content) +# get the most recent release artifacts from github +r = requests.get("https://api.github.com/repos/microsoft/hcsshim/releases") +# list the artifacts from each release +bin_flag = False +exe_flag = False +for release in r.json(): + # these should be newest to oldest + for asset in release["assets"]: + # download the file if it contains dmverity-vhd + if "dmverity-vhd" in asset["name"]: + if "exe" in asset["name"]: + exe_flag = True + else: + bin_flag = True + # get the download url for the dmverity-vhd file + exe_url = asset["browser_download_url"] + # download the file + r = requests.get(exe_url) + # save the file to the bin folder + with open(bin_folder + asset["name"], "wb") as f: + f.write(r.content) + # break out of the loop if we have both files + if bin_flag and exe_flag: + # get the download url for the dmverity-vhd file + api_svn_url = release["html_url"] + # update the url to get framework svn file + api_svn_url = api_svn_url.replace("releases/tag", "raw") + api_svn_url += "/pkg/securitypolicy/svn_api" + # download the file + r = requests.get(api_svn_url) + # save the file to the data folder + with open(data_folder + "svn_api", "wb") as f: + f.write(r.content) + break with open("README.md", "r", encoding="utf-8") as f: README = f.read()