Comments (8)
This is fantastic! Thank you for taking the time to write this library. I think it will be a valuable resource to the community and we're glad you're getting involved.
Please let me know if you have any questions. We're going to changing some things around in the coming weeks and will need to make some minor changes to your code.
I'm looking forward to the PR!
from threatexchange.
Thanks! I'm going to continue working on a few things and see if I can get some more eyes on the general concept. If you or anyone there have any opinions on this I'd love to hear about them as well!
Hopefully we can nail down a decent layout for the code so we can be confident it won't change drastically. If all goes well the changes you are all looking to make in the short term should be fairly simple to include :)
from threatexchange.
For anyone who swings by to look I made another branch which uses similar code but is classful:
https://github.com/mgoffin/ThreatExchange/tree/pytx_classful
The goal here is that you instantiate an object once, provide your APP-ID and APP-SECRET, then from there on out you can use that object to do basically everything. Example:
from pytx import ThreatIndicator
from pytx.vocabulary import Status as s
from pytx.vocabulary import ThreatIndicator as t
t = ThreatIndicator(app_id='<app-id>', app_secret='<app-secret>')
i = t.objects(text="www.facebook.com")
for x in i:
x.set(t.STATUS, s.MALICIOUS)
x.save()
In this example each object returned is an instantiated instance of ThreatIndicator
with your credentials already set, so you can immediately turn around and do things like modify the status
to be MALICIOUS
and submit the change back.
I'm thinking I like this better so I might push the development in this direction unless people oppose.
from threatexchange.
That sounds great. It'll save us a bunch of time in the end. Can't wait
for the merge request back to master :)
One thing we've been toying with is to build a 'translation toolkit' in
python to support getting data in CSV, STIX/TAXII, OpenIOC or other formats
in/out of ThreatExchange. From what you've built so far, you're making it
easy!
On Fri, Mar 27, 2015 at 1:42 PM, Mike Goffin [email protected]
wrote:
For anyone who swings by to look I made another branch which uses similar
code but is classful:https://github.com/mgoffin/ThreatExchange/tree/pytx_classful
The goal here is that you instantiate an object once, provide your APP-ID
and APP-SECRET, then from there on out you can use that object to do
basically everything. Example:from pytx import ThreatIndicatorfrom pytx.vocabulary import Status as sfrom pytx.vocabulary import ThreatIndicator as t
t = ThreatIndicator(app_id='', app_secret='')
i = t.objects(text="www.facebook.com")for x in i:
x.set(t.STATUS, s.MALICIOUS)
x.save()In this example each object returned is an instantiated instance of
ThreatIndicator with your credentials already set, so you can immediately
turn around and do things like modify the status to be MALICIOUS and
submit the change back.I'm thinking I like this better so I might push the development in this
direction unless people oppose.—
Reply to this email directly or view it on GitHub
#1 (comment)
.
from threatexchange.
We could add a "translations" folder to pytx which can contain tools necessary for converting data to/from ThreatExchange. I'll be honest my main focus would not be in this area, but it would at least provide a place for people who want to contribute these types of features. It would surely benefit companies looking to push data into ThreatExchange but have data in weird formats :)
The only thing I would want to make sure of is that pytx doesn't sprawl out of control with requirements. If at all possible I would prefer to make requests
the only requirement. Maybe the better route would be for other libraries to include pytx for doing the translations in their code instead?
from threatexchange.
Given that the PR is up and we're conversing there, this issue can be closed :)
from threatexchange.
TIL that Github does not automatically close the issue when the pull request is landed. Thanks!
from threatexchange.
It was my bad not including the issue # in one of the commits!
from threatexchange.
Related Issues (20)
- [py-ty] Venv setup documentation and/or files
- [hma] Cleanup Settings > ThreatExchange Tab
- [hma] 500 error thrown on invalid PDQ hash HOT 1
- [HMA] graph API 9.0 hardcoded, now deprecated HOT 1
- [py-tx][HMA-in-a-bottle] Modularising py-tx -- Draft roadmap HOT 6
- [hma] Fetcher policy fails to access index HOT 1
- [hma] submitting content gets stuck between "hashed" and "matched" HOT 2
- /matches/for-hash/ gives AttributeError: 'IndexMatchUntyped' object has no attribute 'distance' HOT 1
- [pytx] No match results if creating a local_file with only 1 hash in it HOT 1
- [hma] Size of hashkey has exceeded the maximum size limit of 2048 bytes HOT 3
- [hma] ValueError in indexer
- [vpdq] Add support for Windows in vpdq pypy package HOT 5
- [OMM] Set up basic Continuous Integration git workflows for OMM HOT 2
- [omm] Figure out design for background tasks HOT 5
- [hma] Test production deployment - Nice-to-haves and Need-to-haves HOT 4
- [omm][onboarding] Initial setup issues HOT 2
- psycopg2.errors.UndefinedTable: relation "signal_type_override" does not exist HOT 8
- [vpdq] pypi publish failing HOT 2
- [omm][hma] Move Open Media Match into the Hasher Matcher Actioner Directory HOT 1
- Refactor UI to allow for multiple pages
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from threatexchange.