Froma Bogon/Martian lisitng perspective, I can get this automatically updated from the "Cymru" guys who maintain a dynamic listing. I have their BGP details but they have also stated "Communities" for this dynamic update.
set policy-options policy-statement test term TITAN-BOGES from community MASK
set policy-options policy-statement test term TITAN-BOGES then accept
set policy-options policy-statement test term last then reject
This will ensure that those martians routes are not advertized beyond your AS. Reason being if those routes gets advertised to other AS, you are susceptible to start receving traffic in your AS for those martian routes, which will be un-desirable.
Well, it will work but not in the way the OP desires. Your solution above will ensure that bogon routes received from Team Cymru wil not get advertised upstream (or somewhere else/anywhere, depending on policy). Whereas the OP needed Team Cymru BGP feed in order to block the incoming bogon routes from own upstreams.
You are right, it will not help to block prefixes received from Upstream. And the policy details shared above does not list the action part, but looking at the scenario, I assume this is RTBH and action will be next-hop discard. So it won't help block those prefixes being received from upstream but drop any traffic received for those prefixes.
3a8082e126