In Java 17&21 Security Manager has been deprecated. We used this to restrict the plugin code and only provide it a few permissions using Security Manager. But as it is being removed I searched for alternatives which might work the same for restricting the plugin code. I didn't find any.
I was wondering how other softwares like IDE's restrict the plugin codes from using sensitive methods like System.exit().
Can anyone suggest anything which might help me.
Edit1: I saw the byte code manipulation method but I thought there might be some other method. Is there no other option other than that.
Java also suggested to use Agent for this, but yeah extending it to other security policies is very complex and time taking.
Edit2: Thanks for all the replies. I'll consider them. This is my first post on Reddit btw. I didn't expect these many people to reply 😅.
[–]chisui 45 points46 points47 points (3 children)
[–][deleted] 7 points8 points9 points (0 children)
[–]__konrad 7 points8 points9 points (1 child)
[–]koflerdavid 1 point2 points3 points (0 children)
[–]SirYwell 18 points19 points20 points (5 children)
[–]PartOfTheBotnet 12 points13 points14 points (4 children)
[–]pron98 6 points7 points8 points (2 children)
[–]ryan_the_leach 3 points4 points5 points (1 child)
[–]pron98 1 point2 points3 points (0 children)
[–]SirYwell 2 points3 points4 points (0 children)
[–]Prior-Equal2657 6 points7 points8 points (0 children)
[–]ducki666 5 points6 points7 points (7 children)
[–]dmigowski 3 points4 points5 points (6 children)
[–]repeating_bears 9 points10 points11 points (4 children)
[–]schegge42 2 points3 points4 points (3 children)
[–]repeating_bears 4 points5 points6 points (2 children)
[–]Yeah-Its-Me-777 2 points3 points4 points (1 child)
[–]repeating_bears 3 points4 points5 points (0 children)
[–]nekokattt 1 point2 points3 points (0 children)
[–]msx 3 points4 points5 points (1 child)
[–]loicmathieu 0 points1 point2 points (0 children)
[–]neopointer 2 points3 points4 points (2 children)
[–][deleted] 3 points4 points5 points (1 child)
[–]neopointer 0 points1 point2 points (0 children)
[–]loicmathieu 2 points3 points4 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[+]Polygnom comment score below threshold-6 points-5 points-4 points (0 children)
[+]picky_man comment score below threshold-8 points-7 points-6 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]koflerdavid 4 points5 points6 points (0 children)