Skip to content

Commit

Permalink
changing version number naming scheme and bugfix for 32bit python
Browse files Browse the repository at this point in the history
  • Loading branch information
SethHollandsworth committed Mar 29, 2023
1 parent ff303d1 commit 69e7970
Show file tree
Hide file tree
Showing 18 changed files with 228 additions and 158 deletions.
4 changes: 3 additions & 1 deletion src/confcom/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ azext_confcom/bin/*
**/dmverity-vhd
# metadata file for coverage reports
**/.coverage
**/htmlcov
**/htmlcov
# temporary files for version numbers
**/svn_api
5 changes: 5 additions & 0 deletions src/confcom/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/confcom/azext_confcom/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 := [...]

Expand Down
4 changes: 4 additions & 0 deletions src/confcom/azext_confcom/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 2 additions & 2 deletions src/confcom/azext_confcom/data/customer_rego_policy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/confcom/azext_confcom/data/internal_config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.2.13",
"version": "0.2.14",
"hcsshim_config": {
"maxVersion": "1.0.0",
"minVersion": "0.0.1"
Expand Down Expand Up @@ -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"
]
Expand Down
5 changes: 2 additions & 3 deletions src/confcom/azext_confcom/data/sidecar_rego_policy.txt
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions src/confcom/azext_confcom/rootfs_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


host_os = platform.system()
arch = platform.architecture()[0]
machine = platform.machine()


class SecurityPolicyProxy: # pylint: disable=too-few-public-methods
Expand All @@ -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.")
Expand Down
6 changes: 4 additions & 2 deletions src/confcom/azext_confcom/security_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"
Expand Down Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions src/confcom/azext_confcom/template_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/confcom/azext_confcom/tests/latest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/confcom/azext_confcom/tests/latest/test_confcom_arm.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/confcom/azext_confcom/tests/latest/test_confcom_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def setUpClass(cls):
cls.aci_policy = aci_policy

def test_image_policy(self):
expected_policy = "cGFja2FnZSBwb2xpY3kKCmltcG9ydCBmdXR1cmUua2V5d29yZHMuZXZlcnkKaW1wb3J0IGZ1dHVyZS5rZXl3b3Jkcy5pbgoKYXBpX3N2biA6PSAiMC4xMC4wIgpmcmFtZXdvcmtfc3ZuIDo9ICIwLjEuMCIKCmZyYWdtZW50cyA6PSBbCiAgewogICAgImZlZWQiOiAibWNyLm1pY3Jvc29mdC5jb20vYWNpL2FjaS1jYy1pbmZyYS1mcmFnbWVudCIsCiAgICAiaW5jbHVkZXMiOiBbCiAgICAgICJjb250YWluZXJzIgogICAgXSwKICAgICJpc3N1ZXIiOiAiZGlkOng1MDk6MDpzaGEyNTY6SV9faXVMMjVvWEVWRmRUUF9hQkx4X2VUMVJQSGJDUV9FQ0JRZllacHQ5czo6ZWt1OjEuMy42LjEuNC4xLjMxMS43Ni41OS4xLjMiLAogICAgIm1pbmltdW1fc3ZuIjogIjEuMC4wIgogIH0KXQoKY29udGFpbmVycyA6PSBbeyJhbGxvd19lbGV2YXRlZCI6dHJ1ZSwiYWxsb3dfc3RkaW9fYWNjZXNzIjp0cnVlLCJjb21tYW5kIjpbInB5dGhvbjMiXSwiZW52X3J1bGVzIjpbeyJwYXR0ZXJuIjoiUEFUSD0vdXNyL2xvY2FsL2JpbjovdXNyL2xvY2FsL3NiaW46L3Vzci9sb2NhbC9iaW46L3Vzci9zYmluOi91c3IvYmluOi9zYmluOi9iaW4iLCJyZXF1aXJlZCI6ZmFsc2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YS5mcmFtZXdvcmsubG9hZF9mcmFnbWVudApzY3JhdGNoX21vdW50IDo9IGRhdGEuZnJhbWV3b3JrLnNjcmF0Y2hfbW91bnQKc2NyYXRjaF91bm1vdW50IDo9IGRhdGEuZnJhbWV3b3JrLnNjcmF0Y2hfdW5tb3VudAoKcmVhc29uIDo9IHsiZXJyb3JzIjogZGF0YS5mcmFtZXdvcmsuZXJyb3JzfQ=="

