Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox policy #325

Open
wants to merge 235 commits into
base: dev
Choose a base branch
from
Open

Firefox policy #325

wants to merge 235 commits into from

Conversation

lap1nou
Copy link
Contributor

@lap1nou lap1nou commented Apr 8, 2024

Description

This aim to simplify the maintenance of the Firefox configuration using Firefox policy (https://mozilla.github.io/policy-templates/). Firefox policy can be very powerful to unify the Exegol Firefox configuration into one single file which contributors can easily contribute to.

For example, adding a single bookmark is a tedious task since a contributor would need to download and open the SQLite database and this also means the bookmarks aren't visible easily.

If everything works fine, all we should need to do is place this policies.json file in the Firefox folder, I tested this on an Exegol container and it worked like a charm, this is also what I'm using in my NixOS config and it seems to work fine.

Related issues

N / A

Point of attention

Of course this is a simple example, if you like the idea, I can expand the policy file in order to add already presents bookmarks and extensions.

@ShutdownRepo
Copy link
Member

Awesome! @Dramelac and I think this could also be interesting in my-resources as well
I would gladly merge an expanded version of this 🙏

@ShutdownRepo ShutdownRepo added the enhancement New feature or request label Apr 10, 2024
@lap1nou
Copy link
Contributor Author

lap1nou commented Apr 10, 2024

Hey @ShutdownRepo I updated the policy, it should:

  • Install all the already present extension (UA Switcher, Cookie Editor, Dark Reader, FoxyProxy, Wappalyzer)
  • Install the Burpsuite certficate
  • Add all already present bookmarks and some additional, feel free to tell me if you want to get rid of some or want to add more while we are at it

If you think the policy is fine like that, I can remove the current Firefox install Python script and modify the current install script to copy the policy in the correct folder.

Regards.

@ShutdownRepo
Copy link
Member

awesome, @Skileau as you developed the initial firefox integrations, do you mind checking this out and share your pov?
whatever the outcome, I'm putting this PR on hold as we are in the process of image release, we will merge afterwards, in order to have this change tested in nightly before release

@ShutdownRepo ShutdownRepo added the on hold Item on hold. Requires another matter to be resolved first. label Apr 10, 2024
@Skileau
Copy link
Contributor

Skileau commented Apr 10, 2024

Very interesting!
This would probably be much more optimized than my basic and functional implementation.

I would be glad to take a look at this next week end.

@qu35t-code qu35t-code added under review and removed on hold Item on hold. Requires another matter to be resolved first. labels Apr 15, 2024
@qu35t-code
Copy link
Member

@lap1nou,

Can you specify into which folder we need to add this file ? I tried and didn't reproduce

@qu35t-code qu35t-code added the waiting for additional info Further information is requested label Apr 30, 2024
@lap1nou
Copy link
Contributor Author

lap1nou commented Apr 30, 2024

Hello @qu35t-code,

In /usr/lib/firefox-esr/distribution/policies.json.

Regards.

@Skileau
Copy link
Contributor

Skileau commented Apr 30, 2024

@lap1nou Could you please also explain from where/how you extracted the addons names to enter them in the configuration file?

@lap1nou
Copy link
Contributor Author

lap1nou commented Apr 30, 2024

Hey @Skileau,

I added a comment in the JSON file for this specific reason:

"ExtensionSettings_Comment": "To get the 'ID' of a plugins, type 'about:memory' in Firefox url bar, source: https://stackoverflow.com/questions/48056506/get-add-on-id-of-extensions-in-firefox"

Basically I manually installed an addon and then looked his "name / id" in the about:memory memory profiler.

This is the only way I found unfortunately.

Regards.

@Skileau
Copy link
Contributor

Skileau commented Apr 30, 2024

Thank you for the information @lap1nou 🙂
We have already implemented an automated way to retrieve this ID, I just wanted to make sure that you did not have a more optimised way to do so.

As discussed with @ShutdownRepo on Discord, we will keep our script to retrieve the ID of addons and use it to generate a policy.json file automatically with the structure you suggest (hardcoded values require a manual operation and may cause malfunctions in future updates).

@lap1nou
Copy link
Contributor Author

lap1nou commented Apr 30, 2024

Good @Skileau,

Do you want me to do all of this in this PR ?

@qu35t-code qu35t-code removed the waiting for additional info Further information is requested label Apr 30, 2024
@Skileau
Copy link
Contributor

Skileau commented May 6, 2024

Hi @lap1nou as you prefer 🙂
I can work with you on the integration of policy.json in the existing code if you want.

Otherwise here are the next steps:

  • update addons installation feature + bookmarks management by replacing "manual" installation with the generation of a Firefox policy.
  • integrate this feature to the web installation package as well to install default addons at image build.

You can make all the changes in this PR so that everything related to this subject is centralised here.

@ShutdownRepo
Copy link
Member

ShutdownRepo commented Nov 17, 2024

There are conflicts to solve here, and the documentation needs to be done as well.
Putting this PR on hold in the meantime

@ShutdownRepo ShutdownRepo marked this pull request as draft November 17, 2024 14:04
Copy link
Member

@ShutdownRepo ShutdownRepo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation to be done, and conflicts to solve

ShutdownRepo and others added 2 commits November 17, 2024 15:08
evol: added bookmarks and extension in firefox
@lap1nou lap1nou marked this pull request as ready for review November 27, 2024 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.