Comments (7)
Thank you for opening the issue. This issue is cause by a similar problem that occurred in issue #12 .
However, in this instance the OPA error is being thrown because of non-English language characters being interpreted as non-UTF-8 characters.
We'll look into this and follow up.
from scubagear.
@hervecinetic was this fixed by the v0.2.0 release?
from scubagear.
Took a quick look at this while I was renaming it. I think the problem is that rego expects utf8 (per its error) but PowerShell ConvertTo-Json generates a .NET String, which is apparently a utf-16 based construct in some way. But what I don't understand is that we were getting ASCII compatible binary output for english language before, which was not what i would have expected if it was actually serializing as UTF-16. So I don't understand the full picture here yet, nor am I an expert in this topic.
Sources:
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/convertto-json?view=powershell-7.3
https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-7.0
Crutch, you may have already come to the same conclusion but in the event you haven't looked yet hopefully this is helpful. This seems to be a candidate solution, but I don't have time to test it:
https://stackoverflow.com/questions/23256911/encode-a-string-in-utf-8
from scubagear.
One more note on this one. Orchestrator.psm1 is responsible for writing the unified string of provider data (from the various ConvertTo-Json calls) to a file using Set-Content
Set-Content by default encodes using "utf8NoBom", per documentation
So that explains why we weren't seeing utf-16 providersettingsexport.json, but not quite why rego can't parse the non-ascii characters. So likely will need to reproduce this and then analyze the json encoding more carefully. I'll leave it there, but wanted to post this update since this was nagging at me from earlier today.
from scubagear.
One more note on this one. Orchestrator.psm1 is responsible for writing the unified string of provider data (from the various ConvertTo-Json calls) to a file using Set-Content
Set-Content by default encodes using "utf8NoBom", per documentation
Took a quick look.
Set-Content by default encodes using "utf8NoBom" for PowerShell version 7.2+.
However, it encodes using "Default" (usually ANSI) for PowerShell version 5.1 Set-Content 5.1 documentation
This is likely the source of the issue.
from scubagear.
Nice find. Yes, I agree. That seems the likely cause. A fix may just be to change to UTF8 for encoding since that is what rego is expecting.
from scubagear.
Changed all Set-Content to encode using utf8 or utf8NoBom if available.
from scubagear.
Related Issues (20)
- Bug with MS.DEFENDER.2.1v1 - "User impersonation protection SHOULD be enabled for sensitive accounts in both the standard and strict preset policies." HOT 1
- Bug with MS.DEFENDER.2.2v1 - "Domain impersonation protection SHOULD be enabled for domains owned by the agency in both the standard and strict preset policies" HOT 1
- Bug with MS.DEFENDER.2.3v1 - "Domain impersonation protection SHOULD be added for important partners in both the standard and strict preset policies." HOT 1
- Defender functional tests fail due to timing/cache issues
- Defender functional test plan tests not configured correctly
- Teams product testing with ScubaGear on a GCCHIGH tenant throws a warning about 'invalid teams environment name for migration api'
- MS.SHAREPOINT.4.2v1 functional test fails in SPO mode for GCC high test tenant HOT 3
- Accessibility improvements to HTML reports
- Sharepoint 1.3 1.4 incorrectly produce Fail even when compliant under a specific condition and does not handle N/A HOT 1
- Enhance Sharepoint policy evaluation outputs for policies that are N/A under certain conditions HOT 1
- Modify Sharepoint so that the policies only execute when applicable and produce a consistent N/A message HOT 2
- MS.EXO.4.3v1 Reporting Failure / No option for config file to use other point of contact. HOT 1
- Update Repository Organization section of the readme
- Clarify that unmanaged user / skype access is not available in GCC
- Baseline Policy Enhancements, Part 1
- M365 Auditing Changes and Enhancements, Part 2 HOT 1
- Service Principal Security
- Refactor Test Cases
- Clean up sample config files
- Change from BITS to WebClient HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scubagear.