# deep diff the output policies from the regular policy.json and the ARM template
aci_policy_str = self.aci_policy.get_serialized_output()
Expand All @@ -49,7 +49,7 @@ def setUpClass(cls):
cls.aci_policy = aci_policy

def test_sidecar_image_policy(self):
expected_policy = "cGFja2FnZSBtaWNyb3NvZnRjb250YWluZXJpbnN0YW5jZQoKc3ZuIDo9ICIxLjAuMCIKYXBpX3N2biA6PSAiMC4xMC4wIgpmcmFtZXdvcmtfc3ZuIDo9ICIwLjEuMCIKCmNvbnRhaW5lcnMgOj0gW3siYWxsb3dfZWxldmF0ZWQiOnRydWUsImFsbG93X3N0ZGlvX2FjY2VzcyI6dHJ1ZSwiY29tbWFuZCI6WyIvbW91bnRfYXp1cmVfZmlsZS5zaCJdLCJlbnZfcnVsZXMiOlt7InBhdHRlcm4iOiJQQVRIPS91c3IvbG9jYWwvc2JpbjovdXNyL2xvY2FsL2JpbjovdXNyL3NiaW46L3Vzci9iaW46L3NiaW46L2JpbiIsInJlcXVpcmVkIjpmYWxzZSwic3RyYXRlZ3kiOiJzdHJpbmcifV0sImV4ZWNfcHJvY2Vzc2VzIjpbXSwiaWQiOiJtY3IubWljcm9zb2Z0LmNvbS9hY2kvYXRsYXMtbW91bnQtYXp1cmUtZmlsZS12b2x1bWU6bWFzdGVyXzIwMjAxMjEwLjIiLCJsYXllcnMiOlsiNjA2ZmQ2YmFmNWViMWE3MWZkMjg2YWVhMjk2NzJhMDZiZmU1NWYwMDA3ZGVkOTJlZTczMTQyYTM3NTkwZWQxOSIsIjNhZDFhMmZmNGE0NGJjODYwYjNjZDAyN2NjODZj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iYWY1ZWIxYTcxZmQyODZhZWEyOTY3MmEwNmJmZTU1ZjAwMDdkZWQ5MmVlNzMxNDJhMzc1OTBlZDE5IiwiM2FkMWEyZmY0YTQ0YmM4NjBiM2NkMDI3Y2M4NmNlNDVhMzk5YzRjOTk1YzM2ZTk4MDBjNTM2OGNiNzI3YTdlMSIsImIxY2ZjMzBmMzdmMDhlNjA2NjhkYjNmNzE2MDY5N2IxOWQyYWQ0NWIxMmYwNzUxODg1Mjk5MzczNjE2YTZlMGEiLCJlZjM2NDg0NmM4ZjFmNDNkMTRkMmUzZTc5MTlhMDY0YjBjODI1NTNjMDhiMzU0MjJmNWQxZjA3YzM0MzViNDYyIiwiNTgyZmUzOWJkMzU5MDliYWY2YzQwMzY3MzRlMjBmNzY2MzkxYmE4MzcyN2ZiMWQ2ODNiZTA0NWZlNDUzYjVhZiIsImFhYzlmYjQwNDI1OGMwNjlhZTg1MzgyMzY0ZjVkMmJhMWQ0MDUxOGM2YjFmNTZhZGU2YmMyMmYzMDI4ZWFmZjAiXSwibW91bnRzIjpbXSwic2lnbmFscyI6W10sIndvcmtpbmdfZGlyIjoiLyJ9XQ=="
aci_policy_str = self.aci_policy.get_serialized_output()

self.assertEqual(aci_policy_str, expected_policy)
Expand Down
Loading

0 comments on commit 69e7970

Please sign in to comment.