The documentation located here is not clear on where within the BES file the four lines should be entered. I must be putting it in the correct spot because I’m getting the version and size displayed in the SSA GUI on the endpoint. However, my icon is not showing. The Base64 decodes correctly using UTF-8 in a converter; I’m just not seeing it on the endpoint. Any ideas?
2 Likes
Make sure the base64 data looks like this if not then the icon won’t show. There should be no spaces in the value for the icon and we use 64x64 icons but I think I read somewhere 32x32 is recommended.
{"version": "17.012.20093", "size": "117552112", "icon": "data:image/png;base64,iVBORw0KGgoAAAA......uAASUVORK5CYII="}
1 Like
Yep! I just discovered that after like 10 tries. It has to be a single line! Thanks!
2 Likes
steve
August 24, 2017, 2:29pm
4
For future reference on where to put the additional within the .bes file. In the task definition, the mime field element should be after the <SourceSeverity>
element and before the <Action>
tag, as in this sample task: Sample Chrome SWD task with icon.bes (13.4 KB)
To add it directly to action XML, the mime field element should be right above the <Settings>
tag.
1 Like
Thank you. That example is helpful. I’ll assume it can go anywhere with the other MIMEField stuff, but placing it as the very first, is best.
steve
August 24, 2017, 5:25pm
6
Yes, anywhere within a set of multiple MIMEField elements is fine.
1 Like
To further simplify, it seems that most of the information already exists in the XML, even when you create the task via SWD (which we do). All you really need to do is insert data:image/png;base64,[Encode]
between the far right “”. I had been inserting along side of the original and therefore had two, which was a source of my error.
<MIMEField>
<Name>action-ui-metadata</Name>
<Value>{"version":"10.2.112.0","size":2425344,"icon":""}</Value>
</MIMEField>
2 Likes
jgstew
September 29, 2019, 4:19am
8
AlexaVonTess:
data:image/png;base64,
This works too: data:image/x-icon;base64,
It seems that you aren’t actually limited to PNG based icons for display within the BigFix Self Service Application. It is likely the case that anything that will display within Chromium will work.
See this Example: bigfix-content/fixlet/Test SSA Icon Format x-icon.bes at main · jgstew/bigfix-content · GitHub
Related:
opened 02:09AM - 29 Sep 19 UTC
enhancement
Look at automating the addition of Icons to content for display within the Self … Service Application using REST API or Dashboard or other methods.
Can get an Icon from the content's prefetch statement on windows using: https://github.com/jgstew/tools/blob/master/CSharp/ExtractAssociatedIcon.bat
### ToDo:
- [x] Test if SSA [will display a .ico format image](https://github.com/jgstew/bigfix-content/blob/master/fixlet/Test%20SSA%20Icon%20Format%20x-icon.bes) natively: `data:image/x-icon;base64,`
- [x] ~~Test if SSA will display an SVG format image~~ (it doesn't, need to file RFE)
- [x] Create [Powershell script to convert file to Base64](https://github.com/jgstew/tools/blob/master/powershell/ConvertFileToBase64.bat)
- [x] Test [Relevance to convert file to Base64](https://bigfix.me/relevance/details/3022805)
- [ ] ~~Figure out easiest way to convert .ico format to PNG~~ (if above doesn't work)
- [x] Get [PNG file for SSA from MacOS ICNS file](https://github.com/jgstew/bigfix-content/blob/master/fixlet/Get%20PNG%20From%20ICNS%20File%20-%20MacOS.bes)
- [ ] See if the mimefield image can be added from a fixlet description to the fixlet itself
- [ ] See if the mimefield image can be added on action taken to the action itself
- [ ] Create Console Dashboard to:
- [x] [display current Icons](https://github.com/jgstew/bigfix-content/blob/master/dashboards/IconsForSSA.ojo)
- [ ] Add Icons
- [ ] Replace Icons
### Examples:
#### Console Dashboard for SSA Icons:
- https://github.com/jgstew/bigfix-content/blob/master/dashboards/IconsForSSA.ojo
#### PNG Image MIMEField:
```
<MIMEField>
<Name>action-ui-metadata</Name>
<Value>{"version":"66.208.49227","size":46641152,"icon":"data:image/png;base64,iVB....CC"}</Value>
</MIMEField>
```
#### Fixlet with SSA Icon:
https://github.com/jgstew/bigfix-content/blob/master/fixlet/Open%20Monitor%20Manual%20-%20PG279Q%20-%20Windows.bes
#### Client Relevance:
- [base64 encode](https://developer.bigfix.com/relevance/reference/string.html#base64-encode-string-string) file: `(base64 encodes it) of concatenations of lines of files "setup.exe.ico"`
- fixlet name & icon: `(values of headers "Subject" of it, ("<img alt='icon' height='64' src='" & it as string & "'>") of values of keys "icon" of jsons of values of headers "action-ui-metadata" of it) of fixlets of sites whose("Custom Site" = type of it)`
- get Mac App Icon filename: `(it & ".icns") of (preceding text of last ".icns" of it | it) of strings "CFBundleIconFile" of dictionaries of files "Contents/Info.plist" of folders whose(name of it as lowercase ends with ".app") of folders "/Applications"`
- Get Mac App Icon pathname: `(pathname of folders "Resources" of folders "Contents" of items 0 of it & "/" & item 1 of it) of (it, (it & ".icns") of (preceding text of last ".icns" of it | it) of strings "CFBundleIconFile" of dictionaries of files "Contents/Info.plist" of it) of folders whose(name of it as lowercase ends with ".app") of folders "/Applications"`
- Get Mac App Name & Icon pathname: `( preceding texts of lasts ".app" of names of it, (pathname of folders "Resources" of folders "Contents" of items 0 of it & "/" & item 1 of it) of (it, (it & ".icns") of (preceding text of last ".icns" of it | it) of strings "CFBundleIconFile" of dictionaries of files "Contents/Info.plist" of it) of it) of folders whose(name of it as lowercase ends with ".app") of folders "/Applications"`
- `(preceding texts of lasts ".png" of names of it, sizes of it) of files ending in ".png" of folders "/tmp/_BigFix/Icons"`
- `number of (concatenations of lines of it) of files ending in ".png" of folders "/tmp/_BigFix/Icons" of encodings "ISO-8859-1"`
- get icon files in Mac .app bundle: `files whose(name of it as lowercase ends with ".icns") of folders "Contents/Resources" of folders whose(name of it as lowercase ends with ".app") of folders "/Applications"`
#### Session Relevance:
- number of fixlets with icons: `number of mime fields "action-ui-metadata" of custom bes fixlets`
- icon data from fixlets: `values of keys "icon" of jsons of mime fields "action-ui-metadata" of custom bes fixlets`
- icon HTML from fixlets: `(links of it, ("<img alt='icon' height='64' src='" & it as string & "'>") of values of keys "icon" of jsons of mime fields "action-ui-metadata" of it) of custom bes fixlets`
- get icons from analysis results: `("<img src='data:image/png;base64," & it & "'>") of unique values of (substrings separated by ";;" of concatenations of values of it) of results of bes properties "base64 of Icons"`
- fixlets and tasks missing SSA Icons: (consider baselines too?) `number of custom bes fixlets whose( (task flag of it OR fixlet flag of it) AND visible flag of it AND NOT exists mime fields "action-ui-metadata" of it AND exists default action of it)`
- there isn't session relevance to detect which are offers... need to file RFE for this
- ID Name of fixlets/tasks: `(id of it as string & " " & name of it) of custom bes fixlets whose( (task flag of it OR fixlet flag of it) AND visible flag of it AND NOT exists mime fields "action-ui-metadata" of it AND exists default action of it)`
### Mac Icon File Info:
Get Magic Literal:
```
Q: concatenations of (characters it) of (bytes 0 of it; bytes 1 of it; bytes 2 of it; bytes 3 of it) of files "/Applications/App Store.app/Contents/Resources/AppIcon.icns"
A: icns
```
- https://en.wikipedia.org/wiki/Apple_Icon_Image_format
- Primarily PNG or JPEG 2000 within the file
- "MacOS offers the built-in `iconutil` command line tool to pack and unpack *.icns files."
- https://developer.apple.com/design/human-interface-guidelines/macos/icons-and-images/app-icon/
- https://github.com/sveinbjornt/osxiconutils
- https://github.com/jgstew/bigfix-content/blob/master/fixlet/Get%20PNG%20From%20ICNS%20File%20-%20MacOS.bes
- https://www.macworld.com/article/1060156/sipsicns.html
### Related:
- https://forum.bigfix.com/t/self-service-app-manually-adding-meta-data/22538
- https://github.com/jgstew/tools/blob/master/CSharp/ExtractAssociatedIcon.bat
- https://css-tricks.com/lodge/svg/09-svg-data-uris/
- https://stackoverflow.com/questions/19369334/is-there-a-way-to-show-bitmap-data-in-html-image-tag
- https://www.aconvert.com/image/ico-to-png/
- https://stackoverflow.com/a/5679084/861745
- http://fa2png.io/r/icomoon-free/file-pdf/?color=007dff&margin=2&size=256
- Take ScreenShot - Windows: https://www.bigfix.me/fixlet/details/21898
- ScreenShot Analysis: https://www.bigfix.me/analysis/details/2998452
- View ScreenShot Dashboard: https://github.com/jgstew/bigfix-content/blob/master/dashboards/Screenshots.ojo
- Escape spaces in pathname: https://bigfix.me/relevance/details/3016285
- https://github.com/sveinbjornt/osxiconutils/issues/5
32x32 icons look very very bad in BigFix SSA. Definitely use at least 64x64 or better.
It would be nice if BigFix SSA supported CSS rendered Icons like FontAwesome or similar, but it probably already supports SVG given the above, which I need to test, which might be the next best thing. (Update: Seems like BigFix SSA does NOT support SVG)
alinder
September 29, 2019, 10:30am
9
No one else has mentioned it in this thread, but ever since WebUI added the ability to edit custom content, this process become much easier. You can just add an icon to whatever fixlet using a GUI uploader.
2 Likes