Make px4 communicate only with custom gcs

how could i create condition such that the firmware connects only with my custom gcs. iam modifying px4 firmware and gcs code side by side and coudnt find any probable answers.

Assuming you mean ArduPilot on a Pixhawk: easiest is to enable mavlink signing. This ensures that your drone only accepts telemetry commands from a source (gcs) with a matching key.
USB bypasses it though, so you only have security over Serial.
If you’re using px4 firmware, I’ve no idea.

thanks for your reply. it is ardupilot on pixhawk. ive managed to use my_gcsid as a factor to restrict via usb but the range seems to be 1 - 255. is there a way i can increase this range so that no one can find the value by bruteforce.

protecting against brute force requires more than just a bigger number.
What is your use case?

hey james… my objective is to customise gcs to get a security provision since it is required in my country. if we could create a string like password out of my_gcsid would be enough to do so.

Perhaps @bugobliterator can update on some broader activity on that front.

The problem with using a string is that whilst it’s easy enough to do, you’d need to fork both mavlink and ArduPilot, which then means maintaining those forks to a production ready level. I recommend against that unless you are absolutely confident you have the necessary skill sets and infrastructure to do it with the same or greater rigour as mainline.

Regards,

James

thank you for your valuable input, greatly appreciated. since im just begginer i would refrain from tampering mavlink files.

Please note the provisions in ArduPilot’s licensing requiring that any
(non-business) individual you supply an ArduPilot-equipped autopilot to
must be capable of not only obtaining and modifying the source code under
the same license you’re using it under, but also that they are capable of
uploading and using that software on the autopilot.

See GPLv3 in here: https://en.wikipedia.org/wiki/Tivoization

Peter