Exemple #1
0
    def test_get_windows_acl_data_dir(self):
        """
        Ensure that directory ACL data for Windows is returned.
        """

        output = FileMetaDataModularInput.get_windows_acl_data("../src/bin")

        self.assertEqual(output["owner_sid"][0:5], "S-1-5")
        self.assertEqual(output["group_sid"][0:5], "S-1-5")
        self.assertEqual(output["ace_0_type"], ["ACCESS_ALLOWED"])
        self.assertGreaterEqual(output["ace_0_permissions"].index("READ_CONTROL"), 0)
Exemple #2
0
    def test_get_windows_acl_data_file(self):
        """
        Ensure that file ACL data for Windows is returned.
        """

        output = FileMetaDataModularInput.get_windows_acl_data("../src/bin/file_meta_data.py")

        self.assertEqual(output["owner_sid"][0:5], "S-1-5")
        self.assertEqual(output["group_sid"][0:5], "S-1-5")
        self.assertEqual(output["ace_0_type"], ["ACCESS_ALLOWED"])
        self.assertGreaterEqual(output["ace_0_permissions"].index("FILE_GENERIC_READ"), 0)
Exemple #3
0
    def test_get_windows_acl_data_dir(self):
        """
        Ensure that directory ACL data for Windows is returned.
        """

        output = FileMetaDataModularInput.get_windows_acl_data("../src/bin")

        self.assertEqual(output["owner_sid"][0:5], "S-1-5")
        self.assertEqual(output["group_sid"][0:5], "S-1-5")
        self.assertEqual(output["ace_0_type"], ["ACCESS_ALLOWED"])
        self.assertGreaterEqual(
            output["ace_0_permissions"].index("READ_CONTROL"), 0)
Exemple #4
0
    def test_get_windows_acl_data_file(self):
        """
        Ensure that file ACL data for Windows is returned.
        """

        output = FileMetaDataModularInput.get_windows_acl_data(
            "../src/bin/file_meta_data.py")

        self.assertEqual(output["owner_sid"][0:5], "S-1-5")
        self.assertEqual(output["group_sid"][0:5], "S-1-5")
        self.assertEqual(output["ace_0_type"], ["ACCESS_ALLOWED"])
        self.assertGreaterEqual(
            output["ace_0_permissions"].index("FILE_GENERIC_READ"), 0)