Can somebody assist me in making this rule?

I have Program A i want Program A to only use 1 port whenever i run the program, i have tried to create a rule where i put the source port as the port i need but whenever i do this i get intrusion attempts from my ip and a different port, the program is trying to use another port instead of the port i asked it to use.
How can i make a rule so the program can only use one port?

What is the program?
What port do you want it to use?
What port is it trying to use?

Hello James505

If You Wish To Create A Rule For ‘Program A’
Before Doing This; Make Sure You Are In “Custom Policy Mode”
You can go to CIS > Firewall > Network Security Policy > “Find The Program” > Edit
and add/remove rules for this program.

Did this help?