Embeddeding short Python scripts in bash
remediation?
#8268
lordofhyphens
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem statement:
plist
for MacOS and GPOs for Windows).jq
you fool." However, it's very unlikely thatjq
ornode
is going to be on a Linux distro, where I can assume that anything I have Firefox on is probably also packing Python 2 or 3.To not summon the regexp parse demons, I'd like to use Python (standard modules only) inlined instead so I can just do saner things (I was already going to Jinja out a template to match these policies).
Example
which can operate on
to yield
Alternatively, I'd like to pull in TickTick, which is MIT-licensed itself and does appear to be 100% shell (for our sins). The downside of this approach is that I'd probably have to minify it for the datastream (and stuff it in a macro that gets called over and over).
I was largely able to get the OVAL parser to play nice with a regex searching for the entire path down for a match, but extracting for a replacement was tricky.
Beta Was this translation helpful? Give feedback.
All reactions